68 lines
1.8 KiB
C#
68 lines
1.8 KiB
C#
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));
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
} |