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)