初始化
This commit is contained in:
42
pqs-user/user-api/pom.xml
Normal file
42
pqs-user/user-api/pom.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs-user</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>user-api</artifactId>
|
||||
<name>用户模块对外接口</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-db</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-poi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.AuthClientFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 13:27
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER, path = "/authClient", fallbackFactory = AuthClientFeignClientFallbackFactory.class)
|
||||
public interface AuthClientFeignClient {
|
||||
|
||||
|
||||
/**
|
||||
* 根据客户端名称获取客户端信息
|
||||
* @param clientName 客户端名称
|
||||
* @return 客户端信息
|
||||
*/
|
||||
@GetMapping("/getAuthClientByName/{clientName}")
|
||||
HttpResult<AuthClient> getAuthClientByName(@PathVariable("clientName") String clientName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.DeptFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/11
|
||||
* 部门相关业务对外接口
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER, path = "/dept", fallbackFactory = DeptFeignClientFallbackFactory.class)
|
||||
public interface DeptFeignClient {
|
||||
|
||||
/**
|
||||
* 根据条件获取后代部门索引
|
||||
* @param id 部门id
|
||||
* @param type 指定部门类型
|
||||
* @return 后代部门索引
|
||||
*/
|
||||
@PostMapping("/getDeptDescendantIndexes")
|
||||
HttpResult<List<DeptDTO>> getDeptDescendantIndexes(@RequestParam("id") String id, @RequestParam("type") List<Integer> type);
|
||||
|
||||
/**
|
||||
* 根据区域获取部门id
|
||||
* @param area
|
||||
* @author xy
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getDeptIdByArea")
|
||||
HttpResult<String> getDeptIdByArea(@RequestParam("area") String area);
|
||||
|
||||
/**
|
||||
* 根据部门id获取区域id
|
||||
* @param deptId
|
||||
* @author denghuajun
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getAreaIdByDeptId")
|
||||
HttpResult<String> getAreaIdByDeptId(@RequestParam("deptId") String deptId);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.user.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.fallback.UserFeignClientFallbackFactory;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月08日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.USER,path = "/user",fallbackFactory = UserFeignClientFallbackFactory.class)
|
||||
public interface UserFeignClient {
|
||||
|
||||
/**
|
||||
* 根据登录名查询用户信息
|
||||
*
|
||||
* @param loginName 登录名
|
||||
* @return 用户基本信息
|
||||
*/
|
||||
@GetMapping("/getUserByName/{loginName}")
|
||||
HttpResult<UserDTO> getUserByName(@PathVariable("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 认证后根据用户名判断用户状态
|
||||
* @param loginName 登录名
|
||||
* @return 校验结果
|
||||
*/
|
||||
@GetMapping("/judgeUserStatus/{loginName}")
|
||||
HttpResult<Boolean> judgeUserStatus(@PathVariable("loginName") String loginName);
|
||||
|
||||
/**
|
||||
* 更新用户登录认证密码错误次数
|
||||
*
|
||||
* @param loginName 登录名
|
||||
* @return null
|
||||
*/
|
||||
@PutMapping("/updateUserLoginErrorTimes/{loginName}")
|
||||
HttpResult<String> updateUserLoginErrorTimes(@PathVariable("loginName") String loginName);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.AuthClientFeignClient;
|
||||
import com.njcn.user.pojo.po.AuthClient;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 13:28
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AuthClientFeignClientFallbackFactory implements FallbackFactory<AuthClientFeignClient> {
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param throwable RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public AuthClientFeignClient create(Throwable throwable) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(throwable.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new AuthClientFeignClient() {
|
||||
@Override
|
||||
public HttpResult<AuthClient> getAuthClientByName(String clientName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据客户端名称获取客户端信息",throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.dto.DeptDTO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月11日 10:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DeptFeignClientFallbackFactory implements FallbackFactory<DeptFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
*
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public DeptFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DeptFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DeptDTO>> getDeptDescendantIndexes(String id, List<Integer> type) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据条件获取后代部门索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> getDeptIdByArea(String area) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据区域索引获取部门索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> getAreaIdByDeptId(String deptId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "根据部门索引获取区域索引", cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.njcn.user.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.dto.UserDTO;
|
||||
import com.njcn.user.utils.UserEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年08月24日 10:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public UserFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = UserEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new UserFeignClient() {
|
||||
@Override
|
||||
public HttpResult<UserDTO> getUserByName(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据登录名查询用户信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> judgeUserStatus(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","认证后根据用户名判断用户状态",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> updateUserLoginErrorTimes(String loginName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","更新用户登录认证密码错误次数",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.njcn.user.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年04月13日 10:50
|
||||
*/
|
||||
@Getter
|
||||
public enum UserResponseEnum {
|
||||
|
||||
/**
|
||||
* A0100 ~ A0199 用于用户模块的枚举
|
||||
* <p>
|
||||
* 大致可以分为:
|
||||
* 登录失败状态码 A0101 + 各种登录失败的原因
|
||||
* 注册失败状态码 A0103 + 各种注册失败的原因
|
||||
* 用户权限升级失败(暂时用于app账号不同角色升级) A0103 + 各种升级app权限失败的原因
|
||||
* token校验失败 A0104 + 各种token失败的原因
|
||||
* client校验失败 A0105 + 各种客户端失败的原因
|
||||
*/
|
||||
LOGIN_USERNAME_NOT_FOUND("A0101", "用户不存在"),
|
||||
LOGIN_USERNAME_INVALID("A0101", "用户名非法"),
|
||||
LOGIN_PHONE_NOT_FOUND("A0101", "手机号不存在"),
|
||||
LOGIN_WRONG_PWD("A0101", "用户名密码错误"),
|
||||
LOGIN_WRONG_PHONE_CODE("A0101", "短信验证码错误"),
|
||||
LOGIN_WRONG_CODE("A0101", "验证码错误"),
|
||||
LOGIN_USER_DELETE("A0101", "账号已被注销"),
|
||||
LOGIN_USER_LOCKED("A0101", "账号已被锁定"),
|
||||
LOGIN_USER_UNAUDITED("A0101", "账号未审核"),
|
||||
NEED_MODIFY_PASSWORD("A0101", "密码需修改"),
|
||||
LOGIN_USER_SLEEP("A0101", "账号已休眠"),
|
||||
LOGIN_USER_PASSWORD_EXPIRED("A0101", "账号密码过期"),
|
||||
LOGIN_FIRST_LOGIN("A0101", "账号首次登录"),
|
||||
NEED_MODIFY_PWD("A0101", "密码失效,请重置"),
|
||||
LACK_USER_STRATEGY("A0101", "缺失用户策略配置"),
|
||||
UNSUPPORTED_GRANT_TYPE("A0101", "非法认证方式"),
|
||||
INVALID_IP("A0101", "非法IP访问系统"),
|
||||
INVALID_TIME("A0101", "用户当前时间段禁止访问"),
|
||||
PASSWORD_TRANSPORT_ERROR("A0101", "密码传输完整性被破坏"),
|
||||
SPECIAL_PASSWORD("A0101", "密码需要包含特殊字符字母数字,长度为8-16"),
|
||||
REPEAT_PASSWORD("A0101", "新密码与旧密码不能一致"),
|
||||
|
||||
REGISTER_PHONE_FAIL("A0102", "该号码已注册,请检查phone字段"),
|
||||
REGISTER_LOGIN_NAME_FAIL("A0102", "该账号已注册"),
|
||||
REGISTER_PHONE_WRONG("A0102", "手机号非法"),
|
||||
REGISTER_PASSWORD_WRONG("A0102", "账号密码非法"),
|
||||
REGISTER_LOGIN_NAME_EXIST("A0102", "该登录名已存在,请检查loginName字段"),
|
||||
REGISTER_HOMEPAGE_NAME_EXIST("A0102", "该驾驶舱名已存在,请检查name字段"),
|
||||
FUNCTION_PATH_EXIST("A0102", "菜单路径已存在,请检查path字段"),
|
||||
COMPONENT_NAME_EXIST("A0102", "组件名已存在,请检查name字段"),
|
||||
|
||||
|
||||
UPDATE_ROLE_REFERRAL_CODE_ERROR("A0103", "推荐码非法"),
|
||||
|
||||
PARSE_TOKEN_FORBIDDEN_JWT("A0104", "token已被禁止访问"),
|
||||
REFRESH_TOKEN_EXPIRE_JWT("A0104", "refresh_token已过期"),
|
||||
|
||||
CLIENT_AUTHENTICATION_FAILED("A0105", "客户端认证失败"),
|
||||
NOT_FOUND_CLIENT("A0105", "客户端不存在"),
|
||||
|
||||
DEPT_MISSING("A0106", "未找到此部门"),
|
||||
|
||||
DEPT_NODATA("A0107", "部门下暂无用户"),
|
||||
|
||||
BIND_USER_DATA("A0108", "已绑定用户,先解绑用户"),
|
||||
|
||||
CHILD_DEPT_DATA("A0109", "已绑定子部门,先解绑部门"),
|
||||
|
||||
BIND_MONITOR_DATA("A0110", "已绑定监测点,先解绑监测点"),
|
||||
|
||||
NO_MENU_DATA("A0111","未找到菜单"),
|
||||
|
||||
CHILD_DATA("A0112","数据已绑子节点"),
|
||||
|
||||
BIND_ROLE_DATA("A0113","已有角色绑定,请先解绑"),
|
||||
|
||||
NO_ROLE_DATA("A0114","未找到此角色"),
|
||||
|
||||
BIND_FUNCTION_DATA("A0115","已绑定资源,先解绑资源"),
|
||||
|
||||
DEPT_NAME_REPEAT("A0116","部门名称重复"),
|
||||
|
||||
ROLE_NAME_REPEAT("A0117","角色名称重复");
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
UserResponseEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.njcn.user.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @createTime 2021年05月25日 15:40
|
||||
*/
|
||||
@Getter
|
||||
public enum UserStatusEnum {
|
||||
|
||||
/**
|
||||
* 用户状态0:删除;1:正常;2:锁定;3:待审核;4:休眠;5:密码过期
|
||||
*/
|
||||
DESTROY(0, "用户已注销"),
|
||||
NORMAL(1, "正常"),
|
||||
LOCKED(2, "用户已经被锁定"),
|
||||
UNCHECK(3, "用户未审核"),
|
||||
SLEEP(4, "用户已休眠"),
|
||||
OVERDUE(5, "用户密码已经过期");
|
||||
|
||||
private final int code;
|
||||
|
||||
private final String message;
|
||||
|
||||
UserStatusEnum(int code, String message) {
|
||||
this.code=code;
|
||||
this.message=message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface ComponentState {
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 顶层父类的pid
|
||||
*/
|
||||
String FATHER_PID = "0";
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28
|
||||
*
|
||||
*/
|
||||
public interface DeptState {
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
int ENABLE = 1;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28
|
||||
*
|
||||
*/
|
||||
public interface DeptType {
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义
|
||||
*/
|
||||
int UNCUSTOM = 0;
|
||||
int WEBCUSTOM = 1;
|
||||
int APPCUSTOM = 2;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface FunctionState {
|
||||
|
||||
/**
|
||||
* 权限资源状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 顶层父类的pid
|
||||
*/
|
||||
String FATHER_PID = "0";
|
||||
|
||||
/**
|
||||
* 驾驶舱父类名称
|
||||
*/
|
||||
String DRIVER_NAME = "/home";
|
||||
|
||||
/**
|
||||
* 权限资源类型 0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
*/
|
||||
int MENU = 0;
|
||||
|
||||
int BUTTON = 1;
|
||||
|
||||
int PUBLIC = 2;
|
||||
|
||||
int IN_SERVICE = 3;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface HomePageState {
|
||||
|
||||
/**
|
||||
* 状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
|
||||
int ENABLE = 1;
|
||||
|
||||
/**
|
||||
* 默认首页 用户的id
|
||||
*/
|
||||
String DEFAULT_USER_ID = "0";
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface RoleType {
|
||||
|
||||
/**
|
||||
* 角色类型 0:超级管理员;1:管理员;2:用户
|
||||
*/
|
||||
int SUPER_ADMINISTRATOR = 0;
|
||||
|
||||
int ADMINISTRATOR = 1;
|
||||
|
||||
int USER = 2;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface UserDefaultPassword {
|
||||
|
||||
/**
|
||||
* 新增用户初始密码
|
||||
*/
|
||||
String DEFAULT_PASSWORD = "123456";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 15:00
|
||||
*/
|
||||
public interface UserState {
|
||||
|
||||
/**
|
||||
* 用户状态 0:删除;1:正常;2:锁定;3:待审核;4:休眠;5:密码过期
|
||||
*/
|
||||
int DELETE = 0;
|
||||
int ENABLE = 1;
|
||||
int LOCKED = 2;
|
||||
int UNCHECK = 3;
|
||||
int SLEEP = 4;
|
||||
int OVERDUE = 5;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据来源:0-外部推送 1-正常新增
|
||||
*/
|
||||
int OUT_ORIGIN = 0;
|
||||
int NORMAL_ORIGIN = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 密码状态:0-不需要修改 1-需要修改
|
||||
*/
|
||||
int NEEDLESS = 0;
|
||||
int NEED = 1;
|
||||
|
||||
|
||||
/**
|
||||
* 初始密码错误次数
|
||||
*/
|
||||
int ERROR_PASSWORD_TIMES = 0;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月15日 19:39
|
||||
*/
|
||||
public interface UserType {
|
||||
|
||||
/**
|
||||
* 用户类型 0:临时用户;1:正式用户
|
||||
*/
|
||||
int CASUAL = 0;
|
||||
|
||||
int OFFICIAL = 1;
|
||||
|
||||
/**
|
||||
* 用户权限类型 0:超级管理员;1:管理员;2:用户
|
||||
*/
|
||||
int SUPER_ADMINISTRATOR = 0;
|
||||
|
||||
int ADMINISTRATOR = 1;
|
||||
|
||||
int USER = 2;
|
||||
|
||||
String SUPER_ADMIN = "root";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.njcn.user.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
* @date 2021/12/29 15:10
|
||||
*/
|
||||
public interface UserValidMessage {
|
||||
|
||||
String ID_NOT_BLANK = "id不能为空,请检查id参数";
|
||||
|
||||
String USERNAME_NOT_BLANK = "名称不能为空,请检查name参数";
|
||||
|
||||
String USERNAME_FORMAT_ERROR = "用户名格式错误,需中英文1-16,请检查name参数";
|
||||
|
||||
String LOGIN_NAME_NOT_BLANK = "登录名不能为空,请检查loginName参数";
|
||||
|
||||
String LOGIN_NAME_FORMAT_ERROR = "登录名格式错误,需3-16位的英文字母和数字,请检查loginName参数";
|
||||
|
||||
String PASSWORD_NOT_BLANK = "密码不能为空,请检查password参数";
|
||||
|
||||
String PASSWORD_FORMAT_ERROR = "密码格式错误,需包含特殊字符字母数字,长度为8-16,请检查password参数";
|
||||
|
||||
String DEPT_NOT_BLANK = "部门不能为空,请检查deptId参数";
|
||||
|
||||
String PHONE_FORMAT_ERROR = "电话号码格式错误,请检查phone参数";
|
||||
|
||||
String EMAIL_FORMAT_ERROR = "邮箱格式错误,请检查email参数";
|
||||
|
||||
String LIMIT_IP_START_NOT_BLANK = "起始IP不能为空,请检查limitIpStart参数";
|
||||
|
||||
String LIMIT_IP_START_FORMAT_ERROR = "起始IP格式错误,请检查limitIpStart参数";
|
||||
|
||||
String LIMIT_IP_END_NOT_BLANK = "结束IP不能为空,请检查limitIpEnd参数";
|
||||
|
||||
String LIMIT_IP_END_FORMAT_ERROR = "结束IP格式错误,请检查limitIpEnd参数";
|
||||
|
||||
String LIMIT_TIME_NOT_BLANK = "时间段不能为空,请检查limitTime参数";
|
||||
|
||||
String CASUAL_USER_NOT_BLANK = "类型不能为空";
|
||||
|
||||
String SMS_NOTICE_NOT_BLANK = "短信通知不能为空,请检查smsNotice参数";
|
||||
|
||||
String EMAIL_NOTICE_NOT_BLANK = "邮件通知不能为空,请检查emailNotice参数";
|
||||
|
||||
String PARAM_FORMAT_ERROR = "参数值非法";
|
||||
|
||||
String ROLE_NOT_BLANK = "角色不能为空,请检查role参数";
|
||||
|
||||
String PID_NOT_BLANK = "父节点不能为空,请检查pid参数";
|
||||
|
||||
String CODE_NOT_BLANK = "资源标识不能为空,请检查code参数";
|
||||
|
||||
String PATH_NOT_BLANK = "资源路径不能为空,请检查path参数";
|
||||
|
||||
String PATH_FORMAT_ERROR = "路径格式错误,请检查path参数";
|
||||
|
||||
String SORT_NOT_BLANK = "排序不能为空,请检查sort参数";
|
||||
|
||||
String TYPE_NOT_BLANK = "资源类型不能为空,请检查type参数";
|
||||
|
||||
String LAYOUT_NOT_BLANK = "模板不能为空,请检查layout参数";
|
||||
|
||||
String FUNCTION_ID_NOT_BLANK = "资源id不能为空,请检查functionId参数";
|
||||
|
||||
String FUNCTION_ID_FORMAT_ERROR = "资源id格式错误,请检查functionId参数";
|
||||
|
||||
String FUNCTION_GROUP_NOT_BLANK = "功能数组不能为空,请检查functionGroup参数";
|
||||
|
||||
String FUNCTION_GROUP_FORMAT_ERROR = "功能数组格式错误,请检查functionGroup参数";
|
||||
|
||||
String COMPONENT_CODE_NOT_BLANK = "功能组件表示不能为空,请检查code参数";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 14:56
|
||||
*/
|
||||
@Data
|
||||
public class ComponentDTO implements Serializable {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
private String functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<ComponentDTO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年02月11日 14:08
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeptDTO implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String pid;
|
||||
|
||||
private String pids;
|
||||
|
||||
private String name;
|
||||
|
||||
private String area;
|
||||
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义;3-web测试
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.user.pojo.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月08日 15:12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class UserDTO {
|
||||
|
||||
private String userIndex;
|
||||
|
||||
private String username;
|
||||
|
||||
private String nickname;
|
||||
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 角色集合
|
||||
*/
|
||||
private List<String> roleName;
|
||||
|
||||
/**
|
||||
* sm4加密秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* sm4中间过程校验
|
||||
*/
|
||||
private String standBy;
|
||||
|
||||
private String deptIndex;
|
||||
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.dto.excel;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年04月06日 16:13
|
||||
*/
|
||||
@Data
|
||||
public class UserExcel implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
@Excel(name = "用户名", width = 20)
|
||||
private String name;
|
||||
|
||||
@Excel(name = "登录名", width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "角色", width = 20)
|
||||
private String role;
|
||||
|
||||
@Excel(name = "部门", width = 20)
|
||||
private String deptName;
|
||||
|
||||
@Excel(name = "手机", width = 20)
|
||||
private String phone;
|
||||
|
||||
@Excel(name = "注册时间", format = "yyyy-MM-dd HH:mm:ss", width = 20)
|
||||
private LocalDateTime registerTime;
|
||||
|
||||
@Excel(name = "最后登录时间", format = "yyyy-MM-dd HH:mm:ss", width = 20)
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
@Excel(name = "用户类型", replace = {"临时用户_0", "正式用户_1"}, width = 20)
|
||||
private Integer casualUser;
|
||||
|
||||
@Excel(name = "状态", replace = {"注销_0", "正常_1", "锁定_2", "待审核_3", "休眠_4", "密码过期_5"}, width = 20)
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 9:16
|
||||
*/
|
||||
@Data
|
||||
public class ComponentParam {
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
@NotBlank(message = UserValidMessage.FUNCTION_ID_NOT_BLANK)
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
@NotBlank(message = UserValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_NAME, message = UserValidMessage.PATH_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
@NotEmpty(message = UserValidMessage.FUNCTION_GROUP_NOT_BLANK)
|
||||
private List<Integer> functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
@NotBlank(message = UserValidMessage.COMPONENT_CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
|
||||
/**
|
||||
* 组件更新操作实体
|
||||
* 需要填写的参数:组件的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ComponentUpdateParam extends ComponentParam {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28 14:39
|
||||
* 部门
|
||||
*/
|
||||
@Data
|
||||
public class DeptParam {
|
||||
|
||||
@ApiModelProperty("父节点")
|
||||
@NotBlank(message = ValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("行政区域id")
|
||||
@NotBlank(message = ValidMessage.AREA_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEMS_ID, message = ValidMessage.AREA_FORMAT_ERROR)
|
||||
private String area;
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = ValidMessage.SORT_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
@Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("部门类型 0-非自定义;1-web自定义;2-App自定义")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DeptUpdateParam extends DeptParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/17 10:25
|
||||
*/
|
||||
@Data
|
||||
public class FunctionParam {
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
@NotBlank(message = UserValidMessage.PID_NOT_BLANK)
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_NAME, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("资源标识")
|
||||
@NotBlank(message = UserValidMessage.CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
@NotBlank(message = UserValidMessage.PATH_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.FUNCTION_URL, message = UserValidMessage.PATH_FORMAT_ERROR)
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("资源类型")
|
||||
@NotNull(message = UserValidMessage.TYPE_NOT_BLANK)
|
||||
@Range(min = 0, max = 3, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 资源更新操作实体
|
||||
* 需要填写的参数:资源的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class FunctionUpdateParam extends FunctionParam {
|
||||
|
||||
@ApiModelProperty("资源Id")
|
||||
@NotBlank(message = UserValidMessage.FUNCTION_ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = UserValidMessage.FUNCTION_ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/18 16:14
|
||||
*/
|
||||
@Data
|
||||
public class HomePageParam {
|
||||
|
||||
@ApiModelProperty("自定义页面名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("布局模板")
|
||||
@NotBlank(message = UserValidMessage.LAYOUT_NOT_BLANK)
|
||||
private String layout;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
@NotBlank(message = UserValidMessage.PATH_NOT_BLANK)
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = UserValidMessage.SORT_NOT_BLANK)
|
||||
@Range(min = 0, max = 999, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 首页操作实体
|
||||
* 需要填写的参数:首页的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class HomePageUpdateParam extends HomePageParam {
|
||||
|
||||
@ApiModelProperty("首页Id")
|
||||
@NotBlank(message = UserValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/01/17 14:39
|
||||
* 角色
|
||||
*/
|
||||
@Data
|
||||
public class RoleParam {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DEPT_NAME_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("角色代码")
|
||||
@NotNull(message = ValidMessage.CODE_NOT_BLANK)
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 角色类型 0:超级管理员;1:管理员;2:普通用户
|
||||
*/
|
||||
@ApiModelProperty("角色类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("角色描述")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class RoleUpdateParam extends RoleParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
|
||||
/**
|
||||
* 权限类型
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
/**
|
||||
* 角色的相关关联
|
||||
*/
|
||||
@Data
|
||||
public static class RoleFunctionComponent {
|
||||
private String id;
|
||||
private List<String> idList;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/12/29 14:56
|
||||
*/
|
||||
@Data
|
||||
public class UserParam {
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.USERNAME_REGEX, message = UserValidMessage.USERNAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String deptId;
|
||||
|
||||
@ApiModelProperty("电话号码")
|
||||
@Pattern(regexp = PatternRegex.PHONE_REGEX_OR_NULL, message = UserValidMessage.PHONE_FORMAT_ERROR)
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
@Pattern(regexp = PatternRegex.EMAIL_REGEX_OR_NULL, message = UserValidMessage.EMAIL_FORMAT_ERROR)
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("起始IP")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_IP_START_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = UserValidMessage.LIMIT_IP_START_FORMAT_ERROR)
|
||||
private String limitIpStart;
|
||||
|
||||
@ApiModelProperty("结束IP")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_IP_END_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.IP_REGEX, message = UserValidMessage.LIMIT_IP_END_FORMAT_ERROR)
|
||||
private String limitIpEnd;
|
||||
|
||||
@ApiModelProperty("时间段")
|
||||
@NotBlank(message = UserValidMessage.LIMIT_TIME_NOT_BLANK)
|
||||
private String limitTime;
|
||||
|
||||
@ApiModelProperty("用户类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer casualUser;
|
||||
|
||||
@ApiModelProperty("用户权限类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = 0, max = 2, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("短信通知")
|
||||
@NotNull(message = UserValidMessage.SMS_NOTICE_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer smsNotice;
|
||||
|
||||
@ApiModelProperty("邮件通知")
|
||||
@NotNull(message = UserValidMessage.EMAIL_NOTICE_NOT_BLANK)
|
||||
@Range(min = 0, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer emailNotice;
|
||||
|
||||
@ApiModelProperty("角色")
|
||||
@NotEmpty(message = UserValidMessage.ROLE_NOT_BLANK)
|
||||
private List<String> role;
|
||||
|
||||
/**
|
||||
* 用户新增操作实体
|
||||
*
|
||||
* 需要填写的参数:登录名、密码
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserAddParam extends UserParam {
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
@NotBlank(message = UserValidMessage.LOGIN_NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.LOGIN_NAME_REGEX, message = UserValidMessage.LOGIN_NAME_FORMAT_ERROR)
|
||||
private String loginName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用户更新操作实体
|
||||
*
|
||||
* 需要填写的参数:用户的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserUpdateParam extends UserParam {
|
||||
|
||||
@ApiModelProperty("用户表Id")
|
||||
@NotBlank(message = UserValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UserQueryParam extends BaseParam {
|
||||
|
||||
@ApiModelProperty("用户类型")
|
||||
@NotNull(message = UserValidMessage.CASUAL_USER_NOT_BLANK)
|
||||
@Range(min = -1, max = 1, message = UserValidMessage.PARAM_FORMAT_ERROR)
|
||||
private Integer casualUser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.user.pojo.param;
|
||||
|
||||
import com.njcn.user.pojo.constant.UserValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/3/22 13:31
|
||||
*/
|
||||
@Data
|
||||
public class UserPasswordParam {
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
@NotBlank(message = UserValidMessage.USERNAME_NOT_BLANK)
|
||||
private String name;
|
||||
|
||||
|
||||
@ApiModelProperty("密码")
|
||||
@NotBlank(message = UserValidMessage.PASSWORD_NOT_BLANK)
|
||||
private String password;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-15
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_auth_client")
|
||||
public class AuthClient {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 认证客户端Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 客户端名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源Id列表
|
||||
*/
|
||||
private String resourceIds;
|
||||
|
||||
/**
|
||||
* 客户端秘钥
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 域
|
||||
*/
|
||||
private String scope;
|
||||
|
||||
/**
|
||||
* 授权方式
|
||||
*/
|
||||
private String authorizedGrantTypes;
|
||||
|
||||
/**
|
||||
* 回调地址
|
||||
*/
|
||||
private String webServerRedirectUri;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
private String authorities;
|
||||
|
||||
/**
|
||||
* 认证令牌时效
|
||||
*/
|
||||
private Integer accessTokenValidity;
|
||||
|
||||
/**
|
||||
* 刷新令牌时效
|
||||
*/
|
||||
private Integer refreshTokenValidity;
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private String additionalInformation;
|
||||
|
||||
/**
|
||||
* 是否自动放行 0-不放行 1-放行
|
||||
*/
|
||||
private Boolean autoApprove;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_component")
|
||||
public class Component extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 组件Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 资源Id
|
||||
*/
|
||||
private String functionId;
|
||||
|
||||
/**
|
||||
* 父节点Id
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 功能组件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 功能组件表示
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 组件路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 功能数组
|
||||
*/
|
||||
private String functionGroup;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dept")
|
||||
public class Dept extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点Id(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* (sys_Area)行政区域Id,自定义部门无需填写部门
|
||||
*/
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义;3-web测试
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 部门描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_function")
|
||||
public class Function extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 资源表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 所有上层节点
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源标识
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 图标(没有图标则默认为null)
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 资源类型:0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 资源描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 资源状态:0-删除 1-正常(默认为正常)
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_home_page")
|
||||
public class HomePage extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主页面Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 自定义页面名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 布局魔板
|
||||
*/
|
||||
private String layout;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_role")
|
||||
public class Role extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色代码,有需要用做匹配时候用(关联字典表id)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 角色状态0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 角色类型0-超级管理员 1-其他管理员 2-其他用户
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_component")
|
||||
public class RoleComponent {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 组件Id
|
||||
*/
|
||||
private String componentId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_role_function")
|
||||
public class RoleFunction {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 资源Id
|
||||
*/
|
||||
private String functionId;
|
||||
|
||||
|
||||
}
|
||||
146
pqs-user/user-api/src/main/java/com/njcn/user/pojo/po/User.java
Normal file
146
pqs-user/user-api/src/main/java/com/njcn/user/pojo/po/User.java
Normal file
@@ -0,0 +1,146 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user")
|
||||
public class User extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 登录名
|
||||
*/
|
||||
private String loginName;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 部门Id
|
||||
*/
|
||||
private String deptId;
|
||||
|
||||
/**
|
||||
* 电话号码
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 用户状态0-删除;1-正常;2-锁定;3-待审核;4-休眠;5-密码过期
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 用户类型 0:超级管理员;1:管理员;2:普通用户
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 数据来源:0-外部推送;1-正常新增;默认正常新增
|
||||
*/
|
||||
private Integer origin;
|
||||
|
||||
/**
|
||||
* 用户类型:0-临时用户 1-正式用户
|
||||
*/
|
||||
private Integer casualUser;
|
||||
|
||||
/**
|
||||
* 密码状态:0-不需要修改 1-需要修改
|
||||
*/
|
||||
private Integer pwdState;
|
||||
|
||||
/**
|
||||
* 短信通知(0-不通知;1-通知)默认不通知
|
||||
*/
|
||||
private Integer smsNotice;
|
||||
|
||||
/**
|
||||
* 邮件通知(0-不通知;1-通知)默认不通知
|
||||
*/
|
||||
private Integer emailNotice;
|
||||
|
||||
/**
|
||||
* 推荐码
|
||||
*/
|
||||
private String referralCode;
|
||||
|
||||
/**
|
||||
* 注册时间
|
||||
*/
|
||||
private LocalDateTime registerTime;
|
||||
|
||||
/**
|
||||
* 密码有效期字段(初始化的时候跟注册时间一样)
|
||||
*/
|
||||
private LocalDateTime pwdValidity;
|
||||
|
||||
/**
|
||||
* 最后一次登录时间
|
||||
*/
|
||||
private LocalDateTime loginTime;
|
||||
|
||||
/**
|
||||
* 限制登录起始IP
|
||||
*/
|
||||
private String limitIpStart;
|
||||
|
||||
/**
|
||||
* 限制登录结束IP
|
||||
*/
|
||||
private String limitIpEnd;
|
||||
|
||||
/**
|
||||
* 限制登录时间段(用'-'分割)
|
||||
*/
|
||||
private String limitTime;
|
||||
|
||||
/**
|
||||
* 密码错误次数
|
||||
*/
|
||||
private Integer loginErrorTimes;
|
||||
|
||||
/**
|
||||
* 首次密码错误时间(半个小时错误次数超过N次数则锁定,解锁后密码错误次数、首次密码错误时间重置)
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime firstErrorTime;
|
||||
|
||||
/**
|
||||
* 用户密码错误锁定时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime lockTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_role")
|
||||
public class UserRole {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色Id
|
||||
*/
|
||||
private String roleId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_user_set")
|
||||
public class UserSet {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户配置表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户Id
|
||||
*/
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 工作秘钥
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
* SM4-1值
|
||||
*/
|
||||
private String standBy;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.user.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user_strategy")
|
||||
public class UserStrategy extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户策略Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 密码有效期(1-6月,默认3个月)
|
||||
*/
|
||||
private Integer limitPwdDate;
|
||||
|
||||
/**
|
||||
* 密码错误次数限定(3-20次,默认5次)
|
||||
*/
|
||||
private Integer limitPwdTimes;
|
||||
|
||||
/**
|
||||
* 验证密码错误次数时间范围(5-60分钟,默认30分钟)
|
||||
*/
|
||||
private Integer lockPwdCheck;
|
||||
|
||||
/**
|
||||
* 用户锁定时间(30-60分钟,默认30分钟)
|
||||
*/
|
||||
private Integer lockPwdTime;
|
||||
|
||||
/**
|
||||
* 用户休眠(1-180天,默认90天,临时用户默认3天)
|
||||
*/
|
||||
private Integer sleep;
|
||||
|
||||
/**
|
||||
* 用户注销(1-360天,正常用户默认180天,临时用户默认7天)
|
||||
*/
|
||||
private Integer logout;
|
||||
|
||||
/**
|
||||
* 最大并发数(10-99,默认50)
|
||||
*/
|
||||
private Integer maxNum;
|
||||
|
||||
/**
|
||||
* 类型:0-临时用户 1-正常用户
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/19 14:56
|
||||
*/
|
||||
@Data
|
||||
public class ComponentVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("组件Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("资源id")
|
||||
private String functionId;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("功能组件名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("功能数组")
|
||||
private List<Integer> functionGroup;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("功能组件表示")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<ComponentVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年04月15日 11:28
|
||||
*/
|
||||
@Data
|
||||
public class DeptAllTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<DeptAllTreeVO> children;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/4
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class DeptTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("行政区域id")
|
||||
private String area;
|
||||
|
||||
@ApiModelProperty("行政区域name")
|
||||
private String areaName;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("部门类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("部门描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<DeptTreeVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2021/12/28 10:50
|
||||
* 部门管理VO
|
||||
*/
|
||||
@Data
|
||||
public class DeptVO implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点Id(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点Id
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 行政区域name
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 部门类型 0-非自定义;1-web自定义;2-App自定义
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 部门描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 部门状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/17 17:02
|
||||
*/
|
||||
@Data
|
||||
public class FunctionVO implements Serializable {
|
||||
|
||||
@ApiModelProperty("资源Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("节点")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("资源标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("routeName")
|
||||
private String routeName;
|
||||
|
||||
@ApiModelProperty("路径")
|
||||
private String routePath;
|
||||
|
||||
@ApiModelProperty("图标")
|
||||
private String icon;
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty("资源类型")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("子级")
|
||||
List<FunctionVO> children;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/17
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RoleVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 角色表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 角色代码,有需要用做匹配时候用(关联字典表id)
|
||||
*/
|
||||
private String code;
|
||||
|
||||
|
||||
/**
|
||||
* 角色描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 角色状态0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 角色类型0-超级管理员 1-其他管理员 2-其他用户
|
||||
*/
|
||||
private Integer type;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.user.pojo.vo;
|
||||
|
||||
import com.njcn.user.pojo.param.UserParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/12/29 14:31
|
||||
*/
|
||||
@Data
|
||||
public class UserVO extends UserParam implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("用户Id")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("登录名")
|
||||
private String loginName;
|
||||
|
||||
@ApiModelProperty("状态")
|
||||
private Integer state;
|
||||
|
||||
@ApiModelProperty("注册时间")
|
||||
private String registerTime;
|
||||
|
||||
@ApiModelProperty("登录时间")
|
||||
private String loginTime;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String deptName;
|
||||
|
||||
@ApiModelProperty("角色id")
|
||||
private List<String> roleList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.user.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.user.enums.UserResponseEnum;
|
||||
import com.njcn.user.enums.UserStatusEnum;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年05月26日 17:17
|
||||
*/
|
||||
public class UserEnumUtil {
|
||||
|
||||
/**
|
||||
* 获取UserResponseEnum实例
|
||||
*/
|
||||
public static UserResponseEnum getUserResponseEnumByMessage(@NotNull Object value) {
|
||||
UserResponseEnum userResponseEnum;
|
||||
try {
|
||||
String message = value.toString();
|
||||
if(message.indexOf(StrUtil.C_COMMA)>0){
|
||||
value = message.substring(message.indexOf(StrUtil.C_COMMA)+1);
|
||||
}
|
||||
userResponseEnum = EnumUtils.valueOf(UserResponseEnum.class, value, UserResponseEnum.class.getMethod(BusinessException.GET_MESSAGE_METHOD));
|
||||
return Objects.isNull(userResponseEnum) ? UserResponseEnum.LOGIN_WRONG_PWD : userResponseEnum;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new BusinessException(CommonResponseEnum.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取UserStatusEnum实例
|
||||
*/
|
||||
public static UserStatusEnum getUserStatusEnumByCode(Object value) {
|
||||
UserStatusEnum userStatusEnum;
|
||||
try {
|
||||
userStatusEnum = EnumUtils.valueOf(UserStatusEnum.class, value, UserStatusEnum.class.getMethod(BusinessException.GET_CODE_METHOD));
|
||||
return Objects.isNull(userStatusEnum) ? UserStatusEnum.NORMAL : userStatusEnum;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new BusinessException(CommonResponseEnum.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public static Enum<?> getExceptionEnum(HttpResult<Object> result){
|
||||
//如果返回错误,且为内部错误,则直接抛出异常
|
||||
CommonResponseEnum commonResponseEnum = EnumUtils.getCommonResponseEnumByCode(result.getCode());
|
||||
if (commonResponseEnum == CommonResponseEnum.USER_RESPONSE_ENUM) {
|
||||
return getUserResponseEnumByMessage(result.getMessage());
|
||||
}
|
||||
return commonResponseEnum;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user