[DeviceManage] 取得緊急應變設備 api

This commit is contained in:
dev01 2023-10-24 18:04:16 +08:00
parent aee3b1564c
commit 3598b357a3
2 changed files with 41 additions and 0 deletions

View File

@ -1083,6 +1083,35 @@ namespace FrontendWebApi.ApiControllers
var fr = await backendRepository.GetAllAsync<ForgeInvisible>(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);
}
/// <summary>
/// 取得緊急應變設備
/// </summary>
/// <param name="account"></param>
/// <returns></returns>
[HttpPost]
[Route("api/Device/GetDisasterDevice")]
public async Task<ActionResult<ApiResult<List<DeviceDisaster>>>> GetDisasterDevice()
{
ApiResult<List<DeviceDisaster>> apiResult = new ApiResult<List<DeviceDisaster>>();
try
{
var sqlString = $@" SELECT * FROM device_disaster";
var fr = await backendRepository.GetAllAsync<DeviceDisaster>(sqlString);
apiResult.Code = "0000";
apiResult.Data = fr;
}

View File

@ -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; }
}
}