42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using Infrastructure;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenAuth.App.ServiceApp;
|
|
using OpenAuth.App.ServiceApp.Request;
|
|
|
|
namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
{
|
|
/// <summary>
|
|
/// 管理员任务管理
|
|
/// </summary>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class AdminTaskManageController : ControllerBase
|
|
{
|
|
readonly AdminTaskManageApp _app;
|
|
public AdminTaskManageController(AdminTaskManageApp app)
|
|
{
|
|
_app = app;
|
|
}
|
|
/// <summary>
|
|
/// 添加任务
|
|
/// </summary>
|
|
/// <param name="req"></param>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
public async Task<Response<string>> AddTask(InsTaskReq req)
|
|
{
|
|
Response<string> response = new Response<string>();
|
|
try
|
|
{
|
|
return await _app.AddTask(req);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
response.Code = 500;
|
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
|
}
|
|
return response;
|
|
}
|
|
}
|
|
}
|