[FrontendWebApi] 加入 查詢燈具設備

This commit is contained in:
wanli 2023-01-04 15:12:20 +08:00
parent 2568624e52
commit 4c72cd822e
2 changed files with 39 additions and 0 deletions

View File

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

View File

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