|
@@ -0,0 +1,31 @@
|
|
|
+using Microsoft.AspNetCore.Mvc;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using TEAMModelOS.Model.BaseInfo.Models;
|
|
|
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcRequest;
|
|
|
+using TEAMModelOS.SDK.Extension.DataResult.JsonRpcResponse;
|
|
|
+using TEAMModelOS.Service.Core.Interfaces;
|
|
|
+
|
|
|
+namespace TEAMModelOS.Controllers.Core
|
|
|
+{
|
|
|
+ public class SchoolSystemController
|
|
|
+ {
|
|
|
+ private readonly ISchoolSystemService schoolSystemService;
|
|
|
+ [HttpPost("SaveOrUpdateAll")]
|
|
|
+ public async Task<BaseJosnRPCResponse> SaveOrUpdateAll(JosnRPCRequest<SchoolSystem> request)
|
|
|
+ {
|
|
|
+ JsonRPCResponseBuilder builder = JsonRPCResponseBuilder.custom();
|
|
|
+ SchoolSystem data = new SchoolSystem();
|
|
|
+ if (request.@params.Id != null)
|
|
|
+ {
|
|
|
+ data = await schoolSystemService.UpdateSchool(request.@params);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ data = await schoolSystemService.SaveToCosmosDB(request.@params);
|
|
|
+ }
|
|
|
+ return builder.Data(data).build();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|