迁移管理员逻辑

This commit is contained in:
YunaiV
2020-07-05 18:28:14 +08:00
parent 6a4b6fe67f
commit 51a5e5b750
35 changed files with 676 additions and 323 deletions

View File

@@ -1,15 +0,0 @@
package cn.iocoder.mall.system.api.constant;
public class AdminConstants {
/**
* 账号 - 管理员
*/
public static final String USERNAME_ADMIN = "admin";
/**
* 账号 - 演示账号
*/
public static final String USERNAME_DEMO = "yudaoyuanma";
}

View File

@@ -1,39 +0,0 @@
package cn.iocoder.mall.system.api.dto.admin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
@ApiModel("管理员添加 DTO")
@Data
@Accessors(chain = true)
public class AdminAddDTO implements Serializable {
@ApiModelProperty(value = "登陆账号", required = true, example = "15601691300")
@NotEmpty(message = "登陆账号不能为空")
@Length(min = 5, max = 16, message = "账号长度为 5-16 位")
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
private String username;
@ApiModelProperty(value = "昵称", required = true, example = "小王")
@NotEmpty(message = "昵称不能为空")
@Length(max = 10, message = "昵称长度最大为 10 位")
private String nickname;
@ApiModelProperty(value = "密码", required = true, example = "buzhidao")
@NotEmpty(message = "密码不能为空")
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
private String password;
@ApiModelProperty(value = "部门ID", required = true, example = "1")
@NotNull(message = "部门不能为空")
private Integer deptmentId;
}

View File

@@ -1,21 +0,0 @@
package cn.iocoder.mall.system.api.dto.admin;
import cn.iocoder.common.framework.vo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@ApiModel(value = "管理员分页 DTO")
@Data
@Accessors(chain = true)
public class AdminPageDTO extends PageParam {
@ApiModelProperty(value = "昵称,模糊匹配", example = "小王")
private String nickname;
@ApiModelProperty(value = "所在部门ID")
private Integer deptmentId;
}

View File

@@ -1,42 +0,0 @@
package cn.iocoder.mall.system.api.dto.admin;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
@ApiModel("管理员更新 DTO")
@Data
@Accessors(chain = true)
public class AdminUpdateDTO implements Serializable {
@ApiModelProperty(value = "管理员编号", required = true, example = "1")
@NotNull(message = "管理员编号不能为空")
private Integer id;
@ApiModelProperty(value = "登陆账号", required = true, example = "15601691300")
@NotEmpty(message = "登陆账号不能为空")
@Length(min = 5, max = 16, message = "账号长度为 5-16 位")
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
private String username;
@ApiModelProperty(value = "昵称", required = true, example = "小王")
@NotEmpty(message = "昵称不能为空")
@Length(max = 10, message = "昵称长度最大为 10 位")
private String nickname;
@ApiModelProperty(value = "密码", example = "buzhidao")
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
private String password;
@ApiModelProperty(value = "部门ID", required = true, example = "1")
@NotNull(message = "部门不能为空")
private Integer deptmentId;
}

View File

@@ -1,26 +0,0 @@
package cn.iocoder.mall.system.api.dto.admin;
import cn.iocoder.common.framework.enums.CommonStatusEnum;
import cn.iocoder.common.framework.validator.InEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
@ApiModel("管理员更新状态 DTO")
@Data
@Accessors(chain = true)
public class AdminUpdateStatusDTO {
@ApiModelProperty(value = "管理员编号", required = true, example = "1")
@NotNull(message = "管理员编号不能为空")
private Integer id;
@ApiModelProperty(value = "状态", required = true, example = "1", notes = "见 CommonStatusEnum 枚举")
@NotNull(message = "状态不能为空")
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
private Integer status;
}