namespace Yw.Application
{
///
/// PumpCurve
///
[Route("Curve/PumpChart")]
[ApiDescriptionSettings("Chart", Name = "±ÃÇúÏß", Order = 10000)]
public class PumpChart_Controller : IDynamicApiController
{
private readonly Service.PumpCurve _service = new();
#region Query
///
/// ͨ¹ý ID »ñÈ¡
///
[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
///
/// ¸üÐÂ×ø±êÐÅÏ¢
///
[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
///
/// ɾ³ýÇúÏß
///
[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
}
}