using Infrastructure; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OpenAuth.App.ServiceApp.FireManagement; using OpenAuth.App.ServiceApp.FireManagement.Request; using OpenAuth.Repository.Domain.FireManagement; using System.Threading.Tasks; namespace OpenAuth.WebApi.Controllers.ServiceControllers.FireManagement { /// /// H5 /// [Route("api/[controller]/[action]")] [ApiController] public class FireCodeHController : ControllerBase { private readonly FireCodeH5App _app; public FireCodeHController(FireCodeH5App app) { _app = app; } /// /// 添加进出山记录 /// /// /// [HttpPost] [AllowAnonymous] public async Task> AddEnteringInfo(FmEnteringInfo info) { Response response = new Response(); try { return await _app.AddEnteringInfo(info); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 根据手机号查询登记过的人员信息 /// /// /// /// /// [HttpGet] [AllowAnonymous] public async Task>>> LoadNameInfoByPhone(string phone, int page, int limit) { Response>> response = new Response>>(); try { return await _app.LoadNameInfoByPhone(phone, page, limit); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } /// /// 获取站点信息 /// /// /// [HttpGet] [AllowAnonymous] public async Task> GetSiteInfo(long siteId) { Response response = new Response(); try { return await _app.GetSiteInfo(siteId); } catch (Exception ex) { response.Code = 500; response.Message = ex.InnerException?.Message ?? ex.Message; } return response; } [HttpGet] [AllowAnonymous] public async Task GetFireInfo() { await _app.GetFireInfoAsync(); } //[HttpGet] //[AllowAnonymous] //public async Task GetToken() //{ // await _app.GetToken(); //} } }