Infrastructure/OpenAuth.WebApi/Controllers/ServiceControllers/FireManagement/FireManagementController.cs

67 lines
2.0 KiB
C#

using Infrastructure;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.ServiceApp.FireManagement;
using OpenAuth.App.ServiceApp.FireManagement.Response;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Domain.FireManagement;
namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
{
/// <summary>
/// 防火管理模块
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class FireManagementController : ControllerBase
{
private readonly FireManagementApp _app;
public FireManagementController(FireManagementApp app)
{
_app = app;
}
/// <summary>
/// 下发防火线索任务
/// </summary>
/// <param name="info">防火任信息</param>
/// <returns></returns>
[HttpPost]
public async Task<Response<bool>> IssuedFireClueTask(FmFireclueTask info)
{
Response<bool> response = new Response<bool>();
try
{
return await _app.IssuedFireClueTask(info);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
/// <summary>
/// 查询下发人员
/// </summary>
/// <param name="username"></param>
/// <returns></returns>
[HttpGet]
public async Task<Response<List<SysUserResp>>> GetIssuedUsers(string username)
{
Response<List<SysUserResp>> response = new Response<List<SysUserResp>>();
try
{
return await _app.GetIssuedUsers(username);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
}
}