CreateRoleDto.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Abp.AutoMapper;
  2. using System.ComponentModel.DataAnnotations;
  3. using VberZero.AppService.Base.Dto;
  4. using VberZero.BaseSystem.Roles;
  5. namespace VberZero.AppService.Roles.Dto;
  6. [AutoMapTo(typeof(Role))]
  7. public class CreateRoleDto
  8. {
  9. [StringLength(Role.MaxNameLength)]
  10. public string Name { get; set; }
  11. [Required]
  12. [StringLength(Role.MaxDisplayNameLength)]
  13. public string DisplayName { get; set; }
  14. public string NormalizedName { get; set; }
  15. [StringLength(Role.MaxDescriptionLength)]
  16. public string Description { get; set; }
  17. public List<string> PermissionNames { get; set; }
  18. public CreateRoleDto()
  19. {
  20. PermissionNames = new List<string>();
  21. }
  22. /// <summary>
  23. /// 用户级别
  24. /// </summary>
  25. public virtual VzDefinition.UserType UserType { get; set; }
  26. /// <summary>
  27. /// 账户类型
  28. /// </summary>
  29. public VzDefinition.AccountType AccountType { get; set; }
  30. }
  31. [AutoMapTo(typeof(Role))]
  32. public class UpdateRoleDto : VzEntityDto<int>
  33. {
  34. //[Required]
  35. //[StringLength(Role.MaxNameLength)]
  36. //public string Name { get; set; }
  37. [Required]
  38. [StringLength(Role.MaxDisplayNameLength)]
  39. public string DisplayName { get; set; }
  40. public string NormalizedName { get; set; }
  41. [StringLength(Role.MaxDescriptionLength)]
  42. public string Description { get; set; }
  43. /// <summary>
  44. /// 用户级别
  45. /// </summary>
  46. public virtual VzDefinition.UserType UserType { get; set; }
  47. public List<string> PermissionNames { get; set; }
  48. }