前端:管理员模块添加功能重构
前端:管理员模块修改功能重构
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 管理员添加 DTO
|
||||
@@ -11,16 +14,20 @@ public class AdminAddDTO {
|
||||
* 登陆账号
|
||||
*/
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 6, max = 16, message = "账号长度为 6-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotEmpty(message = "昵称不能为空")
|
||||
@Length(max = 10, message = "昵称长度最大为 10 位")
|
||||
private String nickname;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 6, max = 16, message = "密码长度为 6-16 位")
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package cn.iocoder.mall.admin.api.dto;
|
||||
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 管理员更新 DTO
|
||||
@@ -17,16 +20,19 @@ public class AdminUpdateDTO {
|
||||
* 登陆账号
|
||||
*/
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 6, max = 16, message = "账号长度为 6-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
/**
|
||||
* 昵称
|
||||
*/
|
||||
@NotEmpty(message = "昵称不能为空")
|
||||
@Length(max = 10, message = "昵称长度最大为 10 位")
|
||||
private String nickname;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotEmpty(message = "密码不能为空")
|
||||
@Length(min = 6, max = 16, message = "密码长度为 6-16 位")
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
|
||||
Reference in New Issue
Block a user