UserInfoDto.java 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. package com.xy.dto;
  2. import com.fasterxml.jackson.annotation.JsonFormat;
  3. import com.xy.utils.PageBean;
  4. import io.swagger.annotations.ApiModelProperty;
  5. import lombok.Data;
  6. import lombok.experimental.Accessors;
  7. import javax.validation.constraints.NotBlank;
  8. import javax.validation.constraints.NotNull;
  9. import javax.validation.constraints.Pattern;
  10. import java.time.LocalDate;
  11. import java.time.LocalDateTime;
  12. import java.util.List;
  13. /**
  14. * <p>
  15. * 用户表
  16. * </p>
  17. *
  18. * @author lijin
  19. * @since 2023-01-12
  20. */
  21. public class UserInfoDto {
  22. @Data
  23. @Accessors(chain = true)
  24. public static class Page extends Vo {
  25. @ApiModelProperty(value = "分页对象", required = true)
  26. private PageBean page;
  27. @JsonFormat(pattern = "yyyy-MM-dd")
  28. @ApiModelProperty(value = "创建时间-起")
  29. private LocalDate beginCreateTime;
  30. @JsonFormat(pattern = "yyyy-MM-dd")
  31. @ApiModelProperty(value = "创建时间-始")
  32. private LocalDate endCreateTime;
  33. public LocalDateTime getBeginCreateTime() {
  34. return beginCreateTime == null ? null : beginCreateTime.atTime(0, 0, 0);
  35. }
  36. public LocalDateTime getEndCreateTime() {
  37. return endCreateTime == null ? null : endCreateTime.atTime(23, 59, 59);
  38. }
  39. }
  40. @Data
  41. @Accessors(chain = true)
  42. public static class Save extends Vo {
  43. @NotNull(message = "sysIds不能为空")
  44. @ApiModelProperty("系统id集合")
  45. private String sysIds;
  46. @NotBlank(message = "账户名称不能为空")
  47. @ApiModelProperty(value = "账户名称", required = true)
  48. private String name;
  49. @NotBlank(message = "phone不能为空")
  50. @ApiModelProperty(value = "手机", required = true)
  51. @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,2-9])|(19[0,2-9]))\\d{8}$", message = "phone格式错误")
  52. private String tel;
  53. @ApiModelProperty(value = "邮件")
  54. @Pattern(regexp = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", message = "email格式错误")
  55. private String mail;
  56. @ApiModelProperty(value = "密码", required = true)
  57. @NotBlank(message = "密码不可为空")
  58. @Pattern(regexp = "^[a-zA-z0-9]{6,11}$", message = "password必须为数字或字母,长度6-11位之间")
  59. private String password;
  60. @ApiModelProperty(value = "角色ID(数组)")
  61. private List<Long> roleIds;
  62. }
  63. @Data
  64. @Accessors(chain = true)
  65. public static class Update {
  66. @NotNull(message = "userId不能为空")
  67. @ApiModelProperty(value = "id")
  68. private Long userId;
  69. @ApiModelProperty(value = "手机", required = true)
  70. @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,2-9])|(19[0,2-9]))\\d{8}$", message = "phone格式错误")
  71. private String tel;
  72. @ApiModelProperty(value = "邮件")
  73. @Pattern(regexp = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$", message = "email格式错误")
  74. private String mail;
  75. @ApiModelProperty(value = "密码", required = true)
  76. @Pattern(regexp = "^[a-zA-z0-9]{6,11}$", message = "password必须为数字或字母,长度6-11位之间")
  77. private String password;
  78. @ApiModelProperty(value = "用户类型")
  79. private String userType;
  80. @ApiModelProperty(value = "状态")
  81. private Boolean status;
  82. @ApiModelProperty(value = "系统id集合")
  83. private String sysIds;
  84. }
  85. @Data
  86. @Accessors(chain = true)
  87. public static class Vo {
  88. @ApiModelProperty(value = "id")
  89. private Long userId;
  90. @ApiModelProperty(value = "用户昵称")
  91. private String name;
  92. @ApiModelProperty(value = "手机号")
  93. private String tel;
  94. @ApiModelProperty(value = "邮件")
  95. private String mail;
  96. @ApiModelProperty(value = "微信开放平台识别码")
  97. private String unionid;
  98. @ApiModelProperty(value = "系统id集合")
  99. private String sysIds;
  100. @ApiModelProperty(value = "权限系统用户id")
  101. private Long authorizeUserId;
  102. @ApiModelProperty(value = "用户类型")
  103. private String userType;
  104. @ApiModelProperty(value = "状态")
  105. private Boolean status;
  106. @ApiModelProperty(value = "创建人")
  107. private Long createUser;
  108. @ApiModelProperty(value = "创建时间")
  109. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  110. private LocalDateTime createTime;
  111. @ApiModelProperty(value = "更新人")
  112. private Long updateUser;
  113. @ApiModelProperty(value = "更新时间")
  114. @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  115. private LocalDateTime updateTime;
  116. }
  117. }