参数校验
This commit is contained in:
@ -2,7 +2,9 @@ package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@ -11,41 +13,41 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表添加请求体", requiredProperties = {"nickName", "userAvatar", "phoneNumber",
|
||||
"userAccount", "userPassword", "invitationCode", "userRole", "parentUserId", "superUserList"})
|
||||
"userAccount", "userPassword", "userRole"})
|
||||
public class UserInfoAddRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "用户昵称不能为空")
|
||||
@Schema(description = "用户昵称", example = "chenxinzhi")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户头像URL
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "用户头像URL不能为空")
|
||||
@Schema(description = "用户头像URL", example = "http://xxx.png")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@Schema(description = "手机号", example = "15888610253")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "账号", example = "qingcheng_account")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Schema(description = "密码", example = "qingcheng_password")
|
||||
private String userPassword;
|
||||
|
||||
@ -58,7 +60,7 @@ public class UserInfoAddRequest implements Serializable {
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@NotBlank(message = "参数不能为空")
|
||||
@NotBlank(message = "用户角色不能为空")
|
||||
@Schema(description = "用户角色", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -15,12 +16,14 @@ public class UserInfoLoginRequest implements Serializable {
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "账号", example = "${field.example}")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Schema(description = "密码", example = "${field.example}")
|
||||
private String userPassword;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@ -14,14 +16,16 @@ import com.greenorange.promotion.common.PageRequest;
|
||||
public class UserInfoQueryRequest extends PageRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户表 ID
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户表 ID", example = "1")
|
||||
@NotNull(message = "用户ID不能为null")
|
||||
@Schema(description = "用户ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@Schema(description = "手机号", example = "${field.example}")
|
||||
private String phoneNumber;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
@ -11,67 +13,74 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表更新请求体", requiredProperties = {"id", "nickName", "userAvatar", "phoneNumber",
|
||||
"userAccount", "userPassword", "invitationCode", "userRole", "parentUserId", "superUserList"})
|
||||
"userAccount", "userPassword", "userRole"})
|
||||
public class UserInfoUpdateRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户表 ID
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户表 ID", example = "1")
|
||||
@NotNull(message = "用户ID不能为null")
|
||||
@Schema(description = "用户ID", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "${field.example}")
|
||||
@NotBlank(message = "用户昵称不能为空")
|
||||
@Schema(description = "用户昵称", example = "chenxinzhi")
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户头像URL
|
||||
*/
|
||||
@Schema(description = "用户头像URL", example = "${field.example}")
|
||||
@NotBlank(message = "用户头像URL不能为空")
|
||||
@Schema(description = "用户头像URL", example = "http://xxx.png")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@Schema(description = "手机号", example = "${field.example}")
|
||||
@NotBlank(message = "手机号不能为空")
|
||||
@Schema(description = "手机号", example = "15888610253")
|
||||
private String phoneNumber;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@Schema(description = "账号", example = "${field.example}")
|
||||
@NotBlank(message = "账号不能为空")
|
||||
@Schema(description = "账号", example = "qingcheng_account")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码", example = "${field.example}")
|
||||
@NotBlank(message = "密码不能为空")
|
||||
@Schema(description = "密码", example = "qingcheng_password")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
@Schema(description = "邀请码", example = "${field.example}")
|
||||
@Schema(description = "邀请码", example = "666999")
|
||||
private String invitationCode;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@Schema(description = "用户角色", example = "${field.example}")
|
||||
@NotBlank(message = "用户角色不能为空")
|
||||
@Schema(description = "用户角色", example = "user")
|
||||
private String userRole;
|
||||
|
||||
/**
|
||||
* 上级用户id
|
||||
*/
|
||||
@Schema(description = "上级用户id", example = "${field.example}")
|
||||
@Schema(description = "上级用户id", example = "1")
|
||||
private Long parentUserId;
|
||||
|
||||
/**
|
||||
* 上级用户列表(1,2,3)
|
||||
*/
|
||||
@Schema(description = "上级用户列表(1,2,3)", example = "${field.example}")
|
||||
@Schema(description = "上级用户列表(1,2,3)", example = "1, 2, 3")
|
||||
private String superUserList;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user