From a60f3ee45a6b86de936d19a122acdfb30570a867 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期三, 17 七月 2024 12:30:49 +0800 Subject: [PATCH] bug修复,优化 --- Yw.Application.Run.Core/01-configure/RunAnalyConfigure_Controller.cs | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/Yw.Application.Run.Core/01-configure/RunAnalyConfigure_Controller.cs b/Yw.Application.Run.Core/01-configure/RunAnalyConfigure_Controller.cs index 428a86f..79dff85 100644 --- a/Yw.Application.Run.Core/01-configure/RunAnalyConfigure_Controller.cs +++ b/Yw.Application.Run.Core/01-configure/RunAnalyConfigure_Controller.cs @@ -1,4 +1,6 @@ -锘縩amespace Yw.Application +锘縰sing Mapster; + +namespace Yw.Application { /// <summary> /// RunAnalyConfigure @@ -120,14 +122,30 @@ #region Set /// <summary> + /// 鎻掑叆鎴栨洿鏂� + /// </summary> + [Route("InsertOrUpdate@V1.0")] + [HttpPost] + public long InsertOrUpdate([Required] SetRunAnalyConfigureInput input) + { + var pure = input.Adapt<SetRunAnalyConfigureInput, Model.RunAnalyConfigurePure>(); + var id = _service.InsertOrUpdate(pure); + return id; + } + + /// <summary> /// 璁剧疆 /// </summary> [Route("Set@V1.0")] [HttpPost] public bool Set(List<SetRunAnalyConfigureInput> input) { - var list = input?.Select(x => x.Adapt<SetRunAnalyConfigureInput, Model.RunAnalyConfigure>()).ToList(); - var bol = _service.Set(list); + var list = input?.Select(x => x.Adapt<SetRunAnalyConfigureInput, Model.RunAnalyConfigurePure>()).ToList(); + var bol = _service.Set(list, out string Msg); + if (!bol) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, Msg); + } return bol; } @@ -137,7 +155,7 @@ #region Delete /// <summary> - /// 鍒犻櫎 + /// 閫氳繃 ID 鍒犻櫎 /// </summary> [Route("DeleteByID@V1.0")] [HttpDelete] @@ -151,6 +169,21 @@ return bol; } + /// <summary> + /// 閫氳繃 ObjectType 鍜� ObjectID 鍒犻櫎 + /// </summary> + [Route("DeleteByObjectTypeAndObjectID@V1.0")] + [HttpDelete] + public bool DeleteByObjectTypeAndObjectID([FromQuery][Required] ObjectInput input) + { + var bol = _service.DeleteByObjectTypeAndObjectID(input.ObjectType, input.ObjectID, out string Msg); + if (!bol) + { + throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, Msg); + } + return bol; + } + #endregion -- Gitblit v1.9.3