创建管理员时,头像无法存储问题处理

This commit is contained in:
Chopper
2021-09-29 14:52:27 +08:00
parent 50c08c0e01
commit 95095f35c0
3 changed files with 17 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
@@ -21,18 +22,22 @@ public class AdminUser extends BaseEntity {
private static final long serialVersionUID = 2918352800205024873L;
@ApiModelProperty(value = "用户名")
@Length(max = 20,message = "用户名长度不能超过20个字符")
private String username;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "昵称")
@Length(max = 10,message = "昵称长度不能超过10个字符")
private String nickName;
@ApiModelProperty(value = "手机")
@Length(max = 11,message = "手机号长度不能超过11")
private String mobile;
@ApiModelProperty(value = "邮件")
@Length(max = 100,message = "又想长度不能超过100")
private String email;
@ApiModelProperty(value = "用户头像")

View File

@@ -4,6 +4,7 @@ import cn.lili.mybatis.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
@@ -19,23 +20,29 @@ public class AdminUserDTO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "用户名")
@NotEmpty(message = "用户名不能为空")
@Length(max = 20,message = "用户名长度不能超过20个字符")
private String username;
@NotEmpty(message = "密码不能为空")
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "昵称")
@Length(max = 10,message = "昵称长度不能超过10个字符")
private String nickName;
@ApiModelProperty(value = "手机")
@Length(max = 11,message = "手机号长度不能超过11")
private String mobile;
@ApiModelProperty(value = "邮件")
@Length(max = 100,message = "又想长度不能超过100")
private String email;
@ApiModelProperty(value = "头像")
private String avatar;
@ApiModelProperty(value = "描述/详情/备注")
private String description;