From 5481cd91c5a89abae1c48df138836c309b2f4f89 Mon Sep 17 00:00:00 2001 From: wintel Date: Sun, 17 Sep 2023 18:44:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E5=8D=B0=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E8=BF=94=E5=9B=9Eid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/SysPrinterPlanApp/SysPrinterPlanApp.cs | 3 ++- OpenAuth.WebApi/Controllers/SysPrinterPlansController.cs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OpenAuth.App/SysPrinterPlanApp/SysPrinterPlanApp.cs b/OpenAuth.App/SysPrinterPlanApp/SysPrinterPlanApp.cs index d37e92b3..3491bbbe 100644 --- a/OpenAuth.App/SysPrinterPlanApp/SysPrinterPlanApp.cs +++ b/OpenAuth.App/SysPrinterPlanApp/SysPrinterPlanApp.cs @@ -71,7 +71,7 @@ namespace OpenAuth.App return result; } - public void Add(AddOrUpdateSysPrinterPlanReq obj) + public string Add(AddOrUpdateSysPrinterPlanReq obj) { //程序类型取入口应用的名称,可以根据自己需要调整 var addObj = obj.MapTo(); @@ -82,6 +82,7 @@ namespace OpenAuth.App addObj.CreateTime = DateTime.Now; addObj.CreateUser = _auth.GetUserName(); Repository.Insert(addObj); + return addObj.Id; } public void Update(AddOrUpdateSysPrinterPlanReq obj) diff --git a/OpenAuth.WebApi/Controllers/SysPrinterPlansController.cs b/OpenAuth.WebApi/Controllers/SysPrinterPlansController.cs index e7307060..17dc47c2 100644 --- a/OpenAuth.WebApi/Controllers/SysPrinterPlansController.cs +++ b/OpenAuth.WebApi/Controllers/SysPrinterPlansController.cs @@ -39,12 +39,12 @@ namespace OpenAuth.WebApi.Controllers //添加 [HttpPost] - public Response Add(AddOrUpdateSysPrinterPlanReq obj) + public Response Add(AddOrUpdateSysPrinterPlanReq obj) { - var result = new Response(); + var result = new Response(); try { - _app.Add(obj); + result.Result=_app.Add(obj); } catch (Exception ex)