using FluentValidation; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace OASystem.Domain.Dtos.PersonnelModule { /// /// 物品DTO /// public class GoodsDTO { } #region 物品 DTO /// /// 物品List DTO /// public class GoodsListDTO : DtoBase { /// /// 类型Id /// 全部类型:"" /// 其他类型:"1,2,3,4,5" /// public string TypeIds { get; set; } public string GoodsName { get; set; } } /// /// 物品 OP DTO /// public class GoodsOPDTO { /// /// 当前用户id /// public int CurrUserId { get; set; } /// /// ID编号 /// ID > 0 Edit /// ID < 1 Add /// public int Id { get; set; } /// /// 物品名称 /// public string Name { get; set; } /// /// 类型 /// public int Type { get; set; } /// /// 备注 /// public string Remark { get; set; } } /// /// 物品 OP DTO /// Validator /// public class GoodsOPDTOValidator : AbstractValidator { /// /// 初始化 /// public GoodsOPDTOValidator() { RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!"); RuleFor(x => x.Name).NotEmpty().WithMessage("物品名称为空!"); RuleFor(x => x.Type).Must(x => x > 0).WithMessage("物品所属类型未选择!"); } } #endregion /// /// 物品入库List DTO /// public class GoodsStorageListDTO : DtoBase { /// /// 物品Id /// public int GoodsId { get; set; } } /// /// 物品领用List DTO /// public class GoodsReceiveListDTO : DtoBase { /// /// 物品Id /// public int GoodsId { get; set; } } /// /// 物品入库 操作(Create Or Edit) DTO /// public class GoodsStorageOPDTO { /// /// 物品Id /// public int GoodsId { get; set; } /// /// 物品名称 /// public string GoodsName { get; set; } } }