[FrontendWebApi] 加入 查詢燈具設備
This commit is contained in:
parent
2568624e52
commit
4c72cd822e
@ -711,6 +711,37 @@ namespace FrontendWebApi.ApiControllers
|
||||
return Ok(apiResult);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/GetDevNodeForCor")]
|
||||
public async Task<ActionResult<List<DevNodeForCor>>> GetDevNodeForCor([FromBody] Device p)
|
||||
{
|
||||
ApiResult<List<DevNodeForCor>> apiResult = new ApiResult<List<DevNodeForCor>>();
|
||||
List<DevNodeForCor> device = new List<DevNodeForCor>();
|
||||
|
||||
try
|
||||
{
|
||||
apiResult.Code = "0001";
|
||||
if (p != null )
|
||||
{
|
||||
if (p.device_system_tag == "LT" && p.device_name_tag == "L1")
|
||||
{
|
||||
var d = await backendRepository.GetAllAsync<DevNodeForCor>($@"select device_guid,priority,device_node_coordinate_3d,forge_dbid from device_node where deleted = 0");
|
||||
|
||||
apiResult.Data = d;
|
||||
apiResult.Code = "0000";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
apiResult.Code = "9999";
|
||||
apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
|
||||
Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
|
||||
return Ok(apiResult);
|
||||
}
|
||||
return Ok(apiResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 燈控排程列表
|
||||
/// </summary>
|
||||
|
@ -133,4 +133,12 @@ namespace FrontendWebApi.Models
|
||||
public string device_coordinate_3d { get; set; }
|
||||
public int? forge_dbid { get; set; }
|
||||
}
|
||||
|
||||
public class DevNodeForCor
|
||||
{
|
||||
public string device_guid { get; set; }
|
||||
public int priority { get; set; }
|
||||
public string device_node_coordinate_3d { get; set; }
|
||||
public int? forge_dbid { get; set; }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user