UserInfoDto.java 6.0 KB

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