| | |
| | | { |
| | | private readonly HStation.Service.TransferFileUser _service = new(); |
| | | |
| | | #region Query |
| | | |
| | | /// <summary> |
| | | /// 获取所有 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 通过 Name 获取 |
| | | /// </summary> |
| | | public async Task<TransferFileUserDto> GetByName(string input) |
| | | public async Task<TransferFileUserDto> GetByName(string Name) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | var model = _service.GetByName(input); |
| | | var model = _service.GetByName(Name); |
| | | return model == null ? null : new TransferFileUserDto(model); |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Insert |
| | | |
| | |
| | | public async Task<long> Insert(AddTransferFileUserInput input) |
| | | { |
| | | return await Task.Factory.StartNew(() => |
| | | { |
| | | if (_service.IsExistName(input.Name)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Name:{input.Name}", "名称已存在"); |
| | | } |
| | | var model = input.Adapt<AddTransferFileUserInput, Model.TransferFileUser>(); |
| | | model.SortCode = _service.GetMaxSortCode() + 1; |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | }); |
| | | if (_service.IsExistName(input.Name)) |
| | | { |
| | | throw YOops.Oh(eResultCode.Alert, InternalErrorCodes.V001, $"Name:{input.Name}", "名称已存在"); |
| | | } |
| | | var model = input.Adapt<AddTransferFileUserInput, Model.TransferFileUser>(); |
| | | model.SortCode = _service.GetMaxSortCode() + 1; |
| | | var id = _service.Insert(model); |
| | | return id; |
| | | }); |
| | | } |
| | | |
| | | #endregion Insert |
| | | public Task<bool> Inserts(List<AddTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> BulkInserts(List<AddTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Update |
| | | |
| | |
| | | var bol = _service.Update(rhs); |
| | | return bol; |
| | | }); |
| | | } |
| | | |
| | | public Task<bool> Updates(List<UpdateTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> BulkUpdates(List<UpdateTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | }); |
| | | } |
| | | |
| | | #endregion Update |
| | | #endregion |
| | | |
| | | #region Exist |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | #endregion Exist |
| | | #endregion |
| | | |
| | | #region Delete |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | public Task<bool> Updates(List<UpdateTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> BulkUpdates(List<UpdateTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> DeleteByIds(List<long> Ids) |
| | | { |
| | | throw new NotImplementedException(); |
| | |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> Inserts(List<AddTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | public Task<bool> BulkInserts(List<AddTransferFileUserInput> list) |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | #endregion Delete |
| | | #endregion |
| | | } |
| | | } |