first commit
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
package com.greenorange.promotion.model.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "参数:id列表", requiredProperties = {"ids"})
|
||||
public class CommonBatchRequest implements Serializable {
|
||||
|
||||
|
||||
@Schema(description = "id列表", example = "[8, 9, 17]")
|
||||
private List<Long> ids;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.greenorange.promotion.model.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "参数:id", requiredProperties = {"id"})
|
||||
public class CommonRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@Schema(description = "id", example = "2")
|
||||
private Long id;
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.greenorange.promotion.model.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@Schema(description = "参数:String", requiredProperties = {"templateString"})
|
||||
public class CommonStringRequest implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 字符串
|
||||
*/
|
||||
@Schema(description = "String", example = "templateString")
|
||||
private String templateString;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户表添加请求体
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表添加请求体", requiredProperties =
|
||||
{"userAccount", "userPassword", "miniOpenId", "userName", "userAvatar", "points", "userRole"})
|
||||
public class UserAddRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@Schema(description = "账号", example = "qingcheng")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码", example = "123456")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 小程序openId
|
||||
*/
|
||||
@Schema(description = "小程序openId", example = "324324")
|
||||
private String miniOpenId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "Jack")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
@Schema(description = "用户头像", example = "https://www.com")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
@Schema(description = "积分", example = "1200")
|
||||
private Integer points;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@Schema(description = "用户角色", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import com.greenorange.promotion.common.PageRequest;
|
||||
|
||||
/**
|
||||
* 用户表查询请求体,继承自分页请求 PageRequest
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表查询请求体", requiredProperties = {"current", "pageSize"})
|
||||
public class UserQueryRequest extends PageRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "Jack")
|
||||
private String userName;
|
||||
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@Schema(description = "用户角色", example = "user")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.greenorange.promotion.model.dto.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户表更新请求体
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表更新请求体", requiredProperties =
|
||||
{"id", "userAccount", "userPassword", "miniOpenId", "userName", "userAvatar", "points", "userRole"})
|
||||
public class UserUpdateRequest implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@Schema(description = "账号", example = "qingcheng")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码", example = "123456")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 小程序openId
|
||||
*/
|
||||
@Schema(description = "小程序openId", example = "fdsafdfasd")
|
||||
private String miniOpenId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "Jack")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
@Schema(description = "用户头像", example = "https://www.com")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
@Schema(description = "积分", example = "12000")
|
||||
private Integer points;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@Schema(description = "用户角色", example = "admin")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.greenorange.promotion.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户表
|
||||
* @TableName user
|
||||
*/
|
||||
@TableName(value ="user")
|
||||
@Data
|
||||
public class User implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 小程序openId
|
||||
*/
|
||||
private String miniOpenId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
private Integer points;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
private String userRole;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Integer isDelete;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.greenorange.promotion.model.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户角色枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum UserRoleEnum {
|
||||
|
||||
USER("用户", "user"),
|
||||
ADMIN("管理员", "admin"),
|
||||
BOSS("Boss", "boss"),
|
||||
BAN("被封号", "ban");
|
||||
|
||||
|
||||
private final String text;
|
||||
|
||||
private final String value;
|
||||
|
||||
UserRoleEnum(String text, String value) {
|
||||
this.text = text;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取值列表
|
||||
*/
|
||||
public static List<String> getValues() {
|
||||
return Arrays.stream(values()).map(item -> item.value).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取值列表
|
||||
*/
|
||||
public static UserRoleEnum getEnumByValues(String value) {
|
||||
if (ObjectUtils.isEmpty(value)) {
|
||||
return null;
|
||||
}
|
||||
for (UserRoleEnum anEnum : UserRoleEnum.values()) {
|
||||
if(anEnum.value.equals(value)) {
|
||||
return anEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.greenorange.promotion.model.vo.user;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户表 视图对象
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "用户表 视图对象")
|
||||
public class UserVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id", example = "1")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 账号
|
||||
*/
|
||||
@Schema(description = "账号", example = "${field.example}")
|
||||
private String userAccount;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Schema(description = "密码", example = "${field.example}")
|
||||
private String userPassword;
|
||||
|
||||
/**
|
||||
* 小程序openId
|
||||
*/
|
||||
@Schema(description = "小程序openId", example = "${field.example}")
|
||||
private String miniOpenId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
@Schema(description = "用户昵称", example = "${field.example}")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户头像
|
||||
*/
|
||||
@Schema(description = "用户头像", example = "${field.example}")
|
||||
private String userAvatar;
|
||||
|
||||
/**
|
||||
* 积分
|
||||
*/
|
||||
@Schema(description = "积分", example = "${field.example}")
|
||||
private Integer points;
|
||||
|
||||
/**
|
||||
* 用户角色
|
||||
*/
|
||||
@Schema(description = "用户角色", example = "${field.example}")
|
||||
private String userRole;
|
||||
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
Reference in New Issue
Block a user