mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
92 lines
2.2 KiB
C#
92 lines
2.2 KiB
C#
using System;
|
|
using System.Threading.Tasks;
|
|
using Infrastructure;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenAuth.App;
|
|
using OpenAuth.App.Request;
|
|
using OpenAuth.App.Response;
|
|
using OpenAuth.Repository.Domain;
|
|
|
|
namespace OpenAuth.WebApi.Controllers
|
|
{
|
|
/// <summary>
|
|
/// 加签接口
|
|
/// </summary>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
[ApiExplorerSettings(GroupName = "加签接口_FlowApprovers")]
|
|
public class FlowApproversController : ControllerBase
|
|
{
|
|
private readonly FlowApproverApp _app;
|
|
|
|
//添加
|
|
[HttpPost]
|
|
public Response Add([FromBody] AddApproverReq obj)
|
|
{
|
|
var result = new Response();
|
|
try
|
|
{
|
|
_app.Add(obj);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Code = 500;
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
//修改
|
|
[HttpPost]
|
|
public Response Update([FromBody] AddApproverReq obj)
|
|
{
|
|
var result = new Response();
|
|
try
|
|
{
|
|
_app.Update(obj);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Code = 500;
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 加载列表
|
|
/// </summary>
|
|
[HttpGet]
|
|
public async Task<TableResp<FlowApprover>> Load([FromQuery] QueryApproverReq request)
|
|
{
|
|
return await _app.Load(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 批量删除
|
|
/// </summary>
|
|
[HttpPost]
|
|
public Response Delete([FromBody] string[] ids)
|
|
{
|
|
var result = new Response();
|
|
try
|
|
{
|
|
_app.Delete(ids);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Code = 500;
|
|
result.Message = ex.InnerException?.Message ?? ex.Message;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
public FlowApproversController(FlowApproverApp app)
|
|
{
|
|
_app = app;
|
|
}
|
|
}
|
|
} |