新增打印方案返回id

This commit is contained in:
wintel 2023-09-17 18:44:00 +08:00
parent c5e735b2e8
commit 5481cd91c5
2 changed files with 5 additions and 4 deletions

View File

@ -71,7 +71,7 @@ namespace OpenAuth.App
return result; return result;
} }
public void Add(AddOrUpdateSysPrinterPlanReq obj) public string Add(AddOrUpdateSysPrinterPlanReq obj)
{ {
//程序类型取入口应用的名称,可以根据自己需要调整 //程序类型取入口应用的名称,可以根据自己需要调整
var addObj = obj.MapTo<SysPrinterPlan>(); var addObj = obj.MapTo<SysPrinterPlan>();
@ -82,6 +82,7 @@ namespace OpenAuth.App
addObj.CreateTime = DateTime.Now; addObj.CreateTime = DateTime.Now;
addObj.CreateUser = _auth.GetUserName(); addObj.CreateUser = _auth.GetUserName();
Repository.Insert(addObj); Repository.Insert(addObj);
return addObj.Id;
} }
public void Update(AddOrUpdateSysPrinterPlanReq obj) public void Update(AddOrUpdateSysPrinterPlanReq obj)

View File

@ -39,12 +39,12 @@ namespace OpenAuth.WebApi.Controllers
//添加 //添加
[HttpPost] [HttpPost]
public Response Add(AddOrUpdateSysPrinterPlanReq obj) public Response<string> Add(AddOrUpdateSysPrinterPlanReq obj)
{ {
var result = new Response(); var result = new Response<string>();
try try
{ {
_app.Add(obj); result.Result=_app.Add(obj);
} }
catch (Exception ex) catch (Exception ex)