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

73 lines
2.2 KiB
C#
Raw Normal View History

2026-01-14 16:50:40 +08:00
using Infrastructure;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OpenAuth.App.ServiceApp.FireManagement;
using OpenAuth.App.ServiceApp.FireManagement.Request;
using OpenAuth.App.ServiceApp.FmPreventionPlanManage;
using OpenAuth.App.ServiceApp.FmPreventionPlanManage.Request;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Domain.FireManagement;
namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement
{
/// <summary>
/// 防火应急预案模块
/// </summary>
[Route("api/[controller]/[action]")]
[ApiController]
public class FmPreventionPlanController : ControllerBase
{
private readonly FmPreventionPlanApp _app;
public FmPreventionPlanController(FmPreventionPlanApp app)
{
_app = app;
}
/// <summary>
/// 分页查询防火应急预案列表
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public async Task<Response<PageInfo<List<FmPreventionplan>>>> GetPreventionplanPageList([FromQuery] FmPreventionplanReq req)
{
Response<PageInfo<List<FmPreventionplan>>> response = new Response<PageInfo<List<FmPreventionplan>>>();
try
{
return await _app.GetPreventionplanPageList(req);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
/// <summary>
/// 查询应急预案详情
/// </summary>
/// <returns></returns>
[HttpGet]
[AllowAnonymous]
public async Task<Response<FmPreventionplan>> LoadClueInfoById(string id)
{
Response<FmPreventionplan> response = new Response<FmPreventionplan>();
try
{
return await _app.LoadClueInfoById(id);
}
catch (Exception ex)
{
response.Code = 500;
response.Message = ex.InnerException?.Message ?? ex.Message;
}
return response;
}
}
}