[DeviceManage] 取得緊急應變設備 api
This commit is contained in:
		
							parent
							
								
									aee3b1564c
								
							
						
					
					
						commit
						3598b357a3
					
				| @ -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; | ||||
|             } | ||||
|  | ||||
| @ -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; } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user