mirror of https://gitee.com/stylefeng/roses
【7.4.0】更新@data注解
parent
f44bf21046
commit
110dd2e233
|
@ -30,7 +30,7 @@ import java.lang.annotation.*;
|
|||
* 用来标记在控制器类或方法上,进行判断是否需要对接口进行日志记录
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/1/12 20:48
|
||||
* @since 2022/1/12 20:48
|
||||
*/
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.lang.annotation.*;
|
|||
* 用来解决资源扫描时候,扫描的类的字段上的中文注释获取的问题
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/9 15:59
|
||||
* @since 2020/12/9 15:59
|
||||
*/
|
||||
@Target({ElementType.FIELD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.lang.annotation.*;
|
|||
* json字段的格式化,可以将枚举转化为可读性的值,例如:SexEnum.M -> "男",例如:"M" -> "男“
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:34
|
||||
* @since 2022/9/6 11:34
|
||||
*/
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.lang.annotation.*;
|
|||
* json字段的格式化,可以将类似id值,转化为具体的具有可读性的名称,例如:用户id -> 用户姓名
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:34
|
||||
* @since 2022/9/6 11:34
|
||||
*/
|
||||
@Inherited
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
|
|
@ -31,7 +31,7 @@ package cn.stylefeng.roses.kernel.rule.base;
|
|||
* value一般是String类型,是一串文字
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:27
|
||||
* @since 2022/9/6 11:27
|
||||
*/
|
||||
public interface ReadableEnum<T> {
|
||||
|
||||
|
@ -42,7 +42,7 @@ public interface ReadableEnum<T> {
|
|||
*
|
||||
* @return 返回枚举具有标示性的key或id
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:29
|
||||
* @since 2022/9/6 11:29
|
||||
*/
|
||||
Object getKey();
|
||||
|
||||
|
@ -53,7 +53,7 @@ public interface ReadableEnum<T> {
|
|||
*
|
||||
* @return 返回枚举具有可读性的value值
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:30
|
||||
* @since 2022/9/6 11:30
|
||||
*/
|
||||
Object getName();
|
||||
|
||||
|
@ -63,7 +63,7 @@ public interface ReadableEnum<T> {
|
|||
* @param originValue 原始值
|
||||
* @return T 具体枚举
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/24 15:17
|
||||
* @since 2022/9/24 15:17
|
||||
*/
|
||||
T parseToEnum(String originValue);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.base;
|
|||
* json字段格式化的过程接口规范
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:54
|
||||
* @since 2022/9/6 11:54
|
||||
*/
|
||||
public interface SimpleFieldFormatProcess {
|
||||
|
||||
|
@ -14,7 +14,7 @@ public interface SimpleFieldFormatProcess {
|
|||
* @param originValue 原来的值,格式化之前的值
|
||||
* @return 返回true,代表可以进行转化
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 13:16
|
||||
* @since 2022/9/6 13:16
|
||||
*/
|
||||
boolean canFormat(Object originValue);
|
||||
|
||||
|
@ -24,7 +24,7 @@ public interface SimpleFieldFormatProcess {
|
|||
* @param originValue 格式转化之前的值
|
||||
* @return 格式转化之后的值
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 13:28
|
||||
* @since 2022/9/6 13:28
|
||||
*/
|
||||
Object formatProcess(Object originValue);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.callback;
|
|||
* 系统配置修改的回调事件
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/10/22 21:35
|
||||
* @since 2022/10/22 21:35
|
||||
*/
|
||||
public interface ConfigUpdateCallback {
|
||||
|
||||
|
@ -14,7 +14,7 @@ public interface ConfigUpdateCallback {
|
|||
* @param code 系统配置的编码,例如:SYS_SERVER_DEPLOY_HOST
|
||||
* @param value 新修改的配置值
|
||||
* @author fengshuonan
|
||||
* @date 2022/10/22 21:36
|
||||
* @since 2022/10/22 21:36
|
||||
*/
|
||||
void configUpdate(String code, String value);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.rule.constants;
|
|||
* 规则模块的常量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/16 11:25
|
||||
* @since 2020/10/16 11:25
|
||||
*/
|
||||
public interface RuleConstants {
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.rule.constants;
|
|||
* 符号常量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/2/8 11:59
|
||||
* @since 2021/2/8 11:59
|
||||
*/
|
||||
public interface SymbolConstant {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.constants;
|
|||
* 租户数据常量,如果租户业务变了这里也需要修改
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/24 17:20
|
||||
* @since 2021/9/24 17:20
|
||||
*/
|
||||
public interface TenantConstants {
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.rule.constants;
|
|||
* 构建树有关的常量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 15:50
|
||||
* @since 2020/10/15 15:50
|
||||
*/
|
||||
public interface TreeConstants {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.core.env.ConfigurableEnvironment;
|
|||
* 此类的使用必须激活 ConfigInitListener
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/2/26 18:27
|
||||
* @since 2021/2/26 18:27
|
||||
*/
|
||||
@Getter
|
||||
public class ApplicationPropertiesContext {
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.Getter;
|
|||
* 用于标识mapping.xml中不同数据库的标识
|
||||
*
|
||||
* @author stylefeng
|
||||
* @date 2020/6/20 21:08
|
||||
* @since 2020/6/20 21:08
|
||||
*/
|
||||
@Getter
|
||||
public enum DbTypeEnum {
|
||||
|
@ -63,7 +63,7 @@ public enum DbTypeEnum {
|
|||
* 通过url判断是哪种数据库
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/23 14:22
|
||||
* @since 2022/8/23 14:22
|
||||
*/
|
||||
public static String getTypeByUrl(String url) {
|
||||
if (url == null) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import lombok.Getter;
|
|||
* 解析字段元数据时,各种情况的枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/1/13 16:37
|
||||
* @since 2022/1/13 16:37
|
||||
*/
|
||||
@Getter
|
||||
public enum FieldTypeEnum {
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.enums;
|
|||
* 字段格式化的类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/6 11:48
|
||||
* @since 2022/9/6 11:48
|
||||
*/
|
||||
public enum FormatTypeEnum {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import lombok.Getter;
|
|||
* 系统类就是用户管理,角色管理,日志管理这些
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/28 11:15
|
||||
* @since 2022/9/28 11:15
|
||||
*/
|
||||
@Getter
|
||||
public enum ResBizTypeEnum implements ReadableEnum<ResBizTypeEnum> {
|
||||
|
|
|
@ -35,7 +35,7 @@ import lombok.Getter;
|
|||
* 性别的枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 10:01
|
||||
* @since 2020/10/17 10:01
|
||||
*/
|
||||
@Getter
|
||||
public enum SexEnum implements ReadableEnum<SexEnum> {
|
||||
|
@ -65,7 +65,7 @@ public enum SexEnum implements ReadableEnum<SexEnum> {
|
|||
* 根据code获取枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/29 18:59
|
||||
* @since 2020/10/29 18:59
|
||||
*/
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static SexEnum codeToEnum(String code) {
|
||||
|
@ -83,7 +83,7 @@ public enum SexEnum implements ReadableEnum<SexEnum> {
|
|||
* 编码转化成中文含义
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/11 22:34
|
||||
* @since 2021/1/11 22:34
|
||||
*/
|
||||
public static String codeToMessage(String code) {
|
||||
if (null != code) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import lombok.Getter;
|
|||
* 数据库正序倒序排列的枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/6/29 14:11
|
||||
* @since 2022/6/29 14:11
|
||||
*/
|
||||
@Getter
|
||||
public enum SortByEnum {
|
||||
|
|
|
@ -36,7 +36,7 @@ import lombok.Getter;
|
|||
* 公共状态,一般用来表示开启和关闭
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/14 21:31
|
||||
* @since 2020/10/14 21:31
|
||||
*/
|
||||
@Getter
|
||||
public enum StatusEnum implements ReadableEnum<StatusEnum> {
|
||||
|
@ -66,7 +66,7 @@ public enum StatusEnum implements ReadableEnum<StatusEnum> {
|
|||
* 根据code获取枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/29 18:59
|
||||
* @since 2020/10/29 18:59
|
||||
*/
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static StatusEnum codeToEnum(Integer code) {
|
||||
|
|
|
@ -30,7 +30,7 @@ import lombok.Getter;
|
|||
* 树节点类型的枚举
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/15 13:36
|
||||
* @since 2021/1/15 13:36
|
||||
*/
|
||||
@Getter
|
||||
public enum TreeNodeEnum {
|
||||
|
@ -58,7 +58,7 @@ public enum TreeNodeEnum {
|
|||
* 根据code获取枚举
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/15 13:36
|
||||
* @since 2021/1/15 13:36
|
||||
*/
|
||||
public static TreeNodeEnum codeToEnum(String code) {
|
||||
if (null != code) {
|
||||
|
@ -75,7 +75,7 @@ public enum TreeNodeEnum {
|
|||
* 编码转化成中文含义
|
||||
*
|
||||
* @author liuhanqing
|
||||
* @date 2021/1/15 13:36
|
||||
* @since 2021/1/15 13:36
|
||||
*/
|
||||
public static String codeToName(String code) {
|
||||
if (null != code) {
|
||||
|
|
|
@ -36,7 +36,7 @@ import lombok.Getter;
|
|||
* 是或否的枚举,一般用在数据库字段,例如del_flag字段,char(1),填写Y或N
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/4/13 22:59
|
||||
* @since 2020/4/13 22:59
|
||||
*/
|
||||
@Getter
|
||||
public enum YesOrNotEnum implements ReadableEnum<YesOrNotEnum> {
|
||||
|
@ -75,7 +75,7 @@ public enum YesOrNotEnum implements ReadableEnum<YesOrNotEnum> {
|
|||
* 根据code获取枚举,用在接收前段传参
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 17:58
|
||||
* @since 2022/9/7 17:58
|
||||
*/
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static YesOrNotEnum codeToEnum(Boolean boolFlag) {
|
||||
|
|
|
@ -32,7 +32,7 @@ package cn.stylefeng.roses.kernel.rule.exception;
|
|||
* ServiceException抛出时必须为本接口的实现类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/14 21:41
|
||||
* @since 2020/10/14 21:41
|
||||
*/
|
||||
public interface AbstractExceptionEnum {
|
||||
|
||||
|
@ -41,7 +41,7 @@ public interface AbstractExceptionEnum {
|
|||
*
|
||||
* @return 状态码
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/14 21:42
|
||||
* @since 2020/10/14 21:42
|
||||
*/
|
||||
String getErrorCode();
|
||||
|
||||
|
@ -50,7 +50,7 @@ public interface AbstractExceptionEnum {
|
|||
*
|
||||
* @return 提示信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/14 21:42
|
||||
* @since 2020/10/14 21:42
|
||||
*/
|
||||
String getUserTip();
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ import static cn.stylefeng.roses.kernel.rule.constants.RuleConstants.RULE_MODULE
|
|||
* 第三种是第三方系统调用出错,例如文件服务调用失败,RPC调用超时
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 9:07
|
||||
* @since 2020/10/15 9:07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
|
@ -34,7 +34,7 @@ import static cn.stylefeng.roses.kernel.rule.constants.RuleConstants.FIRST_LEVEL
|
|||
* 系统执行出错,业务本身逻辑问题导致的错误(一级宏观码)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:18
|
||||
* @since 2020/10/15 17:18
|
||||
*/
|
||||
@Getter
|
||||
public enum DefaultBusinessExceptionEnum implements AbstractExceptionEnum {
|
||||
|
|
|
@ -34,7 +34,7 @@ import static cn.stylefeng.roses.kernel.rule.constants.RuleConstants.THIRD_ERROR
|
|||
* 表示错误来源于第三方服务,比如 CDN 服务出错,消息投递超时等问题
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:31
|
||||
* @since 2020/10/15 17:31
|
||||
*/
|
||||
@Getter
|
||||
public enum DefaultThirdExceptionEnum implements AbstractExceptionEnum {
|
||||
|
|
|
@ -34,7 +34,7 @@ import static cn.stylefeng.roses.kernel.rule.constants.RuleConstants.USER_OPERAT
|
|||
* 源于用户操作的异常枚举,比如参数错误,用户安装版本过低,用户支付超时等问题
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:31
|
||||
* @since 2020/10/15 17:31
|
||||
*/
|
||||
@Getter
|
||||
public enum DefaultUserExceptionEnum implements AbstractExceptionEnum {
|
||||
|
|
|
@ -34,7 +34,7 @@ import static cn.stylefeng.roses.kernel.rule.constants.RuleConstants.RULE_EXCEPT
|
|||
* servlet相关业务异常
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:39
|
||||
* @since 2020/10/15 17:39
|
||||
*/
|
||||
@Getter
|
||||
public enum ServletExceptionEnum implements AbstractExceptionEnum {
|
||||
|
|
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||
* 针对一般业务型的主键id的转化
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 11:50
|
||||
* @since 2022/9/7 11:50
|
||||
*/
|
||||
public abstract class BaseSimpleFieldFormatProcess implements SimpleFieldFormatProcess {
|
||||
|
||||
|
@ -61,7 +61,7 @@ public abstract class BaseSimpleFieldFormatProcess implements SimpleFieldFormatP
|
|||
* 原始值得类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 11:52
|
||||
* @since 2022/9/7 11:52
|
||||
*/
|
||||
public abstract Class<?> getItemClass();
|
||||
|
||||
|
@ -73,7 +73,7 @@ public abstract class BaseSimpleFieldFormatProcess implements SimpleFieldFormatP
|
|||
* @param businessId 业务id
|
||||
* @return 转化之后的值
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 12:58
|
||||
* @since 2022/9/7 12:58
|
||||
*/
|
||||
public abstract Object simpleItemFormat(Object businessId);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
* application ready状态的监听器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:28
|
||||
* @since 2021/5/14 20:28
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ApplicationReadyListener implements ApplicationListener<ApplicationReadyEvent> {
|
||||
|
@ -57,7 +57,7 @@ public abstract class ApplicationReadyListener implements ApplicationListener<Ap
|
|||
* 监听器具体的业务逻辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:17
|
||||
* @since 2021/5/14 20:17
|
||||
*/
|
||||
public abstract void eventCallback(ApplicationReadyEvent event);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
* application 启动后状态的监听器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:28
|
||||
* @since 2021/5/14 20:28
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ApplicationStartedListener implements ApplicationListener<ApplicationStartedEvent> {
|
||||
|
@ -57,7 +57,7 @@ public abstract class ApplicationStartedListener implements ApplicationListener<
|
|||
* 监听器具体的业务逻辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:17
|
||||
* @since 2021/5/14 20:17
|
||||
*/
|
||||
public abstract void eventCallback(ApplicationStartedEvent event);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
* context初始化的监听器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:28
|
||||
* @since 2021/5/14 20:28
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class ContextInitializedListener implements ApplicationListener<ApplicationContextInitializedEvent> {
|
||||
|
@ -57,7 +57,7 @@ public abstract class ContextInitializedListener implements ApplicationListener<
|
|||
* 监听器具体的业务逻辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/14 20:17
|
||||
* @since 2021/5/14 20:17
|
||||
*/
|
||||
public abstract void eventCallback(ApplicationContextInitializedEvent event);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import lombok.Data;
|
|||
* 例如,返回角色下拉列表,只需返回角色id和角色名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/21 16:53
|
||||
* @since 2020/11/21 16:53
|
||||
*/
|
||||
@Data
|
||||
public class SimpleDict {
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.Map;
|
|||
* 请求基类,所有接口请求可继承此类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/14 18:12
|
||||
* @since 2020/10/14 18:12
|
||||
*/
|
||||
@Data
|
||||
public class BaseRequest implements Serializable {
|
||||
|
|
|
@ -39,7 +39,7 @@ import java.util.Date;
|
|||
* <p>
|
||||
*
|
||||
* @author yxx
|
||||
* @date 2023/03/28 18:08
|
||||
* @since 2023/03/28 18:08
|
||||
*/
|
||||
@Data
|
||||
public class BaseResponse implements Serializable {
|
||||
|
|
|
@ -31,7 +31,7 @@ import lombok.EqualsAndHashCode;
|
|||
* 请求失败的结果包装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/16 16:26
|
||||
* @since 2020/10/16 16:26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
|
|
@ -31,7 +31,7 @@ import lombok.Data;
|
|||
* http响应结果封装
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 17:33
|
||||
* @since 2020/10/17 17:33
|
||||
*/
|
||||
@Data
|
||||
public class ResponseData<T> {
|
||||
|
|
|
@ -30,7 +30,7 @@ import cn.stylefeng.roses.kernel.rule.constants.RuleConstants;
|
|||
* 响应成功的封装类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/16 16:23
|
||||
* @since 2020/10/16 16:23
|
||||
*/
|
||||
public class SuccessResponseData<T> extends ResponseData<T> {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ package cn.stylefeng.roses.kernel.rule.tenant;
|
|||
* 一次性使用,使用完就立即释放
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:58
|
||||
* @since 2022/11/8 0:58
|
||||
*/
|
||||
public class OnceTenantCodeHolder {
|
||||
|
||||
|
@ -16,7 +16,7 @@ public class OnceTenantCodeHolder {
|
|||
* 设置租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static void setTenantCode(String aesKey) {
|
||||
CONTEXT_HOLDER.set(aesKey);
|
||||
|
@ -26,7 +26,7 @@ public class OnceTenantCodeHolder {
|
|||
* 获取租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static String getTenantCode() {
|
||||
return CONTEXT_HOLDER.get();
|
||||
|
@ -36,7 +36,7 @@ public class OnceTenantCodeHolder {
|
|||
* 清除租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static void clearTenantCode() {
|
||||
CONTEXT_HOLDER.remove();
|
||||
|
|
|
@ -6,7 +6,7 @@ package cn.stylefeng.roses.kernel.rule.tenant;
|
|||
* 在一次Http请求中生效,一般用在登录接口,当前Context没有LoginUser时使用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:58
|
||||
* @since 2022/11/8 0:58
|
||||
*/
|
||||
public class RequestTenantCodeHolder {
|
||||
|
||||
|
@ -16,7 +16,7 @@ public class RequestTenantCodeHolder {
|
|||
* 设置租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static void setTenantCode(String aesKey) {
|
||||
CONTEXT_HOLDER.set(aesKey);
|
||||
|
@ -26,7 +26,7 @@ public class RequestTenantCodeHolder {
|
|||
* 获取租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static String getTenantCode() {
|
||||
return CONTEXT_HOLDER.get();
|
||||
|
@ -36,7 +36,7 @@ public class RequestTenantCodeHolder {
|
|||
* 清除租户编码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/8 0:59
|
||||
* @since 2022/11/8 0:59
|
||||
*/
|
||||
public static void clearTenantCode() {
|
||||
CONTEXT_HOLDER.remove();
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.tenant;
|
|||
* 租户前缀获取
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/7 20:16
|
||||
* @since 2022/11/7 20:16
|
||||
*/
|
||||
public interface TenantPrefixApi {
|
||||
|
||||
|
@ -12,7 +12,7 @@ public interface TenantPrefixApi {
|
|||
* 获取当前用户的租户前缀
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/7 20:29
|
||||
* @since 2022/11/7 20:29
|
||||
*/
|
||||
String getTenantPrefix();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.rule.threadlocal;
|
|||
* 对程序进行拓展,方便清除ThreadLocal
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/10/29 11:14
|
||||
* @since 2021/10/29 11:14
|
||||
*/
|
||||
public interface RemoveThreadLocalApi {
|
||||
|
||||
|
@ -12,7 +12,7 @@ public interface RemoveThreadLocalApi {
|
|||
* 具体删除ThreadLocal的逻辑
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/10/29 11:19
|
||||
* @since 2021/10/29 11:19
|
||||
*/
|
||||
void removeThreadLocalAction();
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||
* 默认递归工具类,用于遍历有父子关系的节点,例如菜单树,字典树等等
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2018/7/25 下午5:59
|
||||
* @since 2018/7/25 下午5:59
|
||||
*/
|
||||
@Data
|
||||
public class DefaultTreeBuildFactory<T extends AbstractTreeNode> implements AbstractTreeBuildFactory<T> {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
* 树构建的抽象类,定义构建tree的基本步骤
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2018/7/25 下午5:59
|
||||
* @since 2018/7/25 下午5:59
|
||||
*/
|
||||
public interface AbstractTreeBuildFactory<T> {
|
||||
|
||||
|
@ -40,7 +40,7 @@ public interface AbstractTreeBuildFactory<T> {
|
|||
* @param nodes 被处理的节点集合
|
||||
* @return 被处理后的节点集合(带树形结构了)
|
||||
* @author fengshuonan
|
||||
* @date 2018/7/26 上午9:45
|
||||
* @since 2018/7/26 上午9:45
|
||||
*/
|
||||
List<T> doTreeBuild(List<T> nodes);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
* 树形节点的抽象接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 14:31
|
||||
* @since 2020/10/15 14:31
|
||||
*/
|
||||
public interface AbstractTreeNode<T> {
|
||||
|
||||
|
@ -39,7 +39,7 @@ public interface AbstractTreeNode<T> {
|
|||
*
|
||||
* @return 节点的id标识
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 15:28
|
||||
* @since 2020/10/15 15:28
|
||||
*/
|
||||
String getNodeId();
|
||||
|
||||
|
@ -48,7 +48,7 @@ public interface AbstractTreeNode<T> {
|
|||
*
|
||||
* @return 父节点的id
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 15:28
|
||||
* @since 2020/10/15 15:28
|
||||
*/
|
||||
String getNodeParentId();
|
||||
|
||||
|
@ -57,7 +57,7 @@ public interface AbstractTreeNode<T> {
|
|||
*
|
||||
* @param childrenNodes 设置节点的子节点
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 15:28
|
||||
* @since 2020/10/15 15:28
|
||||
*/
|
||||
void setChildrenNodes(List<T> childrenNodes);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
|||
* 默认的根节点id是-1,名称是根节点
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 14:39
|
||||
* @since 2020/10/15 14:39
|
||||
*/
|
||||
@Data
|
||||
public class DefaultTreeNode implements AbstractTreeNode<DefaultTreeNode> {
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
* 默认的xm-select的节点结构
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 19:02
|
||||
* @since 2021/1/31 19:02
|
||||
*/
|
||||
@Data
|
||||
public class DefaultXmSelectNode implements AbstractXmSelectNode {
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.List;
|
|||
* 封装用于xm-select组件的节点的方法
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:30
|
||||
* @since 2021/1/31 18:30
|
||||
*/
|
||||
public interface AbstractXmSelectNode {
|
||||
|
||||
|
@ -38,7 +38,7 @@ public interface AbstractXmSelectNode {
|
|||
* 显示的名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:30
|
||||
* @since 2021/1/31 18:30
|
||||
*/
|
||||
String getName();
|
||||
|
||||
|
@ -46,7 +46,7 @@ public interface AbstractXmSelectNode {
|
|||
* 选中值, 当前多选唯一
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:30
|
||||
* @since 2021/1/31 18:30
|
||||
*/
|
||||
String getValue();
|
||||
|
||||
|
@ -54,7 +54,7 @@ public interface AbstractXmSelectNode {
|
|||
* 是否选中
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:31
|
||||
* @since 2021/1/31 18:31
|
||||
*/
|
||||
Boolean getSelected();
|
||||
|
||||
|
@ -62,7 +62,7 @@ public interface AbstractXmSelectNode {
|
|||
* 是否禁用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:31
|
||||
* @since 2021/1/31 18:31
|
||||
*/
|
||||
Boolean getDisabled();
|
||||
|
||||
|
@ -70,7 +70,7 @@ public interface AbstractXmSelectNode {
|
|||
* 获取分组的列表
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/31 18:33
|
||||
* @since 2021/1/31 18:33
|
||||
*/
|
||||
List<?> getChildren();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
|||
* jquery zTree 插件的节点封装
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 21:47
|
||||
* @since 2021/1/6 21:47
|
||||
*/
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
|
@ -102,7 +102,7 @@ public class ZTreeNode implements AbstractTreeNode<ZTreeNode> {
|
|||
* 创建ztree的父级节点
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/6 21:47
|
||||
* @since 2021/1/6 21:47
|
||||
*/
|
||||
public static ZTreeNode createParent() {
|
||||
ZTreeNode zTreeNode = new ZTreeNode();
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
* ant风格资源过滤工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/15 22:31
|
||||
* @since 2020/12/15 22:31
|
||||
*/
|
||||
@Slf4j
|
||||
public class AntPathMatcherUtil {
|
||||
|
@ -44,7 +44,7 @@ public class AntPathMatcherUtil {
|
|||
* @param requestURI 请求的url
|
||||
* @param antPatterns ant风格资源表达式
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/15 22:31
|
||||
* @since 2020/12/15 22:31
|
||||
*/
|
||||
public static Boolean getAntMatchFLag(String requestURI, String contextPath, List<String> antPatterns) {
|
||||
AntPathMatcher antPathMatcher = new AntPathMatcher();
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.lang.reflect.Field;
|
|||
* 获取代理原始对象的工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:20
|
||||
* @since 2020/10/19 16:20
|
||||
*/
|
||||
@Slf4j
|
||||
public class AopTargetUtils {
|
||||
|
@ -44,7 +44,7 @@ public class AopTargetUtils {
|
|||
* 获取代理对象的原始对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:21
|
||||
* @since 2020/10/19 16:21
|
||||
*/
|
||||
public static Object getTarget(Object proxy) {
|
||||
|
||||
|
@ -70,7 +70,7 @@ public class AopTargetUtils {
|
|||
* 获取cglib代理的对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:21
|
||||
* @since 2020/10/19 16:21
|
||||
*/
|
||||
private static Object getCglibProxyTargetObject(Object proxy) throws Exception {
|
||||
Field h = proxy.getClass().getDeclaredField("CGLIB$CALLBACK_0");
|
||||
|
@ -85,7 +85,7 @@ public class AopTargetUtils {
|
|||
* 获取jdk代理的对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:22
|
||||
* @since 2020/10/19 16:22
|
||||
*/
|
||||
private static Object getJdkDynamicProxyTargetObject(Object proxy) throws Exception {
|
||||
Field h = proxy.getClass().getSuperclass().getDeclaredField("h");
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.util.Map;
|
|||
* 获取类类型的工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/1/14 16:42
|
||||
* @since 2022/1/14 16:42
|
||||
*/
|
||||
@Slf4j
|
||||
public class ClassTypeUtil {
|
||||
|
@ -31,7 +31,7 @@ public class ClassTypeUtil {
|
|||
* 判断类类型是否是扫描的包范围之内
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/1/13 17:49
|
||||
* @since 2022/1/13 17:49
|
||||
*/
|
||||
public static boolean ensureEntityFlag(Class<?> clazz) {
|
||||
for (String packageName : entityScanPackage) {
|
||||
|
@ -46,7 +46,7 @@ public class ClassTypeUtil {
|
|||
* 获取类类型的类别
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/1/14 0:25
|
||||
* @since 2022/1/14 0:25
|
||||
*/
|
||||
public static FieldTypeEnum getClassFieldType(Type type) {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum;
|
|||
* 判断数据库类型的工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/27 21:24
|
||||
* @since 2021/3/27 21:24
|
||||
*/
|
||||
public class DatabaseTypeUtil {
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class DatabaseTypeUtil {
|
|||
* 判断数据库类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/27 21:25
|
||||
* @since 2021/3/27 21:25
|
||||
*/
|
||||
public static DbTypeEnum getDbType(String jdbcUrl) {
|
||||
if (StrUtil.isEmpty(jdbcUrl)) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.regex.Pattern;
|
|||
* 日期正则工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/2 15:04
|
||||
* @since 2022/8/2 15:04
|
||||
*/
|
||||
public class DateRegexUtil {
|
||||
|
||||
|
@ -15,7 +15,7 @@ public class DateRegexUtil {
|
|||
* 从指定字符串中提取日期的字符
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/2 15:04
|
||||
* @since 2022/8/2 15:04
|
||||
*/
|
||||
public static String extractDate(String originStr) {
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.sql.DriverManager;
|
|||
* 数据库检测相关的工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/15 11:50
|
||||
* @since 2022/9/15 11:50
|
||||
*/
|
||||
public class DbConnectionUtil {
|
||||
|
||||
|
@ -17,7 +17,7 @@ public class DbConnectionUtil {
|
|||
* 检测数据库的链接是否连通,默认5秒超时
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/15 11:49
|
||||
* @since 2022/9/15 11:49
|
||||
*/
|
||||
public static boolean getValidFlag(String className, String url, String account, String password) {
|
||||
return getValidFlag(className, url, account, password, 5);
|
||||
|
@ -27,7 +27,7 @@ public class DbConnectionUtil {
|
|||
* 检测数据库的链接是否连通
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/15 11:49
|
||||
* @since 2022/9/15 11:49
|
||||
*/
|
||||
public static boolean getValidFlag(String className, String url, String account, String password, Integer timeoutSeconds) {
|
||||
Connection connection = null;
|
||||
|
|
|
@ -32,7 +32,7 @@ import cn.stylefeng.roses.kernel.rule.pojo.response.ErrorResponseData;
|
|||
* 异常处理类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/16 16:03
|
||||
* @since 2020/12/16 16:03
|
||||
*/
|
||||
public class ExceptionUtil {
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class ExceptionUtil {
|
|||
* @param packageName 指定包名
|
||||
* @return 某行堆栈信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/16 16:04
|
||||
* @since 2020/12/16 16:04
|
||||
*/
|
||||
public static String getFirstStackTraceByPackageName(Throwable throwable, String packageName) {
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class ExceptionUtil {
|
|||
* 将异常信息填充到ErrorResponseData中
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/16 16:09
|
||||
* @since 2020/12/16 16:09
|
||||
*/
|
||||
public static void fillErrorResponseData(ErrorResponseData errorResponseData, Throwable throwable, String projectPackage) {
|
||||
if (errorResponseData == null || throwable == null) {
|
||||
|
|
|
@ -8,7 +8,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
* Guns资源编码为固定的guns$开头,如果项目编码修改后,应将资源标识前缀进行修改
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/16 23:07
|
||||
* @since 2022/11/16 23:07
|
||||
*/
|
||||
public class GunsResourceCodeUtil {
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class GunsResourceCodeUtil {
|
|||
* 修改之后为:{newAppCode参数}$sys_notice$add
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/11/16 23:09
|
||||
* @since 2022/11/16 23:09
|
||||
*/
|
||||
public static String replace(String resourceCode, String newAppCode) {
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.List;
|
|||
* 保存Http请求的上下文,在任何地方快速获取HttpServletRequest和HttpServletResponse
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:38
|
||||
* @since 2020/10/15 17:38
|
||||
*/
|
||||
@Slf4j
|
||||
public class HttpServletUtil {
|
||||
|
@ -75,7 +75,7 @@ public class HttpServletUtil {
|
|||
* 获取当前请求的request对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:48
|
||||
* @since 2020/10/15 17:48
|
||||
*/
|
||||
public static HttpServletRequest getRequest() {
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
|
@ -90,7 +90,7 @@ public class HttpServletUtil {
|
|||
* 获取当前请求的response对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 17:48
|
||||
* @since 2020/10/15 17:48
|
||||
*/
|
||||
public static HttpServletResponse getResponse() {
|
||||
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||
|
@ -107,7 +107,7 @@ public class HttpServletUtil {
|
|||
* 如果获取不到或者获取到的是ipv6地址,都返回127.0.0.1
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/26 14:09
|
||||
* @since 2020/10/26 14:09
|
||||
*/
|
||||
public static String getRequestClientIp(HttpServletRequest request) {
|
||||
if (ObjectUtil.isEmpty(request)) {
|
||||
|
@ -125,7 +125,7 @@ public class HttpServletUtil {
|
|||
* @param ipGeoApi 阿里云ip定位api接口
|
||||
* @param ipGeoAppCode 阿里云ip定位appCode
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/26 14:10
|
||||
* @since 2020/10/26 14:10
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static String calcClientIpAddress(HttpServletRequest request, String ipGeoApi, String ipGeoAppCode) {
|
||||
|
@ -172,7 +172,7 @@ public class HttpServletUtil {
|
|||
* 没有相关header被解析,则返回null
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/28 9:14
|
||||
* @since 2020/10/28 9:14
|
||||
*/
|
||||
public static UserAgent getUserAgent(HttpServletRequest request) {
|
||||
|
||||
|
@ -194,7 +194,7 @@ public class HttpServletUtil {
|
|||
*
|
||||
* @return ture-是普通请求
|
||||
* @author fengshuonan
|
||||
* @date 2021/2/22 22:37
|
||||
* @since 2021/2/22 22:37
|
||||
*/
|
||||
public static Boolean getNormalRequestFlag(HttpServletRequest request) {
|
||||
return request.getHeader("Accept") == null || request.getHeader("Accept").toLowerCase().contains("text/html");
|
||||
|
@ -207,7 +207,7 @@ public class HttpServletUtil {
|
|||
*
|
||||
* @return ture-是json请求
|
||||
* @author fengshuonan
|
||||
* @date 2021/2/22 22:37
|
||||
* @since 2021/2/22 22:37
|
||||
*/
|
||||
public static Boolean getJsonRequestFlag(HttpServletRequest request) {
|
||||
return request.getHeader("Accept") == null || request.getHeader("Accept").toLowerCase().contains("application/json");
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.net.UnknownHostException;
|
|||
* IP工具类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/10 14:25
|
||||
* @since 2021/1/10 14:25
|
||||
*/
|
||||
public class IpInfoUtils {
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class IpInfoUtils {
|
|||
* 获取当前机器的hostname
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/10 18:40
|
||||
* @since 2021/1/10 18:40
|
||||
*/
|
||||
public static String getHostName() {
|
||||
try {
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
* 一键添加开源协议头
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/21 20:24
|
||||
* @since 2021/3/21 20:24
|
||||
*/
|
||||
public class LicenseTitleAppenderUtil {
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class LicenseTitleAppenderUtil {
|
|||
* 添加开源协议
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/21 20:25
|
||||
* @since 2021/3/21 20:25
|
||||
*/
|
||||
public static void append(String codeDirectory, String licenseHeader) {
|
||||
List<File> files = FileUtil.loopFiles(codeDirectory);
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.stream.Collectors;
|
|||
* 获取mac地址的工具类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/13 12:59
|
||||
* @since 2020/11/13 12:59
|
||||
*/
|
||||
public class MacAddressUtil {
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class MacAddressUtil {
|
|||
* 一台机器不一定有多个网卡,所以返回的是数组
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/13 13:00
|
||||
* @since 2020/11/13 13:00
|
||||
*/
|
||||
public static List<String> getMacList() throws Exception {
|
||||
java.util.Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces();
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Collection;
|
|||
* 字段类型判断
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 10:24
|
||||
* @since 2022/9/7 10:24
|
||||
*/
|
||||
public class MixFieldTypeUtil {
|
||||
|
||||
|
@ -16,7 +16,7 @@ public class MixFieldTypeUtil {
|
|||
* 判断fieldValue是否是Long、List<Long>、Long[]类型,如果是其中任何一种,则都返回true
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 10:24
|
||||
* @since 2022/9/7 10:24
|
||||
*/
|
||||
public static boolean whetherAssignClass(Object fieldValue, Class<?> clazz) {
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
* 2. 批量上传指定目录下所有jar到本地仓库
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:31
|
||||
* @since 2022/9/30 21:31
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
@ -80,7 +80,7 @@ public class MvnDeployUtil {
|
|||
* 探测pom文件的内容,是否packaging为pom类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:45
|
||||
* @since 2022/9/30 21:45
|
||||
*/
|
||||
public static boolean packagingIsPomFlag(File pom) {
|
||||
BufferedReader reader = null;
|
||||
|
@ -104,7 +104,7 @@ public class MvnDeployUtil {
|
|||
* 递归获取一个目录下的所有文件目录路径
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:49
|
||||
* @since 2022/9/30 21:49
|
||||
*/
|
||||
private void getAllDirs(String fileDir) {
|
||||
|
||||
|
@ -129,7 +129,7 @@ public class MvnDeployUtil {
|
|||
* 获取目录的类型,判断目录下是否同时有pom和jar文件,或者单纯有pom文件
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:49
|
||||
* @since 2022/9/30 21:49
|
||||
*/
|
||||
private DirectoryType getDirectoryType(File directoryPath) {
|
||||
boolean pom = false;
|
||||
|
@ -161,7 +161,7 @@ public class MvnDeployUtil {
|
|||
* 对只有pom文件的目录,执行mvn deploy操作
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:55
|
||||
* @since 2022/9/30 21:55
|
||||
*/
|
||||
private void doOnlyPom(File directory) {
|
||||
|
||||
|
@ -186,7 +186,7 @@ public class MvnDeployUtil {
|
|||
* 对同时包含jar和pom文件的目录,执行mvn deploy操作
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:58
|
||||
* @since 2022/9/30 21:58
|
||||
*/
|
||||
private void doJarAndPom(File directory) {
|
||||
|
||||
|
@ -215,7 +215,7 @@ public class MvnDeployUtil {
|
|||
* 程序入口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:58
|
||||
* @since 2022/9/30 21:58
|
||||
*/
|
||||
public void beginDeploy() {
|
||||
|
||||
|
@ -239,7 +239,7 @@ public class MvnDeployUtil {
|
|||
* 执行真正的mvn命令
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:54
|
||||
* @since 2022/9/30 21:54
|
||||
*/
|
||||
private void executeCommand(String command) {
|
||||
try {
|
||||
|
@ -255,7 +255,7 @@ public class MvnDeployUtil {
|
|||
* 构造mvn deploy command命令
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:52
|
||||
* @since 2022/9/30 21:52
|
||||
*/
|
||||
private String buildCommand(FileType fileType, File deployJar, File deployJarPom) {
|
||||
|
||||
|
@ -304,7 +304,7 @@ public class MvnDeployUtil {
|
|||
* 判断目录下是否有可以上传的jar
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:33
|
||||
* @since 2022/9/30 21:33
|
||||
*/
|
||||
private enum DirectoryType {
|
||||
/**
|
||||
|
@ -327,7 +327,7 @@ public class MvnDeployUtil {
|
|||
* 可以被mvn上传的文件类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/30 21:34
|
||||
* @since 2022/9/30 21:34
|
||||
*/
|
||||
private enum FileType {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.lang.reflect.Array;
|
|||
* 对象转化为数组的工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/7 11:06
|
||||
* @since 2022/9/7 11:06
|
||||
*/
|
||||
public class ObjectConvertUtil {
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class ObjectConvertUtil {
|
|||
* Object转为一个array,确保object为数组类型
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/7/24 22:06
|
||||
* @since 2020/7/24 22:06
|
||||
*/
|
||||
public static Object[] objToArray(Object object) {
|
||||
int length = Array.getLength(object);
|
||||
|
|
|
@ -30,7 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
* 项目相关的工具类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/18 10:41
|
||||
* @since 2021/5/18 10:41
|
||||
*/
|
||||
@Slf4j
|
||||
public class ProjectUtil {
|
||||
|
@ -47,7 +47,7 @@ public class ProjectUtil {
|
|||
*
|
||||
* @return true-分离版,false-不分离版
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/18 10:42
|
||||
* @since 2021/5/18 10:42
|
||||
*/
|
||||
public static Boolean getSeparationFlag() {
|
||||
if (SEPARATION_FLAG != null) {
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.Map;
|
|||
* 构建redirect url的工具类
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/22 11:07
|
||||
* @since 2021/1/22 11:07
|
||||
*/
|
||||
@Slf4j
|
||||
public class RedirectUrlBuildUtil {
|
||||
|
@ -25,7 +25,7 @@ public class RedirectUrlBuildUtil {
|
|||
* @param originUrl 原始的url
|
||||
* @param paramsMap url上要拼接的参数信息
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/22 11:07
|
||||
* @since 2021/1/22 11:07
|
||||
*/
|
||||
public static String createRedirectUrl(String originUrl, Map<String, ?> paramsMap) {
|
||||
if (StrUtil.isBlank(originUrl)) {
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.nio.charset.Charset;
|
|||
* http响应信息的直接渲染工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/15 21:39
|
||||
* @since 2020/12/15 21:39
|
||||
*/
|
||||
@Slf4j
|
||||
public class ResponseRenderUtil {
|
||||
|
@ -50,7 +50,7 @@ public class ResponseRenderUtil {
|
|||
* 渲染接口json信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/15 21:40
|
||||
* @since 2020/12/15 21:40
|
||||
*/
|
||||
public static void renderJsonResponse(HttpServletResponse response, Object responseData) {
|
||||
response.setCharacterEncoding(CharsetUtil.UTF_8);
|
||||
|
@ -67,7 +67,7 @@ public class ResponseRenderUtil {
|
|||
* 渲染接口json信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/15 21:40
|
||||
* @since 2020/12/15 21:40
|
||||
*/
|
||||
public static void renderErrorResponse(HttpServletResponse response,
|
||||
String code, String message, String exceptionClazz) {
|
||||
|
@ -87,7 +87,7 @@ public class ResponseRenderUtil {
|
|||
* 设置渲染文件的头
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/7/1 15:01
|
||||
* @since 2021/7/1 15:01
|
||||
*/
|
||||
public static void setRenderFileHeader(HttpServletResponse response, String fileName) {
|
||||
final String charset = ObjectUtil.defaultIfNull(response.getCharacterEncoding(), CharsetUtil.UTF_8);
|
||||
|
@ -99,7 +99,7 @@ public class ResponseRenderUtil {
|
|||
* 设置图片的渲染文件头
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/7/1 15:01
|
||||
* @since 2021/7/1 15:01
|
||||
*/
|
||||
public static void setRenderImageHeader(HttpServletResponse response) {
|
||||
response.setContentType("image/png");
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.regex.Pattern;
|
|||
* 字符串过滤工具,主要过滤不合法的请求参数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/19 13:37
|
||||
* @since 2022/9/19 13:37
|
||||
*/
|
||||
public class StrFilterUtil {
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class StrFilterUtil {
|
|||
* 过滤文件名
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/9/19 13:39
|
||||
* @since 2022/9/19 13:39
|
||||
*/
|
||||
public static String filterFileName(String param) {
|
||||
Pattern fileNamePattern = Pattern.compile("[\\\\/:*?\"<>|\\s]");
|
||||
|
|
|
@ -32,7 +32,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||
* Token签名工具
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/1 17:41
|
||||
* @since 2022/8/1 17:41
|
||||
*/
|
||||
@Slf4j
|
||||
public class TokenSignUtil {
|
||||
|
@ -43,7 +43,7 @@ public class TokenSignUtil {
|
|||
* @param timestamp 生成sign时的时间戳
|
||||
* @param secretKey 生成时间戳需要的秘钥
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/1 17:43
|
||||
* @since 2022/8/1 17:43
|
||||
*/
|
||||
public static String createSignStr(Long timestamp, String secretKey) {
|
||||
if (ObjectUtil.isEmpty(timestamp) || ObjectUtil.isEmpty(secretKey)) {
|
||||
|
@ -61,7 +61,7 @@ public class TokenSignUtil {
|
|||
* @param signStr 签名字符串
|
||||
* @param expiredSeconds 签名过期时间
|
||||
* @author fengshuonan
|
||||
* @date 2022/8/1 17:48
|
||||
* @since 2022/8/1 17:48
|
||||
*/
|
||||
public static boolean validateSignStr(Long timestamp, String secretKey, String signStr, Integer expiredSeconds) {
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import cn.stylefeng.roses.kernel.jwt.api.pojo.payload.DefaultJwtPayload;
|
|||
* 认证服务的接口,包括基本的登录退出操作和校验token等操作
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/26 14:41
|
||||
* @since 2020/10/26 14:41
|
||||
*/
|
||||
public interface AuthServiceApi {
|
||||
|
||||
|
@ -45,7 +45,7 @@ public interface AuthServiceApi {
|
|||
* @param loginRequest 登录的请求
|
||||
* @return token 一般为jwt token
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/26 14:41
|
||||
* @since 2020/10/26 14:41
|
||||
*/
|
||||
LoginResponse login(LoginRequest loginRequest);
|
||||
|
||||
|
@ -54,7 +54,7 @@ public interface AuthServiceApi {
|
|||
*
|
||||
* @param username 账号
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/26 14:40
|
||||
* @since 2020/10/26 14:40
|
||||
*/
|
||||
LoginResponse loginWithUserName(String username);
|
||||
|
||||
|
@ -64,7 +64,7 @@ public interface AuthServiceApi {
|
|||
* @param username 账号
|
||||
* @param caToken sso登录成功后的会话
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:44
|
||||
* @since 2021/5/25 22:44
|
||||
*/
|
||||
LoginResponse loginWithUserNameAndCaToken(String username, String caToken);
|
||||
|
||||
|
@ -73,7 +73,7 @@ public interface AuthServiceApi {
|
|||
*
|
||||
* @param loginWithTokenRequest 请求
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:44
|
||||
* @since 2021/5/25 22:44
|
||||
*/
|
||||
LoginResponse LoginWithToken(LoginWithTokenRequest loginWithTokenRequest);
|
||||
|
||||
|
@ -81,7 +81,7 @@ public interface AuthServiceApi {
|
|||
* 当前登录人退出登录
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:16
|
||||
* @since 2020/10/19 14:16
|
||||
*/
|
||||
void logout();
|
||||
|
||||
|
@ -90,7 +90,7 @@ public interface AuthServiceApi {
|
|||
*
|
||||
* @param token 某个用户的登录token
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:16
|
||||
* @since 2020/10/19 14:16
|
||||
*/
|
||||
void logoutWithToken(String token);
|
||||
|
||||
|
@ -103,7 +103,7 @@ public interface AuthServiceApi {
|
|||
* @return token解析出的用户基本信息
|
||||
* @throws AuthException 认证异常,如果token错误或过期,会有相关的异常抛出
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:16
|
||||
* @since 2020/10/19 14:16
|
||||
*/
|
||||
DefaultJwtPayload validateToken(String token) throws AuthException;
|
||||
|
||||
|
@ -113,7 +113,7 @@ public interface AuthServiceApi {
|
|||
* @param token 用户登陆的token
|
||||
* @param requestUrl 被校验的url
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/22 16:03
|
||||
* @since 2020/10/22 16:03
|
||||
*/
|
||||
void checkAuth(String token, String requestUrl);
|
||||
|
||||
|
@ -121,7 +121,7 @@ public interface AuthServiceApi {
|
|||
* 取消冻结帐号
|
||||
*
|
||||
* @author xixiaowei
|
||||
* @date 2022/1/22 16:37
|
||||
* @since 2022/1/22 16:37
|
||||
*/
|
||||
void cancelFreeze(LoginRequest loginRequest);
|
||||
|
||||
|
@ -132,7 +132,7 @@ public interface AuthServiceApi {
|
|||
* @param defaultJwtPayload jwt的payload信息
|
||||
* @return 新的当前登录用户
|
||||
* @author fengshuonan
|
||||
* @date 2022/10/17 0:04
|
||||
* @since 2022/10/17 0:04
|
||||
*/
|
||||
LoginUser createNewLoginInfo(String token, DefaultJwtPayload defaultJwtPayload);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
|||
* 当前登陆用户相关的一系列方法
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 10:27
|
||||
* @since 2020/10/17 10:27
|
||||
*/
|
||||
public interface LoginUserApi {
|
||||
|
||||
|
@ -42,7 +42,7 @@ public interface LoginUserApi {
|
|||
*
|
||||
* @return 当前用户的token或null
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 11:05
|
||||
* @since 2020/10/17 11:05
|
||||
*/
|
||||
String getToken();
|
||||
|
||||
|
@ -54,7 +54,7 @@ public interface LoginUserApi {
|
|||
* @return 当前登陆用户信息
|
||||
* @throws AuthException 权限异常
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 10:27
|
||||
* @since 2020/10/17 10:27
|
||||
*/
|
||||
LoginUser getLoginUser() throws AuthException;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public interface LoginUserApi {
|
|||
*
|
||||
* @return 当前登录用户信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 11:00
|
||||
* @since 2020/10/17 11:00
|
||||
*/
|
||||
LoginUser getLoginUserNullable();
|
||||
|
||||
|
@ -74,7 +74,7 @@ public interface LoginUserApi {
|
|||
*
|
||||
* @return true-是超级管理员,false-不是超级管理员
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/4 15:45
|
||||
* @since 2020/11/4 15:45
|
||||
*/
|
||||
boolean getSuperAdminFlag();
|
||||
|
||||
|
@ -83,7 +83,7 @@ public interface LoginUserApi {
|
|||
*
|
||||
* @return 是否登录,true是,false否
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 11:02
|
||||
* @since 2020/10/17 11:02
|
||||
*/
|
||||
boolean hasLogin();
|
||||
|
||||
|
@ -93,7 +93,7 @@ public interface LoginUserApi {
|
|||
* @param buttonCode 按钮的编码
|
||||
* @return true-有权限,false-没有权限
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/9 11:32
|
||||
* @since 2021/1/9 11:32
|
||||
*/
|
||||
boolean haveButton(String buttonCode);
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import cn.stylefeng.roses.kernel.auth.api.exception.AuthException;
|
|||
* 权限相关的服务接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:24
|
||||
* @since 2020/10/19 14:24
|
||||
*/
|
||||
public interface PermissionServiceApi {
|
||||
|
||||
|
@ -43,7 +43,7 @@ public interface PermissionServiceApi {
|
|||
* @param requestUrl 被校验的url
|
||||
* @throws AuthException 认证失败的异常信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:50
|
||||
* @since 2020/10/19 14:50
|
||||
*/
|
||||
void checkPermission(String token, String requestUrl) throws AuthException;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.List;
|
|||
* 会话具有时效性,反之,当用户不再访问系统的时候,会话应该自动失效
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:47
|
||||
* @since 2020/10/19 16:47
|
||||
*/
|
||||
public interface SessionManagerApi {
|
||||
|
||||
|
@ -46,7 +46,7 @@ public interface SessionManagerApi {
|
|||
* @param token 用户登录的token
|
||||
* @param loginUser 登录的用户
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:47
|
||||
* @since 2020/10/19 16:47
|
||||
*/
|
||||
void createSession(String token, LoginUser loginUser, Boolean createCookie);
|
||||
|
||||
|
@ -56,7 +56,7 @@ public interface SessionManagerApi {
|
|||
* @param token 用户的当前token
|
||||
* @param loginUser 新的登录用户信息
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/9 10:43
|
||||
* @since 2021/1/9 10:43
|
||||
*/
|
||||
void updateSession(String token, LoginUser loginUser);
|
||||
|
||||
|
@ -66,7 +66,7 @@ public interface SessionManagerApi {
|
|||
* @param token 用户token
|
||||
* @return token对应用户的详细信息
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:48
|
||||
* @since 2020/10/19 16:48
|
||||
*/
|
||||
LoginUser getSession(String token);
|
||||
|
||||
|
@ -75,7 +75,7 @@ public interface SessionManagerApi {
|
|||
*
|
||||
* @param token 用户token
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:48
|
||||
* @since 2020/10/19 16:48
|
||||
*/
|
||||
void removeSession(String token);
|
||||
|
||||
|
@ -86,7 +86,7 @@ public interface SessionManagerApi {
|
|||
*
|
||||
* @param token 用户token
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/21 16:18
|
||||
* @since 2020/10/21 16:18
|
||||
*/
|
||||
void removeSessionExcludeToken(String token);
|
||||
|
||||
|
@ -96,7 +96,7 @@ public interface SessionManagerApi {
|
|||
* @param token 用户token
|
||||
* @return true-存在会话,false-不存在会话或者失效了
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:49
|
||||
* @since 2020/10/19 16:49
|
||||
*/
|
||||
boolean haveSession(String token);
|
||||
|
||||
|
@ -105,7 +105,7 @@ public interface SessionManagerApi {
|
|||
*
|
||||
* @param token 用户的token
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 16:50
|
||||
* @since 2020/10/19 16:50
|
||||
*/
|
||||
void refreshSession(String token);
|
||||
|
||||
|
@ -115,7 +115,7 @@ public interface SessionManagerApi {
|
|||
* 一般用在单体不分离版本中
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/2 20:25
|
||||
* @since 2021/1/2 20:25
|
||||
*/
|
||||
void destroySessionCookie();
|
||||
|
||||
|
@ -123,7 +123,7 @@ public interface SessionManagerApi {
|
|||
* 获取在线用户列表
|
||||
*
|
||||
* @author peihongwei
|
||||
* @date 2021/1/9 10:41
|
||||
* @since 2021/1/9 10:41
|
||||
*/
|
||||
List<LoginUser> onlineUserList();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.sso.SsoLoginCodeRequest;
|
|||
* 单点服务端相关api
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/5/16 16:53
|
||||
* @since 2022/5/16 16:53
|
||||
*/
|
||||
public interface SsoServerApi {
|
||||
|
||||
|
@ -40,7 +40,7 @@ public interface SsoServerApi {
|
|||
* @param ssoLoginCodeRequest 账号和密码
|
||||
* @return ssoLoginCode,用在单点登录
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/27 17:26
|
||||
* @since 2021/1/27 17:26
|
||||
*/
|
||||
String createSsoLoginCode(SsoLoginCodeRequest ssoLoginCodeRequest);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.auth.api;
|
|||
* 临时用户秘钥获取
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/3/26 14:05
|
||||
* @since 2022/3/26 14:05
|
||||
*/
|
||||
public interface TempSecretApi {
|
||||
|
||||
|
@ -36,7 +36,7 @@ public interface TempSecretApi {
|
|||
* 获取用户临时秘钥
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/3/26 14:07
|
||||
* @since 2022/3/26 14:07
|
||||
*/
|
||||
String getUserTempSecretKey(Long userId);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.auth.api.constants;
|
|||
* auth,鉴权模块的常量
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/16 11:05
|
||||
* @since 2020/10/16 11:05
|
||||
*/
|
||||
public interface AuthConstants {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package cn.stylefeng.roses.kernel.auth.api.constants;
|
|||
* 登录前缀相关的常量
|
||||
*
|
||||
* @author xixiaowei
|
||||
* @date 2022/1/22 17:37
|
||||
* @since 2022/1/22 17:37
|
||||
*/
|
||||
public interface LoginCacheConstants {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import cn.stylefeng.roses.kernel.auth.api.LoginUserApi;
|
|||
* 快速获取当前登陆用户的一系列操作方法,具体实现在Spring容器中查找
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 10:30
|
||||
* @since 2020/10/17 10:30
|
||||
*/
|
||||
public class LoginContext {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
|||
* 当前登录用户的临时保存容器
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/23 17:38
|
||||
* @since 2021/3/23 17:38
|
||||
*/
|
||||
public class LoginUserHolder {
|
||||
|
||||
|
@ -16,7 +16,7 @@ public class LoginUserHolder {
|
|||
* set holder中内容
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/23 17:41
|
||||
* @since 2021/3/23 17:41
|
||||
*/
|
||||
public static void set(LoginUser abstractLoginUser) {
|
||||
LONGIN_USER_HOLDER.set(abstractLoginUser);
|
||||
|
@ -26,7 +26,7 @@ public class LoginUserHolder {
|
|||
* 获取holder中的值
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/23 17:41
|
||||
* @since 2021/3/23 17:41
|
||||
*/
|
||||
public static LoginUser get() {
|
||||
return LONGIN_USER_HOLDER.get();
|
||||
|
@ -36,7 +36,7 @@ public class LoginUserHolder {
|
|||
* 删除保存的用户
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/3/23 17:42
|
||||
* @since 2021/3/23 17:42
|
||||
*/
|
||||
public static void remove() {
|
||||
LONGIN_USER_HOLDER.remove();
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
|
|||
* 清除当前登录用户相关的ThreadLocalHolder
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/10/29 11:41
|
||||
* @since 2021/10/29 11:41
|
||||
*/
|
||||
@Component
|
||||
public class LoginUserRemoveThreadLocalHolder implements RemoveThreadLocalApi {
|
||||
|
|
|
@ -32,7 +32,7 @@ import javax.servlet.http.Cookie;
|
|||
* 每个公司情况不一样,所以预留拓展接口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 13:28
|
||||
* @since 2020/12/27 13:28
|
||||
*/
|
||||
public abstract class SessionCookieCreator {
|
||||
|
||||
|
@ -45,7 +45,7 @@ public abstract class SessionCookieCreator {
|
|||
* @param cookieValue cookie的值
|
||||
* @param sessionExpiredSeconds cookie过期时间
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 13:29
|
||||
* @since 2020/12/27 13:29
|
||||
*/
|
||||
public Cookie createCookie(String cookieName, String cookieValue, Integer sessionExpiredSeconds) {
|
||||
Cookie cookie = new Cookie(cookieName, cookieValue);
|
||||
|
@ -58,7 +58,7 @@ public abstract class SessionCookieCreator {
|
|||
* 拓展cookie的配置
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 13:41
|
||||
* @since 2020/12/27 13:41
|
||||
*/
|
||||
public abstract void expandCookieProp(Cookie cookie);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import static cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEn
|
|||
* 数据范围类型枚举,数据范围的值越小,数据权限越小
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/11/5 15:22
|
||||
* @since 2020/11/5 15:22
|
||||
*/
|
||||
@Getter
|
||||
public enum DataScopeTypeEnum {
|
||||
|
@ -76,7 +76,7 @@ public enum DataScopeTypeEnum {
|
|||
* 根据code获取枚举
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/29 18:59
|
||||
* @since 2020/10/29 18:59
|
||||
*/
|
||||
public static DataScopeTypeEnum codeToEnum(Integer code) {
|
||||
if (null != code) {
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.auth.api.enums;
|
|||
* 单点登录客户端
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/5/16 16:48
|
||||
* @since 2022/5/16 16:48
|
||||
*/
|
||||
public enum SsoClientTypeEnum {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
|||
* 认证类异常
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/15 15:59
|
||||
* @since 2020/10/15 15:59
|
||||
*/
|
||||
public class AuthException extends ServiceException {
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import lombok.Getter;
|
|||
* 认证相关异常
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/16 10:53
|
||||
* @since 2020/10/16 10:53
|
||||
*/
|
||||
@Getter
|
||||
public enum AuthExceptionEnum implements AbstractExceptionEnum {
|
||||
|
|
|
@ -37,7 +37,7 @@ import static cn.stylefeng.roses.kernel.auth.api.constants.AuthConstants.*;
|
|||
* 权限相关配置快速获取
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 16:10
|
||||
* @since 2020/10/17 16:10
|
||||
*/
|
||||
public class AuthConfigExpander {
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class AuthConfigExpander {
|
|||
* 获取不被权限控制的url
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 16:12
|
||||
* @since 2020/10/17 16:12
|
||||
*/
|
||||
public static List<String> getNoneSecurityConfig() {
|
||||
String noneSecurityUrls = ConfigContext.me().getSysConfigValueWithDefault("SYS_NONE_SECURITY_URLS", String.class, "");
|
||||
|
@ -60,7 +60,7 @@ public class AuthConfigExpander {
|
|||
* 用于auth校验的jwt的秘钥
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/2 18:52
|
||||
* @since 2021/1/2 18:52
|
||||
*/
|
||||
public static String getAuthJwtSecret() {
|
||||
String sysJwtSecret = ConfigContext.me().getConfigValueNullable("SYS_AUTH_JWT_SECRET", String.class);
|
||||
|
@ -81,7 +81,7 @@ public class AuthConfigExpander {
|
|||
* 如果登录的时候开启了“记住我”,则用户7天内免登录
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/2 18:53
|
||||
* @since 2021/1/2 18:53
|
||||
*/
|
||||
public static Long getAuthJwtTimeoutSeconds() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_JWT_TIMEOUT_SECONDS", Long.class, DEFAULT_AUTH_JWT_TIMEOUT_SECONDS);
|
||||
|
@ -95,7 +95,7 @@ public class AuthConfigExpander {
|
|||
* 如果开启了记住我功能,在session过期后会从新创建session
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/20 9:32
|
||||
* @since 2020/10/20 9:32
|
||||
*/
|
||||
public static Long getSessionExpiredSeconds() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SESSION_EXPIRED_SECONDS", Long.class, 3600L);
|
||||
|
@ -108,7 +108,7 @@ public class AuthConfigExpander {
|
|||
*
|
||||
* @return true-开启单端限制,false-关闭单端限制
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/21 14:31
|
||||
* @since 2020/10/21 14:31
|
||||
*/
|
||||
public static boolean getSingleAccountLoginFlag() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SINGLE_ACCOUNT_LOGIN_FLAG", Boolean.class, false);
|
||||
|
@ -118,7 +118,7 @@ public class AuthConfigExpander {
|
|||
* 获取携带token的header头的名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/22 14:11
|
||||
* @since 2020/10/22 14:11
|
||||
*/
|
||||
public static String getAuthTokenHeaderName() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_HEADER_NAME", String.class, DEFAULT_AUTH_HEADER_NAME);
|
||||
|
@ -128,7 +128,7 @@ public class AuthConfigExpander {
|
|||
* 获取携带token的param传参的名称
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/22 14:11
|
||||
* @since 2020/10/22 14:11
|
||||
*/
|
||||
public static String getAuthTokenParamName() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_PARAM_NAME", String.class, DEFAULT_AUTH_PARAM_NAME);
|
||||
|
@ -138,7 +138,7 @@ public class AuthConfigExpander {
|
|||
* 会话保存在cookie中时,cooke的name
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/27 13:18
|
||||
* @since 2020/12/27 13:18
|
||||
*/
|
||||
public static String getSessionCookieName() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_SESSION_COOKIE_NAME", String.class, DEFAULT_AUTH_HEADER_NAME);
|
||||
|
@ -148,7 +148,7 @@ public class AuthConfigExpander {
|
|||
* 默认解析jwt的秘钥(用于解析sso传过来的token)
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoJwtSecret() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_JWT_SECRET", String.class, SYS_AUTH_SSO_JWT_SECRET);
|
||||
|
@ -158,7 +158,7 @@ public class AuthConfigExpander {
|
|||
* 默认解析sso加密的数据的秘钥
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoDataDecryptSecret() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_DECRYPT_DATA_SECRET", String.class, SYS_AUTH_SSO_DECRYPT_DATA_SECRET);
|
||||
|
@ -169,7 +169,7 @@ public class AuthConfigExpander {
|
|||
*
|
||||
* @return true-开启远程校验,false-关闭远程校验
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static Boolean getSsoSessionValidateSwitch() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_SESSION_VALIDATE_SWITCH", Boolean.class, SYS_AUTH_SSO_SESSION_VALIDATE_SWITCH);
|
||||
|
@ -179,7 +179,7 @@ public class AuthConfigExpander {
|
|||
* sso会话远程校验,redis的host
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoSessionValidateRedisHost() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_HOST", String.class, SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_HOST);
|
||||
|
@ -189,7 +189,7 @@ public class AuthConfigExpander {
|
|||
* sso会话远程校验,redis的端口
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static Integer getSsoSessionValidateRedisPort() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_PORT", Integer.class, SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_PORT);
|
||||
|
@ -199,7 +199,7 @@ public class AuthConfigExpander {
|
|||
* sso会话远程校验,redis的密码
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoSessionValidateRedisPassword() {
|
||||
return ConfigContext.me().getConfigValueNullable("SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_PASSWORD", String.class);
|
||||
|
@ -209,7 +209,7 @@ public class AuthConfigExpander {
|
|||
* sso会话远程校验,redis的db
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static Integer getSsoSessionValidateRedisDbIndex() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_DB_INDEX", Integer.class, SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_DB_INDEX);
|
||||
|
@ -219,7 +219,7 @@ public class AuthConfigExpander {
|
|||
* sso会话远程校验,redis的缓存前缀
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoSessionValidateRedisCachePrefix() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_CACHE_PREFIX", String.class, SYS_AUTH_SSO_SESSION_VALIDATE_REDIS_CACHE_PREFIX);
|
||||
|
@ -229,7 +229,7 @@ public class AuthConfigExpander {
|
|||
* 获取SSO服务器的地址
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:39
|
||||
* @since 2021/5/25 22:39
|
||||
*/
|
||||
public static String getSsoUrl() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_SSO_HOST", String.class, SYS_AUTH_SSO_HOST);
|
||||
|
@ -241,7 +241,7 @@ public class AuthConfigExpander {
|
|||
* 需要前端配合加密后再打开开关
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/10/16 23:28
|
||||
* @since 2022/10/16 23:28
|
||||
*/
|
||||
public static Boolean getPasswordRsaValidateFlag() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("SYS_AUTH_PASSWORD_RSA_VALIDATE", Boolean.class, false);
|
||||
|
|
|
@ -6,7 +6,7 @@ import cn.stylefeng.roses.kernel.config.api.context.ConfigContext;
|
|||
* 登录相关配置快速获取
|
||||
*
|
||||
* @author xixiaowei
|
||||
* @date 2022/1/24 15:47
|
||||
* @since 2022/1/24 15:47
|
||||
*/
|
||||
public class LoginConfigExpander {
|
||||
|
||||
|
@ -14,7 +14,7 @@ public class LoginConfigExpander {
|
|||
* 获取帐号错误次数校验开关
|
||||
*
|
||||
* @author xixiaowei
|
||||
* @date 2022/1/24 15:48
|
||||
* @since 2022/1/24 15:48
|
||||
*/
|
||||
public static boolean getAccountErrorDetectionFlag() {
|
||||
return ConfigContext.me().getSysConfigValueWithDefault("ACCOUNT_ERROR_DETECTION", Boolean.class, false);
|
||||
|
|
|
@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
* 获取当前登录用户的相关方法
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/28 17:46
|
||||
* @since 2021/9/28 17:46
|
||||
*/
|
||||
public class CommonLoginUserUtil {
|
||||
|
||||
|
@ -21,7 +21,7 @@ public class CommonLoginUserUtil {
|
|||
* 获取当前登录用户Token
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/28 17:46
|
||||
* @since 2021/9/28 17:46
|
||||
*/
|
||||
public static String getToken() {
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
* 获取当前登录用户的远程调用方法,供微服务使用
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 10:08
|
||||
* @since 2021/9/29 10:08
|
||||
*/
|
||||
public interface LoginUserRemoteApi {
|
||||
|
||||
|
@ -44,7 +44,7 @@ public interface LoginUserRemoteApi {
|
|||
* 通过token获取登录的用户
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 10:08
|
||||
* @since 2021/9/29 10:08
|
||||
*/
|
||||
@RequestMapping(value = "/loginUserRemote/getLoginUserByToken", method = RequestMethod.POST)
|
||||
LoginUser getLoginUserByToken(@RequestBody LoginUserRequest loginUserRequest);
|
||||
|
@ -53,7 +53,7 @@ public interface LoginUserRemoteApi {
|
|||
* 判断token是否存在会话
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 11:39
|
||||
* @since 2021/9/29 11:39
|
||||
*/
|
||||
@RequestMapping(value = "/loginUserRemote/haveSession", method = RequestMethod.GET)
|
||||
SessionValidateResponse haveSession(@RequestParam("token") String token);
|
||||
|
@ -62,7 +62,7 @@ public interface LoginUserRemoteApi {
|
|||
* 通过loginUser获取刷新后的LoginUser对象
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 11:39
|
||||
* @since 2021/9/29 11:39
|
||||
*/
|
||||
@RequestMapping(value = "/loginUserRemote/getEffectiveLoginUser", method = RequestMethod.POST)
|
||||
LoginUser getEffectiveLoginUser(@RequestBody LoginUser loginUser);
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
* 获取登录用户信息的请求
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 11:25
|
||||
* @since 2021/9/29 11:25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
* Session校验
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/9/29 11:37
|
||||
* @since 2021/9/29 11:37
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.auth.api.password;
|
|||
* 密码存储时,将密码进行加密的api
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 16:50
|
||||
* @since 2020/12/21 16:50
|
||||
*/
|
||||
public interface PasswordStoredEncryptApi {
|
||||
|
||||
|
@ -38,7 +38,7 @@ public interface PasswordStoredEncryptApi {
|
|||
* @param originPassword 密码明文,待加密的密码
|
||||
* @return 加密后的密码密文
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 16:52
|
||||
* @since 2020/12/21 16:52
|
||||
*/
|
||||
String encrypt(String originPassword);
|
||||
|
||||
|
@ -48,7 +48,7 @@ public interface PasswordStoredEncryptApi {
|
|||
* @param encryptBefore 密码明文
|
||||
* @return true-密码正确,false-密码错误
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 17:09
|
||||
* @since 2020/12/21 17:09
|
||||
*/
|
||||
Boolean checkPassword(String encryptBefore, String encryptAfter);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ package cn.stylefeng.roses.kernel.auth.api.password;
|
|||
* 密码传输时,将密码进行加密和解密的api
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 16:50
|
||||
* @since 2020/12/21 16:50
|
||||
*/
|
||||
public interface PasswordTransferEncryptApi {
|
||||
|
||||
|
@ -38,7 +38,7 @@ public interface PasswordTransferEncryptApi {
|
|||
* @param originPassword 密码明文,待加密的密码
|
||||
* @return 加密后的密码密文
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 16:52
|
||||
* @since 2020/12/21 16:52
|
||||
*/
|
||||
String encrypt(String originPassword);
|
||||
|
||||
|
@ -48,7 +48,7 @@ public interface PasswordTransferEncryptApi {
|
|||
* @param encryptedPassword 加密的密码
|
||||
* @return 解密后的密码明文
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/21 16:51
|
||||
* @since 2020/12/21 16:51
|
||||
*/
|
||||
String decrypt(String encryptedPassword);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import javax.validation.constraints.NotBlank;
|
|||
* 登录的请求参数
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:02
|
||||
* @since 2020/10/19 14:02
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
|
|
@ -33,7 +33,7 @@ import lombok.Data;
|
|||
* 登录操作的响应结果
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/19 14:17
|
||||
* @since 2020/10/19 14:17
|
||||
*/
|
||||
@Data
|
||||
public class LoginResponse {
|
||||
|
@ -72,7 +72,7 @@ public class LoginResponse {
|
|||
* 用于普通登录的组装
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:31
|
||||
* @since 2021/5/25 22:31
|
||||
*/
|
||||
public LoginResponse(LoginUser loginUser, String token, Long expireAt) {
|
||||
this.loginUser = uselessFilter(loginUser);
|
||||
|
@ -84,7 +84,7 @@ public class LoginResponse {
|
|||
* 用于单点登录,返回用户loginCode
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:31
|
||||
* @since 2021/5/25 22:31
|
||||
*/
|
||||
public LoginResponse(String loginCode) {
|
||||
this.ssoLogin = true;
|
||||
|
@ -95,7 +95,7 @@ public class LoginResponse {
|
|||
* 过滤无用的用户信息返回给登录用户
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/7/13 11:23
|
||||
* @since 2021/7/13 11:23
|
||||
*/
|
||||
private LoginUser uselessFilter(LoginUser loginUser) {
|
||||
LoginUser tempUser = new LoginUser();
|
||||
|
|
|
@ -10,7 +10,7 @@ import javax.validation.constraints.NotBlank;
|
|||
* 单点获取到的token
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/5/25 22:43
|
||||
* @since 2021/5/25 22:43
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
|
|
@ -31,7 +31,7 @@ import lombok.Data;
|
|||
* 用在系统登录,密码加密的RSA非对称加密秘钥对
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/10/16 15:28
|
||||
* @since 2022/10/16 15:28
|
||||
*/
|
||||
@Data
|
||||
public class PwdRsaSecretProperties {
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.util.*;
|
|||
* 登录用户信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/10/17 9:58
|
||||
* @since 2020/10/17 9:58
|
||||
*/
|
||||
@Data
|
||||
public class LoginUser implements Serializable {
|
||||
|
|
|
@ -30,7 +30,7 @@ import lombok.Data;
|
|||
* 用户基本信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/26 18:14
|
||||
* @since 2020/12/26 18:14
|
||||
*/
|
||||
@Data
|
||||
public class SimpleRoleInfo {
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Date;
|
|||
* 用户基本信息
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2020/12/26 18:14
|
||||
* @since 2020/12/26 18:14
|
||||
*/
|
||||
@Data
|
||||
public class SimpleUserInfo {
|
||||
|
|
|
@ -10,7 +10,7 @@ import javax.validation.constraints.NotBlank;
|
|||
* 单点登录,获取ssoLoginCode的请求参数封装
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/27 16:55
|
||||
* @since 2021/1/27 16:55
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue