AttachDto.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.ComponentModel.DataAnnotations;
  2. using Abp.AutoMapper;
  3. using AutoMapper;
  4. using VberZero.BaseSystem;
  5. namespace VberZero.AppService.Attaches.Dto;
  6. [AutoMapTo(typeof(SysAttach)), AutoMapFrom(typeof(SysAttach))]
  7. public class AttachDto
  8. {
  9. public AttachDto()
  10. {
  11. CheckAll = true;
  12. }
  13. public AttachDto(string codeKey, string sourceKey) : this()
  14. {
  15. CodeKey = codeKey;
  16. SourceKey = sourceKey;
  17. }
  18. public AttachDto(string codeKey, string sourceKey, string fileInfo, string fileName, string fileExt, string allowExt = null) : this(codeKey, sourceKey)
  19. {
  20. FileInfo = fileInfo;
  21. FileName = fileName;
  22. FileExt = fileExt;
  23. AllowExt = allowExt;
  24. }
  25. public int Id { get; set; }
  26. [StringLength(SysAttach.CodeKeyMaxLength)]
  27. public string CodeKey { get; set; }
  28. [StringLength(SysAttach.SourceKeyMaxLength)]
  29. public string SourceKey { get; set; }
  30. [StringLength(SysAttach.FileTitleMaxLength)]
  31. public string FileTitle { get; set; }
  32. [StringLength(SysAttach.FileNameMaxLength)]
  33. public string FileName { get; set; }
  34. [StringLength(SysAttach.FilePathMaxLength)]
  35. public string FilePath { get; set; }
  36. public int FileType { get; set; }
  37. [StringLength(SysAttach.FileExtMaxLength)]
  38. public string FileExt { get; set; }
  39. [StringLength(SysAttach.DescriptionMaxLength)]
  40. public string Description { get; set; }
  41. [IgnoreMap]
  42. public string FileInfo { get; set; }
  43. [IgnoreMap]
  44. public string AllowExt { get; set; }
  45. [IgnoreMap]
  46. public bool IsUpdate { get; set; }
  47. [IgnoreMap]
  48. public bool CheckAll { get; set; }
  49. }