Просмотр исходного кода

chore: remove kyl project from tracking

WanJL 2 недель назад
Родитель
Сommit
a6d817ad8d
100 измененных файлов с 0 добавлено и 8061 удалено
  1. 0 39
      kyl/.gitignore
  2. 0 102
      kyl/kyl-common/pom.xml
  3. 0 84
      kyl/kyl-common/src/main/java/com/kyl/base/BaseDto.java
  4. 0 66
      kyl/kyl-common/src/main/java/com/kyl/base/BaseEntity.java
  5. 0 105
      kyl/kyl-common/src/main/java/com/kyl/base/BaseVo.java
  6. 0 33
      kyl/kyl-common/src/main/java/com/kyl/base/DataScope.java
  7. 0 24
      kyl/kyl-common/src/main/java/com/kyl/base/IBasicEnum.java
  8. 0 238
      kyl/kyl-common/src/main/java/com/kyl/base/PageResponse.java
  9. 0 149
      kyl/kyl-common/src/main/java/com/kyl/base/ResponseResult.java
  10. 0 140
      kyl/kyl-common/src/main/java/com/kyl/constant/Constants.java
  11. 0 34
      kyl/kyl-common/src/main/java/com/kyl/constant/DeptCacheConstant.java
  12. 0 17
      kyl/kyl-common/src/main/java/com/kyl/constant/SecurityConstant.java
  13. 0 60
      kyl/kyl-common/src/main/java/com/kyl/constant/SuperConstant.java
  14. 0 48
      kyl/kyl-common/src/main/java/com/kyl/constant/UserCacheConstant.java
  15. 0 41
      kyl/kyl-common/src/main/java/com/kyl/enums/BasicEnum.java
  16. 0 73
      kyl/kyl-common/src/main/java/com/kyl/exception/BaseException.java
  17. 0 163
      kyl/kyl-common/src/main/java/com/kyl/exception/GlobalExceptionHandler.java
  18. 0 83
      kyl/kyl-common/src/main/java/com/kyl/exception/ProjectException.java
  19. 0 45
      kyl/kyl-common/src/main/java/com/kyl/utils/AjaxResultBuild.java
  20. 0 69
      kyl/kyl-common/src/main/java/com/kyl/utils/AliOSSUtil.java
  21. 0 104
      kyl/kyl-common/src/main/java/com/kyl/utils/BeanConv.java
  22. 0 52
      kyl/kyl-common/src/main/java/com/kyl/utils/ClientIpUtil.java
  23. 0 60
      kyl/kyl-common/src/main/java/com/kyl/utils/CodeUtil.java
  24. 0 18
      kyl/kyl-common/src/main/java/com/kyl/utils/ConvertHandler.java
  25. 0 124
      kyl/kyl-common/src/main/java/com/kyl/utils/EmptyUtil.java
  26. 0 81
      kyl/kyl-common/src/main/java/com/kyl/utils/ExceptionsUtil.java
  27. 0 92
      kyl/kyl-common/src/main/java/com/kyl/utils/HttpStatus.java
  28. 0 62
      kyl/kyl-common/src/main/java/com/kyl/utils/JwtUtil.java
  29. 0 74
      kyl/kyl-common/src/main/java/com/kyl/utils/NoProcessing.java
  30. 0 30
      kyl/kyl-common/src/main/java/com/kyl/utils/ObjectUtil.java
  31. 0 56
      kyl/kyl-common/src/main/java/com/kyl/utils/RegisterBeanHandler.java
  32. 0 23
      kyl/kyl-common/src/main/java/com/kyl/utils/RequestUtil.java
  33. 0 126
      kyl/kyl-common/src/main/java/com/kyl/utils/SnowflakeIdWorker.java
  34. 0 385
      kyl/kyl-common/src/main/java/com/kyl/utils/StringUtils.java
  35. 0 439
      kyl/kyl-common/src/main/java/com/kyl/utils/UUID.java
  36. 0 93
      kyl/kyl-common/src/main/java/com/kyl/utils/UserThreadLocal.java
  37. 0 129
      kyl/kyl-framework/pom.xml
  38. 0 63
      kyl/kyl-framework/src/main/java/com/kyl/config/CustomRedisConfig.java
  39. 0 21
      kyl/kyl-framework/src/main/java/com/kyl/config/MybatisConfig.java
  40. 0 94
      kyl/kyl-framework/src/main/java/com/kyl/config/SwaggerConfig.java
  41. 0 111
      kyl/kyl-framework/src/main/java/com/kyl/config/WebMvcConfig.java
  42. 0 134
      kyl/kyl-framework/src/main/java/com/kyl/intercept/AutoFillInterceptor.java
  43. 0 76
      kyl/kyl-framework/src/main/java/com/kyl/intercept/UserInterceptor.java
  44. 0 58
      kyl/kyl-framework/src/main/java/com/kyl/intercept/UserTokenIntercept.java
  45. 0 32
      kyl/kyl-framework/src/main/java/com/kyl/properties/JwtTokenManagerProperties.java
  46. 0 33
      kyl/kyl-framework/src/main/java/com/kyl/properties/SecurityConfigProperties.java
  47. 0 32
      kyl/kyl-framework/src/main/java/com/kyl/properties/SwaggerConfigProperties.java
  48. 0 43
      kyl/kyl-pay/pom.xml
  49. 0 73
      kyl/kyl-pay/src/main/java/com/kyl/entity/RefundRecord.java
  50. 0 98
      kyl/kyl-pay/src/main/java/com/kyl/entity/Trading.java
  51. 0 110
      kyl/kyl-pay/src/main/java/com/kyl/vo/RefundRecordVo.java
  52. 0 159
      kyl/kyl-pay/src/main/java/com/kyl/vo/TradingVo.java
  53. 0 43
      kyl/kyl-security/pom.xml
  54. 0 72
      kyl/kyl-security/src/main/java/com/kyl/config/SecurityConfig.java
  55. 0 128
      kyl/kyl-security/src/main/java/com/kyl/controller/DeptController.java
  56. 0 44
      kyl/kyl-security/src/main/java/com/kyl/controller/LoginController.java
  57. 0 87
      kyl/kyl-security/src/main/java/com/kyl/controller/PostController.java
  58. 0 62
      kyl/kyl-security/src/main/java/com/kyl/controller/ResourceController.java
  59. 0 66
      kyl/kyl-security/src/main/java/com/kyl/controller/RoleController.java
  60. 0 100
      kyl/kyl-security/src/main/java/com/kyl/controller/UserController.java
  61. 0 55
      kyl/kyl-security/src/main/java/com/kyl/dto/DeptDto.java
  62. 0 17
      kyl/kyl-security/src/main/java/com/kyl/dto/LoginDto.java
  63. 0 48
      kyl/kyl-security/src/main/java/com/kyl/dto/PostDto.java
  64. 0 69
      kyl/kyl-security/src/main/java/com/kyl/dto/ResourceDto.java
  65. 0 55
      kyl/kyl-security/src/main/java/com/kyl/dto/RoleDto.java
  66. 0 81
      kyl/kyl-security/src/main/java/com/kyl/dto/UserDto.java
  67. 0 59
      kyl/kyl-security/src/main/java/com/kyl/entity/Dept.java
  68. 0 46
      kyl/kyl-security/src/main/java/com/kyl/entity/Post.java
  69. 0 65
      kyl/kyl-security/src/main/java/com/kyl/entity/Resource.java
  70. 0 44
      kyl/kyl-security/src/main/java/com/kyl/entity/Role.java
  71. 0 19
      kyl/kyl-security/src/main/java/com/kyl/entity/RoleResource.java
  72. 0 117
      kyl/kyl-security/src/main/java/com/kyl/entity/User.java
  73. 0 41
      kyl/kyl-security/src/main/java/com/kyl/entity/UserRole.java
  74. 0 35
      kyl/kyl-security/src/main/java/com/kyl/mapper/DeptMapper.java
  75. 0 30
      kyl/kyl-security/src/main/java/com/kyl/mapper/PostMapper.java
  76. 0 51
      kyl/kyl-security/src/main/java/com/kyl/mapper/ResourceMapper.java
  77. 0 34
      kyl/kyl-security/src/main/java/com/kyl/mapper/RoleMapper.java
  78. 0 28
      kyl/kyl-security/src/main/java/com/kyl/mapper/RoleResourceMapper.java
  79. 0 31
      kyl/kyl-security/src/main/java/com/kyl/mapper/UserMapper.java
  80. 0 26
      kyl/kyl-security/src/main/java/com/kyl/mapper/UserRoleMapper.java
  81. 0 110
      kyl/kyl-security/src/main/java/com/kyl/security/JwtAuthorizationManager.java
  82. 0 60
      kyl/kyl-security/src/main/java/com/kyl/service/DeptService.java
  83. 0 21
      kyl/kyl-security/src/main/java/com/kyl/service/LoginService.java
  84. 0 48
      kyl/kyl-security/src/main/java/com/kyl/service/PostService.java
  85. 0 52
      kyl/kyl-security/src/main/java/com/kyl/service/ResourceService.java
  86. 0 25
      kyl/kyl-security/src/main/java/com/kyl/service/RoleResourceService.java
  87. 0 38
      kyl/kyl-security/src/main/java/com/kyl/service/RoleService.java
  88. 0 18
      kyl/kyl-security/src/main/java/com/kyl/service/UserRoleService.java
  89. 0 54
      kyl/kyl-security/src/main/java/com/kyl/service/UserService.java
  90. 0 224
      kyl/kyl-security/src/main/java/com/kyl/service/impl/DeptServiceImpl.java
  91. 0 113
      kyl/kyl-security/src/main/java/com/kyl/service/impl/LoginServiceImpl.java
  92. 0 159
      kyl/kyl-security/src/main/java/com/kyl/service/impl/PostServiceImpl.java
  93. 0 278
      kyl/kyl-security/src/main/java/com/kyl/service/impl/ResourceServiceImpl.java
  94. 0 168
      kyl/kyl-security/src/main/java/com/kyl/service/impl/RoleServiceImpl.java
  95. 0 34
      kyl/kyl-security/src/main/java/com/kyl/service/impl/UserDetailsServiceImpl.java
  96. 0 214
      kyl/kyl-security/src/main/java/com/kyl/service/impl/UserServiceImpl.java
  97. 0 52
      kyl/kyl-security/src/main/java/com/kyl/vo/DeptVo.java
  98. 0 38
      kyl/kyl-security/src/main/java/com/kyl/vo/MenuMetaVo.java
  99. 0 56
      kyl/kyl-security/src/main/java/com/kyl/vo/MenuVo.java
  100. 0 48
      kyl/kyl-security/src/main/java/com/kyl/vo/PostVo.java

+ 0 - 39
kyl/.gitignore

@@ -1,39 +0,0 @@
-target/
-!.mvn/wrapper/maven-wrapper.jar
-!**/src/main/**/target/
-!**/src/test/**/target/
-.kotlin
-
-### IntelliJ IDEA ###
-.idea/modules.xml
-.idea/jarRepositories.xml
-.idea/compiler.xml
-.idea/libraries/
-*.iws
-*.iml
-*.ipr
-
-### Eclipse ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-build/
-!**/src/main/**/build/
-!**/src/test/**/build/
-
-### VS Code ###
-.vscode/
-
-### Mac OS ###
-.DS_Store

+ 0 - 102
kyl/kyl-common/pom.xml

@@ -1,102 +0,0 @@
-<?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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>com.kyl</groupId>
-        <artifactId>kyl</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>kyl-common</artifactId>
-
-    <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <dependencies>
-        <!--分页工具-PageHelper-->
-        <dependency>
-            <groupId>com.github.pagehelper</groupId>
-            <artifactId>pagehelper-spring-boot-starter</artifactId>
-        </dependency>
-
-        <!--工具包-HuTool-->
-        <dependency>
-            <groupId>cn.hutool</groupId>
-            <artifactId>hutool-all</artifactId>
-        </dependency>
-        <!---->
-        <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
-        </dependency>
-        <!-- 拷贝对象 -->
-        <dependency>
-            <groupId>ma.glasnost.orika</groupId>
-            <artifactId>orika-core</artifactId>
-        </dependency>
-        <!---->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-        </dependency>
-        <!---->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <!---->
-        <dependency>
-            <groupId>com.aliyun.oss</groupId>
-            <artifactId>aliyun-sdk-oss</artifactId>
-        </dependency>
-        <!--  knife4j版接口文档 访问/doc.html-->
-        <dependency>
-            <groupId>com.github.xiaoymin</groupId>
-            <artifactId>knife4j-spring-boot-starter</artifactId>
-        </dependency>
-        <!--redis starter-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-
-        <!--JWT-->
-        <dependency>
-            <groupId>com.auth0</groupId>
-            <artifactId>java-jwt</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.jsonwebtoken</groupId>
-            <artifactId>jjwt</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-security</artifactId>
-        </dependency>
-    </dependencies>
-
-    <!-- 项目构建配置 -->
-    <build>
-        <plugins>
-            <!-- Maven编译插件配置 -->
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 84
kyl/kyl-common/src/main/java/com/kyl/base/BaseDto.java

@@ -1,84 +0,0 @@
-package com.kyl.base;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * DTO基类
- *
- * 本类作为数据传输对象(DTO)的基类,定义了一些通用的属性和方法,
- * 用于在整个应用中传递数据。通过实现Serializable接口,确保了对象的可序列化性,
- * 以便于在网络传输或存储时序列化和反序列化。
- */
-@Data
-@NoArgsConstructor
-@ApiModel("DTO基类")
-public class BaseDto  implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 主键
-     *
-     * 用于唯一标识一个实体对象,是数据库表中的主键字段映射。
-     */
-    @ApiModelProperty(value = "主键")
-    private Long id;
-
-    /**
-     * 搜索值
-     *
-     * 用于模糊搜索的功能,不参与序列化和反序列化过程,以避免在API响应中暴露。
-     */
-    @JsonIgnore
-    private String searchValue;
-
-    /**
-     * 备注
-     *
-     * 用于记录额外的说明或注释信息,可以是任意自由文本。
-     */
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    /**
-     * 请求参数
-     *
-     * 用于存储额外的请求参数,不参与序列化和反序列化过程,以避免在API响应中直接暴露。
-     * 这允许在处理请求时动态添加和访问额外的参数。
-     */
-    @JsonIgnore
-    private Map<String, Object> params;
-
-    /**
-     * 获取请求参数
-     *
-     * 如果params属性为空,则初始化为一个新的HashMap并返回,
-     * 这样可以避免在调用时进行空值检查,简化了调用方的代码。
-     *
-     * @return Map<String, Object> 请求参数的映射
-     */
-    public Map<String, Object> getParams() {
-        if (params == null) {
-            params = new HashMap<>();
-        }
-        return params;
-    }
-
-    /**
-     * 设置请求参数
-     *
-     * 允许外部设置整个参数映射,提供了灵活性和扩展性。
-     *
-     * @param params 请求参数的映射
-     */
-    public void setParams(Map<String, Object> params) {
-        this.params = params;
-    }
-}

+ 0 - 66
kyl/kyl-common/src/main/java/com/kyl/base/BaseEntity.java

@@ -1,66 +0,0 @@
-package com.kyl.base;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * 实体基础类,用于为其他实体类提供通用的属性和功能。
- * 该类包含了常见的数据库实体所需的基本字段,如主键、创建时间、更新时间、创建人、更新人等信息。
- * 同时,还提供了一个用于存储请求参数的属性。
- *
- */
-@Data
-@NoArgsConstructor
-public class BaseEntity implements Serializable {
-    // 标记该类可以被序列化,以便在网络传输或持久化存储时能够正确处理对象状态
-
-    /**
-     * 主键
-     * 唯一标识数据库表中的每一条记录。在大多数情况下,它是一个自增长的数字,用于确保数据的唯一性和完整性。
-     */
-    @ApiModelProperty(value = "主键")
-    public Long id;
-
-    /**
-     * 创建时间
-     * 记录该实体在数据库中首次被创建的时间。使用Java 8的LocalDateTime类来表示日期和时间,精确到纳秒级别。
-     */
-    @ApiModelProperty(value = "创建时间")
-    public LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     * 记录该实体在数据库中最后一次被更新的时间。每次实体的属性发生变化并保存到数据库时,该时间会被更新。
-     */
-    @ApiModelProperty(value = "更新时间")
-    public LocalDateTime updateTime;
-
-    /**
-     * 创建人
-     * 记录创建该实体的用户的唯一标识。通常是一个用户ID,用于跟踪数据的创建来源。
-     */
-    @ApiModelProperty(value = "创建人Id")
-    private Long createBy;
-
-    /**
-     * 更新人
-     * 记录最后一次更新该实体的用户的唯一标识。用于追踪数据的更新操作由谁发起。
-     */
-    @ApiModelProperty(value = "更新人Id")
-    private Long updateBy;
-
-    /**
-     * 备注
-     * 一个字符串字段,用于存储关于该实体的额外信息或注释。可以包含一些描述性的文本,帮助用户更好地理解实体的内容。
-     */
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    public BaseEntity(Long id) {
-        this.id = id;
-    }
-}

+ 0 - 105
kyl/kyl-common/src/main/java/com/kyl/base/BaseVo.java

@@ -1,105 +0,0 @@
-package com.kyl.base;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.time.LocalDateTime;
-
-/**
- * BaseVo类是VO基类,提供了基础的实体属性,如主键、创建时间、修改时间等。
- * 该类主要用于实体对象的序列化和反序列化,以及在不同层次之间传递数据。
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-public class BaseVo implements Serializable {
-    /**
-     * 主键,用于唯一标识一个实体对象。
-     */
-    @ApiModelProperty(value = "主键")
-    private Long id;
-
-    /**
-     * 创建时间,表示实体对象创建的时间。
-     */
-    @ApiModelProperty(value = "创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//get
-    protected LocalDateTime createTime;
-
-    /**
-     * 创建日期,仅包含创建时间的日期部分。
-     */
-    @ApiModelProperty(value = "创建时间")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//get
-    protected String createDay;
-
-    /**
-     * 修改时间,表示实体对象最后一次修改的时间。
-     */
-    @ApiModelProperty(value = "修改时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")//get
-    protected LocalDateTime updateTime;
-
-    /**
-     * 创建者,表示创建该实体对象的用户的用户名。
-     */
-    @ApiModelProperty(value = "创建者:username")
-    private Long createBy;
-
-    /**
-     * 更新者,表示最后一次修改该实体对象的用户的用户名。
-     */
-    @ApiModelProperty(value = "更新者:username")
-    private Long updateBy;
-
-    /**
-     * 是否有效,用于标识实体对象的状态。
-     */
-    @ApiModelProperty(value = "是否有效")
-    protected String dataState;
-
-    /**
-     * 备注,用于存储实体对象的附加信息。
-     */
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    /**
-     * 创建人类型,用于区分创建者的来源,1代表前台用户,2代表后台用户。
-     */
-    @ApiModelProperty(value = "创建人类型 1 前台 2后台")
-    private Integer createType;
-
-    /**
-     * 创建人名称,存储创建者的名称。
-     */
-    @ApiModelProperty(value = "创建人名称")
-    private String creator;
-
-    /**
-     * 后台管理端创建人名称,专门用于存储后台管理员的名称。
-     */
-    @ApiModelProperty(value = "后台管理端创建人名称")
-    private String adminCreator;
-
-    /**
-     * 更新人名称,存储最后一次更新者的名称。
-     */
-    @ApiModelProperty(value = "更新人名称")
-    private String updater;
-
-    /**
-     * 构造方法,用于初始化BaseVo对象。
-     *
-     * @param id        实体对象的主键
-     * @param dataState 实体对象的数据状态
-     */
-    public BaseVo(Long id, String dataState) {
-        this.id = id;
-        this.dataState = dataState;
-    }
-}

+ 0 - 33
kyl/kyl-common/src/main/java/com/kyl/base/DataScope.java

@@ -1,33 +0,0 @@
-package com.kyl.base;
-
-import java.lang.annotation.*;
-
-/**
- * DataScope注解用于数据权限过滤
- * 它主要用于方法级别,以控制数据访问权限
- * 通过指定部门别名和用户别名,可以实现细粒度的数据访问控制
- *
- * @author WanJl
- * @version 1.0
- * @title DataScope
- * @description 数据权限过滤注解
- * @create 2024/12/25
- */
-@Target(ElementType.METHOD) // 指定注解应用于方法级别
-@Retention(RetentionPolicy.RUNTIME) // 指定注解在运行时保留,以便运行时进行处理
-@Documented // 指定该注解应被javadoc工具记录
-public @interface DataScope {
-    /**
-     * 部门别名
-     * 用于指定方法关联的部门字段别名
-     * 默认值为空字符串
-     */
-    public String deptAlias() default "";
-
-    /**
-     * 用户别名
-     * 用于指定方法关联的用户字段别名
-     * 默认值为空字符串
-     */
-    public String userAlias() default "";
-}

+ 0 - 24
kyl/kyl-common/src/main/java/com/kyl/base/IBasicEnum.java

@@ -1,24 +0,0 @@
-package com.kyl.base;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title IBasicEnum
- * @description 枚举接口,定义了枚举类型应具备的基本方法
- * @create 2024/12/25
- */
-public interface IBasicEnum {
-
-    /**
-     * 获取枚举成员的编码
-     * @return int 编码值
-     */
-    public int getCode();
-
-    /**
-     * 获取枚举成员的信息
-     * @return String 信息字符串
-     */
-    public String getMsg();
-
-}

+ 0 - 238
kyl/kyl-common/src/main/java/com/kyl/base/PageResponse.java

@@ -1,238 +0,0 @@
-package com.kyl.base;
-
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.util.ObjectUtil;
-import com.github.pagehelper.Page;
-import com.kyl.utils.ConvertHandler;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.*;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.function.Function;
-/**
- * 分页结果包装类,用于统一分页数据的响应格式
- * @author WanJl
- * @version 1.0
- * @title PageResponse
- * @description 分页数据消息体,包含分页信息和数据列表
- * @create 2024/12/25
- */
-@Data
-@ApiModel(value = "分页数据消息体", description = "分页数据统一对象")
-@Builder
-@AllArgsConstructor(access = AccessLevel.PRIVATE)
-@NoArgsConstructor
-public class PageResponse<T> {
-
-    @ApiModelProperty(value = "总条目数", required = true)
-    private Long total = 0L;
-
-    @ApiModelProperty(value = "页尺寸", required = true)
-    private Integer pageSize = 0;
-
-    @ApiModelProperty(value = "总页数", required = true)
-    private Long pages = 0L;
-
-    @ApiModelProperty(value = "页码", required = true)
-    private Integer page = 0;
-
-    @ApiModelProperty(value = "数据列表", required = true)
-    private List<T> records = Collections.EMPTY_LIST;
-
-    /**
-     * 通过mybatis的分页对象构造分页响应,不包含数据列表
-     *
-     * @param page 分页对象,用于获取分页信息
-     */
-    public PageResponse(Page<?> page) {
-        this.page = Convert.toInt(page.getPageNum());
-        this.total = page.getTotal();
-        this.pageSize = Convert.toInt(page.getPageSize());
-        this.pages = (long) page.getPages();
-    }
-
-    /**
-     * 通过mybatis的分页对象构造分页响应,包含数据列表
-     *
-     * @param page  分页对象,用于获取分页信息和数据列表
-     * @param clazz 指定数据列表项的类型
-     */
-    public PageResponse(Page<?> page, Class<T> clazz) {
-        this.page = Convert.toInt(page.getPageNum());
-        this.total = page.getTotal();
-        this.pageSize = Convert.toInt(page.getPageSize());
-        this.pages = (long) page.getPages();
-        // 本构造函数中未处理records,因为需要类型转换,将在其他方法中实现
-    }
-
-    /**
-     * 返回一个空的分页响应实例
-     *
-     * @return 分页数据对象实例,所有字段为默认值
-     */
-    public static <T> PageResponse<T> getInstance() {
-        return PageResponse.<T>builder().build();
-    }
-
-    /**
-     * 将Page对象封装为PageResponse,不包含数据列表
-     *
-     * @param page 源分页对象,用于获取分页信息
-     * @return 分页数据对象,包含分页信息但不包含数据列表
-     */
-    public static <T> PageResponse<T> of(Page<?> page) {
-        return PageResponse.<T>builder()
-                .page(Convert.toInt(page.getPageNum()))
-                .pageSize(Convert.toInt(page.getPageSize()))
-                .pages((long) page.getPages())
-                .total(page.getTotal())
-                .build();
-    }
-
-    /**
-     * 将Page对象封装为PageResponse,并将数据列表转换为指定类型
-     *
-     * @param page 源分页对象,用于获取分页信息和数据列表
-     * @param clazz 指定数据列表项的类型
-     * @return 分页数据对象,包含分页信息和转换后的数据列表
-     */
-    public static <T> PageResponse<T> of(Page<?> page, Class<T> clazz) {
-        return of(page, clazz, null);
-    }
-
-    /**
-     * 将Page对象封装为PageResponse,并将数据列表转换为指定类型,支持自定义转换逻辑
-     *
-     * @param page           源分页对象,用于获取分页信息和数据列表
-     * @param clazz          指定数据列表项的类型
-     * @param convertHandler 自定义转换处理器,用于处理特殊类型的转换
-     * @return 分页数据对象,包含分页信息和转换后的数据列表
-     */
-    public static <O, T> PageResponse<T> of(Page<O> page, Class<T> clazz, ConvertHandler<O, T> convertHandler) {
-        return PageResponse.<T>builder()
-                .page(Convert.toInt(page.getPageNum()))
-                .pageSize(Convert.toInt(page.getPageSize()))
-                .pages((long) page.getPages())
-                .total(page.getTotal())
-                .records(copyToList(page.getResult(), clazz, convertHandler))
-                .build();
-    }
-
-    /**
-     * 将PageResponse对象转换为另一个类型的数据列表
-     *
-     * @param origin 源分页数据对象,包含分页信息和数据列表
-     * @param clazz  指定数据列表项的类型
-     * @return 新的分页数据对象,包含转换后的数据列表
-     */
-    public static <O, T> PageResponse<T> of(PageResponse<O> origin, Class<T> clazz) {
-        return of(origin, clazz, null);
-    }
-
-    /**
-     * 将PageResponse对象转换为另一个类型的数据列表,支持自定义转换逻辑
-     *
-     * @param origin         源分页数据对象,包含分页信息和数据列表
-     * @param clazz          指定数据列表项的类型
-     * @param convertHandler 自定义转换处理器,用于处理特殊类型的转换
-     * @return 新的分页数据对象,包含转换后的数据列表
-     */
-    public static <O, T> PageResponse<T> of(PageResponse<O> origin, Class<T> clazz, ConvertHandler<O, T> convertHandler) {
-        PageResponse<T> target = PageResponse.getInstance();
-        BeanUtil.copyProperties(origin, target, "items");
-
-        if (CollUtil.isEmpty(origin.getRecords())) {
-            return target;
-        }
-        List<T> targetList = copyToList(origin.getRecords(), clazz, convertHandler);
-        target.setRecords(targetList);
-
-        return target;
-    }
-
-    /**
-     * 将List对象封装为分页数据对象
-     *
-     * @param items    数据列表
-     * @param page     页码,如果为空,默认为1
-     * @param pageSize 页尺寸,如果为空,默认为1
-     * @param pages    总页数,如果为空,默认为1
-     * @param counts   总条目数,如果为空,默认为1
-     * @return 分页数据对象,包含分页信息和数据列表
-     */
-    public static <T> PageResponse<T> of(List<T> items, Integer page, Integer pageSize, Long pages, Long counts) {
-        PageResponse<T> pageResponse = PageResponse.<T>builder()
-                .page(Optional.ofNullable(page).orElse(1))
-                .pageSize(Optional.ofNullable(pageSize).orElse(1))
-                .pages(Optional.ofNullable(pages).orElse(1L))
-                .total(Optional.ofNullable(counts).orElse(1L))
-                .build();
-
-        if (CollUtil.isEmpty(items)) {
-            return pageResponse;
-        }
-
-        pageResponse.setRecords(items);
-        return pageResponse;
-    }
-
-    /**
-     * 将List对象封装为分页数据对象,所有分页字段默认为1
-     *
-     * @param items 数据列表
-     * @return 分页数据对象,包含默认分页信息和数据列表
-     */
-    public static <T> PageResponse<T> of(List<T> items) {
-        return of(items, null, null, null, null);
-    }
-
-    /**
-     * 返回包含任意数量元素的分页对象,所有分页字段默认为1
-     *
-     * @param elements 数据列表的元素
-     * @return 分页数据对象,包含默认分页信息和数据列表
-     */
-    @SafeVarargs
-    public static <E> PageResponse<E> of(E... elements) {
-        return of(List.of(elements));
-    }
-
-    /**
-     * 使用自定义函数将数据列表转换为另一个类型的数据列表
-     *
-     * @param origin 源分页数据对象,包含分页信息和数据列表
-     * @param function 自定义转换函数,用于将源数据列表转换为目标类型的数据列表
-     * @return 新的分页数据对象,包含转换后的数据列表
-     */
-    public static <O, T> PageResponse<T> of(PageResponse<O> origin, Function<List<O>, List<T>> function) {
-        List<T> orderVOList = function.apply(origin.getRecords());
-        return PageResponse.of(orderVOList, origin.getPage(), origin.getPageSize(), origin.getPages(), origin.total);
-    }
-
-    /**
-     * 将数据列表转换为另一个类型的数据列表,支持自定义转换逻辑
-     *
-     * @param content 源数据列表
-     * @param clazz   目标数据列表项的类型
-     * @param convertHandler 自定义转换处理器,用于处理特殊类型的转换
-     * @param <T> 目标数据列表项的类型
-     * @param <O> 源数据列表项的类型
-     * @return 转换后的数据列表
-     */
-    private static <T, O> List<T> copyToList(List<O> content, Class<T> clazz, ConvertHandler<O, T> convertHandler) {
-        List<T> targetList = BeanUtil.copyToList(content, clazz);
-
-        if (CollUtil.isNotEmpty(targetList) && ObjectUtil.isNotEmpty(convertHandler)) {
-            for (int i = 0; i < content.size(); i++) {
-                convertHandler.map(content.get(i), targetList.get(i));
-            }
-        }
-        return targetList;
-    }
-}

+ 0 - 149
kyl/kyl-common/src/main/java/com/kyl/base/ResponseResult.java

@@ -1,149 +0,0 @@
-package com.kyl.base;
-
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.kyl.utils.HttpStatus;
-import com.kyl.utils.StringUtils;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.Date;
-/**
- * @author WanJl
- * @version 1.0
- * @title ResponseResult
- * @description 返回结果
- * @create 2024/12/25
- */
-@Data
-@Builder
-@AllArgsConstructor
-@NoArgsConstructor
-public class ResponseResult<T> implements Serializable {
-
-    /**
-     * 响应返回编码
-     */
-    @ApiModelProperty(value = "状态码")
-    private int code;
-
-    /**
-     * 响应返回信息
-     */
-    @ApiModelProperty(value = "状态信息")
-    private String msg;
-
-    /**
-     * 返回结果
-     */
-    @ApiModelProperty(value = "返回结果")
-    private T data;
-
-    /**
-     * 创建时间,处理json的时间参数解析
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss",timezone = "GMT+8")
-    @ApiModelProperty(value = "操作时间")
-    private Date operationTime;
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象
-     *
-     * @param code 状态码
-     * @param msg  返回内容
-     */
-    public ResponseResult(int code, String msg) {
-        this.code = code;
-        this.msg = msg;
-    }
-
-    /**
-     * 初始化一个新创建的 AjaxResult 对象
-     *
-     * @param code 状态码
-     * @param msg  返回内容
-     * @param data 数据对象
-     */
-    public ResponseResult(int code, String msg, T data) {
-        this.code = code;
-        this.msg = msg;
-        if (StringUtils.isNotNull(data)) {
-            this.data = data;
-        }
-        this.operationTime = new Date();
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @return 成功消息
-     */
-    public static ResponseResult success() {
-        return ResponseResult.success("操作成功");
-    }
-
-    /**
-     * 返回成功数据
-     *
-     * @return 成功消息
-     */
-    public static ResponseResult success(Object data) {
-        return ResponseResult.success("操作成功", data);
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @param msg 返回内容
-     * @return 成功消息
-     */
-    public static ResponseResult success(String msg) {
-        return ResponseResult.success(msg, null);
-    }
-
-    /**
-     * 返回成功消息
-     *
-     * @param msg  返回内容
-     * @param data 数据对象
-     * @return 成功消息
-     */
-    public static ResponseResult success(String msg, Object data) {
-        return new ResponseResult(HttpStatus.SUCCESS, msg, data);
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @return
-     */
-    public static ResponseResult error() {
-        return ResponseResult.error("操作失败");
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @param msg 返回内容
-     * @return 警告消息
-     */
-    public static ResponseResult error(String msg) {
-        return ResponseResult.error(msg, null);
-    }
-
-    /**
-     * 返回错误消息
-     *
-     * @param msg  返回内容
-     * @param data 数据对象
-     * @return 警告消息
-     */
-    public static ResponseResult error(String msg, Object data) {
-        return new ResponseResult(HttpStatus.ERROR, msg, data);
-    }
-
-}

+ 0 - 140
kyl/kyl-common/src/main/java/com/kyl/constant/Constants.java

@@ -1,140 +0,0 @@
-package com.kyl.constant;
-
-/**
- * Constants
- * @author WanJl
- **/
-public class Constants {
-    /**
-     * UTF-8 字符集
-     */
-    public static final String UTF8 = "UTF-8";
-
-    /**
-     * GBK 字符集
-     */
-    public static final String GBK = "GBK";
-
-    /**
-     * http请求
-     */
-    public static final String HTTP = "http://";
-
-    /**
-     * https请求
-     */
-    public static final String HTTPS = "https://";
-
-    /**
-     * 通用成功标识
-     */
-    public static final String SUCCESS = "0";
-
-    /**
-     * 通用失败标识
-     */
-    public static final String FAIL = "1";
-
-    /**
-     * 登录成功
-     */
-    public static final String LOGIN_SUCCESS = "Success";
-
-    /**
-     * 注销
-     */
-    public static final String LOGOUT = "Logout";
-
-    /**
-     * 登录失败
-     */
-    public static final String LOGIN_FAIL = "Error";
-
-    /**
-     * 验证码 redis key
-     */
-    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
-
-    /**
-     * 登录用户 redis key
-     */
-    public static final String LOGIN_TOKEN_KEY = "login_tokens:";
-
-    /**
-     * 防重提交 redis key
-     */
-    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
-
-    /**
-     * 验证码有效期(分钟)
-     */
-    public static final Integer CAPTCHA_EXPIRATION = 2;
-
-    /**
-     * 令牌
-     */
-    public static final String TOKEN = "token";
-
-    /**
-     * 令牌前缀
-     */
-    public static final String TOKEN_PREFIX = "Bearer ";
-
-    /**
-     * 令牌前缀
-     */
-    public static final String LOGIN_USER_KEY = "login_user_key";
-
-    /**
-     * 令牌前缀
-     */
-    public static final String MINI_APP_LOGIN_USER_KEY = "mini_app_login_user_key";
-    /**
-     * 用户ID
-     */
-    public static final String JWT_USERID = "userid";
-
-    /**
-     * 用户名称
-     */
-    public static final String JWT_USERNAME = "sub";
-
-    /**
-     * 用户头像
-     */
-    public static final String JWT_AVATAR = "avatar";
-
-    /**
-     * 创建时间
-     */
-    public static final String JWT_CREATED = "created";
-
-    /**
-     * 用户权限
-     */
-    public static final String JWT_AUTHORITIES = "authorities";
-
-    /**
-     * 参数管理 cache key
-     */
-    public static final String SYS_CONFIG_KEY = "sys_config:";
-
-    /**
-     * 字典管理 cache key
-     */
-    public static final String SYS_DICT_KEY = "sys_dict:";
-
-
-    public static final String ACT_CODE_KEY = "ac_dict:";
-
-    /**
-     * 资源映射路径 前缀
-     */
-    public static final String RESOURCE_PREFIX = "/profile";
-
-    /**
-     * 设备最新数据缓存KEY
-     */
-    public static final String DEVICE_LASTDATA_CACHE_KEY = "deviceLastData";
-
-}

+ 0 - 34
kyl/kyl-common/src/main/java/com/kyl/constant/DeptCacheConstant.java

@@ -1,34 +0,0 @@
-package com.kyl.constant;
-
-/**
-* 部门表缓存常量
-*/
-public class DeptCacheConstant {
-
-    /**
-     * 缓存父包
-     */
-    public static final String PREFIX= "dept:";
-
-    /**
-     * 缓存父包
-     */
-    public static final String BASIC= PREFIX+"basic";
-
-    /**
-     * page分页
-     */
-    public static final String PAGE= PREFIX+"page";
-
-    /**
-     * list下拉框
-     */
-    public static final String LIST= PREFIX+"list";
-
-    /**
-     * 树形
-     */
-    public static final String TREE= PREFIX+"tree";
-
-
-}

+ 0 - 17
kyl/kyl-common/src/main/java/com/kyl/constant/SecurityConstant.java

@@ -1,17 +0,0 @@
-package com.kyl.constant;
-
-/**
- * @ClassName SecurityConstant.java
- */
-public class SecurityConstant {
-
-    //用户前端token
-    public static final String USER_TOKEN = "Authorization";
-
-    //本人
-    public static final String DATA_SCOPE_1 = "1";
-
-    //自定义
-    public static final String DATA_SCOPE_0 = "0";
-
-}

+ 0 - 60
kyl/kyl-common/src/main/java/com/kyl/constant/SuperConstant.java

@@ -1,60 +0,0 @@
-
-package com.kyl.constant;
-
-
-/**
- *  静态变量
- */
-public class SuperConstant {
-
-	/**
-	 * 常量是
-	 */
-	public static final String DATA_STATE_0 = "0";
-
-	/**
-	 * 常量否
-	 */
-	public static final String DATA_STATE_1 = "1";
-
-
-	/**
-	 * 树形根节点父Id
-	 */
-	public static final String ROOT_PARENT_ID = "100001000000000";
-
-	/**
-	 * 树形根节点父Id
-	 */
-	public static final String ROOT_DEPT_PARENT_ID = "100000000000000";
-
-	/**
-	 * 常量目录
-	 */
-	public static final String CATALOGUE = "c";
-
-	/**
-	 * 常量菜单
-	 */
-	public static final String MENU = "m";
-
-	/**
-	 * 常量菜单
-	 */
-	public static final String BUTTON = "r";
-
-	/**
-	 * 常量平台
-	 */
-	public static final String SYSTEM = "s";
-
-	/**
-	 *  前端显示布局
-	 */
-	public static final String COMPONENT_LAYOUT="Layout";
-
-	/**
-	 * 常量是
-	 */
-    public static final String DEFAULT_0 = "0";
-}

+ 0 - 48
kyl/kyl-common/src/main/java/com/kyl/constant/UserCacheConstant.java

@@ -1,48 +0,0 @@
-package com.kyl.constant;
-
-/**
-* 用户表缓存常量
-*/
-public class UserCacheConstant {
-
-    /**
-     * 缓存父包
-     */
-    public static final String PREFIX= "user:";
-
-    /**
-     * 缓存父包
-     */
-    public static final String BASIC= PREFIX+"basic";
-
-    /**
-     * 分布式锁前缀
-     */
-    public static final String LOCK_PREFIX = PREFIX+"lock:";
-
-    /**
-     * page分页
-     */
-    public static final String PAGE= PREFIX+"page";
-
-    /**
-     * list下拉框
-     */
-    public static final String LIST= PREFIX+"list";
-
-    /**
-     * 用户登录
-     */
-    public static final String LOGIN= PREFIX+"login";
-
-    /**
-     * 建立用户与会话唯一标识之间的关系,用于判断剔除
-     */
-    public static final String USER_TOKEN = PREFIX+"user-token:";
-
-    /**
-     * 建立会话唯一标识与jwtToken之间的关系,用于令牌续期
-     */
-    public static final String JWT_TOKEN = PREFIX+"jwt-token:";
-
-}

+ 0 - 41
kyl/kyl-common/src/main/java/com/kyl/enums/BasicEnum.java

@@ -1,41 +0,0 @@
-package com.kyl.enums;
-
-import com.kyl.base.IBasicEnum;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-/**
- *  基础枚举
- *  定义了一些通用的枚举值,用于表示操作结果的状态码和信息
- */
-@Getter
-@AllArgsConstructor
-public enum BasicEnum implements IBasicEnum {
-
-    /**
-     * 操作成功的状态码和信息
-     */
-    SUCCEED(200,"操作成功"),
-    /**
-     * 权限不足的状态码和信息
-     */
-    SECURITY_ACCESSDENIED_FAIL(401,"权限不足!"),
-    /**
-     * 系统运行异常的状态码和信息
-     */
-    SYSYTEM_FAIL(1503,"系统运行异常"),
-    /**
-     * 参数校验异常的状态码和信息
-     */
-    VALID_EXCEPTION(1504,"参数校验异常");
-
-    /**
-     * 编码
-     * 代表枚举值的状态码
-     */
-    public int code;
-    /**
-     * 信息
-     * 与状态码对应的描述信息
-     */
-    public String msg;
-}

+ 0 - 73
kyl/kyl-common/src/main/java/com/kyl/exception/BaseException.java

@@ -1,73 +0,0 @@
-package com.kyl.exception;
-
-
-import lombok.Data;
-
-/**
- * BaseException
- * @author WanJl
- **/
-@Data
-public class BaseException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 所属模块
-     */
-    private String module;
-
-    /**
-     * 错误码
-     */
-    private String code;
-
-    /**
-     * 错误码对应的参数
-     */
-    private Object[] args;
-
-    /**
-     * 错误消息
-     */
-    private String defaultMessage;
-
-    public BaseException(String module, String code, Object[] args, String defaultMessage) {
-        this.module = module;
-        this.code = code;
-        this.args = args;
-        this.defaultMessage = defaultMessage;
-    }
-
-    public BaseException(String module, String code, Object[] args) {
-        this(module, code, args, null);
-    }
-
-    public BaseException(String module, String defaultMessage) {
-        this(module, null, null, defaultMessage);
-    }
-
-    public BaseException(String code, Object[] args) {
-        this(null, code, args, null);
-    }
-
-    public BaseException(String defaultMessage) {
-        this(null, "500", null, defaultMessage);
-    }
-
-
-    public String getModule() {
-        return module;
-    }
-
-    public String getCode() {
-        return code;
-    }
-
-    public Object[] getArgs() {
-        return args;
-    }
-
-    public String getDefaultMessage() {
-        return defaultMessage;
-    }
-}

+ 0 - 163
kyl/kyl-common/src/main/java/com/kyl/exception/GlobalExceptionHandler.java

@@ -1,163 +0,0 @@
-package com.kyl.exception;
-
-import cn.hutool.core.exceptions.ExceptionUtil;
-import cn.hutool.core.map.MapUtil;
-import cn.hutool.core.util.ObjectUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.dao.DuplicateKeyException;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.RestControllerAdvice;
-import org.springframework.web.multipart.MaxUploadSizeExceededException;
-
-import java.io.FileNotFoundException;
-import java.nio.file.AccessDeniedException;
-
-@RestControllerAdvice
-@Slf4j
-public class GlobalExceptionHandler {
-
-    /**
-     * 处理自定义异常BaseException。
-     * 返回自定义异常中的错误代码和错误消息。
-     *
-     * @param exception 自定义异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(BaseException.class)
-    public ResponseEntity<Object> handleBaseException(BaseException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("自定义异常处理 -> ", exception);
-        }
-        return ResponseEntity.ok(MapUtil.<String, Object>builder()
-                .put("code", exception.getCode())
-                .put("msg", exception.getDefaultMessage())
-                .build());
-    }
-
-    /**
-     * 处理文件上传超过最大限制异常。
-     * 返回HTTP响应状态码500,包含错误代码和错误消息。
-     *
-     * @param exception 文件上传异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(MaxUploadSizeExceededException.class)
-    public ResponseEntity<Object> handleMaxUploadSizeExceededException(MaxUploadSizeExceededException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("文件上传超过最大限制异常 -> ", exception);
-        }
-
-        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.INTERNAL_SERVER_ERROR.value())
-                        .put("msg", "上传图片大小不能超过5M,格式需为jpg、png、gif")
-                        .build());
-    }
-
-    /**
-     * 处理其他未知异常。
-     * 返回HTTP响应状态码500,包含错误代码和异常堆栈信息。
-     *
-     * @param exception 未知异常
-     * @return 响应数据,包含错误代码和异常堆栈信息
-     */
-    @ExceptionHandler(Exception.class)
-    public ResponseEntity<Object> handleUnknownException(Exception exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("其他未知异常 -> ", exception);
-        }
-
-
-        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.INTERNAL_SERVER_ERROR.value())
-                        .put("msg", ExceptionUtil.stacktraceToString(exception))
-                        .build());
-    }
-
-    /**
-     * 处理FileNotFoundException异常。
-     * 返回HTTP响应状态码400,包含错误代码和错误消息。
-     *
-     * @param exception 文件未找到异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(FileNotFoundException.class)
-    public ResponseEntity<Object> handleFileNotFoundException(FileNotFoundException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("文件不存在 -> ", exception);
-        }
-        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.BAD_REQUEST.value())
-                        .put("msg", exception.getMessage())
-                        .build());
-    }
-
-    /**
-     * 处理没有权限访问接口异常。
-     * 返回HTTP响应状态码401,包含错误代码和错误消息。
-     *
-     * @param exception 权限访问异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(AccessDeniedException.class)
-    public ResponseEntity<Object> handleAccessDeniedException(AccessDeniedException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("没有权限访问接口异常 -> ", exception);
-        }
-        return ResponseEntity.status(HttpStatus.UNAUTHORIZED)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.UNAUTHORIZED.value())
-                        .put("msg", "没有权限访问接口")
-                        .build());
-    }
-
-    /**
-     * 处理运行时异常。
-     * 返回HTTP响应状态码500,包含错误代码和错误消息。
-     *
-     * @param exception 运行时异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(RuntimeException.class)
-    public ResponseEntity<Object> handleRuntimeException(RuntimeException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("其他未知异常 -> ", exception);
-        }
-
-        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.INTERNAL_SERVER_ERROR.value())
-                        .put("msg", exception.getMessage())
-                        .build());
-    }
-
-    /**
-     * 处理key重复异常。
-     * 返回HTTP响应状态码200,包含错误代码和错误消息。
-     *
-     * @param exception key重复异常
-     * @return 响应数据,包含错误代码和错误消息
-     */
-    @ExceptionHandler(DuplicateKeyException.class)
-    public ResponseEntity<Object> handleDuplicateKeyException(DuplicateKeyException exception) {
-        exception.printStackTrace();
-        if (ObjectUtil.isNotEmpty(exception.getCause())) {
-            log.error("其他未知异常 -> ", exception);
-        }
-        return ResponseEntity.status(HttpStatus.OK)
-                .body(MapUtil.<String, Object>builder()
-                        .put("code", HttpStatus.INTERNAL_SERVER_ERROR.value())
-                        .put("msg", "操作失败,数据重复")
-                        .build());
-    }
-}

+ 0 - 83
kyl/kyl-common/src/main/java/com/kyl/exception/ProjectException.java

@@ -1,83 +0,0 @@
-package com.kyl.exception;
-
-
-import com.kyl.base.IBasicEnum;
-
-/**
- * 自定义异常
- */
-public class ProjectException extends RuntimeException {
-
-    //错误编码
-    private int code;
-
-    //提示信息
-    private String message;
-
-    //异常接口
-    private IBasicEnum basicEnumIntface;
-
-    public ProjectException() {
-
-    }
-    public ProjectException(int code, String message) {
-        this.code = code;
-        this.message = message;
-    }
-
-    public ProjectException(IBasicEnum errorCode) {
-        setBasicMsg(errorCode);
-    }
-
-
-    public ProjectException(IBasicEnum errorCode, String throwMsg) {
-        super(throwMsg);
-        setBasicMsg(errorCode);
-    }
-
-    public ProjectException(IBasicEnum errorCode, Throwable throwable) {
-        super(throwable);
-        setBasicMsg(errorCode);
-    }
-
-
-    private void setBasicMsg(IBasicEnum basicEnumIntface) {
-        this.code = basicEnumIntface.getCode();
-        this.message = basicEnumIntface.getMsg();
-        this.basicEnumIntface = basicEnumIntface;
-    }
-
-    public int getCode() {
-        return code;
-    }
-
-    public void setCode(int code) {
-        this.code = code;
-    }
-
-    @Override
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = message;
-    }
-
-    public IBasicEnum getBasicEnumIntface() {
-        return basicEnumIntface;
-    }
-
-    public void setBasicEnumIntface(IBasicEnum basicEnumIntface) {
-        this.basicEnumIntface = basicEnumIntface;
-    }
-
-    @Override
-    public String toString() {
-        return "ProjectException{" +
-                "code='" + code + '\'' +
-                ", message='" + message + '\'' +
-                ", basicEnumIntface=" + basicEnumIntface +
-                '}';
-    }
-}

+ 0 - 45
kyl/kyl-common/src/main/java/com/kyl/utils/AjaxResultBuild.java

@@ -1,45 +0,0 @@
-package com.kyl.utils;
-
-import com.kyl.base.IBasicEnum;
-import com.kyl.base.ResponseResult;
-import com.kyl.enums.BasicEnum;
-
-import java.util.Date;
-
-/**
- * 构造AjaxResult工具
- */
-public class AjaxResultBuild {
-
-    public static <T> ResponseResult<T> build(IBasicEnum basicEnumIntface, T t){
-
-         //构建对象
-        return ResponseResult.<T>builder()
-            .code(basicEnumIntface.getCode())
-            .msg(basicEnumIntface.getMsg())
-            .operationTime(new Date())
-            .data(t)
-            .build();
-    }
-
-    /**
-     * 公共成功响应方法
-     * @param t
-     * @param <T>
-     * @return
-     */
-    public static <T> ResponseResult<T> successBuild(T t){
-        return AjaxResultBuild.build(BasicEnum.SUCCEED,t);
-    }
-
-    /**
-     * 公共失败响应方法
-     * @param t
-     * @param <T>
-     * @return
-     */
-    public static <T> ResponseResult<T> failedBuild(T t){
-        return AjaxResultBuild.build(BasicEnum.SYSYTEM_FAIL,t);
-    }
-
-}

+ 0 - 69
kyl/kyl-common/src/main/java/com/kyl/utils/AliOSSUtil.java

@@ -1,69 +0,0 @@
-package com.kyl.utils;
-
-import com.aliyun.oss.ClientException;
-import com.aliyun.oss.OSS;
-import com.aliyun.oss.OSSClientBuilder;
-import com.aliyun.oss.OSSException;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-
-import java.io.ByteArrayInputStream;
-
-@Data
-@AllArgsConstructor
-@Slf4j
-public class AliOSSUtil {
-
-    private String endpoint;
-    private String accessKeyId;
-    private String accessKeySecret;
-    private String bucketName;
-
-    /**
-     * 文件上传
-     *
-     * @param bytes
-     * @param objectName
-     * @return
-     */
-    public String upload(byte[] bytes, String objectName) {
-
-        // 创建OSSClient实例。
-        OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
-
-        try {
-            // 创建PutObject请求。
-            ossClient.putObject(bucketName, objectName, new ByteArrayInputStream(bytes));
-        } catch (OSSException oe) {
-            log.error("Caught an OSSException, which means your request made it to OSS, "
-                    + "but was rejected with an error response for some reason.");
-            log.error("Error Message:" + oe.getErrorMessage());
-            log.error("Error Code:" + oe.getErrorCode());
-            log.error("Request ID:" + oe.getRequestId());
-            log.error("Host ID:" + oe.getHostId());
-        } catch (ClientException ce) {
-            log.error("Caught an ClientException, which means the client encountered "
-                    + "a serious internal problem while trying to communicate with OSS, "
-                    + "such as not being able to access the network.");
-            log.error("Error Message:" + ce.getMessage());
-        } finally {
-            if (ossClient != null) {
-                ossClient.shutdown();
-            }
-        }
-
-        //文件访问路径规则 https://BucketName.Endpoint/ObjectName
-        StringBuilder stringBuilder = new StringBuilder("https://");
-        stringBuilder
-                .append(bucketName)
-                .append(".")
-                .append(endpoint)
-                .append("/")
-                .append(objectName);
-
-        log.info("文件上传到:{}", stringBuilder.toString());
-
-        return stringBuilder.toString();
-    }
-}

+ 0 - 104
kyl/kyl-common/src/main/java/com/kyl/utils/BeanConv.java

@@ -1,104 +0,0 @@
-package com.kyl.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import ma.glasnost.orika.MapperFacade;
-import ma.glasnost.orika.MapperFactory;
-import ma.glasnost.orika.MappingContext;
-import ma.glasnost.orika.converter.BidirectionalConverter;
-import ma.glasnost.orika.converter.ConverterFactory;
-import ma.glasnost.orika.impl.DefaultMapperFactory;
-import ma.glasnost.orika.metadata.Type;
-
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.util.ArrayList;
-import java.util.List;
-
-/***
- * 对象转换工具,当对象成员变量属性:名称及类型相同时候会自动填充其值
- */
-@Slf4j
-public class BeanConv {
-
-    private static MapperFacade mapper;
-
-    private static MapperFacade notNullMapper;
-
-    static {
-        MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
-        ConverterFactory converterFactory = mapperFactory.getConverterFactory();
-        converterFactory.registerConverter(new LocalDateTimeConverter());
-        converterFactory.registerConverter(new LocalDateConverter());
-        converterFactory.registerConverter(new LocalTimeConverter());
-        mapper = mapperFactory.getMapperFacade();
-        MapperFactory notNullMapperFactory = new DefaultMapperFactory.Builder().mapNulls(false).build();
-        notNullMapper = notNullMapperFactory.getMapperFacade();
-    }
-
-    private static class LocalDateTimeConverter extends BidirectionalConverter<LocalDateTime, LocalDateTime> {
-
-        @Override
-        public LocalDateTime convertTo(LocalDateTime localDateTime, Type<LocalDateTime> type, MappingContext mappingContext) {
-            return LocalDateTime.from(localDateTime);
-        }
-
-        @Override
-        public LocalDateTime convertFrom(LocalDateTime localDateTime, Type<LocalDateTime> type, MappingContext mappingContext) {
-            return LocalDateTime.from(localDateTime);
-        }
-    }
-    private static class LocalDateConverter extends BidirectionalConverter<LocalDate, LocalDate> {
-        @Override
-        public LocalDate convertTo(LocalDate localDate, Type<LocalDate> type, MappingContext mappingContext) {
-            return LocalDate.from(localDate);
-        }
-
-        @Override
-        public LocalDate convertFrom(LocalDate localDate, Type<LocalDate> type, MappingContext mappingContext) {
-            return LocalDate.from(localDate);
-        }
-    }
-    private static class LocalTimeConverter extends BidirectionalConverter<LocalTime, LocalTime> {
-
-        @Override
-        public LocalTime convertTo(LocalTime localTime, Type<LocalTime> type, MappingContext mappingContext) {
-            return LocalTime.from(localTime);
-        }
-
-        @Override
-        public LocalTime convertFrom(LocalTime localTime, Type<LocalTime> type, MappingContext mappingContext) {
-            return LocalTime.from(localTime);
-        }
-    }
-
-
-    /***
-     *  深度复制对象
-     *
-     * @param source 源对象
-     * @param destinationClass 目标类型
-     * @return
-     */
-    public static <T> T toBean(Object source, Class<T> destinationClass) {
-        if (EmptyUtil.isNullOrEmpty(source)){
-            return null;
-        }
-        return mapper.map(source, destinationClass);
-    }
-
-    /***
-     *  复制List
-     *
-     * @param sourceList 源list对象
-     * @param destinationClass 目标类型
-     * @return
-     */
-    public static <T> List<T> toBeanList(List<?> sourceList, Class<T> destinationClass) {
-        if (EmptyUtil.isNullOrEmpty(sourceList)){
-            return new ArrayList<>();
-        }
-        return mapper.mapAsList(sourceList,destinationClass);
-    }
-
-}

+ 0 - 52
kyl/kyl-common/src/main/java/com/kyl/utils/ClientIpUtil.java

@@ -1,52 +0,0 @@
-package com.kyl.utils;
-
-import com.google.common.net.InetAddresses;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * 请求人的ip
- * @author WanJl
- */
-@Slf4j
-public class ClientIpUtil {
-
-    private static final String HN_CND_SRC_IP = "cdn-src-ip";
-    private static final String HN_X_REAL_IP = "x-real-ip";
-    private static final String HN_X_FORWARDED_FOR = "x-forwarded-for";
-    private static final String SR_IP = ",";
-    private static final String IP_UNKNOWN = "127.0.0.1";
-
-
-    public static String clientIp(HttpServletRequest request) {
-        String ip = null;
-        String cdnSrcIp = RequestUtil.headerValue(request, "cdn-src-ip");
-        String realIp = RequestUtil.headerValue(request, "x-real-ip");
-        String forwardedFor = RequestUtil.headerValue(request, "x-forwarded-for");
-        String remoteAddr = request.getRemoteAddr();
-        log.info("cdnSrcIp:{}, realIp:{}, forwardedFor:{}, remoteAddr:{}", cdnSrcIp, realIp, forwardedFor, remoteAddr);
-        if (StringUtils.isNotBlank(cdnSrcIp)) {
-            ip = ip(cdnSrcIp);
-        } else if (StringUtils.isNotBlank(realIp)) {
-            ip = ip(realIp);
-        } else if (StringUtils.isNotBlank(forwardedFor)) {
-            ip = ip(forwardedFor);
-        } else if (StringUtils.isNotBlank(remoteAddr)) {
-            ip = remoteAddr;
-        }
-
-        ip = ipValid(ip) ? ip : "127.0.0.1";
-        log.debug("client_ip:{}", ip);
-        return ip;
-    }
-
-    private static String ip(String ips) {
-        return StringUtils.split(ips, ",")[0];
-    }
-
-    private static boolean ipValid(String ip) {
-        return StringUtils.isNotBlank(ip) && InetAddresses.isInetAddress(ip);
-    }
-}

+ 0 - 60
kyl/kyl-common/src/main/java/com/kyl/utils/CodeUtil.java

@@ -1,60 +0,0 @@
-package com.kyl.utils;
-
-import cn.hutool.core.date.LocalDateTimeUtil;
-import org.springframework.data.redis.core.RedisTemplate;
-
-import java.time.LocalDateTime;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author WanJl
- */
-public class CodeUtil {
-
-    /**
-     * code生成
-     * 样例:TZ 20230630 1010 0001
-     *
-     * @param prefix        code前缀  比如:退住(TZ)、合同(HT)
-     * @param redisTemplate code后四位根据redis自增生成
-     * @param expire        生成自增后的失效时间,
-     * @return  code码
-     */
-    public static String generateCode(String prefix, RedisTemplate<String,String> redisTemplate, long expire) {
-        String dateStr = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmmss");
-        String code = prefix + dateStr;
-        Long increment = redisTemplate.boundValueOps(code).increment();
-        //设置过期时间
-        if(expire == 0) {
-            expire = 5;
-        }
-        redisTemplate.expire(code, expire, TimeUnit.SECONDS);
-        //最终生成的code吗
-        return code += increment;
-    }
-
-    /**
-     * 生成具有给定前缀和时间戳的编码。
-     *
-     * @param prefix        编码前缀,例如 "TZ" 表示退住或 "HT" 表示合同。
-     * @param redisTemplate 用于生成代码末尾四位数字的 Redis 模板。
-     * @param expireSeconds 生成的编码的过期时间(秒)。
-     * @return 生成的编码。
-     */
-    public static String generateCode2(String prefix, RedisTemplate<String, String> redisTemplate, long expireSeconds) {
-        String dateStr = LocalDateTimeUtil.format(LocalDateTime.now(), "yyyyMMddHHmmss");
-        String code = prefix + dateStr;
-
-        // 从 Redis 中递增并获取编码的值,使其唯一。
-        Long increment = redisTemplate.boundValueOps(code).increment();
-
-        // 设置编码在 Redis 中的过期时间。
-        if (expireSeconds <= 0) {
-            expireSeconds = 5; // 如果未提供,默认过期时间为 5 秒。
-        }
-        redisTemplate.expire(code, expireSeconds, TimeUnit.SECONDS);
-
-        // 最终带有递增值的编码。
-        return code + increment;
-    }
-}

+ 0 - 18
kyl/kyl-common/src/main/java/com/kyl/utils/ConvertHandler.java

@@ -1,18 +0,0 @@
-package com.kyl.utils;
-
-
-/**
- * @author WanJl
- * @version 1.0
- * @title ConvertHandler
- * @description 特殊类型转换器
- * @create 2024/12/25
- */
-public interface ConvertHandler<O, T> {
-    /**
-     * 特殊对象类型转换
-     * @param originObject 源对象
-     * @param targetObject 目标对象
-     */
-    void map(O originObject, T targetObject);
-}

+ 0 - 124
kyl/kyl-common/src/main/java/com/kyl/utils/EmptyUtil.java

@@ -1,124 +0,0 @@
-package com.kyl.utils;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 判断对象是否为空的工具类
- */
-public abstract class EmptyUtil {
-
-	/***
-	 * 对string字符串是否为空判断
-	 *
-	 * @param str 被判定字符串
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(String str) {
-		if (str == null || "".equals(str.trim()) || "null".equalsIgnoreCase(str.trim()) || "undefined".equalsIgnoreCase(str.trim())) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/***
-	 *  对于StringBuffer类型的非空判断
-	 *
-	 * @param str 被判定StringBuffer
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(StringBuffer str) {
-		return (str == null || str.length() == 0);
-	}
-
-	/***
-	 *  对于string数组类型的非空判断
-	 *
-	 * @param str 被判定字符串数组
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(String[] str) {
-		if (str == null || str.length == 0) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/***
-	 *  对于Object类型的非空判断
-	 *
-	 * @param obj 被判定对象
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(Object obj) {
-		if (obj == null || "".equals(obj)) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/***
-	 *  对于Object数组类型的非空判断
-	 *
-	 * @param obj 被判定对象数组
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(Object[] obj) {
-		if (obj == null || obj.length == 0) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/***
-	 *  对于Collection类型的非空判断
-	 *
-	 * @param collection 被判定Collection类型对象
-	 * @return
-	 */
-	public static boolean isNullOrEmpty(Collection collection) {
-		if (collection == null || collection.isEmpty()) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/**
-	 * @方法名:对于Map类型的非空判断
-	 * @功能说明:对于Map类型的非空判断
-	 * @return boolean true-为空,false-不为空
-	 * @throws
-	 */
-	@SuppressWarnings("rawtypes")
-	public static boolean isNullOrEmpty( Map map) {
-		if (map == null || map.isEmpty()) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	/**
-	 *
-	 * @方法名:removeNullUnit
-	 * @功能说明: 删除集合中的空元素
-	 * @return
-	 */
-	public static <T> List<T> removeNullUnit(List<T> xllxList) {
-		List<T> need = new ArrayList<T>();
-		for (int i = 0; i < xllxList.size(); i++) {
-			if (!isNullOrEmpty(xllxList.get(i))) {
-				need.add(xllxList.get(i));
-			}
-		}
-		return need;
-	}
-
-}

+ 0 - 81
kyl/kyl-common/src/main/java/com/kyl/utils/ExceptionsUtil.java

@@ -1,81 +0,0 @@
-package com.kyl.utils;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- *  异常转换工具
- */
-public class ExceptionsUtil {
-
-	/**
-	 *
-	 * <b>方法名:</b>:unchecked<br>
-	 * <b>功能说明:</b>:将CheckedException转换为UncheckedException.<br>
-	 */
-	public static RuntimeException unchecked(Exception e) {
-		if (e instanceof RuntimeException) {
-			return (RuntimeException) e;
-		} else {
-			return new RuntimeException(e);
-		}
-	}
-
-	/**
-	 *
-	 * <b>方法名:</b>:getStackTraceAsString<br>
-	 * <b>功能说明:</b>:将ErrorStack转化为String<br>
-	 */
-	public static String getStackTraceAsString(Exception e) {
-		StringWriter stringWriter = new StringWriter();
-		e.printStackTrace(new PrintWriter(stringWriter));
-		return stringWriter.toString();
-	}
-
-	/**
-	 *
-	 * <b>方法名:</b>:getErrorMessageWithNestedException<br>
-	 * <b>功能说明:</b>:获取组合本异常信息与底层异常信息的异常描述, 适用于本异常为统一包装异常类,底层异常才是根本原因的情况<br>
-	 */
-	public static String getErrorMessageWithNestedException(Exception e) {
-		Throwable nestedException = e.getCause();
-		return new StringBuilder().append(e.getMessage()).append(" nested exception is ")
-				.append(nestedException.getClass().getName()).append(":").append(nestedException.getMessage())
-				.toString();
-	}
-
-	/**
-	 *
-	 * <b>方法名:</b>:isCausedBy<br>
-	 * <b>功能说明:</b>:判断异常是否由某些底层的异常引起<br>
-	 */
-	public static boolean isCausedBy(Exception ex, @SuppressWarnings("unchecked") Class<? extends Exception>... causeExceptionClasses) {
-		Throwable cause = ex;
-		while (cause != null) {
-			for (Class<? extends Exception> causeClass : causeExceptionClasses) {
-				if (causeClass.isInstance(cause)) {
-					return true;
-				}
-			}
-			cause = cause.getCause();
-		}
-		return false;
-	}
-
-	/**
-	 *
-	 * <b>方法名:</b>:convertReflectionExceptionToUnchecked<br>
-	 * <b>功能说明:</b>:将反射时的checked exception转换为unchecked exception.<br>
-	 */
-	public static RuntimeException convertReflectionExceptionToUnchecked(Exception e) {
-		if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException || e instanceof NoSuchMethodException) {
-			return new IllegalArgumentException("Reflection Exception.", e);
-		} else if (e instanceof InvocationTargetException) {
-			return new RuntimeException("Reflection Exception.", ((InvocationTargetException) e).getTargetException());
-		} else if (e instanceof RuntimeException) {
-			return (RuntimeException) e;
-		}
-		return new RuntimeException("Unexpected Checked Exception.", e);
-	}
-}

+ 0 - 92
kyl/kyl-common/src/main/java/com/kyl/utils/HttpStatus.java

@@ -1,92 +0,0 @@
-package com.kyl.utils;
-
-
-/**
- * @author WanJl
- * @version 1.0
- * @title HttpStatus
- * @description 状态码
- * @create 2024/12/25
- */
-public class HttpStatus {
-    /**
-     * 操作成功
-     */
-    public static final int SUCCESS = 200;
-
-    /**
-     * 对象创建成功
-     */
-    public static final int CREATED = 201;
-
-    /**
-     * 请求已经被接受
-     */
-    public static final int ACCEPTED = 202;
-
-    /**
-     * 操作已经执行成功,但是没有返回数据
-     */
-    public static final int NO_CONTENT = 204;
-
-    /**
-     * 资源已被移除
-     */
-    public static final int MOVED_PERM = 301;
-
-    /**
-     * 重定向
-     */
-    public static final int SEE_OTHER = 303;
-
-    /**
-     * 资源没有被修改
-     */
-    public static final int NOT_MODIFIED = 304;
-
-    /**
-     * 参数列表错误(缺少,格式不匹配)
-     */
-    public static final int BAD_REQUEST = 400;
-
-    /**
-     * 未授权
-     */
-    public static final int UNAUTHORIZED = 401;
-
-    /**
-     * 访问受限,授权过期
-     */
-    public static final int FORBIDDEN = 403;
-
-    /**
-     * 资源,服务未找到
-     */
-    public static final int NOT_FOUND = 404;
-
-    /**
-     * 不允许的http方法
-     */
-    public static final int BAD_METHOD = 405;
-
-    /**
-     * 资源冲突,或者资源被锁
-     */
-    public static final int CONFLICT = 409;
-
-    /**
-     * 不支持的数据,媒体类型
-     */
-    public static final int UNSUPPORTED_TYPE = 415;
-
-    /**
-     * 系统内部错误
-     */
-    public static final int ERROR = 500;
-
-    /**
-     * 接口未实现
-     */
-    public static final int NOT_IMPLEMENTED = 501;
-}
-

+ 0 - 62
kyl/kyl-common/src/main/java/com/kyl/utils/JwtUtil.java

@@ -1,62 +0,0 @@
-package com.kyl.utils;
-
-import cn.hutool.core.date.DateField;
-import cn.hutool.core.date.DateUtil;
-import io.jsonwebtoken.Claims;
-import io.jsonwebtoken.JwtBuilder;
-import io.jsonwebtoken.Jwts;
-import io.jsonwebtoken.SignatureAlgorithm;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Date;
-import java.util.Map;
-
-public class JwtUtil {
-    /**
-     * 生成jwt
-     * 使用Hs256算法, 私匙使用固定秘钥
-     *
-     * @param secretKey jwt秘钥
-     * @param dateOffset jwt过期时间(小时)
-     * @param claims    设置的信息
-     * @return
-     */
-    public static String createJWT(String secretKey , int dateOffset, Map<String, Object> claims) {
-        // 指定签名的时候使用的签名算法,也就是header那部分
-        SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;
-
-        // 设置jwt的body
-        JwtBuilder builder = Jwts.builder()
-                // 如果有私有声明,一定要先设置这个自己创建的私有的声明,这个是给builder的claim赋值,一旦写在标准的声明赋值之后,就是覆盖了那些标准的声明的
-                .setClaims(claims)
-                // 设置签名使用的签名算法和签名使用的秘钥
-                .signWith(signatureAlgorithm, secretKey.getBytes(StandardCharsets.UTF_8))
-                // 设置过期时间
-                .setExpiration(DateUtil.offset(new Date(), DateField.HOUR_OF_DAY, dateOffset));
-
-        return builder.compact();
-    }
-
-    /**
-     * Token解密
-     *
-     * @param secretKey jwt秘钥 此秘钥一定要保留好在服务端, 不能暴露出去, 否则sign就可以被伪造, 如果对接多个客户端建议改造成多个
-     * @param token     加密后的token
-     * @return
-     */
-    public static Claims parseJWT(String secretKey, String token) {
-        try {
-            // 得到DefaultJwtParser
-            Claims claims = Jwts.parser()
-                    // 设置签名的秘钥
-                    .setSigningKey(secretKey.getBytes(StandardCharsets.UTF_8))
-                    // 设置需要解析的jwt
-                    .parseClaimsJws(token).getBody();
-            return claims;
-        } catch (Exception e) {
-//            throw new AccessDeniedException("没有权限,请登录");
-            throw new RuntimeException("没有权限,请登录");
-        }
-    }
-
-}

+ 0 - 74
kyl/kyl-common/src/main/java/com/kyl/utils/NoProcessing.java

@@ -1,74 +0,0 @@
-package com.kyl.utils;
-
-/**
- *  工具类补全
- */
-public class NoProcessing {
-
-    /***
-     *  处理补全编号,所有编号都是15位,共5层,每层关系如下:
-     * 第一层:100000000000000
-     * 第二层:100001000000000
-     * 第三层:100001001000000
-     * 第四层:100001001001000
-     * 第五层:100001001001001
-     * @param input 如果为001000000000000处理完成后则变为001
-     * @return
- * @return: java.lang.String
-     */
-    public static String processString(String input) {
-        int step = input.length() / 3;
-        for (int i =0;i<step;i++ ){
-            String targetString = input.substring(input.length()-3,input.length());
-            if ("000".equals(targetString)){
-                input = input.substring(0,input.length()-3);
-            }else {
-                break;
-            }
-        }
-        return input;
-    }
-
-    public static void main(String[] args) {
-//        String input = "100001001001000";
-        String input = "100000000000000";
-        String processedString = createNo(input,false);
-        System.out.println(processedString);
-    }
-
-    /***
-     *  生产层级编号
-     * @param input 输入编号
-     * @param peerNode 是否下属节点
-     * @return
-     * @return: java.lang.String
-     */
-    public static String createNo(String input,boolean peerNode) {
-        int step = input.length() / 3;
-        int supplement = 0;
-        for (int i =0;i<step;i++ ){
-            String targetString = input.substring(input.length()-3,input.length());
-            if ("000".equals(targetString)){
-                input = input.substring(0,input.length()-3);
-                supplement++;
-            }else {
-                break;
-            }
-        }
-        if (peerNode){
-            input = String.valueOf(Long.valueOf(input) + 1L);
-            for (int i =0;i<supplement;i++ ){
-                input = input+"000";
-            }
-        }else {
-            input = String.valueOf(Long.valueOf(input+"001"));
-            for (int i =0;i<supplement-1;i++ ){
-                input = input+"000";
-            }
-        }
-        return input;
-    }
-
-
-
-}

+ 0 - 30
kyl/kyl-common/src/main/java/com/kyl/utils/ObjectUtil.java

@@ -1,30 +0,0 @@
-package com.kyl.utils;
-
-import cn.hutool.core.util.ArrayUtil;
-
-/**
- * 扩展hutool中的方法
- */
-public class ObjectUtil extends cn.hutool.core.util.ObjectUtil {
-
-    /**
-     * 给定对象是否与提供的中任一对象相同,相同则返回{@code true},没有相同的返回{@code false}<br>
-     * 如果参与比对的对象列表为空,返回{@code false}
-     *
-     * @param obj1 给定需要检查的对象
-     * @param objs 需要参与比对的对象列表
-     * @return 是否相同
-     */
-    public static boolean equalsAny(Object obj1, Object... objs) {
-        if (ArrayUtil.isEmpty(objs)) {
-            return false;
-        }
-        for (Object obj : objs) {
-            if (cn.hutool.core.util.ObjectUtil.equal(obj1, obj)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}

+ 0 - 56
kyl/kyl-common/src/main/java/com/kyl/utils/RegisterBeanHandler.java

@@ -1,56 +0,0 @@
-package com.kyl.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.stereotype.Component;
-
-/**
- * IOC工厂处理工具
- */
-@Slf4j
-@Component
-public class RegisterBeanHandler {
-
-    ConfigurableApplicationContext configurableApplicationContext;
-
-    @Autowired
-    public RegisterBeanHandler(ConfigurableApplicationContext configurableApplicationContext) {
-        this.configurableApplicationContext = configurableApplicationContext;
-    }
-
-    /**
-     * 注册bean
-     * @param beanName bean的id
-     * @param bean 实现类
-     */
-    public <T> void registerBean(String beanName, T bean) {
-        // 将bean对象注册到bean工厂
-        configurableApplicationContext.getBeanFactory().registerSingleton(beanName, bean);
-    }
-
-    /**
-     * 移除bean
-     * @param beanName bean的id
-     */
-    public void unregisterBean(String beanName){
-        ((DefaultListableBeanFactory) configurableApplicationContext.getBeanFactory()).removeBeanDefinition(beanName);
-    }
-
-    /**
-     * 获得bean
-     * @param beanName bean的id
-     */
-    public <T> T getBean(String beanName, Class<T> t) {
-        return configurableApplicationContext.getBean(beanName,t);
-    }
-
-    /**
-     * bean是否存在
-     * @param beanName bean的id
-     */
-    public boolean containsBean(String beanName) {
-        return configurableApplicationContext.containsBean(beanName);
-    }
-}

+ 0 - 23
kyl/kyl-common/src/main/java/com/kyl/utils/RequestUtil.java

@@ -1,23 +0,0 @@
-package com.kyl.utils;
-
-import lombok.extern.slf4j.Slf4j;
-
-import javax.servlet.http.HttpServletRequest;
-
-@Slf4j
-public class RequestUtil {
-
-    private static final String HN_REFERER = "referer";
-
-    public static String headerValue(HttpServletRequest request, String name) {
-        return request.getHeader(name);
-    }
-
-    public static String parameterValue(HttpServletRequest request, String name) {
-        return request.getParameter(name);
-    }
-
-    public static String referer(HttpServletRequest request) {
-        return request.getHeader("referer");
-    }
-}

+ 0 - 126
kyl/kyl-common/src/main/java/com/kyl/utils/SnowflakeIdWorker.java

@@ -1,126 +0,0 @@
-package com.kyl.utils;
-
-/**
- *
- */
-public class SnowflakeIdWorker {
-    // ==============================Fields===========================================
-    /** 开始时间截 (2020-08-28) */
-    private final long twepoch = 1598598185157L;
-
-    /** 机器id所占的位数 */
-    private final long workerIdBits = 5L;
-
-    /** 数据标识id所占的位数 */
-    private final long datacenterIdBits = 5L;
-
-    /** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */
-    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
-
-    /** 支持的最大数据标识id,结果是31 */
-    private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
-
-    /** 序列在id中占的位数 */
-    private final long sequenceBits = 12L;
-
-    /** 机器ID向左移12位 */
-    private final long workerIdShift = sequenceBits;
-
-    /** 数据标识id向左移17位(12+5) */
-    private final long datacenterIdShift = sequenceBits + workerIdBits;
-
-    /** 时间截向左移22位(5+5+12) */
-    private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
-
-    /** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */
-    private final long sequenceMask = -1L ^ (-1L << sequenceBits);
-
-    /** 工作机器ID(0~31) */
-    private long workerId =1;
-
-    /** 数据中心ID(0~31) */
-    private long datacenterId;
-
-    /** 毫秒内序列(0~4095) */
-    private long sequence = 0L;
-
-    /** 上次生成ID的时间截 */
-    private long lastTimestamp = -1L;
-
-    //==============================Constructors=====================================
-    /**
-     * 构造函数
-     * @param workerId 工作ID (0~31)
-     * @param datacenterId 数据中心ID (0~31)
-     */
-    public SnowflakeIdWorker(long workerId, long datacenterId) {
-        if (workerId > maxWorkerId || workerId < 0) {
-            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
-        }
-        if (datacenterId > maxDatacenterId || datacenterId < 0) {
-            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
-        }
-        this.workerId = workerId;
-        this.datacenterId = datacenterId;
-    }
-
-    // ==============================Methods==========================================
-    /**
-     * 获得下一个ID (该方法是线程安全的)
-     * @return SnowflakeId
-     */
-    public synchronized long nextId() {
-        long timestamp = timeGen();
-
-        //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
-        if (timestamp < lastTimestamp) {
-            throw new RuntimeException(
-                    String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
-        }
-
-        //分表节点数
-        sequence = (int)(Math.random()*3);
-
-        //上次生成ID的时间截
-        lastTimestamp = timestamp;
-
-        //移位并通过或运算拼到一起组成64位的ID
-         long id = ((timestamp - twepoch) << timestampLeftShift) //
-                | (datacenterId << datacenterIdShift) //
-                | (workerId << workerIdShift) //
-                | sequence;
-        return id;
-    }
-
-    /**
-     * 阻塞到下一个毫秒,直到获得新的时间戳
-     * @param lastTimestamp 上次生成ID的时间截
-     * @return 当前时间戳
-     */
-    protected long tilNextMillis(long lastTimestamp) {
-        long timestamp = timeGen();
-        while (timestamp <= lastTimestamp) {
-            timestamp = timeGen();
-        }
-        return timestamp;
-    }
-
-    /**
-     * 返回以毫秒为单位的当前时间
-     * @return 当前时间(毫秒)
-     */
-    protected long timeGen() {
-        return System.currentTimeMillis();
-    }
-
-    //==============================Test=============================================
-    /** 测试 */
-    public static void main(String[] args) throws InterruptedException {
-        SnowflakeIdWorker idWorker = new SnowflakeIdWorker(1, 1);
-        for (int i = 0; i < 1000; i++) {
-            long id = idWorker.nextId();
-            Thread.sleep(1);
-            System.out.println(id);
-        }
-    }
-}

+ 0 - 385
kyl/kyl-common/src/main/java/com/kyl/utils/StringUtils.java

@@ -1,385 +0,0 @@
-package com.kyl.utils;
-
-
-import org.apache.commons.lang3.RandomStringUtils;
-
-import java.util.*;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title StringUtils
- * @description 字符串工具类
- * @create 2024/12/25
- */
-public class StringUtils extends org.apache.commons.lang3.StringUtils {
-
-    /**
-     * 空字符串
-     */
-    private static final String NULLSTR = "";
-
-    /**
-     * 下划线
-     */
-    private static final char SEPARATOR = '_';
-
-    /**
-     * 获取参数不为空值
-     *
-     * @param value defaultValue 要判断的value
-     * @return value 返回值
-     */
-    public static <T> T nvl(T value, T defaultValue) {
-        return value != null ? value : defaultValue;
-    }
-
-    /**
-     * * 判断一个Collection是否为空, 包含List,Set,Queue
-     *
-     * @param coll 要判断的Collection
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Collection<?> coll) {
-        return isNull(coll) || coll.isEmpty();
-    }
-
-    /**
-     * * 判断一个Collection是否非空,包含List,Set,Queue
-     *
-     * @param coll 要判断的Collection
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Collection<?> coll) {
-        return !isEmpty(coll);
-    }
-
-    /**
-     * * 判断一个对象数组是否为空
-     *
-     * @param objects 要判断的对象数组
-     *                * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Object[] objects) {
-        return isNull(objects) || (objects.length == 0);
-    }
-
-    /**
-     * * 判断一个对象数组是否非空
-     *
-     * @param objects 要判断的对象数组
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Object[] objects) {
-        return !isEmpty(objects);
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     *
-     * @param map 要判断的Map
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(Map<?, ?> map) {
-        return isNull(map) || map.isEmpty();
-    }
-
-    /**
-     * * 判断一个Map是否为空
-     *
-     * @param map 要判断的Map
-     * @return true:非空 false:空
-     */
-    public static boolean isNotEmpty(Map<?, ?> map) {
-        return !isEmpty(map);
-    }
-
-    /**
-     * * 判断一个字符串是否为空串
-     *
-     * @param str String
-     * @return true:为空 false:非空
-     */
-    public static boolean isEmpty(String str) {
-        return isNull(str) || NULLSTR.equals(str.trim());
-    }
-
-    /**
-     * * 判断一个字符串是否为非空串
-     *
-     * @param str String
-     * @return true:非空串 false:空串
-     */
-    public static boolean isNotEmpty(String str) {
-        return !isEmpty(str);
-    }
-
-    /**
-     * * 判断一个对象是否为空
-     *
-     * @param object Object
-     * @return true:为空 false:非空
-     */
-    public static boolean isNull(Object object) {
-        return object == null;
-    }
-
-    /**
-     * * 判断一个对象是否非空
-     *
-     * @param object Object
-     * @return true:非空 false:空
-     */
-    public static boolean isNotNull(Object object) {
-        return !isNull(object);
-    }
-
-    /**
-     * * 判断一个对象是否是数组类型(Java基本型别的数组)
-     *
-     * @param object 对象
-     * @return true:是数组 false:不是数组
-     */
-    public static boolean isArray(Object object) {
-        return isNotNull(object) && object.getClass().isArray();
-    }
-
-    /**
-     * 去空格
-     */
-    public static String trim(String str) {
-        return (str == null ? "" : str.trim());
-    }
-
-    /**
-     * 截取字符串
-     *
-     * @param str   字符串
-     * @param start 开始
-     * @return 结果
-     */
-    public static String substring(final String str, int start) {
-        if (str == null) {
-            return NULLSTR;
-        }
-
-        if (start < 0) {
-            start = str.length() + start;
-        }
-
-        if (start < 0) {
-            start = 0;
-        }
-        if (start > str.length()) {
-            return NULLSTR;
-        }
-
-        return str.substring(start);
-    }
-
-    /**
-     * 截取字符串
-     *
-     * @param str   字符串
-     * @param start 开始
-     * @param end   结束
-     * @return 结果
-     */
-    public static String substring(final String str, int start, int end) {
-        if (str == null) {
-            return NULLSTR;
-        }
-
-        if (end < 0) {
-            end = str.length() + end;
-        }
-        if (start < 0) {
-            start = str.length() + start;
-        }
-
-        if (end > str.length()) {
-            end = str.length();
-        }
-
-        if (start > end) {
-            return NULLSTR;
-        }
-
-        if (start < 0) {
-            start = 0;
-        }
-        if (end < 0) {
-            end = 0;
-        }
-
-        return str.substring(start, end);
-    }
-
-
-    /**
-     * 字符串转set
-     *
-     * @param str 字符串
-     * @param sep 分隔符
-     * @return set集合
-     */
-    public static final Set<String> str2Set(String str, String sep) {
-        return new HashSet<String>(str2List(str, sep, true, false));
-    }
-
-    /**
-     * 字符串转list
-     *
-     * @param str         字符串
-     * @param sep         分隔符
-     * @param filterBlank 过滤纯空白
-     * @param trim        去掉首尾空白
-     * @return list集合
-     */
-    public static final List<String> str2List(String str, String sep, boolean filterBlank, boolean trim) {
-        List<String> list = new ArrayList<String>();
-        if (StringUtils.isEmpty(str)) {
-            return list;
-        }
-
-        // 过滤空白字符串
-        if (filterBlank && StringUtils.isBlank(str)) {
-            return list;
-        }
-        String[] split = str.split(sep);
-        for (String string : split) {
-            if (filterBlank && StringUtils.isBlank(string)) {
-                continue;
-            }
-            if (trim) {
-                string = string.trim();
-            }
-            list.add(string);
-        }
-
-        return list;
-    }
-
-    /**
-     * 下划线转驼峰命名
-     */
-    public static String toUnderScoreCase(String str) {
-        if (str == null) {
-            return null;
-        }
-        StringBuilder sb = new StringBuilder();
-        // 前置字符是否大写
-        boolean preCharIsUpperCase = true;
-        // 当前字符是否大写
-        boolean curreCharIsUpperCase = true;
-        // 下一字符是否大写
-        boolean nexteCharIsUpperCase = true;
-        for (int i = 0; i < str.length(); i++) {
-            char c = str.charAt(i);
-            if (i > 0) {
-                preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
-            } else {
-                preCharIsUpperCase = false;
-            }
-
-            curreCharIsUpperCase = Character.isUpperCase(c);
-
-            if (i < (str.length() - 1)) {
-                nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
-            }
-
-            if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
-                sb.append(SEPARATOR);
-            } else if ((i != 0 && !preCharIsUpperCase) && curreCharIsUpperCase) {
-                sb.append(SEPARATOR);
-            }
-            sb.append(Character.toLowerCase(c));
-        }
-
-        return sb.toString();
-    }
-
-    /**
-     * 是否包含字符串
-     *
-     * @param str  验证字符串
-     * @param strs 字符串组
-     * @return 包含返回true
-     */
-    public static boolean inStringIgnoreCase(String str, String... strs) {
-        if (str != null && strs != null) {
-            for (String s : strs) {
-                if (str.equalsIgnoreCase(trim(s))) {
-                    return true;
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
-     *
-     * @param name 转换前的下划线大写方式命名的字符串
-     * @return 转换后的驼峰式命名的字符串
-     */
-    public static String convertToCamelCase(String name) {
-        StringBuilder result = new StringBuilder();
-        // 快速检查
-        if (name == null || name.isEmpty()) {
-            // 没必要转换
-            return "";
-        } else if (!name.contains("_")) {
-            // 不含下划线,仅将首字母大写
-            return name.substring(0, 1).toUpperCase() + name.substring(1);
-        }
-        // 用下划线将原始字符串分割
-        String[] camels = name.split("_");
-        for (String camel : camels) {
-            // 跳过原始字符串中开头、结尾的下换线或双重下划线
-            if (camel.isEmpty()) {
-                continue;
-            }
-            // 首字母大写
-            result.append(camel.substring(0, 1).toUpperCase());
-            result.append(camel.substring(1).toLowerCase());
-        }
-        return result.toString();
-    }
-
-    /**
-     * 驼峰式命名法 例如:user_name->userName
-     */
-    public static String toCamelCase(String s) {
-        if (s == null) {
-            return null;
-        }
-        s = s.toLowerCase();
-        StringBuilder sb = new StringBuilder(s.length());
-        boolean upperCase = false;
-        for (int i = 0; i < s.length(); i++) {
-            char c = s.charAt(i);
-
-            if (c == SEPARATOR) {
-                upperCase = true;
-            } else if (upperCase) {
-                sb.append(Character.toUpperCase(c));
-                upperCase = false;
-            } else {
-                sb.append(c);
-            }
-        }
-        return sb.toString();
-    }
-
-    @SuppressWarnings("unchecked")
-    public static <T> T cast(Object obj) {
-        return (T) obj;
-    }
-
-    public static String getRandom(int weight) {
-        return RandomStringUtils.random(weight,
-                new char[]{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 's',
-                        't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9'});
-    }
-}

+ 0 - 439
kyl/kyl-common/src/main/java/com/kyl/utils/UUID.java

@@ -1,439 +0,0 @@
-package com.kyl.utils;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.Random;
-import java.util.concurrent.ThreadLocalRandom;
-
-
-/**
- * 提供通用唯一识别码(universally unique identifier)(UUID)实现
- * @author WanJl
- **/
-public final class UUID implements java.io.Serializable, Comparable<UUID> {
-    private static final long serialVersionUID = -1185015143654744140L;
-
-    /**
-     * SecureRandom 的单例
-     */
-    private static class Holder {
-        static final SecureRandom numberGenerator = getSecureRandom();
-    }
-
-    /**
-     * 此UUID的最高64有效位
-     */
-    private final long mostSigBits;
-
-    /**
-     * 此UUID的最低64有效位
-     */
-    private final long leastSigBits;
-
-    /**
-     * 私有构造
-     *
-     * @param data 数据
-     */
-    private UUID(byte[] data) {
-        long msb = 0;
-        long lsb = 0;
-        assert data.length == 16 : "data must be 16 bytes in length";
-        for (int i = 0; i < 8; i++) {
-            msb = (msb << 8) | (data[i] & 0xff);
-        }
-        for (int i = 8; i < 16; i++) {
-            lsb = (lsb << 8) | (data[i] & 0xff);
-        }
-        this.mostSigBits = msb;
-        this.leastSigBits = lsb;
-    }
-
-    /**
-     * 使用指定的数据构造新的 UUID。
-     *
-     * @param mostSigBits  用于 {@code UUID} 的最高有效 64 位
-     * @param leastSigBits 用于 {@code UUID} 的最低有效 64 位
-     */
-    public UUID(long mostSigBits, long leastSigBits) {
-        this.mostSigBits = mostSigBits;
-        this.leastSigBits = leastSigBits;
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。
-     *
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID fastUUID() {
-        return randomUUID(false);
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
-     *
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID randomUUID() {
-        return randomUUID(true);
-    }
-
-    /**
-     * 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
-     *
-     * @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能
-     * @return 随机生成的 {@code UUID}
-     */
-    public static UUID randomUUID(boolean isSecure) {
-        final Random ng = isSecure ? Holder.numberGenerator : getRandom();
-
-        byte[] randomBytes = new byte[16];
-        ng.nextBytes(randomBytes);
-        randomBytes[6] &= 0x0f; /* clear version */
-        randomBytes[6] |= 0x40; /* set to version 4 */
-        randomBytes[8] &= 0x3f; /* clear variant */
-        randomBytes[8] |= 0x80; /* set to IETF variant */
-        return new UUID(randomBytes);
-    }
-
-    /**
-     * 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。
-     *
-     * @param name 用于构造 UUID 的字节数组。
-     * @return 根据指定数组生成的 {@code UUID}
-     */
-    public static UUID nameUUIDFromBytes(byte[] name) {
-        MessageDigest md;
-        try {
-            md = MessageDigest.getInstance("MD5");
-        } catch (NoSuchAlgorithmException nsae) {
-            throw new InternalError("MD5 not supported");
-        }
-        byte[] md5Bytes = md.digest(name);
-        md5Bytes[6] &= 0x0f; /* clear version */
-        md5Bytes[6] |= 0x30; /* set to version 3 */
-        md5Bytes[8] &= 0x3f; /* clear variant */
-        md5Bytes[8] |= 0x80; /* set to IETF variant */
-        return new UUID(md5Bytes);
-    }
-
-    /**
-     * 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。
-     *
-     * @param name 指定 {@code UUID} 字符串
-     * @return 具有指定值的 {@code UUID}
-     * @throws IllegalArgumentException 如果 name 与 {@link #toString} 中描述的字符串表示形式不符抛出此异常
-     */
-    public static UUID fromString(String name) {
-        String[] components = name.split("-");
-        if (components.length != 5) {
-            throw new IllegalArgumentException("Invalid UUID string: " + name);
-        }
-        for (int i = 0; i < 5; i++) {
-            components[i] = "0x" + components[i];
-        }
-
-        long mostSigBits = Long.decode(components[0]).longValue();
-        mostSigBits <<= 16;
-        mostSigBits |= Long.decode(components[1]).longValue();
-        mostSigBits <<= 16;
-        mostSigBits |= Long.decode(components[2]).longValue();
-
-        long leastSigBits = Long.decode(components[3]).longValue();
-        leastSigBits <<= 48;
-        leastSigBits |= Long.decode(components[4]).longValue();
-
-        return new UUID(mostSigBits, leastSigBits);
-    }
-
-    /**
-     * 返回此 UUID 的 128 位值中的最低有效 64 位。
-     *
-     * @return 此 UUID 的 128 位值中的最低有效 64 位。
-     */
-    public long getLeastSignificantBits() {
-        return leastSigBits;
-    }
-
-    /**
-     * 返回此 UUID 的 128 位值中的最高有效 64 位。
-     *
-     * @return 此 UUID 的 128 位值中最高有效 64 位。
-     */
-    public long getMostSignificantBits() {
-        return mostSigBits;
-    }
-
-    /**
-     * 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。
-     * <p>
-     * 版本号具有以下含意:
-     * <ul>
-     * <li>1 基于时间的 UUID
-     * <li>2 DCE 安全 UUID
-     * <li>3 基于名称的 UUID
-     * <li>4 随机生成的 UUID
-     * </ul>
-     *
-     * @return 此 {@code UUID} 的版本号
-     */
-    public int version() {
-        // Version is bits masked by 0x000000000000F000 in MS long
-        return (int) ((mostSigBits >> 12) & 0x0f);
-    }
-
-    /**
-     * 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。
-     * <p>
-     * 变体号具有以下含意:
-     * <ul>
-     * <li>0 为 NCS 向后兼容保留
-     * <li>2 <a href="http://www.ietf.org/rfc/rfc4122.txt">IETF&nbsp;RFC&nbsp;4122</a>(Leach-Salz), 用于此类
-     * <li>6 保留,微软向后兼容
-     * <li>7 保留供以后定义使用
-     * </ul>
-     *
-     * @return 此 {@code UUID} 相关联的变体号
-     */
-    public int variant() {
-        // This field is composed of a varying number of bits.
-        // 0 - - Reserved for NCS backward compatibility
-        // 1 0 - The IETF aka Leach-Salz variant (used by this class)
-        // 1 1 0 Reserved, Microsoft backward compatibility
-        // 1 1 1 Reserved for future definition.
-        return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63));
-    }
-
-    /**
-     * 与此 UUID 相关联的时间戳值。
-     *
-     * <p>
-     * 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。<br>
-     * 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。
-     *
-     * <p>
-     * 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
-     * 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
-     *
-     * @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。
-     */
-    public long timestamp() throws UnsupportedOperationException {
-        checkTimeBase();
-        return (mostSigBits & 0x0FFFL) << 48//
-                | ((mostSigBits >> 16) & 0x0FFFFL) << 32//
-                | mostSigBits >>> 32;
-    }
-
-    /**
-     * 与此 UUID 相关联的时钟序列值。
-     *
-     * <p>
-     * 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。
-     * <p>
-     * {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的 UUID,则此方法抛出
-     * UnsupportedOperationException。
-     *
-     * @return 此 {@code UUID} 的时钟序列
-     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
-     */
-    public int clockSequence() throws UnsupportedOperationException {
-        checkTimeBase();
-        return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
-    }
-
-    /**
-     * 与此 UUID 相关的节点值。
-     *
-     * <p>
-     * 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。
-     * <p>
-     * 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
-     * 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
-     *
-     * @return 此 {@code UUID} 的节点值
-     * @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
-     */
-    public long node() throws UnsupportedOperationException {
-        checkTimeBase();
-        return leastSigBits & 0x0000FFFFFFFFFFFFL;
-    }
-
-    /**
-     * 返回此{@code UUID} 的字符串表现形式。
-     *
-     * <p>
-     * UUID 的字符串表示形式由此 BNF 描述:
-     *
-     * <pre>
-     * {@code
-     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
-     * time_low               = 4*<hexOctet>
-     * time_mid               = 2*<hexOctet>
-     * time_high_and_version  = 2*<hexOctet>
-     * variant_and_sequence   = 2*<hexOctet>
-     * node                   = 6*<hexOctet>
-     * hexOctet               = <hexDigit><hexDigit>
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * </pre>
-     *
-     * </blockquote>
-     *
-     * @return 此{@code UUID} 的字符串表现形式
-     * @see #toString(boolean)
-     */
-    @Override
-    public String toString() {
-        return toString(false);
-    }
-
-    /**
-     * 返回此{@code UUID} 的字符串表现形式。
-     *
-     * <p>
-     * UUID 的字符串表示形式由此 BNF 描述:
-     *
-     * <pre>
-     * {@code
-     * UUID                   = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
-     * time_low               = 4*<hexOctet>
-     * time_mid               = 2*<hexOctet>
-     * time_high_and_version  = 2*<hexOctet>
-     * variant_and_sequence   = 2*<hexOctet>
-     * node                   = 6*<hexOctet>
-     * hexOctet               = <hexDigit><hexDigit>
-     * hexDigit               = [0-9a-fA-F]
-     * }
-     * </pre>
-     *
-     * </blockquote>
-     *
-     * @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串
-     * @return 此{@code UUID} 的字符串表现形式
-     */
-    public String toString(boolean isSimple) {
-        final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
-        // time_low
-        builder.append(digits(mostSigBits >> 32, 8));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // time_mid
-        builder.append(digits(mostSigBits >> 16, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // time_high_and_version
-        builder.append(digits(mostSigBits, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // variant_and_sequence
-        builder.append(digits(leastSigBits >> 48, 4));
-        if (false == isSimple) {
-            builder.append('-');
-        }
-        // node
-        builder.append(digits(leastSigBits, 12));
-
-        return builder.toString();
-    }
-
-    /**
-     * 返回此 UUID 的哈希码。
-     *
-     * @return UUID 的哈希码值。
-     */
-    @Override
-    public int hashCode() {
-        long hilo = mostSigBits ^ leastSigBits;
-        return ((int) (hilo >> 32)) ^ (int) hilo;
-    }
-
-    /**
-     * 将此对象与指定对象比较。
-     * <p>
-     * 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的 varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。
-     *
-     * @param obj 要与之比较的对象
-     * @return 如果对象相同,则返回 {@code true};否则返回 {@code false}
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if ((null == obj) || (obj.getClass() != UUID.class)) {
-            return false;
-        }
-        UUID id = (UUID) obj;
-        return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits);
-    }
-
-    // Comparison Operations
-
-    /**
-     * 将此 UUID 与指定的 UUID 比较。
-     *
-     * <p>
-     * 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。
-     *
-     * @param val 与此 UUID 比较的 UUID
-     * @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。
-     */
-    @Override
-    public int compareTo(UUID val) {
-        // The ordering is intentionally set up so that the UUIDs
-        // can simply be numerically compared as two numbers
-        return (this.mostSigBits < val.mostSigBits ? -1 : //
-                (this.mostSigBits > val.mostSigBits ? 1 : //
-                        (this.leastSigBits < val.leastSigBits ? -1 : //
-                                (this.leastSigBits > val.leastSigBits ? 1 : //
-                                        0))));
-    }
-
-    // -------------------------------------------------------------------------------------------------------------------
-    // Private method start
-
-    /**
-     * 返回指定数字对应的hex值
-     *
-     * @param val    值
-     * @param digits 位
-     * @return 值
-     */
-    private static String digits(long val, int digits) {
-        long hi = 1L << (digits * 4);
-        return Long.toHexString(hi | (val & (hi - 1))).substring(1);
-    }
-
-    /**
-     * 检查是否为time-based版本UUID
-     */
-    private void checkTimeBase() {
-        if (version() != 1) {
-            throw new UnsupportedOperationException("Not a time-based UUID");
-        }
-    }
-
-    /**
-     * 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG)
-     *
-     * @return {@link SecureRandom}
-     */
-    public static SecureRandom getSecureRandom() {
-        try {
-            return SecureRandom.getInstance("SHA1PRNG");
-        } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * 获取随机数生成器对象<br>
-     * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。
-     *
-     * @return {@link ThreadLocalRandom}
-     */
-    public static ThreadLocalRandom getRandom() {
-        return ThreadLocalRandom.current();
-    }
-}

+ 0 - 93
kyl/kyl-common/src/main/java/com/kyl/utils/UserThreadLocal.java

@@ -1,93 +0,0 @@
-package com.kyl.utils;
-
-import com.alibaba.fastjson.JSONObject;
-import com.kyl.base.BaseVo;
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * subjectContent.java
- *  用户主体对象
- */
-@Slf4j
-public class UserThreadLocal {
-
-
-    /***
-     *  创建线程局部userVO变量
-     */
-    public static ThreadLocal<String> subjectThreadLocal = new ThreadLocal<String>() {
-        @Override
-        protected String initialValue() {
-            return null;
-        }
-    };
-
-
-    // 提供线程局部变量set方法
-    public static void setSubject(String subject) {
-
-        subjectThreadLocal.set(subject);
-    }
-    // 提供线程局部变量get方法
-    public static String getSubject() {
-
-        return subjectThreadLocal.get();
-    }
-
-    //清空当前线程,防止内存溢出
-    public static void removeSubject() {
-
-        subjectThreadLocal.remove();
-    }
-    private static final ThreadLocal<Long> LOCAL = new ThreadLocal<>();
-
-    private UserThreadLocal() {
-
-    }
-
-    /**
-     * 将authUserInfo放到ThreadLocal中
-     *
-     * @param authUserInfo {@link Long}
-     */
-    public static void set(Long authUserInfo) {
-        LOCAL.set(authUserInfo);
-    }
-
-    /**
-     * 从ThreadLocal中获取authUserInfo
-     */
-    public static Long get() {
-        return LOCAL.get();
-    }
-
-    /**
-     * 从当前线程中删除authUserInfo
-     */
-    public static void remove() {
-        LOCAL.remove();
-    }
-
-    /**
-     * 从当前线程中获取前端用户id
-     * @return 用户id
-     */
-    public static Long getUserId() {
-        return LOCAL.get();
-    }
-
-    /**
-     * 从当前线程中获取前端后端id
-     * @return 用户id
-     */
-    public static Long getMgtUserId() {
-        String subject = subjectThreadLocal.get();
-        if (ObjectUtil.isEmpty(subject)) {
-            return null;
-        }
-        BaseVo baseVo = JSONObject.parseObject(subject, BaseVo.class);
-        return baseVo.getId() ;
-    }
-
-
-}

+ 0 - 129
kyl/kyl-framework/pom.xml

@@ -1,129 +0,0 @@
-<?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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>com.kyl</groupId>
-        <artifactId>kyl</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>kyl-framework</artifactId>
-
-    <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <!-- 定义项目依赖 -->
-    <dependencies>
-        <!--MySQL支持-->
-        <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-        </dependency>
-        <!--springboot的测试支持-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-        </dependency>
-        <!-- 自定义公共依赖 -->
-        <dependency>
-            <groupId>com.kyl</groupId>
-            <artifactId>kyl-common</artifactId>
-        </dependency>
-        <!--Spring Boot Web模块-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-        <!--Spring Boot Actuator模块,用于监控和管理应用-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-actuator</artifactId>
-        </dependency>
-        <!--Spring Boot自动配置模块-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-autoconfigure</artifactId>
-        </dependency>
-        <!--Spring Boot配置处理器-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-        </dependency>
-        <!--Druid数据源的Spring Boot启动器-->
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-        </dependency>
-        <!-- 引入mybatis-plus依赖坐标-->
-        <dependency>
-            <groupId>com.baomidou</groupId>
-            <artifactId>mybatis-plus-boot-starter</artifactId>
-        </dependency>
-        <!--Redis-->
-        <!--引入springboot整合缓存的起步依赖-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-cache</artifactId>
-        </dependency>
-        <!--引入springboot整合redis的起步依赖-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-data-redis</artifactId>
-        </dependency>
-        <!--Redisson缓存客户端-->
-        <dependency>
-            <groupId>org.redisson</groupId>
-            <artifactId>redisson-spring-boot-starter</artifactId>
-        </dependency>
-        <!--ZXing二维码生成核心库-->
-        <dependency>
-            <groupId>com.google.zxing</groupId>
-            <artifactId>core</artifactId>
-        </dependency>
-
-        <!--XXL-JOB分布式任务调度框架核心库-->
-        <dependency>
-            <groupId>com.xuxueli</groupId>
-            <artifactId>xxl-job-core</artifactId>
-        </dependency>
-
-        <!--Apache Commons Codec库,用于加密和解密-->
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-        </dependency>
-
-        <!--JAXB API,用于XML绑定-->
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-        </dependency>
-
-        <!--Spring Boot缓存支持-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-cache</artifactId>
-        </dependency>
-        <!--activiti7依赖-->
-        <dependency>
-            <groupId>org.activiti</groupId>
-            <artifactId>activiti-spring-boot-starter</artifactId>
-        </dependency>
-    </dependencies>
-
-    <!-- 项目构建配置 -->
-    <build>
-        <plugins>
-            <!-- Maven编译插件配置 -->
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 63
kyl/kyl-framework/src/main/java/com/kyl/config/CustomRedisConfig.java

@@ -1,63 +0,0 @@
-package com.kyl.config;
-
-import com.fasterxml.jackson.annotation.JsonAutoDetect;
-import com.fasterxml.jackson.annotation.PropertyAccessor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import org.springframework.cache.CacheManager;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.data.redis.cache.RedisCacheConfiguration;
-import org.springframework.data.redis.cache.RedisCacheManager;
-import org.springframework.data.redis.connection.RedisConnectionFactory;
-import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
-import org.springframework.data.redis.serializer.RedisSerializationContext;
-import org.springframework.data.redis.serializer.StringRedisSerializer;
-
-import java.time.Duration;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title CustomRedisConfig
- * @description
- * @create 2026/2/7
- */
-@Configuration
-@EnableCaching
-public class CustomRedisConfig {
-
-    @Bean
-    public CacheManager cacheManager(RedisConnectionFactory redisConnectionFactory) {
-        // 创建ObjectMapper并配置
-        ObjectMapper objectMapper = new ObjectMapper();
-        objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
-        objectMapper.activateDefaultTyping(
-                objectMapper.getPolymorphicTypeValidator(),
-                ObjectMapper.DefaultTyping.NON_FINAL
-        );
-        // 支持Java8时间类型
-        objectMapper.registerModule(new JavaTimeModule());
-
-        // 创建JSON序列化器
-        GenericJackson2JsonRedisSerializer jsonSerializer =
-                new GenericJackson2JsonRedisSerializer(objectMapper);
-
-        // 配置缓存默认设置
-        RedisCacheConfiguration cacheConfig = RedisCacheConfiguration.defaultCacheConfig()
-                .entryTtl(Duration.ofMinutes(10))  // 设置默认过期时间
-                .disableCachingNullValues()  // 不缓存null值
-                .serializeKeysWith(RedisSerializationContext.SerializationPair
-                        .fromSerializer(new StringRedisSerializer()))  // Key使用字符串序列化
-                .serializeValuesWith(RedisSerializationContext.SerializationPair
-                        .fromSerializer(jsonSerializer));  // Value使用JSON序列化
-
-        return RedisCacheManager.builder(redisConnectionFactory)
-                .cacheDefaults(cacheConfig)
-                .build();
-    }
-
-
-}
-

+ 0 - 21
kyl/kyl-framework/src/main/java/com/kyl/config/MybatisConfig.java

@@ -1,21 +0,0 @@
-package com.kyl.config;
-
-import com.kyl.intercept.AutoFillInterceptor;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-/**
- *  webMvc高级配置
- */
-@Configuration
-public class MybatisConfig {
-
-    /***
-     *  自动填充拦截器
-     */
-    @Bean
-    public AutoFillInterceptor autoFillInterceptor(){
-        return new AutoFillInterceptor();
-    }
-
-}

+ 0 - 94
kyl/kyl-framework/src/main/java/com/kyl/config/SwaggerConfig.java

@@ -1,94 +0,0 @@
-package com.kyl.config;
-
-import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
-import com.kyl.properties.SwaggerConfigProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties;
-import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties;
-import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType;
-import org.springframework.boot.actuate.endpoint.ExposableEndpoint;
-import org.springframework.boot.actuate.endpoint.web.*;
-import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier;
-import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier;
-import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Import;
-import org.springframework.core.env.Environment;
-import org.springframework.util.StringUtils;
-import springfox.bean.validators.configuration.BeanValidatorPluginsConfiguration;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-@Configuration
-@EnableConfigurationProperties(SwaggerConfigProperties.class)
-@EnableKnife4j
-@Import(BeanValidatorPluginsConfiguration.class)
-public class SwaggerConfig {
-
-    @Autowired
-    SwaggerConfigProperties swaggerConfigProperties;
-
-    @Bean(value = "defaultApi2")
-    @ConditionalOnClass(SwaggerConfigProperties.class)
-    public Docket defaultApi2() {
-        // 构建API文档  文档类型为swagger2
-        return new Docket(DocumentationType.SWAGGER_2)
-                .select()
-                // 配置 api扫描路径
-                .apis(RequestHandlerSelectors.basePackage(swaggerConfigProperties.getSwaggerPath()))
-                // 指定路径的设置  any代表所有路径
-                .paths(PathSelectors.any())
-                // api的基本信息
-                .build().apiInfo(new ApiInfoBuilder()
-                        // api文档名称
-                        .title(swaggerConfigProperties.getTitle())
-                        // api文档描述
-                        .description(swaggerConfigProperties.getDescription())
-                        // api文档版本
-                        .version("1.0") // 版本
-                        // api作者信息
-                        .contact(new Contact(
-                                swaggerConfigProperties.getContactName(),
-                                swaggerConfigProperties.getContactUrl(),
-                                swaggerConfigProperties.getContactEmail()))
-                        .build());
-    }
-
-    /**
-     * 增加如下配置可解决Spring 6.x 与Swagger 3.0.0 不兼容问题
-     **/
-    @Bean
-    public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,
-                                                                         ServletEndpointsSupplier servletEndpointsSupplier,
-                                                                         ControllerEndpointsSupplier controllerEndpointsSupplier,
-                                                                         EndpointMediaTypes endpointMediaTypes,
-                                                                         CorsEndpointProperties corsProperties,
-                                                                         WebEndpointProperties webEndpointProperties,
-                                                                         Environment environment) {
-        List<ExposableEndpoint<?>> allEndpoints = new ArrayList();
-        Collection<ExposableWebEndpoint> webEndpoints = webEndpointsSupplier.getEndpoints();
-        allEndpoints.addAll(webEndpoints);
-        allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
-        allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
-        String basePath = webEndpointProperties.getBasePath();
-        EndpointMapping endpointMapping = new EndpointMapping(basePath);
-        boolean shouldRegisterLinksMapping = this.shouldRegisterLinksMapping(webEndpointProperties, environment, basePath);
-        return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes, corsProperties.toCorsConfiguration(),
-                new EndpointLinksResolver(allEndpoints, basePath), shouldRegisterLinksMapping, null);
-    }
-
-    private boolean shouldRegisterLinksMapping(WebEndpointProperties webEndpointProperties, Environment environment, String basePath) {
-        return webEndpointProperties.getDiscovery().isEnabled() && (StringUtils.hasText(basePath) || ManagementPortType.get(environment).equals(ManagementPortType.DIFFERENT));
-    }
-}

+ 0 - 111
kyl/kyl-framework/src/main/java/com/kyl/config/WebMvcConfig.java

@@ -1,111 +0,0 @@
-package com.kyl.config;
-
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
-import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
-import com.kyl.intercept.UserInterceptor;
-import com.kyl.intercept.UserTokenIntercept;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import java.math.BigInteger;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.format.DateTimeFormatter;
-
-/**
- *  webMvc高级配置
- */
-@Configuration
-@ComponentScan("springfox.documentation.swagger.web")
-public class WebMvcConfig implements WebMvcConfigurer {
-
-   @Autowired
-   UserTokenIntercept userTokenIntercept;
-
-    @Autowired
-   UserInterceptor userInterceptor;
-
-    //拦截的时候过滤掉swagger相关路径和登录相关接口
-    private static final String[] EXCLUDE_PATH_PATTERNS = new String[]{
-            "/swagger-ui.html",
-            "/webjars/**",
-            "/swagger-resources",
-            "/v2/api-docs",
-            // 登录接口
-            "/customer/user/login",
-            // 房型列表接口
-            "/customer/roomTypes",
-            "/customer/orders/project/**",
-            "/user/refresh/**"};
-
-    /**
-     *  拦截器
-     */
-    @Override
-    public void addInterceptors(InterceptorRegistry registry) {
-        //userToken拦截
-        registry.addInterceptor(userTokenIntercept).excludePathPatterns(ADMIN_EXCLUDE_PATH_PATTERNS);
-        // 小程序端接口鉴权拦截器
-        registry.addInterceptor(userInterceptor).excludePathPatterns(EXCLUDE_PATH_PATTERNS).addPathPatterns("/customer/**");
-    }
-
-    //拦截的时候过滤掉swagger相关路径和登录相关接口
-    private static final String[] ADMIN_EXCLUDE_PATH_PATTERNS = new String[]{"/swagger-ui.html",
-            "/webjars/**",
-            "/swagger-resources",
-            "/v2/api-docs",
-            "/customer/**",
-            "/security/**",
-            "/common/**",
-            "/user/refresh/**"};
-
-    /**
-     * 资源路径 映射
-     */
-    @Override
-    public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        //支持webjars
-        registry.addResourceHandler("/webjars/**")
-                .addResourceLocations("classpath:/META-INF/resources/webjars/");
-        //支持swagger
-        registry.addResourceHandler("swagger-ui.html")
-                .addResourceLocations("classpath:/META-INF/resources/");
-        //支持小刀
-        registry.addResourceHandler("doc.html")
-                .addResourceLocations("classpath:/META-INF/resources/");
-    }
-
-    public static final String DEFAULT_DATE_FORMAT = "yyyy-MM-dd";
-    public static final String DEFAULT_DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
-    public static final String DEFAULT_TIME_FORMAT = "HH:mm:ss";
-
-    @Bean
-    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
-        return builder -> {
-            // 序列化
-            builder.serializerByType(Long.class, ToStringSerializer.instance);
-            builder.serializerByType(BigInteger.class, ToStringSerializer.instance);
-            builder.serializerByType(LocalDateTime.class, new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
-            builder.serializerByType(LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
-            builder.serializerByType(LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
-
-            // 反序列化
-            builder.deserializerByType(LocalDateTime.class, new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_TIME_FORMAT)));
-            builder.deserializerByType(LocalDate.class, new LocalDateDeserializer(DateTimeFormatter.ofPattern(DEFAULT_DATE_FORMAT)));
-            builder.deserializerByType(LocalTime.class, new LocalTimeDeserializer(DateTimeFormatter.ofPattern(DEFAULT_TIME_FORMAT)));
-
-        };
-    }
-}

+ 0 - 134
kyl/kyl-framework/src/main/java/com/kyl/intercept/AutoFillInterceptor.java

@@ -1,134 +0,0 @@
-package com.kyl.intercept;
-
-
-import cn.hutool.core.util.ObjectUtil;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.UserThreadLocal;
-import org.apache.ibatis.binding.MapperMethod;
-import org.apache.ibatis.executor.Executor;
-import org.apache.ibatis.mapping.MappedStatement;
-import org.apache.ibatis.mapping.SqlCommandType;
-import org.apache.ibatis.plugin.*;
-import org.apache.ibatis.reflection.MetaObject;
-import org.apache.ibatis.reflection.SystemMetaObject;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.Properties;
-
-@Component
-@Intercepts({
-        @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})
-})
-public class AutoFillInterceptor implements Interceptor {
-
-    private static final String CREATE_BY = "createBy";
-    private static final String UPDATE_BY = "updateBy";
-
-    private static final String CREATE_TIME = "createTime";
-    private static final String UPDATE_TIME = "updateTime";
-
-    @Override
-    public Object intercept(Invocation invocation) throws Throwable {
-        Object[] args = invocation.getArgs();
-        // 获取用于描述SQL语句的映射信息
-        MappedStatement ms = (MappedStatement) args[0];
-        SqlCommandType sqlCommandType = ms.getSqlCommandType();
-
-        // 获取sql参数实体 ParamMap
-        Object parameter = args[1];
-
-        if (parameter != null && sqlCommandType != null) {
-            // 获取用户ID
-            Long userId = loadUserId();
-
-            if (SqlCommandType.INSERT.equals(sqlCommandType)) {
-                // 插入操作
-                if (parameter instanceof MapperMethod.ParamMap) {
-                    // 批量插入的情况
-                    MapperMethod.ParamMap paramMap = (MapperMethod.ParamMap) parameter;
-                    ArrayList list = (ArrayList) paramMap.get("list");
-                    list.forEach(v -> {
-                        // 设置创建人和创建时间字段值
-                        setFieldValByName(CREATE_BY, userId, v);
-                        setFieldValByName(CREATE_TIME, LocalDateTime.now(), v);
-                        setFieldValByName(UPDATE_TIME, LocalDateTime.now(), v);
-                    });
-                    paramMap.put("list", list);
-                } else {
-                    // 单条插入的情况
-                    // 设置创建人和创建时间字段值
-                    setFieldValByName(CREATE_BY, userId, parameter);
-                    setFieldValByName(CREATE_TIME, LocalDateTime.now(), parameter);
-                    setFieldValByName(UPDATE_TIME, LocalDateTime.now(), parameter);
-                }
-            } else if (SqlCommandType.UPDATE.equals(sqlCommandType)) {
-                // 更新操作
-                // 设置更新人和更新时间字段值
-                setFieldValByName(UPDATE_BY, userId, parameter);
-                setFieldValByName(UPDATE_TIME, LocalDateTime.now(), parameter);
-            }
-        }
-
-        // 继续执行原始方法
-        return invocation.proceed();
-    }
-
-    /**
-     * 通过反射设置实体的字段值
-     *
-     * @param fieldName 字段名
-     * @param fieldVal  字段值
-     * @param parameter 实体对象
-     */
-    private void setFieldValByName(String fieldName, Object fieldVal, Object parameter) {
-        MetaObject metaObject = SystemMetaObject.forObject(parameter);
-        if (fieldName.equals(CREATE_BY)) {
-            Object value = metaObject.getValue(fieldName);
-            if (ObjectUtil.isNotEmpty(value)) {
-                return;
-            }
-        }
-
-        if (metaObject.hasSetter(fieldName)) {
-            metaObject.setValue(fieldName, fieldVal);
-        }
-    }
-
-    @Override
-    public Object plugin(Object target) {
-        if (target instanceof Executor) {
-            // 对目标对象进行包装,返回代理对象
-            return Plugin.wrap(target, this);
-        }
-        // 非 Executor 类型的对象,直接返回原始对象
-        return target;
-    }
-
-    @Override
-    public void setProperties(Properties properties) {
-        // 读取配置文件中的属性,此处没有使用
-    }
-
-    /**
-     * 获取当前用户的ID,用于填充创建人和更新人字段的值
-     *
-     * @return 当前用户ID
-     */
-    public static Long loadUserId() {
-        // 从 ThreadLocal 中获取用户ID
-        Long userId = UserThreadLocal.getUserId();
-        // 如果 ThreadLocal 中不存在用户ID,则从管理用户ID中获取
-        if (ObjectUtil.isNotEmpty(userId)) {
-            return userId;
-        }
-        userId = UserThreadLocal.getMgtUserId();
-        // 如果管理用户ID也不存在,则默认返回ID为1的用户
-        if (!EmptyUtil.isNullOrEmpty(userId)) {
-            return userId;
-        }
-        return 1L;
-    }
-}
-

+ 0 - 76
kyl/kyl-framework/src/main/java/com/kyl/intercept/UserInterceptor.java

@@ -1,76 +0,0 @@
-package com.kyl.intercept;
-
-import cn.hutool.core.map.MapUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.kyl.constant.Constants;
-import com.kyl.exception.BaseException;
-import com.kyl.properties.JwtTokenManagerProperties;
-import com.kyl.utils.JwtUtil;
-import com.kyl.utils.UserThreadLocal;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.HandlerInterceptor;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Map;
-
-/**
- * 小程序端token校验
- * 统一对请求的合法性进行校验,需要进行2个方面的校验,
- * 一、请求头中是否携带了authorization
- * 二、请求头中是否存在userId,如果不存在则说明是非法请求,响应401状态码
- * 如果是合法请求,将userId存储到ThreadLocal中
- */
-@Slf4j
-@Component
-@EnableConfigurationProperties(JwtTokenManagerProperties.class)
-public class UserInterceptor implements HandlerInterceptor {
-
-    @Value("${token.header:authorization}")
-    private String header;
-
-    @Autowired
-    private JwtTokenManagerProperties jwtTokenManagerProperties;
-
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-
-        //如果不是映射到方法就放行,比如跨域验证请求、静态资源等不需要身份校验的请求
-        if (!(handler instanceof HandlerMethod)) {
-            return true;
-        }
-
-        //获取header的参数
-        String token = request.getHeader(header);
-
-        log.info("开始解析 customer user token {}", token);
-        if (ObjectUtil.isEmpty(token)) {
-            //token失效
-            throw new BaseException("小程序登录","401",null,"没有权限,请登录");
-        }
-        Map<String, Object> claims = JwtUtil.parseJWT(jwtTokenManagerProperties.getBase64EncodedSecretKey(), token);
-        if (ObjectUtil.isEmpty(claims)) {
-            //token失效
-            throw new BaseException("小程序登录","401",null,"没有权限,请登录");
-        }
-
-        Long userId = MapUtil.get(claims, Constants.JWT_USERID, Long.class);
-        if (ObjectUtil.isEmpty(userId)) {
-            throw new BaseException("小程序登录","401",null,"没有权限,请登录");
-        }
-
-        UserThreadLocal.set(userId);
-
-        return true;
-    }
-
-    @Override
-    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-        UserThreadLocal.remove();
-    }
-}

+ 0 - 58
kyl/kyl-framework/src/main/java/com/kyl/intercept/UserTokenIntercept.java

@@ -1,58 +0,0 @@
-package com.kyl.intercept;
-
-import com.kyl.constant.SecurityConstant;
-import com.kyl.constant.UserCacheConstant;
-import com.kyl.properties.JwtTokenManagerProperties;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.JwtUtil;
-import com.kyl.utils.UserThreadLocal;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.stereotype.Component;
-import org.springframework.web.method.HandlerMethod;
-import org.springframework.web.servlet.HandlerInterceptor;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- *  多租户放到SubjectContent上下文中
- */
-@Component
-public class UserTokenIntercept implements HandlerInterceptor {
-
-    @Autowired
-    private StringRedisTemplate redisTemplate;
-
-    @Autowired
-    private JwtTokenManagerProperties jwtTokenManagerProperties;
-
-    @Override
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-
-        if (!(handler instanceof HandlerMethod)) {
-            return true;
-        }
-        //从头部中拿到当前userToken
-        String userToken = request.getHeader(SecurityConstant.USER_TOKEN);
-        if (!EmptyUtil.isNullOrEmpty(userToken)) {
-            String jwtTokenKey = UserCacheConstant.JWT_TOKEN + userToken;
-            String jwtToken = redisTemplate.opsForValue().get(jwtTokenKey);
-            if (!EmptyUtil.isNullOrEmpty(jwtToken)) {
-                Object userObj = JwtUtil.parseJWT(
-                        jwtTokenManagerProperties.getBase64EncodedSecretKey(),
-                        jwtToken).get("userVo");
-                String currentUser = String.valueOf(userObj);
-                //放入当前线程中:用户当前的web直接获得user使用
-                UserThreadLocal.setSubject(currentUser);
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
-        //移除当前线程中的参数
-        UserThreadLocal.removeSubject();
-    }
-}

+ 0 - 32
kyl/kyl-framework/src/main/java/com/kyl/properties/JwtTokenManagerProperties.java

@@ -1,32 +0,0 @@
-package com.kyl.properties;
-
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import lombok.ToString;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-import java.io.Serializable;
-
-/**
- * jw配置文件
- */
-@Setter
-@Getter
-@NoArgsConstructor
-@ToString
-@Configuration
-@ConfigurationProperties(prefix = "kyl.framework.jwt")
-public class JwtTokenManagerProperties implements Serializable {
-
-    /**
-     *  签名密码
-     */
-    private String base64EncodedSecretKey;
-
-    /**
-     *  有效时间
-     */
-    private Integer ttl;
-}

+ 0 - 33
kyl/kyl-framework/src/main/java/com/kyl/properties/SecurityConfigProperties.java

@@ -1,33 +0,0 @@
-package com.kyl.properties;
-
-import lombok.Data;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *  忽略配置及跨域
- */
-@Slf4j
-@Data
-@ConfigurationProperties(prefix = "kyl.framework.security")
-@Configuration
-public class SecurityConfigProperties {
-
-    String defaultPassword ;
-
-    List<String> ignoreUrl = new ArrayList<>();
-
-    List<String> origins = new ArrayList<>();
-
-    String loginPage;
-
-    //令牌有效时间
-    Integer accessTokenValiditySeconds = 3*24*3600;
-
-    //刷新令牌有效时间
-    Integer refreshTokenValiditySeconds= 7*24*3600;
-}

+ 0 - 32
kyl/kyl-framework/src/main/java/com/kyl/properties/SwaggerConfigProperties.java

@@ -1,32 +0,0 @@
-package com.kyl.properties;
-
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import lombok.ToString;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-import java.io.Serializable;
-
-/**
- *  SwaggerConfigProperties配置类
- */
-@Setter
-@Getter
-@NoArgsConstructor
-@ToString
-@ConfigurationProperties(prefix = "kyl.framework.swagger")
-public class SwaggerConfigProperties implements Serializable {
-
-    public String swaggerPath;
-
-    public String title;
-
-    public String description;
-
-    public String contactName;
-
-    public String contactUrl;
-
-    public String contactEmail;
-}

+ 0 - 43
kyl/kyl-pay/pom.xml

@@ -1,43 +0,0 @@
-<?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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>com.kyl</groupId>
-        <artifactId>kyl</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>kyl-pay</artifactId>
-
-    <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-    <dependencies>
-        <dependency>
-            <groupId>com.kyl</groupId>
-            <artifactId>kyl-framework</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-autoconfigure</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-configuration-processor</artifactId>
-        </dependency>
-    </dependencies>
-    <!-- 项目构建配置 -->
-    <build>
-        <plugins>
-            <!-- Maven编译插件配置 -->
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 73
kyl/kyl-pay/src/main/java/com/kyl/entity/RefundRecord.java

@@ -1,73 +0,0 @@
-package com.kyl.entity;
-
-import com.kyl.base.BaseEntity;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.*;
-
-import java.math.BigDecimal;
-
-/**
- * 退款记录表
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class RefundRecord extends BaseEntity {
-
-    private static final long serialVersionUID = -3998253241655800061L;
-
-    @ApiModelProperty(value = "交易系统订单号【对于三方来说:商户订单】")
-    private Long tradingOrderNo;
-
-    @ApiModelProperty(value = "业务系统订单号")
-    private Long productOrderNo;
-
-    @ApiModelProperty(value = "本次退款订单号")
-    private Long refundNo;
-
-    @ApiModelProperty(value = "商户号")
-    private Long enterpriseId;
-
-    @ApiModelProperty(value = "退款渠道【支付宝、微信、现金】")
-    private String tradingChannel;
-
-    @ApiModelProperty(value = "退款状态")
-    private Integer refundStatus;
-
-    @ApiModelProperty(value = "返回编码")
-    private String refundCode;
-
-    @ApiModelProperty(value = "返回信息")
-    private String refundMsg;
-
-    @ApiModelProperty(value = "备注【订单门店,桌台信息】")
-    private String memo;
-
-    @ApiModelProperty(value = "本次退款金额")
-    private BigDecimal refundAmount;
-
-    @ApiModelProperty(value = "原订单金额")
-    private BigDecimal total;
-
-    private String dataState;
-
-    private Integer createType;
-
-    @Builder
-    public RefundRecord(Long id, String dataState, Long tradingOrderNo, Long productOrderNo, Long refundNo, Long enterpriseId, String tradingChannel, Integer refundStatus, String refundCode, String refundMsg, String memo, BigDecimal refundAmount, BigDecimal total) {
-        super(id);
-        this.tradingOrderNo = tradingOrderNo;
-        this.productOrderNo = productOrderNo;
-        this.refundNo = refundNo;
-        this.enterpriseId = enterpriseId;
-        this.tradingChannel = tradingChannel;
-        this.refundStatus = refundStatus;
-        this.refundCode = refundCode;
-        this.refundMsg = refundMsg;
-        this.memo = memo;
-        this.refundAmount = refundAmount;
-        this.total = total;
-        this.dataState = dataState;
-    }
-}

+ 0 - 98
kyl/kyl-pay/src/main/java/com/kyl/entity/Trading.java

@@ -1,98 +0,0 @@
-package com.kyl.entity;
-
-
-import com.kyl.base.BaseEntity;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-
-/**
- * 交易订单表
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class Trading extends BaseEntity {
-
-    private static final long serialVersionUID = -3427581867070559590L;
-
-    @ApiModelProperty(value = "openId标识")
-    private String openId;
-
-    @ApiModelProperty(value = "业务系统订单号")
-    private Long productOrderNo;
-
-    @ApiModelProperty(value = "交易系统订单号【对于三方来说:商户订单】")
-    private Long tradingOrderNo;
-
-    @ApiModelProperty(value = "支付渠道【支付宝、微信、现金、免单挂账】")
-    private String tradingChannel;
-
-    @ApiModelProperty(value = "交易类型【1账单,2订单】")
-    private String tradingType;
-
-    @ApiModelProperty(value = "交易单状态【DFK待付款,FKZ付款中,QXDD取消订单,YJS已结算,MD免单,GZ挂账】")
-    private Integer tradingState;
-
-    @ApiModelProperty(value = "收款人姓名")
-    private String payeeName;
-
-    @ApiModelProperty(value = "收款人账户ID")
-    private Long payeeId;
-
-    @ApiModelProperty(value = "付款人姓名")
-    private String payerName;
-
-    @ApiModelProperty(value = "付款人Id")
-    private Long payerId;
-
-    @ApiModelProperty(value = "交易金额")
-    private BigDecimal tradingAmount;
-
-    @ApiModelProperty(value = "退款金额【付款后】")
-    private BigDecimal refund;
-
-    @ApiModelProperty(value = "是否有退款:YES,NO")
-    private String isRefund;
-
-    @ApiModelProperty(value = "第三方交易返回编码【最终确认交易结果】")
-    private String resultCode;
-
-    @ApiModelProperty(value = "第三方交易返回提示消息【最终确认交易信息】")
-    private String resultMsg;
-
-    @ApiModelProperty(value = "第三方交易返回信息json【分析交易最终信息】")
-    private String resultJson;
-
-    @ApiModelProperty(value = "统一下单返回编码")
-    private String placeOrderCode;
-
-    @ApiModelProperty(value = "统一下单返回信息")
-    private String placeOrderMsg;
-
-    @ApiModelProperty(value = "统一下单返回信息json【用于生产二维码、Android ios唤醒支付等】")
-    private String placeOrderJson;
-
-    @ApiModelProperty(value = "商户号")
-    private Long enterpriseId;
-
-    @ApiModelProperty(value = "备注【订单门店,桌台信息】")
-    private String memo;
-
-    @ApiModelProperty(value = "二维码base64数据")
-    private String qrCode;
-
-    @ApiModelProperty(value = "是否有效")
-    protected String enableFlag;
-
-    String phone;
-
-    private String memberCreator;
-
-
-}

+ 0 - 110
kyl/kyl-pay/src/main/java/com/kyl/vo/RefundRecordVo.java

@@ -1,110 +0,0 @@
-package com.kyl.vo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.kyl.base.BaseVo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-import java.time.LocalDateTime;
-
-/**
- *
- */
-@Data
-@NoArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-@ApiModel(value="RefundRecordVo对象", description="")
-public class RefundRecordVo extends BaseVo {
-
-    private static final long serialVersionUID = 1L;
-
-    @Builder
-    public RefundRecordVo(Long id, String dataState, Long tradingOrderNo, Long productOrderNo, Long refundNo, Long enterpriseId, Long storeId, String tradingChannel, Integer refundStatus, String refundCode, String refundMsg, String memo, BigDecimal refundAmount,Integer orderStatus) {
-        super(id, dataState);
-        this.tradingOrderNo = tradingOrderNo;
-        this.productOrderNo = productOrderNo;
-        this.refundNo = refundNo;
-        this.enterpriseId = enterpriseId;
-        this.storeId = storeId;
-        this.tradingChannel = tradingChannel;
-        this.refundStatus = refundStatus;
-        this.refundCode = refundCode;
-        this.refundMsg = refundMsg;
-        this.memo = memo;
-        this.refundAmount = refundAmount;
-        this.orderStatus = orderStatus;
-    }
-
-    @ApiModelProperty(value = "交易系统订单号【对于三方来说:商户订单】")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long tradingOrderNo;
-
-    @ApiModelProperty(value = "业务系统订单号")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long productOrderNo;
-
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    @ApiModelProperty(value = "本次退款订单号")
-    private Long refundNo;
-
-    @ApiModelProperty(value = "本次退款订单号 字符串")
-    private String refundNoStr;
-
-    @ApiModelProperty(value = "商户号")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long enterpriseId;
-
-    @ApiModelProperty(value = "门店主键id")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long storeId;
-
-    @ApiModelProperty(value = "退款渠道【支付宝、微信、现金】")
-    private String tradingChannel;
-
-    @ApiModelProperty(value = "退款状态【成功:2,进行中:1, 失败:3】")
-    private Integer refundStatus;
-
-    @ApiModelProperty(value = "返回编码")
-    private String refundCode;
-
-    @ApiModelProperty(value = "返回信息")
-    private String refundMsg;
-
-    @ApiModelProperty(value = "备注【订单门店,桌台信息】")
-    private String memo;
-
-    @ApiModelProperty(value = "本次退款金额")
-    private BigDecimal refundAmount;
-
-    /**
-     * 开始时间
-     */
-    @ApiModelProperty(value = "开始时间")
-    private Integer orderStatus;
-
-    /**
-     * 开始时间
-     */
-    @ApiModelProperty(value = "开始时间")
-    private LocalDateTime startTime;
-    /**
-     * 结束时间
-     */
-    @ApiModelProperty(value = "结束时间")
-    private LocalDateTime endTime;
-
-    @ApiModelProperty(value = "页码")
-    private int pageNum = 1;
-    @ApiModelProperty(value = "页大小")
-    private int pageSize = 10;
-
-
-    @ApiModelProperty(value = "订单编码")
-    private String orderNo;
-
-}

+ 0 - 159
kyl/kyl-pay/src/main/java/com/kyl/vo/TradingVo.java

@@ -1,159 +0,0 @@
-package com.kyl.vo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.kyl.base.BaseVo;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- * @ClassName TradingVo.java
- *  交易结果
- */
-@Data
-@NoArgsConstructor
-public class TradingVo extends BaseVo {
-
-    private static final long serialVersionUID = 1L;
-
-    @Builder
-    public TradingVo(Long id, String dataState, String openId, Long productOrderNo, Long tradingOrderNo, String tradingChannel, Integer tradingState, String payeeName, Long payeeId, String payerName, Long payerId, BigDecimal tradingAmount, BigDecimal refund, String isRefund, String resultCode, String resultMsg, String resultJson, String placeOrderCode, String placeOrderMsg, String placeOrderJson, Long enterpriseId, Long storeId, String memo, String qrCodeImageBase64, Long outRequestNo, BigDecimal operTionRefund, String authCode, String quitUrl, String returnUrl, String billType, Date billDate, String billDownloadUrl) {
-        super(id, dataState);
-        this.openId = openId;
-        this.productOrderNo = productOrderNo;
-        this.tradingOrderNo = tradingOrderNo;
-        this.tradingChannel = tradingChannel;
-        this.tradingState = tradingState;
-        this.payeeName = payeeName;
-        this.payeeId = payeeId;
-        this.payerName = payerName;
-        this.payerId = payerId;
-        this.tradingAmount = tradingAmount;
-        this.refund = refund;
-        this.isRefund = isRefund;
-        this.resultCode = resultCode;
-        this.resultMsg = resultMsg;
-        this.resultJson = resultJson;
-        this.placeOrderCode = placeOrderCode;
-        this.placeOrderMsg = placeOrderMsg;
-        this.placeOrderJson = placeOrderJson;
-        this.enterpriseId = enterpriseId;
-        this.storeId = storeId;
-        this.memo = memo;
-        this.qrCodeImageBase64 = qrCodeImageBase64;
-        this.outRequestNo = outRequestNo;
-        this.operTionRefund = operTionRefund;
-        this.authCode = authCode;
-        this.quitUrl = quitUrl;
-        this.returnUrl = returnUrl;
-        this.billType = billType;
-        this.billDate = billDate;
-        this.billDownloadUrl = billDownloadUrl;
-    }
-
-    @ApiModelProperty(value = "openId标识")
-    private String openId;
-
-    @ApiModelProperty(value = "业务系统订单号")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long productOrderNo;
-
-    @ApiModelProperty(value = "交易系统订单号【对于三方来说:商户订单】")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long tradingOrderNo;
-
-    @ApiModelProperty(value = "支付渠道【支付宝、微信】")
-    private String tradingChannel;
-
-    @ApiModelProperty(value = "交易单状态")
-    private Integer tradingState;
-
-    @ApiModelProperty(value = "收款人姓名")
-    private String payeeName;
-
-    @ApiModelProperty(value = "交易类型【1账单,2订单】")
-    private String tradingType;
-
-    @ApiModelProperty(value = "收款人账户ID")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long payeeId;
-
-    @ApiModelProperty(value = "付款人姓名")
-    private String payerName;
-
-    @ApiModelProperty(value = "付款人Id")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long payerId;
-
-    @ApiModelProperty(value = "交易金额")
-    private BigDecimal tradingAmount;
-
-    @ApiModelProperty(value = "退款总金额")
-    private BigDecimal refund;
-
-    @ApiModelProperty(value = "是否有退款:YES,NO")
-    private String isRefund;
-
-    @ApiModelProperty(value = "第三方交易返回编码【最终确认交易结果】")
-    private String resultCode;
-
-    @ApiModelProperty(value = "第三方交易返回提示消息【最终确认交易信息】")
-    private String resultMsg;
-
-    @ApiModelProperty(value = "第三方交易返回信息json【分析交易最终信息】")
-    private String resultJson;
-
-    @ApiModelProperty(value = "统一下单返回编码")
-    private String placeOrderCode;
-
-    @ApiModelProperty(value = "统一下单返回信息")
-    private String placeOrderMsg;
-
-    @ApiModelProperty(value = "统一下单返回信息json【用于生产二维码、Android ios唤醒支付等】")
-    private String placeOrderJson;
-
-    @ApiModelProperty(value = "商户号")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long enterpriseId;
-
-    @ApiModelProperty(value = "门店主键id")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long storeId;
-
-    @ApiModelProperty(value = "线下支付凭证【支付凭证链接】")
-    private String memo;
-
-    @ApiModelProperty(value = "二维码base64")
-    private String qrCodeImageBase64;
-
-    @ApiModelProperty(value = "退款请求号")
-    private Long outRequestNo;
-
-    @ApiModelProperty(value = "本次退款金额")
-    private BigDecimal operTionRefund;
-
-    @ApiModelProperty(value = "支付授权码")
-    private String authCode;
-
-    @ApiModelProperty(value = "支付宝:HTTP/HTTPS开头字符串")
-    private String quitUrl;
-
-    @ApiModelProperty(value = "支付宝:用户付款中途退出返回商户网站的地址")
-    private String returnUrl;
-
-    @ApiModelProperty(value = "账单类型,商户通过接口或商户经开放平台授权后其所属服务商通过接口可以获取以下账单类型")
-    private String billType;
-
-    @ApiModelProperty(value = "账单时间:日账单格式为yyyy-MM-dd,最早可下载2016年1月1日开始的日账单。不支持下载当日账单,只能下载前一日24点前的账单数据(T+1)")
-    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")//get
-    protected Date billDate;
-
-    @ApiModelProperty(value = "账单地址")
-    private String billDownloadUrl;
-
-    String phone;
-}

+ 0 - 43
kyl/kyl-security/pom.xml

@@ -1,43 +0,0 @@
-<?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">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>com.kyl</groupId>
-        <artifactId>kyl</artifactId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-
-    <artifactId>kyl-security</artifactId>
-
-    <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-    </properties>
-
-    <!-- 配置项目依赖项 -->
-    <dependencies>
-        <!-- Kyl框架依赖 -->
-        <dependency>
-            <groupId>com.kyl</groupId>
-            <artifactId>kyl-framework</artifactId>
-        </dependency>
-        <!-- Spring Boot AOP依赖 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-aop</artifactId>
-        </dependency>
-    </dependencies>
-    <!-- 项目构建配置 -->
-    <build>
-        <plugins>
-            <!-- Maven编译插件配置 -->
-            <plugin>
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </build>
-</project>

+ 0 - 72
kyl/kyl-security/src/main/java/com/kyl/config/SecurityConfig.java

@@ -1,72 +0,0 @@
-package com.kyl.config;
-
-
-import com.kyl.properties.SecurityConfigProperties;
-import com.kyl.security.JwtAuthorizationManager;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.http.SessionCreationPolicy;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.web.SecurityFilterChain;
-
-import java.util.List;
-
-
-/**
- * @author WanJl
- * @version 1.0
- * @title SecurityConfig
- * @description SpringSecurity的配置类
- * @create 2026/1/26
- */
-@Configuration
-public class SecurityConfig {
-    @Autowired
-    JwtAuthorizationManager jwtAuthorizationManager;
-    @Autowired
-    SecurityConfigProperties securityConfigProperties;
-    @Bean
-    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
-        //要忽略的地址列表
-        List<String> ignoreUrl = securityConfigProperties.getIgnoreUrl();
-        //配置请求授权规则,允许所有用户访问登录接口
-        http.authorizeHttpRequests()
-                //忽略路径--把要忽略的路径List转换为String类型数组,并且指定长度
-                .antMatchers(ignoreUrl.toArray(new String[ignoreUrl.size()])).permitAll() //放行路径
-                .anyRequest().access(jwtAuthorizationManager);   //设置自定义授权管理器
-
-
-        //关闭session
-        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
-        //关闭缓存
-        http.headers().cacheControl().disable();
-        //禁用CSRF防护
-        http.csrf().disable();
-        //返回
-        return http.build();
-    }
-
-    @Bean
-    public PasswordEncoder passwordEncoder(){
-        //修改密码的编码方式
-        return new BCryptPasswordEncoder();
-    }
-
-
-    /**
-     * 配置并返回认证管理器
-     * @param configuration
-     * @return
-     * @throws Exception
-     */
-    @Bean
-    public AuthenticationManager authenticationManager(AuthenticationConfiguration configuration) throws Exception {
-        return configuration.getAuthenticationManager();
-    }
-
-}

+ 0 - 128
kyl/kyl-security/src/main/java/com/kyl/controller/DeptController.java

@@ -1,128 +0,0 @@
-package com.kyl.controller;
-
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.kyl.base.ResponseResult;
-import com.kyl.constant.DeptCacheConstant;
-import com.kyl.dto.DeptDto;
-import com.kyl.entity.Dept;
-import com.kyl.service.DeptService;
-import com.kyl.vo.DeptVo;
-import com.kyl.vo.TreeVo;
-import io.swagger.v3.oas.annotations.Operation;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Caching;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * 部门管理控制器
- *
- * @author WanJl
- * @version 1.0
- * @title DeptController
- * @description 部门的增删改查、树结构、状态修改等核心接口
- * @create 2026/1/27
- */
-@Tag(name = "部门管理模块", description = "部门的增删改查、树结构展示、状态修改等接口")
-@RestController
-@RequestMapping("/dept")
-public class DeptController {
-
-    @Resource
-    private DeptService deptService;
-
-    /**
-     * 条件查询部门列表
-     *
-     * @param deptDto 部门查询条件DTO(包含部门编号、名称、状态等查询条件)
-     * @return 部门VO列表响应结果
-     */
-    @Operation(summary = "条件查询部门列表", description = "根据部门编号、名称、状态等条件模糊/精准查询部门信息列表,返回封装后的VO数据")
-    @PostMapping("/list")
-    public ResponseResult<List<DeptVo>> list(@RequestBody DeptDto deptDto) {
-        List<DeptVo> list = deptService.findDeptVoListByCondition(deptDto);
-        return ResponseResult.success(list);
-    }
-
-    /**
-     * 获取部门树形结构
-     *
-     * @return 部门树形结构VO响应结果(一级部门为根节点,包含子部门递归结构)
-     */
-    @Operation(summary = "获取部门树形结构", description = "查询所有有效部门,组装成树形层级结构,适用于前端下拉树、树形展示场景")
-    @PostMapping("/tree")
-    public ResponseResult<TreeVo> deptTree() {
-        TreeVo treeVo = deptService.deptTreeVo();
-        return ResponseResult.success(treeVo);
-    }
-
-    /**
-     * 新增部门
-     *
-     * @param deptDto 新增部门参数DTO(包含部门名称、父部门编号、排序、状态等)
-     * @return 新增结果(true=成功,false=失败)
-     */
-    @Operation(summary = "新增部门", description = "添加新的部门信息,支持设置父部门形成层级,需传入部门基本信息")
-    @PutMapping
-    public ResponseResult<Boolean> createDept(@RequestBody DeptDto deptDto) {
-        Boolean flag = deptService.saveDept(deptDto);
-        return ResponseResult.success(flag);
-    }
-
-    /**
-     * 修改部门状态
-     *
-     * @param deptDto 状态修改参数(必传deptNo部门编号、dataState状态:0=启用,1=禁用)
-     * @return 修改结果(true=成功,false=失败)
-     */
-    @Operation(summary = "修改部门状态", description = "单独修改部门的启用/禁用状态,0表示启用,1表示禁用,需传入部门编号和目标状态")
-    @Caching(evict = {
-            @CacheEvict(value = DeptCacheConstant.TREE,allEntries = true),
-            @CacheEvict(value = DeptCacheConstant.LIST,allEntries = true),
-    })
-    @PatchMapping("/is_enable")
-    public ResponseResult<Boolean> updateIsEnable(@RequestBody DeptDto deptDto) {
-        String dataState = deptDto.getDataState();
-        String deptNo = deptDto.getDeptNo();
-        //封装修改条件
-        UpdateWrapper<Dept> updateWrapper = new UpdateWrapper<>();
-        updateWrapper.eq("dept_no", deptNo);
-        updateWrapper.set("data_state", dataState);
-        //修改
-        Boolean flag = deptService.update(updateWrapper);
-        return ResponseResult.success(flag);
-    }
-
-    /**
-     * 删除部门
-     *
-     * @param deptNo 路径参数-部门编号
-     * @return 删除结果(true=成功,false=失败,包含子部门时一般禁止删除)
-     */
-    @Operation(summary = "删除部门", description = "根据部门编号删除部门,若部门存在子部门或关联员工,一般会返回删除失败")
-    @DeleteMapping("/{deptNo}")
-    public ResponseResult<Boolean> deleteDept(
-            @Parameter(name = "deptNo", description = "部门编号", required = true, example = "DEPT001")
-            @PathVariable String deptNo) {
-        Boolean flag = deptService.removeDept(deptNo);
-        return ResponseResult.success(flag);
-    }
-
-    /**
-     * 修改部门信息
-     *
-     * @param deptDto 部门修改参数DTO(必传deptNo,其他为要修改的信息:名称、父部门、排序等)
-     * @return 修改结果(true=成功,false=失败)
-     */
-    @Operation(summary = "修改部门信息", description = "修改部门的基本信息,支持修改名称、父部门、排序等,需传入部门编号标识修改对象")
-    @PatchMapping
-    public ResponseResult<Boolean> updateDept(@RequestBody DeptDto deptDto) {
-        Boolean flag = deptService.updateDept(deptDto);
-        return ResponseResult.success(flag);
-    }
-
-}

+ 0 - 44
kyl/kyl-security/src/main/java/com/kyl/controller/LoginController.java

@@ -1,44 +0,0 @@
-package com.kyl.controller;
-
-import com.kyl.base.ResponseResult;
-import com.kyl.dto.LoginDto;
-import com.kyl.service.LoginService;
-import com.kyl.vo.UserVo;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 登录控制器
- * 提供用户登录相关的API接口
- */
-@Api(tags = "登录管理", description = "用户登录相关操作")
-@RestController
-@RequestMapping("/security")
-public class LoginController {
-
-    @Autowired
-    private LoginService loginService;
-
-    /**
-     * 用户登录接口
-     * 接收用户名密码等登录信息,返回登录结果
-     *
-     * @param loginDto 登录数据传输对象,包含用户名、密码等信息
-     * @return ResponseResult<UserVo> 统一响应结果,包含用户信息
-     */
-    @ApiOperation(value = "用户登录", notes = "根据用户名密码进行登录验证")
-    @PostMapping("/login")
-    public ResponseResult<UserVo> login(@ApiParam(value = "登录信息", required = true)
-                                        @RequestBody LoginDto loginDto) {
-        // 调用LoginService的login方法,传入loginDto参数
-        UserVo userVo = loginService.login(loginDto);
-        // 响应给前端
-        return ResponseResult.success(userVo);
-    }
-}

+ 0 - 87
kyl/kyl-security/src/main/java/com/kyl/controller/PostController.java

@@ -1,87 +0,0 @@
-package com.kyl.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.kyl.base.PageResponse;
-import com.kyl.base.ResponseResult;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.PostDto;
-import com.kyl.entity.Post;
-import com.kyl.service.PostService;
-import com.kyl.vo.PostVo;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title PostController
- * @description
- * @create 2026/1/29
- */
-@RestController
-@RequestMapping("/post")
-public class PostController {
-    @Resource
-    private PostService postService;
-
-    /**
-     * 分页查询岗位列表
-     * @param postDto 查询参数
-     * @param pageNum 页码
-     * @param pageSize 页尺寸
-     * @return
-     */
-    @PostMapping("/page/{pageNum}/{pageSize}")
-    public ResponseResult<PageResponse<PostVo>> page(@RequestBody PostDto postDto,
-                               @PathVariable("pageNum") Integer pageNum,
-                               @PathVariable("pageSize") Integer pageSize) {
-
-        PageResponse<PostVo> pageResponse=postService.findPostPage(postDto, pageNum, pageSize);
-        return ResponseResult.success(pageResponse);
-    }
-
-    /**
-     * 保存岗位
-     * @param postDto
-     * @return
-     */
-    @PutMapping
-    public ResponseResult<Boolean> savePost(@RequestBody PostDto postDto){
-        return ResponseResult.success(postService.savePost(postDto));
-    }
-
-    /**
-     * 修改岗位
-     * @param postDto
-     * @return
-     */
-    @PatchMapping
-    public ResponseResult<Boolean> updatePost(@RequestBody PostDto postDto){
-        return ResponseResult.success(postService.updatePost(postDto));
-    }
-
-    /**
-     * 删除岗位
-     * @param postNo
-     * @return
-     */
-    @DeleteMapping("/{postNo}")
-    public ResponseResult<Boolean> deletePost(@PathVariable("postNo") String postNo){
-        QueryWrapper<Post> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("post_no", postNo);
-        return ResponseResult.success(postService.remove(queryWrapper));
-    }
-
-    /**
-     * 根据部门编号查询职位列表
-     */
-    @PostMapping("/list")
-    public ResponseResult<List<PostVo>> findPostList(@RequestBody PostDto postDto){
-        List<PostVo> postVoList = postService.findPostList(postDto);
-        return ResponseResult.success(postVoList);
-    }
-
-}

+ 0 - 62
kyl/kyl-security/src/main/java/com/kyl/controller/ResourceController.java

@@ -1,62 +0,0 @@
-package com.kyl.controller;
-
-
-import com.kyl.base.ResponseResult;
-import com.kyl.dto.ResourceDto;
-import com.kyl.entity.Resource;
-import com.kyl.service.ResourceService;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.vo.MenuVo;
-import com.kyl.vo.ResourceVo;
-import com.kyl.vo.TreeVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title ResourceController
- * @description
- * @create 2026/1/27
- */
-@RestController
-@RequestMapping("/resource")
-public class ResourceController {
-    @Autowired
-    private ResourceService resourceService;
-
-
-    @GetMapping("/menus")
-    public ResponseResult<List<MenuVo>> menus() {
-        List<MenuVo> list = resourceService.menus();
-        return ResponseResult.success(list);
-    }
-
-    @GetMapping("/myButten")
-    public ResponseResult<List<MenuVo>> myButten() {
-        List<MenuVo> list = resourceService.myButten();
-        return ResponseResult.success(list);
-    }
-
-    @PostMapping("/list")
-    public ResponseResult<List<ResourceVo>> list(@RequestBody ResourceDto resourceDto) {
-        List<Resource> resourceList =
-                resourceService
-                        .lambdaQuery()
-                        .eq(!EmptyUtil.isNullOrEmpty(resourceDto.getParentResourceNo()),Resource::getParentResourceNo, resourceDto.getParentResourceNo())
-                        .eq(!EmptyUtil.isNullOrEmpty(resourceDto.getResourceType()),Resource::getResourceType, resourceDto.getResourceType())
-                        .orderByAsc(Resource::getSortNo)
-                        .list();
-        List<ResourceVo> list = BeanConv.toBeanList(resourceList, ResourceVo.class);
-        return ResponseResult.success(list);
-    }
-
-    @PostMapping("/tree")
-    public ResponseResult<TreeVo> tree(){
-        TreeVo deptListTree = resourceService.findDeptListTree();
-        return ResponseResult.success(deptListTree);
-    }
-}

+ 0 - 66
kyl/kyl-security/src/main/java/com/kyl/controller/RoleController.java

@@ -1,66 +0,0 @@
-package com.kyl.controller;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.kyl.base.PageResponse;
-import com.kyl.base.ResponseResult;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.Role;
-import com.kyl.service.RoleService;
-import com.kyl.service.RoleResourceService;
-import com.kyl.utils.BeanConv;
-import com.kyl.vo.RoleVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RoleController
- * @description
- * @create 2026/1/29
- */
-@RestController
-@RequestMapping("/role")
-public class RoleController {
-    @Resource
-    private RoleService roleService;
-    /**
-     * 初始化角色列表
-     * @return
-     */
-    @PostMapping("/init-roles")
-    public ResponseResult<RoleVo> initRoles(){
-        QueryWrapper<Role> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("data_state", SuperConstant.DATA_STATE_0);
-        List<Role> list = roleService.list(queryWrapper);
-        List<RoleVo> roleVoList = BeanConv.toBeanList(list, RoleVo.class);
-        return ResponseResult.success(roleVoList);
-    }
-
-    /**
-     * 分页查询角色列表
-     * @param roleDto 查询参数
-     * @param pageNum 当前页码
-     * @param pageSize 每页数量
-     * @return
-     */
-    @PostMapping("/page/{pageNum}/{pageSize}")
-    public ResponseResult<PageResponse<RoleVo>> page(@RequestBody RoleDto roleDto,
-                                                    @PathVariable Integer pageNum,
-                                                    @PathVariable Integer pageSize){
-        PageResponse<RoleVo> page = roleService.findRolePage(roleDto, pageNum, pageSize);
-        return ResponseResult.success(page);
-    }
-    //修改角色的菜单权限
-    //前端传入的参数有2个,一个是角色id,一个是菜单编号集合
-    @PatchMapping
-    public ResponseResult<String> updateRoleMenu(@RequestBody RoleDto roleDto){
-        return ResponseResult.success(roleService.updateRole(roleDto));
-    }
-}

+ 0 - 100
kyl/kyl-security/src/main/java/com/kyl/controller/UserController.java

@@ -1,100 +0,0 @@
-package com.kyl.controller;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.kyl.base.PageResponse;
-import com.kyl.base.ResponseResult;
-import com.kyl.dto.UserDto;
-import com.kyl.entity.User;
-import com.kyl.service.UserService;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.UserThreadLocal;
-import com.kyl.vo.UserVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserController
- * @description
- * @create 2026/1/27
- */
-@Slf4j
-@RestController
-@RequestMapping("/user")
-public class UserController {
-    @Resource
-    private UserService userService;
-
-    @GetMapping("/current-user")
-    public ResponseResult<UserVo> findCurrentUser(){
-        //从当前线程中获取用户信息
-        String subject = UserThreadLocal.getSubject();
-        //转换成UserVo对象
-        UserVo userVo = JSONObject.parseObject(subject, UserVo.class);
-        log.info("当前用户信息为---------->{}",userVo);
-        return ResponseResult.success(userVo);
-    }
-
-    /**
-     * 查询用户列表
-     * @return
-     */
-    @PostMapping("/list")
-    public ResponseResult<List<UserVo>> findUserList(){
-        List<User> list = userService.list();
-        List<UserVo> userVoList = BeanConv.toBeanList(list, UserVo.class);
-        return ResponseResult.success(userVoList);
-    }
-
-    /**
-     * 分页查询用户列表
-     * @param userDto 查询参数
-     * @param pageNum 当前页码
-     * @param pageSize 每页显示数量
-     * @return
-     */
-    @PostMapping("/page/{pageNum}/{pageSize}")
-    public ResponseResult<PageResponse<UserVo>> findUserPageList(@RequestBody UserDto userDto,
-                                                                    @PathVariable("pageNum") Integer pageNum,
-                                                                    @PathVariable("pageSize") Integer pageSize){
-        PageResponse<UserVo> pageResponse=userService.findUserPage(userDto, pageNum, pageSize);
-        return ResponseResult.success(pageResponse);
-    }
-
-    /**
-     * 保存用户
-     * @param userDto
-     * @return
-     */
-    @PutMapping
-    public ResponseResult<Boolean> saveUser(@RequestBody UserDto userDto){
-        boolean flag = userService.saveUser(userDto);
-        return ResponseResult.success(flag);
-    }
-
-    /**
-     * 修改用户
-     * @param userDto
-     * @return
-     */
-    @PatchMapping
-    public ResponseResult<Boolean> updateUser(@RequestBody UserDto userDto){
-        log.info("修改用户信息---------->{}",userDto);
-        boolean flag = userService.updateUser(userDto);
-        return ResponseResult.success(flag);
-    }
-
-    @DeleteMapping("/remove/{id}")
-    public ResponseResult<Boolean> removeUser(@PathVariable("id") Long id){
-        log.info("删除用户---------->{}",id);
-        boolean flag = userService.removeUserById(id);
-        return ResponseResult.success(flag);
-    }
-
-
-}

+ 0 - 55
kyl/kyl-security/src/main/java/com/kyl/dto/DeptDto.java

@@ -1,55 +0,0 @@
-package com.kyl.dto;
-
-import com.kyl.base.BaseDto;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.Objects;
-
-/**
- * @author WanJl
- */
-@Data
-@NoArgsConstructor
-public class DeptDto extends BaseDto {
-
-    @ApiModelProperty(value = "父部门编号")
-    private String parentDeptNo;
-
-    @ApiModelProperty(value = "部门编号")
-    private String deptNo;
-
-    @ApiModelProperty(value = "部门名称")
-    private String deptName;
-
-    @ApiModelProperty(value = "排序")
-    private Integer sortNo;
-
-    @ApiModelProperty(value = "负责人Id")
-    private Long leaderId;
-
-    @ApiModelProperty(value = "是否启用(0:启用,1:禁用)")
-    private String dataState;
-
-    @ApiModelProperty(value = "层级")
-    private Integer level = 4;
-
-    @Builder
-    public DeptDto(String parentDeptNo, String deptNo, String deptName, Integer sortNo, Long leaderId, String dataState, Integer level) {
-        this.parentDeptNo = parentDeptNo;
-        this.deptNo = deptNo;
-        this.deptName = deptName;
-        this.sortNo = sortNo;
-        this.leaderId = leaderId;
-        this.dataState = dataState;
-        this.level = level;
-    }
-
-    @Override
-    public int hashCode() {
-        int result = Objects.hash(super.hashCode(), getParentDeptNo(), getDeptNo(), getDeptName(), getDataState(), getLeaderId());
-        return result;
-    }
-}

+ 0 - 17
kyl/kyl-security/src/main/java/com/kyl/dto/LoginDto.java

@@ -1,17 +0,0 @@
-package com.kyl.dto;
-
-
-import lombok.Data;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title LoginDto
- * @description
- * @create 2026/1/23
- */
-@Data
-public class LoginDto {
-    private String username;
-    private String password;
-}

+ 0 - 48
kyl/kyl-security/src/main/java/com/kyl/dto/PostDto.java

@@ -1,48 +0,0 @@
-package com.kyl.dto;
-
-import com.kyl.base.BaseDto;
-import com.kyl.vo.DeptVo;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- */
-@Data
-@NoArgsConstructor
-public class PostDto extends BaseDto {
-
-    @ApiModelProperty(value = "部门编号")
-    private String deptNo;
-
-    @ApiModelProperty(value = "岗位编码:父部门编号+001【3位】")
-    private String postNo;
-
-    @ApiModelProperty(value = "岗位名称")
-    private String postName;
-
-    @ApiModelProperty(value = "显示顺序")
-    private Integer sortNo;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "职位对应部门")
-    private DeptVo deptVo;
-
-    @ApiModelProperty(value = "是否启用(0:启用,1:禁用)")
-    private String dataState;
-
-    @Builder
-    public PostDto(String deptNo, String postNo, String postName, Integer sortNo, String remark, DeptVo deptVo, String dataState) {
-        this.deptNo = deptNo;
-        this.postNo = postNo;
-        this.postName = postName;
-        this.sortNo = sortNo;
-        this.remark = remark;
-        this.deptVo = deptVo;
-        this.dataState = dataState;
-    }
-}

+ 0 - 69
kyl/kyl-security/src/main/java/com/kyl/dto/ResourceDto.java

@@ -1,69 +0,0 @@
-package com.kyl.dto;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import com.kyl.base.BaseDto;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * 资源DTO
- */
-@Data
-@NoArgsConstructor
-public class ResourceDto extends BaseDto {
-
-    @ApiModelProperty(value = "资源编号")
-    private String resourceNo;
-
-    @ApiModelProperty(value = "父资源编号")
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private String parentResourceNo;
-
-    @ApiModelProperty(value = "资源名称")
-    private String resourceName;
-
-    @ApiModelProperty(value = "资源类型:s平台 c目录 m菜单 r按钮")
-    private String resourceType;
-
-    @ApiModelProperty(value = "请求地址")
-    private String requestPath;
-
-    @ApiModelProperty(value = "权限标识")
-    private String label;
-
-    @ApiModelProperty(value = "排序")
-    private Integer sortNo;
-
-    @ApiModelProperty(value = "图标")
-    private String icon;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "角色查询资源:资源对应角色id")
-    private String roleId;
-
-    @ApiModelProperty(value = "层级")
-    private Integer level = 4;
-
-    @ApiModelProperty(value = "是否启用(0:启用,1:禁用)")
-    private String dataState;
-
-    @Builder
-    public ResourceDto(String resourceNo, String parentResourceNo, String resourceName, String resourceType, String requestPath, String label, Integer sortNo, String icon, String remark, String roleId, Integer level, String dataState) {
-        this.resourceNo = resourceNo;
-        this.parentResourceNo = parentResourceNo;
-        this.resourceName = resourceName;
-        this.resourceType = resourceType;
-        this.requestPath = requestPath;
-        this.label = label;
-        this.sortNo = sortNo;
-        this.icon = icon;
-        this.remark = remark;
-        this.roleId = roleId;
-        this.level = level;
-        this.dataState = dataState;
-    }
-}

+ 0 - 55
kyl/kyl-security/src/main/java/com/kyl/dto/RoleDto.java

@@ -1,55 +0,0 @@
-package com.kyl.dto;
-
-import com.kyl.base.BaseDto;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * 角色表
- */
-@Data
-@NoArgsConstructor
-public class RoleDto extends BaseDto {
-
-    @ApiModelProperty(value = "角色名称")
-    private String roleName;
-
-    @ApiModelProperty(value = "角色标识")
-    private String label;
-
-    @ApiModelProperty(value = "排序")
-    private Integer sortNo;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "人员查询部门:当前人员Id")
-    private String userId;
-
-    @ApiModelProperty(value = "数据范围(0自定义  1本人 2本部门及以下 3本部门 4全部)")
-    private String dataScope;
-
-    @ApiModelProperty(value = "是否启用(0:启用,1:禁用)")
-    private String dataState;
-
-    @ApiModelProperty(value = "TREE结构:选中资源No")
-    private String[] checkedResourceNos;
-
-    @ApiModelProperty(value = "TREE结构:选中部门No")
-    private String[] checkedDeptNos;
-
-    @Builder
-    public RoleDto(String roleName, String label, Integer sortNo, String remark, String userId, String dataScope, String dataState, String[] checkedResourceNos, String[] checkedDeptNos) {
-        this.roleName = roleName;
-        this.label = label;
-        this.sortNo = sortNo;
-        this.remark = remark;
-        this.userId = userId;
-        this.dataScope = dataScope;
-        this.dataState = dataState;
-        this.checkedResourceNos = checkedResourceNos;
-        this.checkedDeptNos = checkedDeptNos;
-    }
-}

+ 0 - 81
kyl/kyl-security/src/main/java/com/kyl/dto/UserDto.java

@@ -1,81 +0,0 @@
-package com.kyl.dto;
-
-import com.kyl.base.BaseDto;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.Set;
-
-/**
- * 用户表
- */
-@Data
-@NoArgsConstructor
-public class UserDto extends BaseDto {
-
-    @ApiModelProperty(value = "用户账号")
-    private String username;
-
-    @ApiModelProperty(value = "是否启用(0:启用,1:禁用)")
-    private String dataState;
-
-    @ApiModelProperty(value = "用户邮箱")
-    private String email;
-
-    @ApiModelProperty(value = "用户昵称")
-    private String nickName;
-
-    @ApiModelProperty(value = "用户职位")
-    private String post;
-
-    @ApiModelProperty(value = "用户部门")
-    private String dept;
-
-    @ApiModelProperty(value = "真实姓名")
-    private String realName;
-
-    @ApiModelProperty(value = "手机号码")
-    private String mobile;
-
-    @ApiModelProperty(value = "用户性别(0男 1女 2未知)")
-    private String sex;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "选中节点")
-    private String[] checkedIds;
-
-    @ApiModelProperty(value = "查询用户:用户角色Ids")
-    private Set<String>  roleVoIds;
-
-    @ApiModelProperty(value = "部门编号【当前】")
-    private String deptNo;
-
-    @ApiModelProperty(value = "职位编号【当前】")
-    private String postNo;
-
-    @ApiModelProperty(value = "角色Id【当前】")
-    private Long roleId;
-
-    @Builder
-    public UserDto(String username, String dataState, String email, String nickName, String post, String dept, String realName, String mobile, String sex, String remark, String[] checkedIds, Set<String> roleVoIds, String deptNo, String postNo, Long roleId) {
-        this.username = username;
-        this.dataState = dataState;
-        this.email = email;
-        this.nickName = nickName;
-        this.post = post;
-        this.dept = dept;
-        this.realName = realName;
-        this.mobile = mobile;
-        this.sex = sex;
-        this.remark = remark;
-        this.checkedIds = checkedIds;
-        this.roleVoIds = roleVoIds;
-        this.deptNo = deptNo;
-        this.postNo = postNo;
-        this.roleId = roleId;
-    }
-}

+ 0 - 59
kyl/kyl-security/src/main/java/com/kyl/entity/Dept.java

@@ -1,59 +0,0 @@
-package com.kyl.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.kyl.base.BaseEntity;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title Dept
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class Dept extends BaseEntity {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 父部门编号
-     */
-    private String parentDeptNo;
-
-    /**
-     * 部门编号:
-     */
-    private String deptNo;
-
-    /**
-     * 部门名称
-     */
-    private String deptName;
-
-    /**
-     * 排序
-     */
-    private Integer sortNo;
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-    /**
-     * 负责人Id
-     */
-    private Long leaderId;
-
-    /**
-     * 负责人姓名
-     */
-    @TableField(exist = false)  // 表示该字段不是数据库字段
-    private String leaderName;
-
-
-}

+ 0 - 46
kyl/kyl-security/src/main/java/com/kyl/entity/Post.java

@@ -1,46 +0,0 @@
-package com.kyl.entity;
-
-import com.kyl.base.BaseEntity;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class Post extends BaseEntity {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * 部门编号
-     */
-    private String deptNo;
-
-    /**
-     * 岗位编码:父部门编号+01【2位】
-     */
-    private String postNo;
-
-    /**
-     * 岗位名称
-     */
-    private String postName;
-
-    /**
-     * 显示顺序
-     */
-    private Integer sortNo;
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-}

+ 0 - 65
kyl/kyl-security/src/main/java/com/kyl/entity/Resource.java

@@ -1,65 +0,0 @@
-package com.kyl.entity;
-
-import com.kyl.base.BaseEntity;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class Resource extends BaseEntity {
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-    /**
-     * 图标
-     */
-    private String icon;
-
-    /**
-     * 权限标识
-     */
-    private String label;
-
-    /**
-     * 父资源编号
-     */
-    private String parentResourceNo;
-
-    /**
-     * 请求地址
-     */
-    private String requestPath;
-
-    /**
-     * 资源名称
-     */
-    private String resourceName;
-
-    /**
-     * 资源编号
-
-     */
-    private String resourceNo;
-
-    /**
-     * 资源类型:s平台 c目录 m菜单 r按钮
-     */
-    private String resourceType;
-
-    /**
-     * 排序
-     */
-    private Integer sortNo;
-
-}

+ 0 - 44
kyl/kyl-security/src/main/java/com/kyl/entity/Role.java

@@ -1,44 +0,0 @@
-package com.kyl.entity;
-
-import com.kyl.base.BaseEntity;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class Role extends BaseEntity {
-
-    /**
-     * 数据范围:0自定义  1本人 2本部门及以下 3本部门 4全部
-     */
-    private String dataScope;
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-    /**
-     * 权限标识
-     */
-    private String label;
-
-    /**
-     * 角色名称
-     */
-    private String roleName;
-
-    /**
-     * 排序
-     */
-    private Integer sortNo;
-
-}

+ 0 - 19
kyl/kyl-security/src/main/java/com/kyl/entity/RoleResource.java

@@ -1,19 +0,0 @@
-package com.kyl.entity;
-
-
-import com.kyl.base.BaseEntity;
-import lombok.Data;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RoleResource
- * @description
- * @create 2026/2/9
- */
-@Data
-public class RoleResource extends BaseEntity {
-    private Long roleId;
-    private Long resourceNo;
-    private String dataState;
-}

+ 0 - 117
kyl/kyl-security/src/main/java/com/kyl/entity/User.java

@@ -1,117 +0,0 @@
-package com.kyl.entity;
-
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.kyl.base.BaseEntity;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class User extends BaseEntity {
-
-    /**
-     * 头像地址
-     */
-    private String avatar;
-
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-    /**
-     * 部门编号
-     */
-    private String deptNo;
-
-    /**
-     * 用户邮箱
-     */
-    private String email;
-
-    /**
-     * 是否删除
-     */
-    private Integer isDelete;
-
-    /**
-     * 是否是部门leader(0:否,1:是)
-     */
-    private Integer isLeader;
-
-    /**
-     * 手机号码
-     */
-    private String mobile;
-
-    /**
-     * 用户昵称
-     */
-    private String nickName;
-
-    /**
-     * open_id标识
-     */
-    private String openId;
-
-    /**
-     * 密码
-     */
-    private String password;
-
-    /**
-     * 岗位编号
-     */
-    private String postNo;
-
-    /**
-     * 真实姓名
-     */
-    private String realName;
-
-    /**
-     * 用户性别(0男 1女 2未知)
-     */
-    private String sex;
-
-
-    /**
-     * 用户类型(0:系统用户,1:客户)
-     */
-    private String userType;
-
-    /**
-     * 用户账号
-     */
-    private String username;
-
-
-
-    @Builder
-    public User(String username, String openId, String password, String userType, String avatar, String nickName, String email, String realName, String mobile, String sex, String dataState, String deptNo, String postNo, Integer isLeader) {
-        this.username = username;
-        this.openId = openId;
-        this.password = password;
-        this.userType = userType;
-        this.avatar = avatar;
-        this.nickName = nickName;
-        this.email = email;
-        this.realName = realName;
-        this.mobile = mobile;
-        this.sex = sex;
-        this.dataState = dataState;
-        this.deptNo = deptNo;
-        this.postNo = postNo;
-        this.isLeader = isLeader;
-    }
-}

+ 0 - 41
kyl/kyl-security/src/main/java/com/kyl/entity/UserRole.java

@@ -1,41 +0,0 @@
-package com.kyl.entity;
-
-import com.kyl.base.BaseEntity;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title
- * @description
- * @create 2024/12/4
- */
-
-@Data
-@NoArgsConstructor
-public class UserRole extends BaseEntity {
-
-    /**
-     * 数据状态(0正常 1停用)
-     */
-    private String dataState;
-
-    /**
-     * 角色ID
-     */
-    private Long roleId;
-
-    /**
-     * 用户ID
-     */
-    private Long userId;
-
-    @Builder
-    public UserRole(Long userId, Long roleId, String dataState) {
-        this.userId = userId;
-        this.roleId = roleId;
-        this.dataState = dataState;
-    }
-}

+ 0 - 35
kyl/kyl-security/src/main/java/com/kyl/mapper/DeptMapper.java

@@ -1,35 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.kyl.dto.DeptDto;
-import com.kyl.entity.Dept;
-import com.kyl.vo.DeptVo;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title DeptMapper
- * @description
- * @create 2026/1/27
- */
-@Mapper
-public interface DeptMapper extends BaseMapper<Dept> {
-    /**
-     * 根据条件查询部门列表
-     * @param deptDto
-     * @return
-     */
-    List<DeptVo> findDeptVoListByCondition(@Param("deptDto") DeptDto deptDto);
-
-    /**
-     * 根据角色Id查询部门列表
-     * @param roleIdList
-     * @return
-     */
-    List<DeptVo> findDeptVoListByRoleIds(@Param("roleIdList") List<Long> roleIdList);
-}

+ 0 - 30
kyl/kyl-security/src/main/java/com/kyl/mapper/PostMapper.java

@@ -1,30 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.pagehelper.Page;
-import com.kyl.dto.PostDto;
-import com.kyl.entity.Post;
-import com.kyl.vo.PostVo;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title PostMapper
- * @description
- * @create 2026/1/29
- */
-@Mapper
-public interface PostMapper extends BaseMapper<Post> {
-
-    /**
-     * 根据条件查询岗位列表
-     * @param postDto
-     * @return
-     */
-    Page<List<PostVo>> selectPage(@Param("postDto") PostDto postDto);
-}

+ 0 - 51
kyl/kyl-security/src/main/java/com/kyl/mapper/ResourceMapper.java

@@ -1,51 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.kyl.entity.Resource;
-import com.kyl.vo.ResourceVo;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title ResourceMapper
- * @description
- * @create 2026/1/26
- */
-@Mapper
-public interface ResourceMapper extends BaseMapper<Resource> {
-    /**
-     * 根据用户Id查询资源列表
-     * @param userId
-     * @return
-     */
-    List<ResourceVo> findResourceListByUserId(@Param("userId") Long userId);
-
-    /**
-     * 根据角色Id列表查询资源列表
-     * @param roleIds
-     * @return
-     */
-    List<ResourceVo> findResourceListByRoleIds(@Param("roleIds")List<Long> roleIds,@Param("resourceType") String resourceType);
-
-    List<ResourceVo> findResourcesByRoleIds(@Param("roleIds")List<Long> roleIds);
-
-    /**
-     * 根据角色Id列表查询按钮列表
-     * @param roleIds
-     * @return
-     */
-    List<ResourceVo> findButtonListByRoleIds(@Param("roleIds")List<Long> roleIds);
-
-    /**
-     * 查询所有资源列表
-     * @return
-     */
-    List<ResourceVo> findResourceList();
-
-}

+ 0 - 34
kyl/kyl-security/src/main/java/com/kyl/mapper/RoleMapper.java

@@ -1,34 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.pagehelper.Page;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.Role;
-import com.kyl.vo.RoleVo;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RoleMapper
- * @description
- * @create 2026/1/26
- */
-@Mapper
-public interface RoleMapper extends BaseMapper<Role> {
-    /**
-     * 根据用户Id查询角色列表
-     * @param userId
-     * @return
-     */
-    @Select("SELECT role_id FROM sys_user_role WHERE user_id = #{userId}")
-    List<Long> findRoleIdsByUserId(Long userId);
-
-    Page<List<RoleVo>> findRoleVoListByUserId(@Param("roleDto") RoleDto roleDto);
-
-}

+ 0 - 28
kyl/kyl-security/src/main/java/com/kyl/mapper/RoleResourceMapper.java

@@ -1,28 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.RoleResource;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RolesResourceMapper
- * @description
- * @create 2026/2/9
- */
-@Mapper
-public interface RoleResourceMapper extends BaseMapper<RoleResource> {
-
-    int countRoleResourceByRoleId(Long roleId);
-
-    int deleteRoleResourceByRoleId(Long id);
-
-
-    int createRoleResource(@Param("roleDto") RoleDto roleDto);
-}

+ 0 - 31
kyl/kyl-security/src/main/java/com/kyl/mapper/UserMapper.java

@@ -1,31 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.github.pagehelper.Page;
-import com.kyl.base.PageResponse;
-import com.kyl.dto.UserDto;
-import com.kyl.entity.User;
-import com.kyl.vo.UserVo;
-import org.apache.ibatis.annotations.Mapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserMapper
- * @description
- * @create 2026/1/26
- */
-@Mapper
-public interface UserMapper extends BaseMapper<User> {
-    /**
-     * 分页查询用户列表
-     *
-     * @param userDto
-     * @return
-     */
-    Page<List<UserVo>> selectPageList(@Param("userDto") UserDto userDto);
-}

+ 0 - 26
kyl/kyl-security/src/main/java/com/kyl/mapper/UserRoleMapper.java

@@ -1,26 +0,0 @@
-package com.kyl.mapper;
-
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.kyl.entity.UserRole;
-import com.kyl.vo.UserRoleVo;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserRoleMapper
- * @description
- * @create 2026/1/29
- */
-@Mapper
-public interface UserRoleMapper extends BaseMapper<UserRole> {
-    /**
-     * 根据用户id查询用户角色
-     * @param userId
-     * @return
-     */
-    List<UserRoleVo> selectByUserId(Long userId);
-}

+ 0 - 110
kyl/kyl-security/src/main/java/com/kyl/security/JwtAuthorizationManager.java

@@ -1,110 +0,0 @@
-package com.kyl.security;
-
-
-import com.alibaba.fastjson.JSONObject;
-import com.kyl.constant.SecurityConstant;
-import com.kyl.constant.UserCacheConstant;
-import com.kyl.properties.JwtTokenManagerProperties;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.JwtUtil;
-import com.kyl.utils.ObjectUtil;
-import com.kyl.vo.UserVo;
-import io.jsonwebtoken.Claims;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.security.authorization.AuthorizationDecision;
-import org.springframework.security.authorization.AuthorizationManager;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.web.access.intercept.RequestAuthorizationContext;
-import org.springframework.stereotype.Component;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Supplier;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title JwtAuthorizationManager
- * @description 自定义的 JWT 认证授权管理器
- * @create 2026/1/26
- */
-@Slf4j
-@Component
-public class JwtAuthorizationManager  implements AuthorizationManager<RequestAuthorizationContext> {
-
-    @Autowired
-    private JwtTokenManagerProperties jwtTokenManagerProperties;
-    @Autowired
-    private StringRedisTemplate redisTemplate;
-
-    @Override
-    public AuthorizationDecision check(Supplier<Authentication> authentication, RequestAuthorizationContext requestAuthorizationContext) {
-        //1、获取用户当前的请求路径
-        //获取请求方式
-        String method = requestAuthorizationContext.getRequest().getMethod();
-        //获取请求路径
-        String requestURI = requestAuthorizationContext.getRequest().getRequestURI();
-        String  targetUrl = method + requestURI;
-        log.info("用户请求路径为:{}",targetUrl);
-        //2、获取请求中的认证后传递过来的userToken
-        String userToken =requestAuthorizationContext.getRequest().getHeader(SecurityConstant.USER_TOKEN);
-        log.info("用户请求的token为:{}",userToken);
-        //3、判断userToken
-        if (EmptyUtil.isNullOrEmpty(userToken)){
-            return new AuthorizationDecision(false);    //返回403
-        }
-        //4、通过userToken获取jwt
-        String jwtTokenKey = UserCacheConstant.JWT_TOKEN + userToken;
-        //查询redis数据库中是否存在jwtTokenKey
-        String jwtToken = redisTemplate.opsForValue().get(jwtTokenKey);
-        log.info("用户请求的jwtToken为:{}",jwtToken);
-        //5、判定如果jwtToken为空,则请求不合法
-        if (EmptyUtil.isNullOrEmpty(jwtToken)){
-            return new AuthorizationDecision(false);    //返回403
-        }
-        //6、校验jwtToken到底合不合法
-        Claims claims = JwtUtil.parseJWT(jwtTokenManagerProperties.getBase64EncodedSecretKey(), jwtToken);
-        log.info("解析后的claims为:{}",claims);
-        if (ObjectUtil.isEmpty(claims)){
-            //token失效
-            return new AuthorizationDecision(false);    //返回403
-        }
-        //7、如果校验token通过,就获取userVo对象
-        UserVo userVo = JSONObject.parseObject(String.valueOf(claims.get("userVo")), UserVo.class);
-
-        log.info("用户信息为:{}",userVo);
-        //8、校验redis中的userToken和前端传入的userToken是不是一致的,如果不一致,说明当前用户又再次登录了。当前登录的需要被剔除。
-        String currentUserToken = redisTemplate.opsForValue().get(UserCacheConstant.USER_TOKEN + userVo.getUsername());
-        //log.info("UserVo的userToken----{}",userVo.getUserToken());
-        log.info("当前用户token为:{}",currentUserToken);
-        if (!userToken.equals(currentUserToken)){
-            return new AuthorizationDecision(false);    //返回403
-        }
-
-        //9、判断存活时间如果少于10分钟,就续期
-        Long remainTime = redisTemplate.opsForValue().getOperations().getExpire(jwtTokenKey);
-        if (remainTime.longValue()<=600){
-            //jwt生成的token也会过期的,所以也需要重新生成token
-            Map<String,Object> c=new HashMap<>();
-            String userVoString = String.valueOf(claims.get("userVo"));
-            c.put("userVo",userVoString);
-            //jwtToken令牌颁布
-            String newJwtToken = JwtUtil.createJWT(
-                    jwtTokenManagerProperties.getBase64EncodedSecretKey(),
-                    jwtTokenManagerProperties.getTtl(),
-                    c);
-            long ttl=Long.valueOf(jwtTokenManagerProperties.getTtl())/100;
-            //更新jwtToken
-            redisTemplate.opsForValue().set(jwtTokenKey,newJwtToken,ttl, TimeUnit.SECONDS);
-            //更新过期时间
-            redisTemplate.expire(UserCacheConstant.USER_TOKEN+userVo.getUsername(),ttl,TimeUnit.SECONDS);
-        }
-        //10、判断用户角色权限
-        //......
-
-        return new AuthorizationDecision(true);
-    }
-}

+ 0 - 60
kyl/kyl-security/src/main/java/com/kyl/service/DeptService.java

@@ -1,60 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.kyl.dto.DeptDto;
-import com.kyl.entity.Dept;
-import com.kyl.vo.DeptVo;
-import com.kyl.vo.TreeVo;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title DeptService
- * @description
- * @create 2026/1/27
- */
-public interface DeptService extends IService<Dept> {
-    /**
-     * 根据条件查询部门列表
-     * @param deptDto
-     * @return
-     */
-    List<DeptVo> findDeptVoListByCondition(DeptDto deptDto);
-
-    /**
-     * 组织部门树形结构
-     * @return
-     */
-    TreeVo deptTreeVo();
-
-    /**
-     * 新增部门
-     * @param deptDto
-     * @return
-     */
-    Boolean saveDept(DeptDto deptDto);
-
-    /**
-     * 修改部门
-     * @param deptDto
-     * @return
-     */
-    Boolean updateDept(DeptDto deptDto);
-
-    /**
-     * 删除部门
-     * @param deptNo
-     * @return
-     */
-    Boolean removeDept(String deptNo);
-
-    /**
-     * 根据角色Id查询部门列表
-     * @param roleIdList
-     * @return
-     */
-    List<DeptVo> findDeptVoListByRoleIds(List<Long> roleIdList);
-}

+ 0 - 21
kyl/kyl-security/src/main/java/com/kyl/service/LoginService.java

@@ -1,21 +0,0 @@
-package com.kyl.service;
-
-
-import com.kyl.dto.LoginDto;
-import com.kyl.vo.UserVo;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title LoginService
- * @description 登录服务接口
- * @create 2026/1/23
- */
-public interface LoginService {
-    /**
-     * 用户登录
-     * @param loginDto 登录参数
-     * @return
-     */
-    UserVo login(LoginDto loginDto);
-}

+ 0 - 48
kyl/kyl-security/src/main/java/com/kyl/service/PostService.java

@@ -1,48 +0,0 @@
-package com.kyl.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.kyl.base.PageResponse;
-import com.kyl.dto.PostDto;
-import com.kyl.entity.Post;
-import com.kyl.vo.PostVo;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title PostService
- * @description
- * @create 2026/1/29
- */
-public interface PostService extends IService<Post> {
-    /**
-     * 查询岗位列表
-     *
-     * @param postDto 查询参数
-     * @param pageNum 页码
-     * @param pageSize 页尺寸
-     * @return 岗位列表
-     */
-    PageResponse<PostVo> findPostPage(PostDto postDto, Integer pageNum, Integer pageSize);
-
-    /**
-     * 保存岗位
-     * @param postDto
-     * @return
-     */
-    Boolean savePost(PostDto postDto);
-    /**
-     * 修改岗位
-     * @param postDto
-     * @return
-     */
-    Boolean updatePost(PostDto postDto);
-
-    /**
-     * 根据条件查询岗位列表
-     * @param postDto
-     * @return
-     */
-    List<PostVo> findPostList(PostDto postDto);
-}

+ 0 - 52
kyl/kyl-security/src/main/java/com/kyl/service/ResourceService.java

@@ -1,52 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.kyl.entity.Resource;
-import com.kyl.vo.MenuVo;
-import com.kyl.vo.ResourceVo;
-import com.kyl.vo.TreeVo;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title ResourceService
- * @description
- * @create 2026/1/26
- */
-public interface ResourceService extends IService<Resource> {
-    /**
-     * 根据用户Id查询资源列表
-     * @param userId
-     * @return
-     */
-    List<ResourceVo> findResourceListByUserId(Long userId);
-
-    /**
-     * 查询菜单列表
-     * 查询当前登陆人角色的动态菜单
-     * @return
-     */
-    List<MenuVo> menus();
-
-    /**
-     * 查询按钮列表
-     * @return
-     */
-    List<MenuVo> myButten();
-
-    /**
-     * 根据角色Id列表查询资源列表
-     * @param id
-     * @return
-     */
-    List<ResourceVo> findResourceListByRoleIds(List<Long> id);
-
-    /**
-     * 查询部门列表树
-     * @return
-     */
-    TreeVo findDeptListTree();
-}

+ 0 - 25
kyl/kyl-security/src/main/java/com/kyl/service/RoleResourceService.java

@@ -1,25 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.RoleResource;
-import com.kyl.mapper.RoleResourceMapper;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RolesResourceService
- * @description
- * @create 2026/2/9
- */
-@Service
-public class RoleResourceService extends ServiceImpl<RoleResourceMapper, RoleResource> {
-
-}

+ 0 - 38
kyl/kyl-security/src/main/java/com/kyl/service/RoleService.java

@@ -1,38 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.kyl.base.PageResponse;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.Role;
-import com.kyl.vo.RoleVo;
-
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RoleService
- * @description
- * @create 2026/1/26
- */
-public interface RoleService extends IService<Role> {
-    /**
-     * 根据用户Id查询角色列表
-     * @param userId
-     * @return
-     */
-    List<RoleVo> findRoleVoListByUserId(Long userId);
-
-    /**
-     * 分页查询角色列表
-     * @param roleDto
-     * @param pageNum
-     * @param pageSize
-     * @return
-     */
-    PageResponse<RoleVo> findRolePage(RoleDto roleDto, Integer pageNum, Integer pageSize);
-
-
-    boolean updateRole(RoleDto roleDto);
-}

+ 0 - 18
kyl/kyl-security/src/main/java/com/kyl/service/UserRoleService.java

@@ -1,18 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.kyl.entity.UserRole;
-import com.kyl.mapper.UserRoleMapper;
-import org.springframework.stereotype.Service;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserRoleService
- * @description
- * @create 2026/1/29
- */
-@Service
-public class UserRoleService extends ServiceImpl<UserRoleMapper, UserRole> {
-}

+ 0 - 54
kyl/kyl-security/src/main/java/com/kyl/service/UserService.java

@@ -1,54 +0,0 @@
-package com.kyl.service;
-
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.kyl.base.PageResponse;
-import com.kyl.dto.UserDto;
-import com.kyl.entity.User;
-import com.kyl.vo.UserVo;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserService
- * @description 用户服务
- * @create 2026/1/23
- */
-public interface UserService extends IService<User> {
-    /**
-     * 登录用的根据用户名查询用户VO对象
-     * @param username
-     * @return
-     */
-    UserVo findUserVoForLogin(String username);
-
-    /**
-     * 分页查询用户列表
-     * @param userDto 查询条件
-     * @param pageNum 页码
-     * @param pageSize 每页数量
-     * @return 用户列表
-     */
-    PageResponse<UserVo> findUserPage(UserDto userDto, Integer pageNum, Integer pageSize);
-
-    /**
-     * 保存用户
-     * @param userDto
-     * @return
-     */
-    boolean saveUser(UserDto userDto);
-
-    /**
-     * 修改用户
-     * @param userDto
-     * @return
-     */
-    boolean updateUser(UserDto userDto);
-
-    /**
-     * 删除用户
-     * @param id
-     * @return
-     */
-    boolean removeUserById(Long id);
-}

+ 0 - 224
kyl/kyl-security/src/main/java/com/kyl/service/impl/DeptServiceImpl.java

@@ -1,224 +0,0 @@
-package com.kyl.service.impl;
-
-
-import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.kyl.constant.DeptCacheConstant;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.DeptDto;
-import com.kyl.entity.Dept;
-import com.kyl.exception.BaseException;
-import com.kyl.mapper.DeptMapper;
-import com.kyl.service.DeptService;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.NoProcessing;
-import com.kyl.utils.UserThreadLocal;
-import com.kyl.vo.DeptVo;
-import com.kyl.vo.TreeItemVo;
-import com.kyl.vo.TreeVo;
-import lombok.extern.slf4j.Slf4j;
-import org.assertj.core.util.Lists;
-import org.springframework.cache.annotation.CacheEvict;
-import org.springframework.cache.annotation.Cacheable;
-import org.springframework.cache.annotation.Caching;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.time.LocalDateTime;
-import java.util.Comparator;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title DeptServiceImpl
- * @description
- * @create 2026/1/27
- */
-@Service
-@Slf4j
-public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements DeptService {
-    @Resource
-    private DeptMapper deptMapper;
-
-    @Cacheable(value = DeptCacheConstant.LIST, key = "#deptDto.hashCode()")
-    @Override
-    public List<DeptVo> findDeptVoListByCondition(DeptDto deptDto) {
-        // 先去redis数据库里查询,如果redis数据库里没有,则去MySQL数据库里查询
-        List<DeptVo> deptVoList = deptMapper.findDeptVoListByCondition(deptDto);
-        //查询完后,缓存到redis数据库中
-        return deptVoList;
-    }
-
-    /**
-     * 组织部门树形结构
-     *
-     * @return
-     */
-    @Cacheable(value = DeptCacheConstant.TREE)
-    @Override
-    public TreeVo deptTreeVo() {
-        //1、获取根节点
-        String parentDeptNo = SuperConstant.ROOT_DEPT_PARENT_ID;    //疗养院节点的父节点
-
-        //2、构建查询条件
-        DeptDto param = DeptDto.builder()
-                .dataState(SuperConstant.DATA_STATE_0)  //数据状态为0,启用
-                .parentDeptNo(NoProcessing.processString(parentDeptNo)) //传入处理后的父部门编号
-                .build();
-        //3、根据条件查询部门列表
-        List<DeptVo> deptVoList = findDeptVoListByCondition(param);
-        if (EmptyUtil.isNullOrEmpty(deptVoList)){
-            throw new BaseException("部门没有数据");
-        }
-        //4、获取根节点
-        DeptVo rootDept = deptVoList.stream()
-                .filter(d -> d.getParentDeptNo().equals(parentDeptNo))
-                .collect(Collectors.toList()).get(0);
-        //5、返回部门数据
-        List<TreeItemVo> treeItemVoList = Lists.newArrayList();
-
-        //6、调用递归获取子节点数据
-        recursionTreeItem(treeItemVoList,rootDept,deptVoList);
-
-        return TreeVo.builder().items(treeItemVoList).build();
-    }
-
-
-
-    /**
-     * 递归获取子节点数据
-     * @param treeItemVoList 封装返回的数据
-     * @param rootDept 当前的部门
-     * @param deptVoList 部门列表(全部数据)
-     */
-    private void recursionTreeItem(List<TreeItemVo> treeItemVoList, DeptVo rootDept, List<DeptVo> deptVoList) {
-        //1、构建Item对象
-        TreeItemVo treeItemVo = TreeItemVo.builder()
-                .id(rootDept.getDeptNo())   //节点Id
-                .label(rootDept.getDeptName())   //节点内容
-                .build();
-        //2、获取当前部门下的所有子部门
-        List<DeptVo> childrenList = Lists.newArrayList();
-        for (DeptVo deptVo : deptVoList){
-            if (deptVo.getParentDeptNo().equals(rootDept.getDeptNo())){
-                childrenList.add(deptVo);
-            }
-        }
-        //3、如果子部门不为空,就递归获取子部门数据
-        if (!EmptyUtil.isNullOrEmpty(childrenList)){
-            List<TreeItemVo> childrenTreeItemVoList = Lists.newArrayList();
-            for (DeptVo deptVo : childrenList){
-                //递归获取子部门数据
-                recursionTreeItem(childrenTreeItemVoList,deptVo,deptVoList);
-            }
-            //4、设置子部门数据
-            treeItemVo.setChildren(childrenTreeItemVoList);
-        }
-        //5、添加到返回数据中
-        treeItemVoList.add(treeItemVo);
-    }
-    /**
-     * 新增部门
-     *
-     * @param deptDto
-     * @return
-     */
-    @Caching(
-            evict = {
-                @CacheEvict(value = DeptCacheConstant.TREE,allEntries = true),
-                @CacheEvict(value = DeptCacheConstant.LIST,allEntries = true)
-            }
-    )
-    @Override
-    public Boolean saveDept(DeptDto deptDto) {
-        //1、把DeptDto里面的属性复制到Dpet对象中
-        Dept dept = BeanConv.toBean(deptDto, Dept.class);
-        dept.setDeptNo(createDeptNo(dept.getParentDeptNo()));//部门编号
-        dept.setCreateTime(LocalDateTime.now());    //创建时间
-        dept.setUpdateTime(LocalDateTime.now());    //更新时间
-        dept.setCreateBy(UserThreadLocal.getMgtUserId());//创建人Id
-        dept.setUpdateBy(UserThreadLocal.getMgtUserId());//更新人Id
-        log.info("新增的部门为----------->{}",dept);
-        return save(dept);
-    }
-
-    /**
-     * 创建部门编号
-     * @param parentDeptNo
-     * @return
-     */
-    private String createDeptNo(String parentDeptNo){
-        //1、部门层级不能超过4级
-        if (NoProcessing.processString(parentDeptNo).length()/3==5){
-            throw new BaseException("部门层级不能超过4级");
-        }
-
-        //2、构建部门编号,有两种情况
-        //有子部门,就在已有子部门的基础上累加
-        //没有子部门,直接新增子部门编号
-        DeptDto deptDto = DeptDto.builder()
-                .parentDeptNo(parentDeptNo) //父部门编号
-                .build();
-        //根据部门编号查询子部门列表
-        List<DeptVo> deptVoList = deptMapper.findDeptVoListByCondition(deptDto);
-
-        //没有下属部门的情况
-        if (EmptyUtil.isNullOrEmpty(deptVoList)){
-            return NoProcessing.createNo(parentDeptNo,false);
-        }else {//有下属部门的情况
-            //获取下属部门中最大的部门编号
-            Long deptNo = deptVoList.stream().map(dept -> Long.valueOf(dept.getDeptNo())).max(Comparator.comparing(i -> i)).get();
-            return NoProcessing.createNo(String.valueOf(deptNo),true);
-        }
-
-    }
-
-    /**
-     * 修改部门
-     *
-     * @param deptDto
-     * @return
-     */
-    @Caching(evict = {
-            @CacheEvict(value = DeptCacheConstant.TREE,allEntries = true),
-            @CacheEvict(value = DeptCacheConstant.LIST,allEntries = true),
-    })
-    @Override
-    public Boolean updateDept(DeptDto deptDto) {
-        Dept dept = BeanConv.toBean(deptDto, Dept.class);
-        dept.setUpdateBy(UserThreadLocal.getMgtUserId());   //更新人Id
-        dept.setUpdateTime(LocalDateTime.now());    //更新时间
-        return updateById(dept);
-    }
-
-    /**
-     * 删除部门
-     *
-     * @param deptNo
-     * @return
-     */
-    @Caching(evict = {
-            @CacheEvict(value = DeptCacheConstant.TREE,allEntries = true),
-            @CacheEvict(value = DeptCacheConstant.LIST,allEntries = true)
-    })
-    @Override
-    public Boolean removeDept(String deptNo) {
-        UpdateWrapper updateWrapper=new UpdateWrapper<>();
-        updateWrapper.eq("dept_no",deptNo);
-        return this.remove(updateWrapper);
-    }
-
-    /**
-     * 根据角色Id查询部门列表
-     *
-     * @param roleIdList
-     * @return
-     */
-    @Override
-    public List<DeptVo> findDeptVoListByRoleIds(List<Long> roleIdList) {
-        return deptMapper.findDeptVoListByRoleIds(roleIdList);
-    }
-}

+ 0 - 113
kyl/kyl-security/src/main/java/com/kyl/service/impl/LoginServiceImpl.java

@@ -1,113 +0,0 @@
-package com.kyl.service.impl;
-
-
-import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.json.JSONUtil;
-import com.kyl.constant.UserCacheConstant;
-import com.kyl.dto.LoginDto;
-import com.kyl.exception.BaseException;
-import com.kyl.properties.JwtTokenManagerProperties;
-import com.kyl.service.LoginService;
-import com.kyl.service.ResourceService;
-import com.kyl.service.RoleService;
-import com.kyl.utils.JwtUtil;
-import com.kyl.vo.ResourceVo;
-import com.kyl.vo.RoleVo;
-import com.kyl.vo.UserAuth;
-import com.kyl.vo.UserVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
-import org.springframework.data.redis.core.StringRedisTemplate;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title LoginServiceImpl
- * @description
- * @create 2026/1/23
- */
-@Service
-public class LoginServiceImpl implements LoginService {
-    @Resource
-    private AuthenticationManager authenticationManager;
-    @Resource
-    private RoleService roleService;
-    @Resource
-    private ResourceService resourceService;
-    @Autowired
-    JwtTokenManagerProperties jwtTokenManagerProperties;
-    @Autowired
-    private StringRedisTemplate redisTemplate;
-
-    @Override
-    public UserVo login(LoginDto loginDto) {
-        //1、认证管理器--认证用户,我们需要准备UserDetailsService来查询用户
-        UsernamePasswordAuthenticationToken authenticationToken=new
-                UsernamePasswordAuthenticationToken(loginDto.getUsername(),loginDto.getPassword());
-        Authentication authenticate = authenticationManager.authenticate(authenticationToken);
-        //2、判断是否校验成功
-        if (!authenticate.isAuthenticated()){
-            throw new BaseException("登录失败...Authentication校验失败");
-        }
-        //3、获取用户认证的信息
-        UserAuth userAuth = (UserAuth) authenticate.getPrincipal();
-        //将userAuth里面的属性赋值到UserVo对象中
-        //BeanUtil.toBean(原对象,新对象类型.class)
-        //这个方法是hutool工具库提供的一个根据已有对象创建目标对象的方法,并且把已有对象的所有属性,赋值到新对象的对应属性中。
-        UserVo userVo = BeanUtil.toBean(userAuth, UserVo.class);
-
-        //4、获取角色列表
-        List<RoleVo> roleVoList = roleService.findRoleVoListByUserId(userVo.getId());
-        userVo.setRoleList(roleVoList);
-        //获取每个角色的label标记,返回set集合
-        userVo.setRoleLabels(roleVoList.stream().map(RoleVo::getLabel).collect(Collectors.toSet()));
-
-        //5、获取权限列表
-        List<ResourceVo> resourceVoList = resourceService.findResourceListByUserId(userVo.getId());
-        Set<String> requestPathSet = resourceVoList.stream()
-                .filter(resourceVo -> resourceVo.getResourceType().equals("r")) //过滤出按钮权限
-                .map(ResourceVo::getRequestPath)    //获取请求路径
-                .collect(Collectors.toSet());
-        userVo.setResourceRequestPaths(requestPathSet);
-
-        //6、重置密码为空字符串
-        userVo.setPassword("");
-
-        //7、存入到redis中  username:uuid
-        String uuidToken = UUID.randomUUID().toString();
-        userVo.setUserToken(uuidToken);
-        Map<String,Object> claims=new HashMap<>();
-        String userVoString = JSONUtil.toJsonStr(userVo);
-        claims.put("userVo",userVoString);
-        //8、生成token
-        String jwtToken = JwtUtil.createJWT(
-                jwtTokenManagerProperties.getBase64EncodedSecretKey(),
-                jwtTokenManagerProperties.getTtl(),
-                claims);
-
-        //生成用户token的key
-        String userTokenKey= UserCacheConstant.USER_TOKEN+userVo.getUsername();
-        //生成过期时间
-        long ttl=Long.valueOf(jwtTokenManagerProperties.getTtl()/1000);
-
-        //9、将token和uuid存入redis
-        redisTemplate.opsForValue().set(userTokenKey,uuidToken,ttl, TimeUnit.SECONDS);
-
-        //10、把jwt存到redis中
-        //生成JwtToken的key
-        String jwtTokenKey= UserCacheConstant.JWT_TOKEN+uuidToken;
-        redisTemplate.opsForValue().set(jwtTokenKey,jwtToken,ttl, TimeUnit.SECONDS);
-
-        //返回vo
-        return userVo;
-    }
-}

+ 0 - 159
kyl/kyl-security/src/main/java/com/kyl/service/impl/PostServiceImpl.java

@@ -1,159 +0,0 @@
-package com.kyl.service.impl;
-
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
-import com.kyl.base.PageResponse;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.PostDto;
-import com.kyl.entity.Dept;
-import com.kyl.entity.Post;
-import com.kyl.mapper.PostMapper;
-import com.kyl.service.DeptService;
-import com.kyl.service.PostService;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.NoProcessing;
-import com.kyl.utils.UserThreadLocal;
-import com.kyl.vo.DeptVo;
-import com.kyl.vo.PostVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.time.LocalDateTime;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title PostServiceImpl
- * @description
- * @create 2026/1/29
- */
-@Service
-@Slf4j
-public class PostServiceImpl extends ServiceImpl<PostMapper, Post> implements PostService {
-    @Resource
-    private PostMapper postMapper;
-    @Resource
-    private DeptService deptService;
-    /**
-     * 查询岗位列表
-     *
-     * @param postDto  查询参数
-     * @param pageNum  页码
-     * @param pageSize 页尺寸
-     * @return 岗位列表
-     */
-    @Override
-    public PageResponse<PostVo> findPostPage(PostDto postDto, Integer pageNum, Integer pageSize) {
-        //1、启动PageHelper分页插件
-        PageHelper.startPage(pageNum, pageSize);
-        //2、判空
-        if (EmptyUtil.isNullOrEmpty(postDto.getDeptNo())){
-            throw new RuntimeException("部门不能为空");
-        }
-        //3、调用mapper查询
-        //判断,如果部门编号是疗养院编号,那么查询所有
-        Page<List<PostVo>> page = null;
-        if (postDto.getDeptNo().equals(SuperConstant.ROOT_PARENT_ID)){
-            postDto.setDeptNo(null);
-            page = postMapper.selectPage(postDto);
-        }else {
-            page = postMapper.selectPage(postDto);
-        }
-        //4、将查询结果转化为PageResponse
-        PageResponse<PostVo> pageResponse = PageResponse.of(page, PostVo.class);
-        log.info("查询岗位列表成功----->{}",pageResponse);
-        //5、判断分页中是否有数据,如果不为空
-        if (!EmptyUtil.isNullOrEmpty(pageResponse.getRecords())){
-            //6、遍历分页数据--赋值部门名称
-            for (PostVo postVo : pageResponse.getRecords()) {
-                QueryWrapper<Dept> queryWrapper = new QueryWrapper<>();
-                queryWrapper.eq("dept_no",postVo.getDeptNo());
-                Dept dept = deptService.getOne(queryWrapper);
-                DeptVo deptVo = BeanConv.toBean(dept, DeptVo.class);
-                postVo.setDeptVo(deptVo);
-            }
-        }
-        log.info("查询岗位列表成功----->{}",pageResponse.getRecords());
-        return pageResponse;
-    }
-
-    /**
-     * 保存岗位
-     *
-     * @param postDto
-     * @return
-     */
-    @Override
-    public Boolean savePost(PostDto postDto) {
-        //1、转换PostVo为 Post
-        Post post = BeanConv.toBean(postDto, Post.class);
-        post.setUpdateBy(UserThreadLocal.getMgtUserId());
-        //2、生成岗位编号
-        String postNo = createPostNo(post.getDeptNo());
-        post.setPostNo(postNo);
-        //3、保存岗位
-        boolean flag = this.save(post);
-        return flag;
-    }
-
-    /**
-     * 生成岗位编号
-     * @param deptNo
-     * @return
-     */
-    private String createPostNo(String deptNo) {
-        //1、根据部门编号查询职位列表
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("dept_no",deptNo);
-        List<Post> postList = this.list(queryWrapper);
-        //2、判断当前部门下是否有职位
-        if (EmptyUtil.isNullOrEmpty(postList)){ //没有职位
-            return NoProcessing.createNo(deptNo,false);
-        }else { //有职位
-            Long postNo = postList.stream()
-                    .map(post -> Long.valueOf(post.getPostNo()))
-                    .max(Comparator.comparing(i -> i)).get();
-            //生成岗位编号并返回给调用者
-            return NoProcessing.createNo(String.valueOf(postNo),true);
-        }
-
-    }
-
-    /**
-     * 修改岗位
-     *
-     * @param postDto
-     * @return
-     */
-    @Override
-    public Boolean updatePost(PostDto postDto) {
-        Post post = BeanConv.toBean(postDto, Post.class);
-        //修改时间&修改人
-        post.setUpdateTime(LocalDateTime.now());
-        post.setUpdateBy(UserThreadLocal.getMgtUserId());
-        boolean flag = this.updateById(post);
-        return flag;
-    }
-
-    /**
-     * 根据条件查询岗位列表
-     *
-     * @param postDto
-     * @return
-     */
-    @Override
-    public List<PostVo> findPostList(PostDto postDto) {
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("dept_no",postDto.getDeptNo());
-        List<Post> postList = this.list(queryWrapper);
-        List<PostVo> postVoList = BeanConv.toBeanList(postList, PostVo.class);
-        return postVoList;
-    }
-}

+ 0 - 278
kyl/kyl-security/src/main/java/com/kyl/service/impl/ResourceServiceImpl.java

@@ -1,278 +0,0 @@
-package com.kyl.service.impl;
-
-
-import cn.hutool.core.collection.CollUtil;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.kyl.constant.SuperConstant;
-import com.kyl.entity.Resource;
-import com.kyl.exception.BaseException;
-import com.kyl.mapper.ResourceMapper;
-import com.kyl.mapper.RoleMapper;
-import com.kyl.service.ResourceService;
-import com.kyl.service.RoleService;
-import com.kyl.utils.UserThreadLocal;
-import com.kyl.vo.*;
-import lombok.extern.slf4j.Slf4j;
-import org.assertj.core.util.Lists;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static com.kyl.constant.SuperConstant.DATA_STATE_0;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title ResourceServiceImpl
- * @description
- * @create 2026/1/26
- */
-@Service
-@Slf4j
-public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> implements ResourceService {
-
-    @Autowired
-    private ResourceMapper resourceMapper;
-    @Autowired
-    private RoleMapper roleMapper;
-    @Override
-    public List<ResourceVo> findResourceListByUserId(Long userId) {
-
-        return resourceMapper.findResourceListByUserId(userId);
-    }
-
-    @Override
-    public List<MenuVo> menus() {
-        //1、获取当前登录的用户的Id
-        Long mgtUserId = UserThreadLocal.getMgtUserId();
-        log.info("当前登录的用户的Id为------------->{}", mgtUserId);
-        //2、根据用户Id查询角色
-        List<Long> roleIds = roleMapper.findRoleIdsByUserId(mgtUserId);
-        if (CollUtil.isEmpty(roleIds)){
-            throw new BaseException("用户没有角色,请为用户分配角色和菜单");
-        }
-        //3、根据角色Id列表查询权限列表
-        List<ResourceVo> resourceVoList = resourceMapper.findResourceListByRoleIds(roleIds,"m");
-
-        List<MenuVo> list =new ArrayList<>();
-        //4、递归封装菜单
-        recursionMenuVo(list,resourceVoList);
-        return list;
-    }
-
-
-    /**
-     * 自定义的递归封装菜单的方法
-     * @param list 菜单列表
-     * @param resourceVoList 资源列表
-     * @return
-     */
-    private List<MenuVo> recursionMenuVo(List<MenuVo> list, List<ResourceVo> resourceVoList) {
-        for (ResourceVo resourceVo : resourceVoList){
-            //判断当前的资源的父节点id是否为指定父节点id,是否为目录
-            if (resourceVo.getParentResourceNo().equals(SuperConstant.ROOT_PARENT_ID)){
-                MenuVo menuVo = new MenuVo();
-                menuVo.setName(resourceVo.getResourceName());
-                menuVo.setPath("/"+resourceVo.getRequestPath());
-                menuVo.setComponent(SuperConstant.COMPONENT_LAYOUT);
-                //封装资源的meta属性对象
-                MenuMetaVo menuMetaVo = MenuMetaVo.builder()
-                        .title(resourceVo.getResourceName())
-                        .icon(resourceVo.getIcon())
-                        .build();
-                menuVo.setMeta(menuMetaVo);
-                menuVo.setRedirect("/"+resourceVo.getResourceName());
-                menuVo.setChildren(getChildrenList(resourceVo,resourceVoList,resourceVo.getRequestPath()));  //获取子菜单
-                list.add(menuVo);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 递归获取菜单的子菜单
-     * @param resourceVo 资源对象
-     * @param resourceVoList 资源列表
-     * @param requestPath   请求路径
-     * @return
-     */
-    private List<MenuVo> getChildrenList(ResourceVo resourceVo, List<ResourceVo> resourceVoList, String requestPath) {
-        //1、获取当前资源下的所有子资源
-        ArrayList<MenuVo> childrenList = Lists.newArrayList();
-        //2、循环遍历获取子资源
-        for (ResourceVo resource : resourceVoList){
-            //判断子菜单的父节点id有没有和resourceVo的id相等的
-            if (resource.getParentResourceNo().equals(resourceVo.getResourceNo())){
-                MenuVo menuVo= new MenuVo();
-                menuVo.setName(resource.getResourceName());
-                menuVo.setPath(resource.getRequestPath());  //封装请求路径
-                menuVo.setComponent(requestPath+"/"+resource.getRequestPath()); //封装完整请求路径
-                MenuMetaVo menuMetaVo = MenuMetaVo.builder()    //封装meta属性对象
-                        .title(resource.getResourceName())
-                        .icon(resource.getIcon())
-                        .build();
-                menuVo.setMeta(menuMetaVo);
-                menuVo.setRedirect("/"+resourceVo.getResourceName()+"/"+resource.getResourceName());
-                //递归获取子菜单
-                menuVo.setChildren(getChildrenList(resource,resourceVoList,resourceVo.getRequestPath()));
-                childrenList.add(menuVo);
-            }
-        }
-        return childrenList;
-    }
-
-    /**
-     * 自定义的递归封装按钮的方法
-     * @return
-     */
-    @Override
-    public List<MenuVo> myButten() {
-        //1、获取当前登录的用户的Id
-        Long mgtUserId = UserThreadLocal.getMgtUserId();
-        //2、根据用户Id查询角色
-        List<Long> roleIds = roleMapper.findRoleIdsByUserId(mgtUserId);
-        if (CollUtil.isEmpty(roleIds)){
-            throw new BaseException("用户没有角色,请为用户分配角色和菜单");
-        }
-        //3、根据角色Id列表查询权限列表
-        List<ResourceVo> resourceVoList = resourceMapper.findButtonListByRoleIds(roleIds);
-        log.info("myButten---权限列表为------------->{}", resourceVoList);
-        List<MenuVo> list =new ArrayList<>();
-        //4、递归封装按钮
-        recursionButtonVo(list,resourceVoList);
-        log.info("myButten---封装的按钮列表为------------->{}", list);
-        return list;
-    }
-
-    /**
-     * 封装按钮
-     * @param list
-     * @param resourceVoList
-     * @return
-     */
-    private List<MenuVo> recursionButtonVo(List<MenuVo> list, List<ResourceVo> resourceVoList) {
-        for (ResourceVo resourceVo : resourceVoList){
-            if (resourceVo.getParentResourceNo().equals(SuperConstant.ROOT_PARENT_ID)){
-                MenuVo menuVo = new MenuVo();
-                menuVo.setName(resourceVo.getResourceName());
-                menuVo.setPath(resourceVo.getRequestPath());
-                menuVo.setChildren(getAllChildrens(resourceVo,resourceVoList));
-                list.add(menuVo);
-            }
-        }
-        return list;
-    }
-
-    /**
-     * 获取所有子菜单
-     * @param resourceVo
-     * @param resourceVoList
-     * @return
-     */
-    private List<MenuVo> getAllChildrens(ResourceVo resourceVo, List<ResourceVo> resourceVoList) {
-        //1、新建一个集合
-        ArrayList<MenuVo> childrenList = Lists.newArrayList();
-        //2、循环遍历
-        for (ResourceVo resource : resourceVoList){
-            //判断子菜单的父节点id有没有和resourceVo的id相等的
-            if (resource.getParentResourceNo().equals(resourceVo.getResourceNo())){
-                MenuVo menuVo = new MenuVo();
-                menuVo.setName(resource.getResourceName());
-                menuVo.setPath(resource.getRequestPath());
-                menuVo.setChildren(getAllChildrens(resource,resourceVoList));
-                childrenList.add(menuVo);
-            }
-        }
-        return childrenList;
-    }
-
-    @Override
-    public List<ResourceVo> findResourceListByRoleIds(List<Long> id) {
-        return resourceMapper.findResourcesByRoleIds(id);
-    }
-
-
-    @Override
-    public TreeVo findDeptListTree() {
-        List<TreeItemVo> rootNodes = new ArrayList<>();
-        try {
-            // 1. 查询所有部门数据
-            List<ResourceVo> allResource = resourceMapper.findResourceList();
-            if (allResource == null || allResource.isEmpty()) {
-                log.info("无部门数据,返回空树形结构");
-                return new TreeVo(rootNodes);
-            }
-
-            // 2. 构建ID -> TreeItemVo的映射(用数据库的id字段作为唯一标识,避免业务编号重复/缺失)
-            Map<String, TreeItemVo> treeItemMap = new HashMap<>();
-
-            // 第一步:转换所有部门为TreeItemVo,全量非空校验
-            for (ResourceVo resourceVo : allResource) {
-                // 核心:用数据库的id作为节点唯一ID(日志中Row有id字段,非空)
-                String nodeId = resourceVo.getResourceNo() == null ? "" : resourceVo.getResourceNo().toString();
-                // 部门名称为空时默认显示"未命名部门"
-                String nodeLabel = resourceVo.getResourceName() == null ? "未命名部门" : resourceVo.getResourceName();
-                // 父部门编号(转成String,统一格式)
-                String parentDeptNo = resourceVo.getParentResourceNo() == null ? "" : resourceVo.getParentResourceNo().toString();
-
-                // 构建TreeItemVo(用Builder,children默认初始化)
-                TreeItemVo treeItem = TreeItemVo.builder()
-                        .id(nodeId)
-                        .label(nodeLabel)
-                        .children(new ArrayList<>())
-                        .build();
-                // 存入Map(key为节点ID,非空)
-                treeItemMap.put(nodeId, treeItem);
-
-                log.debug("转换部门:ID={}, 名称={}, 父编号={}", nodeId, nodeLabel, parentDeptNo);
-            }
-
-            // 第二步:绑定父子关系 + 筛选根节点(全量非空校验)
-            for (ResourceVo resourceVo : allResource) {
-                // 基础字段非空处理
-                String nodeId = resourceVo.getResourceNo() == null ? "" : resourceVo.getResourceNo().toString();
-                String parentDeptNo = resourceVo.getParentResourceNo() == null ? "" : resourceVo.getParentResourceNo().toString();
-
-                // 1. 获取当前节点(非空校验)
-                TreeItemVo currentItem = treeItemMap.get(nodeId);
-                if (currentItem == null) {
-                    log.warn("部门ID={}转换的TreeItemVo为空,跳过绑定", nodeId);
-                    continue;
-                }
-
-                // 2. 判断根节点:父编号为空/0/空字符串 → 根节点
-                if (parentDeptNo.isEmpty() || DATA_STATE_0.equals(parentDeptNo)) {
-                    rootNodes.add(currentItem);
-                    continue;
-                }
-
-                // 3. 绑定子节点到父节点(父节点非空校验)
-                TreeItemVo parentItem = treeItemMap.get(parentDeptNo);
-                if (parentItem == null) {
-                    log.warn("部门ID={}的父部门ID={}不存在,设为根节点", nodeId, parentDeptNo);
-                    rootNodes.add(currentItem);
-                    continue;
-                }
-                if(parentItem.getChildren() == null) {
-                    //log.warn("parentItem.getChildren(): {}", parentItem.getChildren());
-                    //'parentItem.getChildren()' 的结果总是 'null'
-                }
-                parentItem.getChildren().add(currentItem);
-            }
-
-        } catch (Exception e) {
-            log.error("构建部门树形结构失败", e);
-            // 异常时返回空树形,避免接口500
-            return new TreeVo(new ArrayList<>());
-        }
-
-        // 4. 返回封装后的TreeVo
-        return new TreeVo(rootNodes);
-    }
-
-
-}

+ 0 - 168
kyl/kyl-security/src/main/java/com/kyl/service/impl/RoleServiceImpl.java

@@ -1,168 +0,0 @@
-package com.kyl.service.impl;
-
-
-import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
-import com.kyl.base.PageResponse;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.RoleDto;
-import com.kyl.entity.Role;
-import com.kyl.entity.RoleResource;
-import com.kyl.entity.UserRole;
-import com.kyl.mapper.RoleMapper;
-import com.kyl.service.*;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.ObjectUtil;
-import com.kyl.vo.DeptVo;
-import com.kyl.vo.ResourceVo;
-import com.kyl.vo.RoleVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title RoleServiceImpl
- * @description
- * @create 2026/1/26
- */
-@Service
-@Slf4j
-public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
-
-    @Resource
-    private RoleMapper roleMapper;
-    @Resource
-    private ResourceService resourceService;
-    @Resource
-    private DeptService deptService;
-    @Resource
-    UserRoleService userRoleService;
-    @Resource
-    RoleResourceService roleResourceService;
-
-    @Override
-    public List<RoleVo> findRoleVoListByUserId(Long userId) {
-        //根据userId查询角色Id
-        List<Long> roleIdList = roleMapper.findRoleIdsByUserId(userId);
-        //根据角色Id查询角色列表
-        List<Role> roleList = this.listByIds(roleIdList);
-        //封装VO
-        List<RoleVo> roleVoList = new ArrayList<>();
-        for (Role role : roleList) {
-            roleVoList.add(BeanUtil.toBean(role, RoleVo.class));
-        }
-        log.info("RoleServiceImpl查询用户角色列表成功----->{}", roleVoList);
-        return roleVoList;
-    }
-
-    /**
-     * 分页查询角色列表
-     *
-     * @param roleDto
-     * @param pageNum
-     * @param pageSize
-     * @return
-     */
-    @Override
-    public PageResponse<RoleVo> findRolePage(RoleDto roleDto, Integer pageNum, Integer pageSize) {
-        //1、开启分页
-        PageHelper.startPage(pageNum, pageSize);
-        //2、查询分页数据
-        Page<List<RoleVo>> page = roleMapper.findRoleVoListByUserId(roleDto);
-
-        //3、封装数据
-        PageResponse<RoleVo> roleVoPageResponse = PageResponse.of(page, RoleVo.class);
-
-        List<Long> roleIdList = roleVoPageResponse.getRecords().stream().map(RoleVo::getId).collect(Collectors.toList());
-
-
-        if (!EmptyUtil.isNullOrEmpty(roleVoPageResponse.getRecords())) {
-            //4、装配对于的资源数据权限
-            List<ResourceVo> resourceVoList = resourceService.findResourceListByRoleIds(roleIdList);
-            log.info("资源列表条数---->{}", resourceVoList.size());
-            //5、装配当前的部门数据权限
-            List<DeptVo> deptVoList = deptService.findDeptVoListByRoleIds(roleIdList);
-            roleVoPageResponse.getRecords().forEach(roleVo -> {
-                //创建一个资源集合
-                List<String> resourceNoSet = resourceVoList.stream()
-                        //资源的角色id如果和当前角色id一致
-                        .filter(resourceVo -> resourceVo.getRoleId().equals(String.valueOf(roleVo.getId())))
-                        .map(ResourceVo::getResourceNo).collect(Collectors.toList());
-                String[] resourceNoSetArray = resourceNoSet.toArray(new String[0]);
-                log.info("角色id--->{}资源编号集合长度------->{}", roleVo.getId(),resourceNoSetArray.length);
-                roleVo.setCheckedResourceNos(resourceNoSetArray);
-
-                //装配部门数据权限
-                Set<String> deptNoSet = deptVoList.stream()
-                        .filter(deptVo -> deptVo.getRoleId().equals(String.valueOf(roleVo.getId())))
-                        .map(DeptVo::getDeptNo).collect(Collectors.toSet());
-                roleVo.setCheckedDeptNos(deptNoSet.toArray(new String[0]));
-            });
-            log.info("资源列表---->{}", resourceVoList);
-        }
-
-        return roleVoPageResponse;
-    }
-
-    @Override
-    public boolean updateRole(RoleDto roleDto) {
-        Role role = BeanConv.toBean(roleDto, Role.class);
-
-        //判断是修改角色 还是 修改角色对应的资源菜单
-        if (ObjectUtil.isNotEmpty(role.getDataScope())){
-            //1、启用禁用角色--如果角色已经分配用户,就不能禁用角色
-            if (ObjectUtil.isNotEmpty(roleDto.getDataState())&& "1".equals(roleDto.getDataState())){
-                Long count = userRoleService.lambdaQuery().eq(UserRole::getRoleId, role.getId()).count();
-                //判断是否已经分配用户
-                if (count>0){
-                    throw new RuntimeException("角色已经分配用户,不能禁用角色");
-                }
-            }
-            //2、修改角色信息
-            boolean flag = this.updateById(role);
-            if (!flag){
-                throw new RuntimeException("修改角色信息失败");
-            }
-            return true;
-        }
-        //3、修改角色对应的菜单
-        if (ObjectUtil.isEmpty(role.getDataScope())){
-            //删除角色对应的菜单
-            roleResourceService.remove(new QueryWrapper<RoleResource>().eq("role_id", role.getId()));
-            //保存角色对应的菜单
-            if (roleDto.getCheckedResourceNos() == null|| roleDto.getCheckedResourceNos().length == 0){
-                return true;
-            }
-            String[] checkedResourceNos = roleDto.getCheckedResourceNos();
-            List<RoleResource> roleResourceList = new ArrayList<>();
-            for (String checkedResourceNo : checkedResourceNos) {
-                RoleResource roleResource = new RoleResource();
-                roleResource.setRoleId(role.getId());   //角色Id
-                roleResource.setResourceNo(Long.valueOf(checkedResourceNo));//资源Id
-                roleResource.setDataState(SuperConstant.DATA_STATE_0);  //启用
-                roleResourceList.add(roleResource);
-            }
-            //判断集合是否为空
-            if (roleResourceList.isEmpty()){
-                return true;
-            }
-            boolean saved = roleResourceService.saveBatch(roleResourceList);
-            if (!saved) {
-                throw new RuntimeException("保存角色对应的菜单失败");
-            }
-        }
-        return true;
-    }
-}

+ 0 - 34
kyl/kyl-security/src/main/java/com/kyl/service/impl/UserDetailsServiceImpl.java

@@ -1,34 +0,0 @@
-package com.kyl.service.impl;
-
-
-import com.kyl.service.LoginService;
-import com.kyl.service.UserService;
-import com.kyl.vo.UserAuth;
-import com.kyl.vo.UserVo;
-import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.core.userdetails.UserDetailsService;
-import org.springframework.security.core.userdetails.UsernameNotFoundException;
-import org.springframework.stereotype.Service;
-
-import javax.annotation.Resource;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserDetailsServiceImpl
- * @description 用户登录服务
- * @create 2026/1/23
- */
-@Service
-public class UserDetailsServiceImpl implements UserDetailsService {
-
-    @Resource
-    UserService userService;
-    @Override
-    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
-        //这里我们默认使用账号和密码进行登录,如果是多种方式登录,可以使用重载
-        UserVo userVo = userService.findUserVoForLogin(username);
-        //让SpringSecurity去验证用户名和密码
-        return new UserAuth(userVo);
-    }
-}

+ 0 - 214
kyl/kyl-security/src/main/java/com/kyl/service/impl/UserServiceImpl.java

@@ -1,214 +0,0 @@
-package com.kyl.service.impl;
-
-
-import cn.hutool.core.bean.BeanUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.github.pagehelper.Page;
-import com.github.pagehelper.PageHelper;
-import com.kyl.base.PageResponse;
-import com.kyl.constant.SuperConstant;
-import com.kyl.dto.UserDto;
-import com.kyl.entity.User;
-import com.kyl.entity.UserRole;
-import com.kyl.mapper.UserMapper;
-import com.kyl.properties.SecurityConfigProperties;
-import com.kyl.service.UserRoleService;
-import com.kyl.service.UserService;
-import com.kyl.utils.BeanConv;
-import com.kyl.utils.EmptyUtil;
-import com.kyl.utils.NoProcessing;
-import com.kyl.vo.RoleVo;
-import com.kyl.vo.UserVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title UserServiceImpl
- * @description
- * @create 2026/1/26
- */
-@Service
-@Slf4j
-public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
-
-    @Autowired
-    private UserMapper userMapper;
-    @Autowired
-    private RoleServiceImpl roleService;
-    @Autowired
-    private PasswordEncoder bCryptPasswordEncoder;
-    @Autowired
-    private SecurityConfigProperties securityConfigProperties;
-    @Resource
-    private UserRoleService userRoleService;
-
-    @Override
-    public UserVo findUserVoForLogin(String username) {
-        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
-        //封装条件
-        queryWrapper.eq("username",username);
-        User user = userMapper.selectOne(queryWrapper);
-        //封装vo
-        UserVo userVo = BeanUtil.toBean(user, UserVo.class);
-        return userVo;
-    }
-
-    /**
-     * 分页查询用户列表
-     *
-     * @param userDto  查询条件
-     * @param pageNum  页码
-     * @param pageSize 每页数量
-     * @return 用户列表
-     */
-    @Override
-    public PageResponse<UserVo> findUserPage(UserDto userDto, Integer pageNum, Integer pageSize) {
-        //1、判断部门编号是否为空
-        if (!EmptyUtil.isNullOrEmpty(userDto.getDeptNo())){
-            //不为空,则取部门编号
-            String deptNo = NoProcessing.processString(userDto.getDeptNo());
-            userDto.setDeptNo(deptNo);
-        }
-        //2、构建分页对象
-        PageHelper.startPage(pageNum,pageSize);
-        Page<List<UserVo>> userVoPage = userMapper.selectPageList(userDto);
-
-        PageResponse<UserVo> pageResponse=PageResponse.of(userVoPage, UserVo.class);
-        //3、装配角色
-        if (!EmptyUtil.isNullOrEmpty(pageResponse.getRecords())){
-            //3.1 获取用户id列表
-            List<Long> userIdList = pageResponse.getRecords().stream().map(UserVo::getId).collect(Collectors.toList());
-            //3.2 获取用户角色列表
-            userIdList.stream().forEach(userId -> {
-                //3.3 根据用户id查询角色列表
-                List<RoleVo> roleVoList = roleService.findRoleVoListByUserId(userId);
-                //3.4 封装角色列表
-                pageResponse.getRecords().stream().filter(userVo -> userVo.getId().equals(userId)).forEach(userVo -> {
-                    //封装角色列表
-                    userVo.setRoleList(roleVoList);
-                    //封装角色id列表
-                    userVo.setRoleVoIds(roleVoList.stream().map(v->v.getId().toString()).collect(Collectors.toSet()));
-                    //封装角色标识列表
-                    userVo.setRoleLabels(roleVoList.stream().map(RoleVo::getLabel).collect(Collectors.toSet()));
-                });
-            });
-
-        }
-        log.info("查询用户列表成功----->{}",pageResponse.getRecords());
-
-        return pageResponse;
-    }
-
-    /**
-     * 保存用户
-     *
-     * @param userDto
-     * @return
-     */
-    @Override
-    @Transactional  //事务---数据库中的一个概念
-    /*
-        我们一次可能执行多条SQL语句,而是修改的SQL语句
-        1---
-        2----
-        3----x
-        4----
-        5---
-        事务是把n个步骤,合并为1步,这一步,必须完全成功,或者完全失败
-        一个事务中5个步骤,必须全部成功,或全部失败
-        只要有一个步骤失败了,其他的步骤立刻回滚。
-     */
-    public boolean saveUser(UserDto userDto) {
-        //1、复制属性
-        User user = BeanConv.toBean(userDto, User.class);
-        user.setUsername(user.getEmail());
-        user.setNickName(user.getRealName());
-        String password = bCryptPasswordEncoder.encode(securityConfigProperties.getDefaultPassword());
-        user.setPassword(password);
-        //2、保存用户
-        boolean flag = this.save(user);
-        if (!flag)  throw new RuntimeException("保存用户失败");
-        log.info("保存用户成功----->{}",user);
-        //3、保存用户角色---保存到角色用户关联表
-        flag=saveUserRole(userDto,user.getId());
-        if (!flag) throw new RuntimeException("保存用户角色中间表出错");
-        return flag;
-    }
-
-    /**
-     * 新增用户角色到关联表
-     * @param userDto
-     * @param userId
-     * @return
-     */
-    private Boolean saveUserRole(UserDto userDto,Long userId){
-        List<UserRole> userRoleList = userDto.getRoleVoIds().stream().map(roleId -> {
-            UserRole userRole = UserRole.builder()
-                    .userId(userId)   //这个时候用户的id已经生成出来了
-                    .roleId(Long.valueOf(roleId))   //角色id
-                    .dataState(SuperConstant.DATA_STATE_0)  //数据状态
-                    .build();
-            return userRole;
-        }).collect(Collectors.toList());
-        return userRoleService.saveOrUpdateBatch(userRoleList);
-    }
-
-
-
-    /**
-     * 修改用户
-     *
-     * @param userDto
-     * @return
-     */
-    @Override
-    @Transactional
-    public boolean updateUser(UserDto userDto) {
-        //1、复制属性
-        User user = BeanConv.toBean(userDto, User.class);
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("user_id",user.getId());
-        //2、删除用户角色
-        boolean flag = userRoleService.remove(queryWrapper);
-        if (!flag)  throw new RuntimeException("删除用户角色中间表出错");
-        //3、修改用户
-        flag = this.updateById(user);
-        //4、保存用户角色
-        flag=saveUserRole(userDto,user.getId());
-
-        return flag;
-    }
-
-    /**
-     * 删除用户
-     * @param id
-     * @return
-     */
-    @Override
-    @Transactional  //spring提供的声明式事务,把注解添加到方法上面,
-    // java代码中,只要调用了事务方法,就会自动开启事务,方法执行完毕,事务就会自动提交。
-    //如果方法执行过程中,有异常,就会回滚事务。
-    //但是这种@Transactional 声明式事务有缺点
-    public boolean removeUserById(Long id) {
-        //1、删除用户角色
-        QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.eq("user_id",id);
-        boolean flag = userRoleService.remove(queryWrapper);
-        if (!flag)  throw new RuntimeException("删除用户角色中间表出错");
-        //2、删除用户
-        flag = this.removeById(id);
-        return flag;
-    }
-}
-

+ 0 - 52
kyl/kyl-security/src/main/java/com/kyl/vo/DeptVo.java

@@ -1,52 +0,0 @@
-package com.kyl.vo;
-
-
-import com.kyl.base.BaseVo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * 部门表
- */
-@Data
-@NoArgsConstructor
-@AllArgsConstructor
-@ApiModel(value = "部门表")
-public class DeptVo extends BaseVo {
-
-    @ApiModelProperty(value = "父部门编号")
-    private String parentDeptNo;
-    @ApiModelProperty(value = "部门编号")
-    private String deptNo;
-    @ApiModelProperty(value = "部门名称")
-    private String deptName;
-    @ApiModelProperty(value = "排序")
-    private Integer sortNo;
-    @ApiModelProperty(value = "负责人Id")
-    private Long leaderId;
-    @ApiModelProperty(value = "负责人姓名")
-    private String leaderName;
-    @ApiModelProperty(value = "角色查询部门:部门对应角色id")
-    private String roleId;
-    @ApiModelProperty(value = "层级")
-    private Integer level = 4;
-    @ApiModelProperty(value = "部门描述")
-    private String remark;
-
-    @Builder
-    public DeptVo(Long id, String dataState, String parentDeptNo, String deptNo, String deptName, Integer sortNo, Long leaderId, String leaderName, String roleId, Integer level) {
-        super(id, dataState);
-        this.parentDeptNo = parentDeptNo;
-        this.deptNo = deptNo;
-        this.deptName = deptName;
-        this.sortNo = sortNo;
-        this.leaderId = leaderId;
-        this.leaderName = leaderName;
-        this.roleId = roleId;
-        this.level = level;
-    }
-}

+ 0 - 38
kyl/kyl-security/src/main/java/com/kyl/vo/MenuMetaVo.java

@@ -1,38 +0,0 @@
-package com.kyl.vo;
-
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title MenuMetaVo
- * @description 动态菜单的meta元数据对象
- * @create 2026/1/27
- */
-@Data
-@NoArgsConstructor
-public class MenuMetaVo implements Serializable {
-
-    @ApiModelProperty(value = "标题")
-    private String title;
-
-    @ApiModelProperty(value = "图标")
-    private String icon;
-
-    @ApiModelProperty(value = "角色")
-    private List<String> roles;
-
-    @Builder
-    public MenuMetaVo(String title, String icon, List<String> roles) {
-        this.title = title;
-        this.icon = icon;
-        this.roles = roles;
-    }
-}

+ 0 - 56
kyl/kyl-security/src/main/java/com/kyl/vo/MenuVo.java

@@ -1,56 +0,0 @@
-package com.kyl.vo;
-
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * @author WanJl
- * @version 1.0
- * @title MenuVo
- * @description 动态菜单Vo对象
- * @create 2026/1/27
- */
-@Data
-@NoArgsConstructor
-public class MenuVo implements Serializable {
-
-    // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
-    @ApiModelProperty(value = "路由名字")
-    private  String name;
-
-    @ApiModelProperty(value = "请求路径")
-    private String path;
-
-    @ApiModelProperty(value = "模块跳转目标")
-    private String component;
-
-    @ApiModelProperty(value = "高亮子菜单")
-    private String redirect;
-
-    // 当设置 true 的时候该路由不会在侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
-    @ApiModelProperty(value = "是否显示")
-    private Boolean hidden;
-
-    @ApiModelProperty(value = "子菜单")
-    private List<MenuVo> children;
-
-    @ApiModelProperty(value = "meta属性")
-    private MenuMetaVo meta;
-
-    @Builder
-    public MenuVo(String name, String path, String component, String redirect, Boolean hidden, List<MenuVo> children, MenuMetaVo meta) {
-        this.name = name;
-        this.path = path;
-        this.component = component;
-        this.redirect = redirect;
-        this.hidden = hidden;
-        this.children = children;
-        this.meta = meta;
-    }
-}

+ 0 - 48
kyl/kyl-security/src/main/java/com/kyl/vo/PostVo.java

@@ -1,48 +0,0 @@
-package com.kyl.vo;
-
-import com.kyl.base.BaseVo;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Builder;
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-/**
- * 岗位表
- */
-@Data
-@NoArgsConstructor
-public class PostVo extends BaseVo {
-
-    @ApiModelProperty(value = "部门编号")
-    private String deptNo;
-
-    @ApiModelProperty(value = "岗位编码:父部门编号+001【3位】")
-    private String postNo;
-
-    @ApiModelProperty(value = "岗位名称")
-    private String postName;
-
-    @ApiModelProperty(value = "显示顺序")
-    private Integer sortNo;
-
-    @ApiModelProperty(value = "备注")
-    private String remark;
-
-    @ApiModelProperty(value = "列表选择:选中职位Ids")
-    private String[] checkedIds;
-
-    @ApiModelProperty(value = "职位对应部门")
-    private DeptVo deptVo;
-
-    @Builder
-    public PostVo(Long id, String dataState, String deptNo, String postNo, String postName, Integer sortNo, String remark, String[] checkedIds, DeptVo deptVo) {
-        super(id, dataState);
-        this.deptNo = deptNo;
-        this.postNo = postNo;
-        this.postName = postName;
-        this.sortNo = sortNo;
-        this.remark = remark;
-        this.checkedIds = checkedIds;
-        this.deptVo = deptVo;
-    }
-}

Некоторые файлы не были показаны из-за большого количества измененных файлов