namespace Yw.Application
|
{
|
/// <summary>
|
/// PumpCurve
|
/// </summary>
|
[Route("Curve/PumpChart")]
|
[ApiDescriptionSettings("Chart", Name = "±ÃÇúÏß", Order = 10000)]
|
public class PumpChart_Controller : IDynamicApiController
|
{
|
|
private readonly Service.PumpCurve _service = new();
|
|
#region Query
|
|
|
|
/// <summary>
|
/// ͨ¹ý ID »ñÈ¡
|
/// </summary>
|
[Route("GetByID@V1.0")]
|
[HttpGet]
|
public PumpChartDto GetByID([FromQuery][Required] IDInput input)
|
{
|
var model = _service.GetByID(input.ID);
|
return model == null ? null : new PumpChartDto(model);
|
}
|
|
|
|
#endregion
|
|
|
|
#region Update
|
|
|
|
/// <summary>
|
/// ¸üÐÂ×ø±êÐÅÏ¢
|
/// </summary>
|
[Route("UpdateCoordParas@V1.0")]
|
[HttpPut]
|
public bool UpdateCoordParas(UpdatePumpCoordParasInput input)
|
{
|
var bol = _service.UpdateCoordParas(input.ID, input.CoordParas, UserManager.UserID, DateTime.Now);
|
return bol;
|
}
|
|
|
|
#endregion
|
|
#region Delete
|
|
/// <summary>
|
/// ɾ³ýÇúÏß
|
/// </summary>
|
[Route("DeleteByID@V1.0")]
|
[HttpDelete]
|
public bool DeleteByID([FromQuery][Required] IDInput input)
|
{
|
var bol = _service.DeleteByID(input.ID, out string Msg);
|
if (!bol)
|
{
|
throw YOops.Oh(eResultCode.Alert, ErrorCodes.D999, Msg);
|
}
|
return bol;
|
}
|
|
#endregion
|
|
|
|
|
|
}
|
}
|