Files
wcs/WCS.WebApi/Controllers/SingleLightController.cs
hehaibing-1996 7427b804f6 提交修改
2024-11-12 13:33:40 +08:00

67 lines
1.9 KiB
C#

using Microsoft.AspNetCore.Mvc;
using WCS.BLL.Services.IService;
using WCS.BLL.Services.Service;
using WCS.Model;
using WCS.Model.ApiModel;
using WCS.Model.ApiModel.SelfCheck;
using WCS.Model.ApiModel.SingleLight;
using WCS.Model.ApiModel.Stocktaking;
using WCS.Model.ApiModel.User;
using WCS.Model.WebSocketModel;
namespace WCS.WebApi.Controllers
{
/// <summary>
/// 单灯单独控制亮灯接口 煤科院钻探分院项目
/// </summary>
[ApiController]
[Route("[controller]")]
public class SingleLightController : ControllerBase
{
public ISingleLightService _singleLightService { get; set; }
public SingleLightController(ISingleLightService singleLightService)
{
_singleLightService = singleLightService;
}
[Route("singleLightControl")]
[HttpPost(Name = "singleLightControl")]
public async Task<ResponseBase> SingleLightControl(SingleLightControlRequest request)
{
try
{
return await _singleLightService.SingleLightControl(request);
}
catch (Exception ex)
{
return new ResponseBase()
{
Code = 300,
Message = "操作失败:" + ex.Message,
};
}
}
[Route("turnoffLightByArea")]
[HttpPost(Name = "turnoffLightByArea")]
public async Task<ResponseBase> TurnoffLightByArea(TurnoffLightByAreaRequest request)
{
try
{
return await _singleLightService.TurnoffLightByArea(request);
}
catch (Exception ex)
{
return new ResponseBase()
{
Code = 300,
Message = "操作失败:" + ex.Message,
};
}
}
}
}