2025-03-13 21:24:19 +08:00

68 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Microsoft.AspNetCore.Mvc;
using DOAN.Model.Bydlms.Dto;
using DOAN.Model.Bydlms;
using DOAN.Service.Bydlms.IBydlmsService;
using DOAN.Admin.WebApi.Filters;
using DOAN.Service.Bydlms;
//创建时间2025-02-19
namespace DOAN.Admin.WebApi.Controllers.Bydlms
{
/// <summary>
/// 数据采集记录
/// </summary>
[AllowAnonymous]
[Route("bydlms/BydEcharts")]
public class BydEchartsController : BaseController
{
/// <summary>
/// 数据采集记录接口
/// </summary>
private readonly IBydEchartsService _BydEchartsService;
public BydEchartsController(IBydEchartsService BydEchartsService)
{
_BydEchartsService = BydEchartsService;
}
/// <summary>
/// 设备采集数据上传
/// </summary>
/// <returns></returns>
[HttpGet("GetDeviceOptions")]
[AllowAnonymous]
public IActionResult GetDeviceOptions()
{
try
{
var response = _BydEchartsService.GetMachineOptions();
return SUCCESS(response);
}
catch (Exception e)
{
return ToResponse(new ApiResult(500, e.Message));
}
}
/// <summary>
/// 设备采集数据上传
/// </summary>
/// <returns></returns>
[HttpPost("GetEchartsData")]
[AllowAnonymous]
public IActionResult GetEchartsData([FromBody] EchartsQuery parm)
{
try
{
var response = _BydEchartsService.GetEchartsList(parm);
return SUCCESS(response);
}
catch (Exception e)
{
return ToResponse(new ApiResult(500, e.Message));
}
}
}
}