using Microsoft.AspNetCore.Mvc;
|
using System.Net;
|
using System.Net.Http.Headers;
|
using Microsoft.Extensions.Hosting.Internal;
|
using Microsoft.AspNetCore.Http.Extensions;
|
using IStation.Untity;
|
using Furion.DynamicApiController;
|
using System.ComponentModel.DataAnnotations;
|
using Mapster;
|
|
|
namespace IStation.Application
|
{
|
/// <summary>
|
/// MonitorFluctRecord
|
/// </summary>
|
[Route("Run/MonitorFluctRecord")]
|
[ApiDescriptionSettings("Run", Name = "监测波动记录", Order = 600)]
|
public class MonitorFluctRecord_Controller:IDynamicApiController
|
{
|
private readonly Service.MonitorFluctRecord _service = new Service.MonitorFluctRecord();
|
|
|
/// <summary>
|
/// 通过 MonitorPointID 获取
|
/// </summary>
|
[Route("GetByMonitorPointID@V1.0")]
|
[HttpGet]
|
public List<MonitorFluctRecordDto> GetByMonitorPointID
|
(
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
long CorpID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "MonitorPointID 必须大于0")]
|
long MonitorPointID
|
)
|
{
|
var list = _service.GetByMonitorPointID(CorpID, MonitorPointID);
|
var vm_list = list?.Select(x => x.Adapt<Model.MonitorFluctRecord, MonitorFluctRecordDto>()).ToList();
|
return vm_list;
|
}
|
|
|
|
/// <summary>
|
/// 通过 SignalID 获取
|
/// </summary>
|
[Route("GetBySignalID@V1.0")]
|
[HttpGet]
|
public MonitorFluctRecordDto GetBySignalID
|
(
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
long CorpID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "MonitorPointID 必须大于0")]
|
long MonitorPointID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "SignalID 必须大于0")]
|
long SignalID
|
)
|
{
|
var model = _service.GetBySignalID(CorpID, MonitorPointID,SignalID);
|
return model?.Adapt<Model.MonitorFluctRecord, MonitorFluctRecordDto>();
|
}
|
|
/// <summary>
|
/// 通过 MonitorPointID 判断是否存在
|
/// </summary>
|
[Route("IsExistByMonitorPointID@V1.0")]
|
[HttpGet]
|
public bool IsExistByMonitorPointID
|
(
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
long CorpID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "MonitorPointID 必须大于0")]
|
long MonitorPointID
|
)
|
{
|
var bol = _service.IsExistByMonitorPointID(CorpID,MonitorPointID);
|
return bol;
|
}
|
|
/// <summary>
|
/// 通过 SignalID 判断是否存在
|
/// </summary>
|
[Route("IsExistBySignalID@V1.0")]
|
[HttpGet]
|
public bool IsExistBySignalID
|
(
|
[Required, Range(1, long.MaxValue, ErrorMessage = "CorpID 必须大于0")]
|
long CorpID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "MonitorPointID 必须大于0")]
|
long MonitorPointID,
|
[Required, Range(1, long.MaxValue, ErrorMessage = "SignalID 必须大于0")]
|
long SignalID
|
)
|
{
|
var bol = _service.IsExistBySignalID(CorpID, MonitorPointID, SignalID);
|
return bol;
|
}
|
}
|
}
|