| | |
| | | /// PumpSeries |
| | | /// </summary> |
| | | [Route("Assets/PumpPropContent")] |
| | | [ApiDescriptionSettings("Assets", Name = "资产", Order = 600000)] |
| | | [ApiDescriptionSettings("Assets", Name = "PumpPropContent", Order = 500000)] |
| | | public class PumpPropContent_Controller : IDynamicApiController |
| | | { |
| | | private readonly HStation.Service.PumpPropContent _service = new(); |
| | |
| | | /// </summary> |
| | | [Route("GetByID@V1.0")] |
| | | [HttpGet] |
| | | public PumpPropContentDto GetByID(long ID) |
| | | public PumpPropContentDto GetByID([FromQuery][Required] IDInput input) |
| | | { |
| | | var model = _service.GetByID(ID); |
| | | var model = _service.GetByID(input.ID); |
| | | return model == null ? null : new PumpPropContentDto(model); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | [Route("GetByIds@V1.0")] |
| | | [HttpGet] |
| | | public List<PumpPropContentDto> GetByIds(List<long> Ids) |
| | | public List<PumpPropContentDto> GetByIds([FromQuery][Required] IdsInput input) |
| | | { |
| | | var list = _service.GetByIds(Ids); |
| | | var ids = LongListHelper.ToList(input.Ids); |
| | | var list = _service.GetByIds(ids); |
| | | var vm_list = list?.Select(x => new PumpPropContentDto(x)).ToList(); |
| | | return vm_list; |
| | | } |
| | |
| | | /// </summary> |
| | | [Route("Insert@V1.0")] |
| | | [HttpPost] |
| | | public long Insert(AddPumpPropContentDto input) |
| | | public long Insert(AddPumpPropContentInput input) |
| | | { |
| | | var model = input.Adapt<AddPumpPropContentDto, Model.PumpPropContent>(); |
| | | var model = input.Adapt<AddPumpPropContentInput, Model.PumpPropContent>(); |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | } |
| | |
| | | /// </summary> |
| | | [Route("Inserts@V1.0")] |
| | | [HttpPost] |
| | | public bool Inserts(List<AddPumpPropContentDto> inputList) |
| | | public bool Inserts(List<AddPumpPropContentInput> inputList) |
| | | { |
| | | var list = inputList.Select(x => x.Adapt<AddPumpPropContentDto, Model.PumpPropContent>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<AddPumpPropContentInput, Model.PumpPropContent>()).ToList(); |
| | | var bol = _service.Inserts(list); |
| | | return bol; |
| | | } |
| | |
| | | /// </summary> |
| | | [Route("Update@V1.0")] |
| | | [HttpPut] |
| | | public bool Update(UpdatePumpPropContentDto input) |
| | | public bool Update([Required] UpdatePumpPropContentInput input) |
| | | { |
| | | var model = _service.GetByID(input.ID); |
| | | if (model == null) |
| | |
| | | /// </summary> |
| | | [Route("Updates@V1.0")] |
| | | [HttpPut] |
| | | public bool Updates(List<UpdatePumpPropContentDto> inputList) |
| | | public bool Updates([Required] List<UpdatePumpPropContentInput> inputList) |
| | | { |
| | | if (inputList == null || inputList.Count < 1) |
| | | { |
| | | return false; |
| | | } |
| | | var list = inputList.Select(x => x.Adapt<UpdatePumpPropContentDto, Model.PumpPropContent>()).ToList(); |
| | | var list = inputList.Select(x => x.Adapt<UpdatePumpPropContentInput, Model.PumpPropContent>()).ToList(); |
| | | var bol = _service.Updates(list); |
| | | return bol; |
| | | } |
| | |
| | | /// </summary> |
| | | [Route("DeleteByID@V1.0")] |
| | | [HttpDelete] |
| | | public bool DeleteByID(long ID) |
| | | public bool DeleteByID([FromQuery][Required] IDInput input) |
| | | { |
| | | var bol = _service.DeleteByID(ID, out string msg); |
| | | var bol = _service.DeleteByID(input.ID, out string msg); |
| | | if (!bol) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.D999, msg); |