diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 70b3dab..f849100 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -1083,6 +1083,35 @@ namespace FrontendWebApi.ApiControllers var fr = await backendRepository.GetAllAsync(sqlString, param); + apiResult.Code = "0000"; + apiResult.Data = fr; + } + catch (Exception exception) + { + apiResult.Code = "9999"; + apiResult.Msg = "系統內部錯誤,請聯絡管理者。"; + Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message); + return Ok(apiResult); + } + return Ok(apiResult); + } + + /// + /// 取得緊急應變設備 + /// + /// + /// + [HttpPost] + [Route("api/Device/GetDisasterDevice")] + public async Task>>> GetDisasterDevice() + { + ApiResult> apiResult = new ApiResult>(); + + try + { + var sqlString = $@" SELECT * FROM device_disaster"; + var fr = await backendRepository.GetAllAsync(sqlString); + apiResult.Code = "0000"; apiResult.Data = fr; } diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 21137de..4cf8b13 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -203,4 +203,16 @@ namespace FrontendWebApi.Models public string device_name_tag { get; set; } } + public class DeviceDisaster + { + public string device_guid { get; set; } + public string device_system_value { get; set; } + public string device_building_tag { get; set; } + public string device_system_tag { get; set; } + public string device_name_tag { get; set; } + public string device_floor_tag { get; set; } + public string device_serial_tag { get; set; } + public string device_number { get; set; } + } + }