67 Commits

Author SHA1 Message Date
lhc
d08b9ad886 Merge branch 'master' into upgrade/springboot-4-jdk21
# Conflicts:
#	hcframe-parent/hcframe-base/pom.xml
2026-03-09 10:04:13 +08:00
openclaw
86c990c6c3 feat: 修复编译错误 2026-03-03 17:51:48 +08:00
openclaw
105db7d81e fix: upgrade to Shiro 3.0 and migrate all servlet imports to Jakarta EE
- Upgrade Shiro from 2.1.0 to 3.0.0-alpha-1
  * Shiro 3.0 fully supports Jakarta EE 9+ (jakarta.servlet.*)
  * Shiro 2.x still uses javax.servlet, incompatible with Spring Boot 4
- Migrate all javax.servlet imports to jakarta.servlet in hcframe-base
  * Affected modules: shiro, auth, common (filters/listeners)
  * Fixed ShiroSessionManager to use jakarta.servlet.ServletRequest
  * Fixed AuthFilter, NoStateFilter
  * Fixed SimpleCORSFilter, webSessionListener
- All Shiro integration files now compatible with Jakarta EE

Files changed:
* pom.xml (Shiro version upgrade)
* ShiroConfig.java (jakarta.servlet.Filter)
* ShiroSessionManager.java (jakarta.servlet imports)
* AuthFilter.java, NoStateFilter.java
* SimpleCORSFilter.java, webSessionListener.java
* FtUserController.java and related files

Build result: BUILD SUCCESS 
Installed: hcframe-base-1.2.5.5.1-SNAPSHOT.jar to local Maven
2026-03-02 18:12:25 +08:00
openclaw
43059515e2 refactor(hcframe-base): complete remaining Swagger2 to SpringDoc migrations
- Migrated additional 7 controllers:
  * DataSourceController
  * DatasourceTypeController
  * DatasourceConfigController
  * TableConfigController
  * TableGenController
  * FtUserController
  * AuthFunctionController
- Fixed all @ApiImplicitParam annotations (moved to inline @Parameter)
- Verified: zero swagger2 annotations remaining
- Verified: zero swagger2 imports remaining
- BUILD SUCCESS 
2026-03-02 17:10:07 +08:00
openclaw
aab4ddfd07 chore: remove backup file TableController.java.bak 2026-03-02 17:08:58 +08:00
openclaw
7b379091fe refactor(hcframe-base): migrate from Swagger2 to SpringDoc OpenAPI 3
- Replace io.swagger.annotations with io.swagger.v3.oas.annotations
- @Api -> @Tag
- @ApiOperation -> @Operation
- @ApiModelProperty -> @Schema
- @ApiModel -> @Schema
- @ApiImplicitParam(s) -> @Parameter inline in method signature
- Affected files:
  * common: ResultVO, WebPageInfo, SortItem
  * datasource entities: DatasourceType, DatasourceConfig
  * tableconfig entities: FieldInfo, TableInfo
  * controllers: TableController
2026-03-02 17:08:58 +08:00
lhc
48efe9f2ef feat: 更新swagger 2026-03-02 16:11:15 +08:00
lhc
632ff57b34 feat: 更新hcframe版本 2026-03-02 14:48:28 +08:00
lhc
0eb73cd9dc feat: 更新swagger到springbootdoc 2026-03-02 10:58:01 +08:00
lhc
8e4b598b8a fix: 恢复druid连接池 2026-02-28 19:03:53 +08:00
openclaw
0d71d111c9 revert: 恢复 DataSourceUtil 为原始 Hikari 实现(参考 a1ff98c) 2026-02-28 18:43:13 +08:00
openclaw
25c16f856a fix: 移除不合适的兼容 shim(org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration) 2026-02-28 18:39:14 +08:00
openclaw
7b904f3f8e fix: 添加兼容 shim org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration (供 druid starter 依赖) 2026-02-28 18:25:29 +08:00
openclaw
f0507df4a1 fix: 从 hcframe-base 中移除 HikariCP 依赖,改用 Druid 2026-02-28 18:24:03 +08:00
openclaw
0a20701a74 fix: hcframe-base 将 HikariDataSource 使用点替换为 DruidDataSource 2026-02-28 18:21:02 +08:00
openclaw
99de88c1f7 fix: 在 hcframe-base 中将 Hikari 初始化替换为 Druid 实现(保留方法名以兼容调用) 2026-02-28 18:20:34 +08:00
openclaw
5850b91cbf fix: 用 druid-spring-boot-3-starter:1.2.27 替换/补充 Druid 以兼容 Spring Boot 4 2026-02-28 18:08:34 +08:00
openclaw
39d7885c54 fix: 升级 mybatis-spring-boot-starter 到 4.0.1 以兼容 Spring Boot 4 2026-02-28 17:49:33 +08:00
openclaw
bbc571db4b fix: 升级 mybatis-spring-boot-starter 到 2.3.2 以兼容新版 Spring Boot 2026-02-28 17:32:31 +08:00
lhc
bdaaa0360d fix: 修复webpageinfo默认值丢失问题 2026-02-28 15:05:19 +08:00
lhc
c042746bbb Merge branch 'master' into upgrade/springboot-4-jdk21
# Conflicts:
#	hcframe-parent/hcframe-base/pom.xml
2026-02-28 15:00:10 +08:00
lhc
1e21bde2e8 Merge branch 'master' into upgrade/springboot-4-jdk21
# Conflicts:
#	hcframe-parent/hcframe-base/pom.xml
2026-02-27 16:24:20 +08:00
openclaw
027994e925 SB4/JDK21: fix module compilation after upgrade (add starters, remove incompatible imports, small API adjustments) 2026-02-26 10:29:49 +08:00
lhc
70af1aab7e fix: 修复编译错误 2026-02-13 18:44:35 +08:00
lhc
625688b357 fix: 修复java21废弃api 2026-02-13 18:32:36 +08:00
openclaw
c81b290cf9 fix: replace deprecated Jackson2JsonRedisSerializer with GenericJackson2JsonRedisSerializer for redis module 2026-02-13 18:27:38 +08:00
openclaw
bd0f8d9e68 fix: resolve activiti module build issues (jakarta.servlet migration, dependencies update) 2026-02-13 18:23:42 +08:00
lhc
f368b005db fix: 修复ThreadLocal问题 2026-02-13 18:17:08 +08:00
openclaw
2ac38baec3 refactor: remove ThreadLocal entirely and use explicit thread-based ConcurrentHashMap approach in DBContextHolder 2026-02-13 17:52:53 +08:00
openclaw
3b39d4e8a8 refactor: replace ThreadLocal with ConcurrentHashMap in DBContextHolder for better compatibility (avoiding virtual thread issues) 2026-02-13 17:50:35 +08:00
openclaw
4237cb924c fix(hcframe-base): resolves spring boot 3.x deprecation warnings; apply latest EndpointSupplier structure
- Removed ServletEndpointsSupplier, ControllerEndpointsSupplier
- Modified webEndpointServletHandlerMapping bean to align latest MediaTypes+standards

Detailed Migration -> resolved:
- Since ServletEndpo* removed too, standardizing Endpoint signature construction
2026-02-13 17:32:23 +08:00
lhc
20d7610af9 fix: 修复lombok警告 2026-02-13 17:31:27 +08:00
openclaw
fb3f2d6b9c fix(hcframe-user): migrate to Spring Boot 3 and fix Shiro/SystemRealm API compatibility
- Remove ServletComponentScan annotation (removed in SB3)
- Migrate javax.servlet.http to jakarta.servlet.http
- Add org.jetbrains:annotations:26.0.1 dependency
- Implement missing SystemRealm.setTimeoutLogoutLog(String) method
- Fix Condition.creatCriteria calls by adding tableName parameter

Breaking changes addressed:
- @ServletComponentScan removed in Spring Boot 3
- javax.* to jakarta.* package migration
- SystemRealm API update requiring setTimeoutLogoutLog implementation
- Condition.creatCriteria signature change requiring tableName parameter
2026-02-13 17:12:22 +08:00
openclaw
0c0c8567d0 fix(hcframe-base): remove duplicate old shiro-based Base64 methods 2026-02-13 16:45:38 +08:00
openclaw
34955b66f9 chore(parent): enforce maven-compiler-plugin fork/executable and lombok annotation processor for JDK21 2026-02-13 16:45:00 +08:00
openclaw
14724a5e04 chore(hcframe-base): remove shiro-codec (not available in central) 2026-02-13 16:44:25 +08:00
openclaw
be1f232549 fix(hcframe-base): replace Shiro Base64 with java.util.Base64 to remove shiro codec dependency 2026-02-13 16:44:04 +08:00
openclaw
29b145044b fix(hcframe-base): add shiro-codec dependency for org.apache.shiro.codec 2026-02-13 16:43:33 +08:00
openclaw
51dc4c29ac fix(hcframe-base): add shiro-core dependency to resolve org.apache.shiro.codec package 2026-02-13 16:43:14 +08:00
lhc
a621633c9b fix: 更新lombok版本 2026-02-13 16:42:32 +08:00
lhc
059dfcfca7 fix: 更新shiro版本,修复lombok编译警告问题 2026-02-13 16:33:15 +08:00
lhc
a4da97d86b fix: 修复pom.xml错误,修复lombok编译错误 2026-02-13 16:18:56 +08:00
openclaw
49c066384c fix(poms): correct hcframe-base version tag and remove duplicate malformed dependency 2026-02-13 16:01:38 +08:00
openclaw
b8dfd34cec fix(poms): correct hcframe-base dependency entries to 1.2.5.5-SNAPSHOT 2026-02-13 16:00:53 +08:00
openclaw
3e21609aa8 chore(deps): update hcframe-base dependency to 1.2.5.5-SNAPSHOT in modules 2026-02-13 15:59:51 +08:00
openclaw
32c682eefe chore(hcframe-base): bump version to 1.2.5.5-SNAPSHOT 2026-02-13 15:59:21 +08:00
openclaw
a1ff98c991 Replace Druid with HikariCP; DataSource refactor (initHikari, DataSourceUtil, configs); set Java 21 release in parent and redis-starter 2026-02-12 18:53:46 +08:00
openclaw
4875ff9836 chore(hcframe-base): temporarily stub Druid servlet/filter beans to avoid javax->jakarta conflicts during SB4 migration (placeholder, restore later) 2026-02-12 18:00:47 +08:00
openclaw
316890c731 fix(hcframe-base): remove extra arg from WebMvcEndpointHandlerMapping call; use raw types for Druid servlet/filter registration to avoid javax/jakarta generic mismatch 2026-02-12 18:00:12 +08:00
openclaw
6f19b67702 fix(hcframe-base): migrate javax.servlet imports to jakarta; adapt DocMvcConfig to Spring Boot 4 API 2026-02-12 17:58:47 +08:00
openclaw
ab1b2f586f fix(hcframe-base): adapt DocMvcConfig to Spring Boot 4 package moves (WebMvcEndpointHandlerMapping) 2026-02-12 17:55:45 +08:00
openclaw
64adacb599 fix(hcframe-base): add actuator-autoconfigure to resolve servlet actuator package 2026-02-12 17:49:13 +08:00
openclaw
9e2219ad02 fix(hcframe-base): add spring-boot-actuator explicit dependency for servlet actuator types 2026-02-12 17:48:48 +08:00
openclaw
00ff640ac2 fix(hcframe-base): pin aop to 4.0.0-M2; add servlet/websocket provided APIs; add spring milestone repo 2026-02-12 17:48:16 +08:00
openclaw
9fc931ed38 fix(hcframe-base): pin spring-boot-starter-aop to 4.0.0-M2; add spring milestones repo 2026-02-12 17:47:40 +08:00
openclaw
65801dd427 chore: enforce maven-compiler-plugin release=21 via pluginManagement 2026-02-12 17:42:05 +08:00
openclaw
6a041b2e3c chore: try Spring Boot 4.0.1 as fallback 2026-02-12 17:40:26 +08:00
openclaw
5e89c180e6 chore: add Spring repo to parent POM (correct location) 2026-02-12 17:39:34 +08:00
openclaw
84f866960b chore: add Spring release repository to parent POM (try resolve SB 4.x artifacts) 2026-02-12 17:38:59 +08:00
openclaw
decbf7953c chore: add javax.annotation-api fallback for existing imports 2026-02-12 17:19:02 +08:00
openclaw
28f6d6b280 chore: add jakarta.annotation-api for Java21 migration 2026-02-12 17:18:42 +08:00
openclaw
d224a74737 chore: upgrade lombok to 1.18.28 for Java 21 compatibility 2026-02-12 17:18:23 +08:00
openclaw
fd479eeb1a fix(hcframe-base): pin ehcache version for migration 2026-02-12 17:17:51 +08:00
openclaw
db8007f067 fix(hcframe-base): pin spring-boot-starter-aop version for initial SB4 migration 2026-02-12 17:17:29 +08:00
openclaw
e81aa1bfb3 chore: configure maven-compiler-plugin release=21 2026-02-12 17:16:56 +08:00
openclaw
26e8c80925 chore: set maven.compiler to Java 21 2026-02-12 17:16:42 +08:00
openclaw
5d5d62c27a chore: bump Spring Boot to 4.0.2 (parent) 2026-02-12 17:12:25 +08:00
58 changed files with 15376 additions and 492 deletions

View File

@@ -12,9 +12,11 @@
<artifactId>hcframe-activiti</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>com.taixingyiji</groupId>
@@ -24,7 +26,7 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.2-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
@@ -32,12 +34,25 @@
<version>7.1.0.M1</version>
</dependency>
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.2-SNAPSHOT</version>
<scope>compile</scope>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- Ensure autoconfigure and web starters are available for SB4 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
@@ -46,4 +61,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@@ -3,21 +3,15 @@ package com.taixingyiji.activiti;
import com.taixingyiji.base.module.datasource.config.DataSourceConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import jakarta.servlet.annotation.WebFilter;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import tk.mybatis.spring.annotation.MapperScan;
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class,
org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class,
})
@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
//@EnableDiscoveryClient
//@EnableFeignClients

View File

@@ -73,4 +73,9 @@ public class ShiroRealmConfig implements SystemRealm {
map.put("/**", ShiroType.ANON);
return map;
}
@Override
public void setTimeoutLogoutLog(String userId) {
// no-op for now
}
}

View File

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
/**
* @author lhc

View File

@@ -5,7 +5,7 @@ import com.taixingyiji.base.common.ResultVO;
import com.taixingyiji.base.common.WebPageInfo;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
public interface ProcessService {

View File

@@ -16,7 +16,7 @@ import org.springframework.util.ResourceUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.HashMap;
import java.util.Map;

View File

@@ -7,13 +7,13 @@
<groupId>com.taixingyiji</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hcframe-base</artifactId>
<version>1.2.5.3.5-SNAPSHOT</version>
<modelVersion>4.0.0</modelVersion>
<version>1.2.5.5.1-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<log4j2.version>2.17.0</log4j2.version>
</properties>
<dependencies>
@@ -77,7 +77,7 @@
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.4</version>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -97,6 +97,7 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<version>4.0.0-M2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
@@ -113,9 +114,9 @@
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-openapi2-spring-boot-starter</artifactId>
<version>4.4.0</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>3.0.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter -->
<!-- <dependency>-->
@@ -144,7 +145,7 @@
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>1.13.0</version>
<version>3.0.0-alpha-1</version>
<exclusions>
<exclusion>
<groupId>commons-beanutils</groupId>
@@ -152,6 +153,11 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>3.0.0-alpha-1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.pac4j/pac4j-cas -->
<!-- <dependency>-->
@@ -185,10 +191,17 @@
<artifactId>mapper-spring-boot-starter</artifactId>
<version>2.1.5</version>
</dependency>
<!-- Druid starter for Spring Boot 3/4 compatibility -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.4</version>
<artifactId>druid-spring-boot-4-starter</artifactId>
<version>1.2.28-SNAPSHOT</version>
</dependency>
<!-- Micrometer for metrics (Hikari metrics auto-instrumented by Spring Boot + Micrometer) -->
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>1.11.4</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
@@ -239,8 +252,9 @@
</dependency>
<!-- ehcache -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.10.8</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.dm</groupId>-->
@@ -274,6 +288,30 @@
<version>3.5.0</version>
<scope>provided</scope>
</dependency>
<!-- Provide legacy javax servlet/websocket APIs needed by existing code (compile-only/provided) -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
<!-- Explicit actuator module to expose servlet-based actuator endpoint types for Spring Boot 4.x -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
<version>4.0.1</version>
</dependency>
</dependencies>
<build>
<finalName>hcframe-base</finalName>

View File

@@ -1,7 +1,7 @@
package com.taixingyiji.base.common;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
/**
* @author lhc
@@ -19,7 +19,7 @@ public class ResultVO<T> {
private Integer code=SUCCESS;
//("返回信息")
@ApiModelProperty(example="ActionOK")
@Schema(example="ActionOK")
private String msg;
//("返回数据")

View File

@@ -1,6 +1,6 @@
package com.taixingyiji.base.common;
import io.swagger.annotations.ApiModel;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -19,7 +19,7 @@ import java.io.Serializable;
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@ApiModel
@Schema
public class SortItem implements Serializable {
private static final long serialVersionUID = 5462627800342658554L;
private String field;

View File

@@ -1,7 +1,6 @@
package com.taixingyiji.base.common;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -21,7 +20,7 @@ import java.util.List;
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@ApiModel
@Schema
public class WebPageInfo implements Serializable {
private static final long serialVersionUID = 1156251348750279606L;
@@ -29,45 +28,43 @@ public class WebPageInfo implements Serializable {
public static final String DESC = "desc";
public static final String ASC = "asc";
@ApiModelProperty(
value="每页显示条数" ,
example="10",
dataType = "Integer"
@Schema(
description="每页显示条数" ,
example="10"
)
@Builder.Default
private Integer pageSize = 10;
@ApiModelProperty(
value="页码" ,
example="1",
dataType = "Integer"
@Schema(
description="页码" ,
example="1"
)
@Builder.Default
private Integer pageNum = 1;
@ApiModelProperty(value="排序字段")
@Schema(description="排序字段")
private String sortField;
@ApiModelProperty(
value = "正序倒序",
allowableValues = "asc,desc",
@Schema(
description = "正序倒序",
allowableValues = {"asc","desc"},
example = "asc")
@Builder.Default
private String order = ASC;
@ApiModelProperty(
value = "符合排序字段",example = "[{\"field\":\"CREATE_TIME\",\"order\":\"ASC\"}]")
@Schema(
description = "符合排序字段",example = "[{\"field\":\"CREATE_TIME\",\"order\":\"ASC\"}]")
private String sortList;
@ApiModelProperty(
value = "开启分页缓存"
@Schema(
description = "开启分页缓存"
)
@Builder.Default
private boolean enableCache = false;
@ApiModelProperty(
value = "开启分页排序"
@Schema(
description = "开启分页排序"
)
@Builder.Default
private boolean enableSort = true;

View File

@@ -5,8 +5,8 @@ import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointPr
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;
// Removed import of ControllerEndpointsSupplier and ServletEndpointsSupplier due to deprecation in Spring Boot 3.
import org.springframework.boot.webmvc.actuate.endpoint.web.WebMvcEndpointHandlerMapping;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@@ -27,23 +27,22 @@ import java.util.List;
public class DocMvcConfig {
@Bean
public org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(
WebEndpointsSupplier webEndpointsSupplier, ServletEndpointsSupplier servletEndpointsSupplier,
ControllerEndpointsSupplier controllerEndpointsSupplier, EndpointMediaTypes endpointMediaTypes,
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(
WebEndpointsSupplier webEndpointsSupplier, 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());
// Removed deprecated servlet and controller endpoint suppliers due to deprecation in Spring Boot 3.
allEndpoints.addAll(webEndpoints);
String basePath = webEndpointProperties.getBasePath();
EndpointMapping endpointMapping = new EndpointMapping(basePath);
boolean shouldRegisterLinksMapping = shouldRegisterLinksMapping(webEndpointProperties,
environment, basePath);
return new org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes,
return new WebMvcEndpointHandlerMapping(endpointMapping, webEndpoints, endpointMediaTypes,
corsProperties.toCorsConfiguration(), new EndpointLinksResolver(allEndpoints, basePath),
shouldRegisterLinksMapping, null);
shouldRegisterLinksMapping);
}
/**

View File

@@ -1,6 +1,6 @@
package com.taixingyiji.base.common.config;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpSession;
import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

View File

@@ -4,10 +4,10 @@ import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.*;
import jakarta.servlet.annotation.WebFilter;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
/**

View File

@@ -1,9 +1,9 @@
package com.taixingyiji.base.common.config;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.ServletRequestEvent;
import jakarta.servlet.ServletRequestListener;
import jakarta.servlet.annotation.WebListener;
import jakarta.servlet.http.HttpServletRequest;
@WebListener
public class webSessionListener implements ServletRequestListener {

View File

@@ -1,7 +1,7 @@
package com.taixingyiji.base.common.utils;
import org.apache.shiro.codec.Base64;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
@@ -138,9 +138,28 @@ public class EncryptUtil {
}
private String base64(byte[] res) {
return new String(Base64.encode(res));
return Base64.getEncoder().encodeToString(res);
}
/**
* 使用Base64进行加密
*
* @param res 密文
* @return
*/
public String Base64Encode(String res) {
return Base64.getEncoder().encodeToString(res.getBytes());
}
/**
* 使用Base64进行解密
*
* @param res
* @return
*/
public String Base64Decode(String res) {
return new String(Base64.getDecoder().decode(res));
}
/**
* 将二进制转换成16进制
*/
@@ -299,23 +318,4 @@ public class EncryptUtil {
return res ^ key.hashCode();
}
/**
* 使用Base64进行加密
*
* @param res 密文
* @return
*/
public String Base64Encode(String res) {
return String.valueOf(Base64.encode(res.getBytes()));
}
/**
* 使用Base64进行解密
*
* @param res
* @return
*/
public String Base64Decode(String res) {
return new String(Base64.decode(res));
}
}

View File

@@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Date;
@Component

View File

@@ -4,7 +4,7 @@ import com.taixingyiji.base.common.ResultVO;
import com.taixingyiji.base.module.auth.entity.OsSysMenu;
import com.taixingyiji.base.module.auth.service.AuthFunctionService;
import com.taixingyiji.base.module.auth.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -19,7 +19,7 @@ import java.util.List;
* @decription 权限接口
*/
@RestController
@Api(tags = "权限管理")
@Tag(name = "权限管理")
@RequestMapping("auth/function")
public class AuthFunctionController {

View File

@@ -4,16 +4,16 @@ import com.taixingyiji.base.common.ResultVO;
import com.taixingyiji.base.module.auth.service.FtUserService;
import com.taixingyiji.base.module.log.annotation.LogAnno;
import com.taixingyiji.base.module.shiro.service.ShiroService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
/**
* (FtUser)表控制层
@@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest;
* @since 2020-02-11 19:29:10
*/
@RestController
@Api(tags = "用户相关接口")
@Tag(name = "用户相关接口")
@RequestMapping("ftUser")
public class FtUserController {
/**
@@ -34,19 +34,17 @@ public class FtUserController {
@Autowired
ShiroService shiroService;
@ApiOperation(value = "用户登陆")
@ApiImplicitParams({
@ApiImplicitParam(name = "username", value = "用户名", required = true),
@ApiImplicitParam(name = "password", value = "密码", required = true),
})
@Operation(summary = "用户登陆")
//@LogAnno(operateType = "用户登录")
@PostMapping("login")
public ResultVO login(HttpServletRequest request, String username, String password) {
public ResultVO login(HttpServletRequest request,
@Parameter(description = "用户名", required = true) String username,
@Parameter(description = "密码", required = true) String password) {
return ftUserService.login(request, username, password);
}
@LogAnno(operateType = "用户登出", isBefore = true)
@ApiOperation(value = "用户登出")
@Operation(summary = "用户登出")
@PostMapping("/logout")
public ResultVO logOut(HttpServletRequest request) {
String token = request.getHeader("X-Access-Token");

View File

@@ -3,7 +3,7 @@ package com.taixingyiji.base.module.auth.service;
import com.taixingyiji.base.common.ResultVO;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
/**
* (FtUser)表服务接口

View File

@@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;

View File

@@ -6,10 +6,9 @@ import com.taixingyiji.base.common.utils.TableNameUtil;
import com.taixingyiji.base.module.data.service.TableService;
import com.taixingyiji.base.module.tableconfig.entity.OsSysTable;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -18,7 +17,7 @@ import java.util.Map;
/***
* @description 控制器提供接口
*/
@Api(tags = "通用增删改查接口")
@Tag(name = "通用增删改查接口")
@RequestMapping("common")
@RestController// 控制器注解告诉Spring框架进行管理并返回Json格式字符串将@ResponeseBody 和 @Controller注解功能合并的注解
public class TableController {
@@ -34,120 +33,116 @@ public class TableController {
this.tableNameUtil = tableNameUtil;
}
@ApiOperation(value = "保存接口(不带保存日期)")
@Operation(summary = "保存接口(不带保存日期)")
@PostMapping("/{typeName}")
public ResultVO<Integer> save(@PathVariable String typeName, @RequestParam Map<String, Object> map) {
return ResultVO.getSuccess(tableService.save(tableNameUtil.getTableName(typeName), map));
}
@ApiOperation(value = "保存接口(带保存日期)")
@Operation(summary = "保存接口(带保存日期)")
@PostMapping("/{typeName}/date")
public ResultVO<Map<String, Object>> saveWithDate(@PathVariable String typeName, @RequestParam Map<String, Object> map) {
return tableService.saveWithDate(tableNameUtil.getTableName(typeName), map);
}
@ApiOperation(value = "获取单条数据")
@Operation(summary = "获取单条数据")
@GetMapping("/{typeName}/one/{id}")
public ResultVO<Map<String, Object>> getOne(@PathVariable String typeName, @PathVariable String id) {
return ResultVO.getSuccess(tableService.getOne(tableNameUtil.getTableName(typeName), id));
}
@ApiOperation(value = "获取多条数据")
@Operation(summary = "获取多条数据")
@GetMapping("/{typeName}/many/{ids}")
public ResultVO<List<Map<String, Object>>> getMany(@PathVariable String typeName, @PathVariable String ids) {
return ResultVO.getSuccess(tableService.getMany(tableNameUtil.getTableName(typeName), ids));
}
@ApiOperation(value = "获取多条数据")
@Operation(summary = "获取多条数据")
@GetMapping("/{typeName}/reference/{id}")
public ResultVO<PageInfo<Map<String, Object>>> getReference(@PathVariable String typeName, String target, String data, WebPageInfo webPageInfo, @PathVariable String id) {
return ResultVO.getSuccess(tableService.getReference(tableNameUtil.getTableName(typeName), data, webPageInfo, target,id));
}
@ApiOperation(value = "更新接口")
@Operation(summary = "更新接口")
@PutMapping({"/{typeName}/{version}", "/{typeName}"})
public ResultVO<Map<String,Object>> update(@PathVariable String typeName, @RequestParam Map<String, Object> map, @PathVariable(required = false) Integer version) {
return tableService.update(tableNameUtil.getTableName(typeName), map, version);
}
@ApiOperation(value = "更新接口(带更改日期)")
@Operation(summary = "更新接口(带更改日期)")
@PutMapping({"/{typeName}/{version}/date", "/{typeName}/date"})
public ResultVO<Map<String,Object>> updateWithDate(@PathVariable String typeName, @RequestParam Map<String, Object> map, @PathVariable(required = false) Integer version) {
return tableService.updateWithDate(tableNameUtil.getTableName(typeName), map, version);
}
@ApiOperation(value = "删除接口(可批量)")
@Operation(summary = "删除接口(可批量)")
@DeleteMapping("/{typeName}")
@ApiImplicitParam(name = "ids", value = "id主键的数组的toString", required = true)
public ResultVO<Integer> delete(@PathVariable String typeName, String ids) {
public ResultVO<Integer> delete(@PathVariable String typeName, @Parameter(description = "id主键的数组的toString", required = true) String ids) {
return tableService.delete(tableNameUtil.getTableName(typeName), ids);
}
@ApiOperation(value = "逻辑删除(可批量)")
@Operation(summary = "逻辑删除(可批量)")
@DeleteMapping("/{typeName}/logic")
@ApiImplicitParam(name = "ids", value = "id主键的数组的toString", required = true)
public ResultVO<Integer> logicDelete(@PathVariable String typeName, String ids) {
public ResultVO<Integer> logicDelete(@PathVariable String typeName, @Parameter(description = "id主键的数组的toString", required = true) String ids) {
return tableService.logicDelete(tableNameUtil.getTableName(typeName), ids);
}
@ApiOperation(value = "获取单表数据接口(带分页)")
@Operation(summary = "获取单表数据接口(带分页)")
@GetMapping("/{typeName}")
@ApiImplicitParams({
@ApiImplicitParam(name = "typeName", value = " 类型", type = "path", required = true),
@ApiImplicitParam(name = "data", value = " JSON.stringify()后的数据,主要为查询条件"),
})
public ResultVO<PageInfo<Map<String, Object>>> searchTables(@PathVariable String typeName, String data, WebPageInfo webPageInfo) {
public ResultVO<PageInfo<Map<String, Object>>> searchTables(
@PathVariable @Parameter(description = "类型", required = true) String typeName,
@Parameter(description = "JSON.stringify()后的数据,主要为查询条件") String data,
WebPageInfo webPageInfo) {
return ResultVO.getSuccess(tableService.searchSingleTables(data, tableNameUtil.getTableName(typeName), webPageInfo));
}
@ApiOperation(value = "获取连表数据接口(带分页)")
@Operation(summary = "获取连表数据接口(带分页)")
@GetMapping("/{typeName}/join")
@ApiImplicitParams({
@ApiImplicitParam(name = "typeName", value = " 类型", type = "path", required = true),
@ApiImplicitParam(name = "data", value = " JSON.stringify()后的数据,主要为查询条件"),
})
public ResultVO<PageInfo<Map<String, Object>>> searchJoinTables(@PathVariable String typeName, String data, WebPageInfo webPageInfo) {
public ResultVO<PageInfo<Map<String, Object>>> searchJoinTables(
@PathVariable @Parameter(description = "类型", required = true) String typeName,
@Parameter(description = "JSON.stringify()后的数据,主要为查询条件") String data,
WebPageInfo webPageInfo) {
return ResultVO.getSuccess(tableService.searchJoinTables(data, webPageInfo, tableNameUtil.getTableName(typeName)));
}
@ApiOperation(value = "获取单表接口(不带分页)")
@Operation(summary = "获取单表接口(不带分页)")
@GetMapping("/getListNoPage/{typeName}")
public ResultVO<List<Map<String, Object>>> getListNoPage(@PathVariable String typeName, @RequestParam Map<String, Object> map) {
return tableService.getListNoPage(tableNameUtil.getTableName(typeName), map);
}
@ApiOperation(value = "获取表格全部信息")
@Operation(summary = "获取表格全部信息")
@GetMapping("/{typeName}/getTableInfo/")
public ResultVO<OsSysTable> getTableInfo(@PathVariable String typeName) {
return ResultVO.getSuccess(tableNameUtil.getTableAllInfo(typeName));
}
@ApiOperation(value = "批量更新")
@Operation(summary = "批量更新")
@PutMapping("/{typeName}/batch")
public ResultVO<Integer> updateBatch(@PathVariable String typeName, @RequestParam Map<String, Object> map) {
return tableService.updateBatch(tableNameUtil.getTableName(typeName), map);
}
@ApiOperation(value = "批量更新(带日期)")
@Operation(summary = "批量更新(带日期)")
@PutMapping("/{typeName}/batchWithDate")
public ResultVO<Integer> updateBatchWithDate(@PathVariable String typeName, @RequestParam Map<String, Object> map) {
return tableService.updateBatchWithDate(tableNameUtil.getTableName(typeName), map);
}
@ApiOperation(value = "批量新增")
@Operation(summary = "批量新增")
@PostMapping("/{typeName}/batch")
public ResultVO<Integer> saveBatch(@PathVariable String typeName, @RequestParam String data) {
return tableService.saveBatch(tableNameUtil.getTableName(typeName), data);
}
@ApiOperation(value = "批量新增(带日期)")
@Operation(summary = "批量新增(带日期)")
@PostMapping("/{typeName}/batchWithDate")
public ResultVO<Integer> saveBatchWithDate(@PathVariable String typeName, @RequestParam String data) {
return tableService.saveBatchWithDate(tableNameUtil.getTableName(typeName), data);
}
@ApiOperation(value = "获取基表信息")
@Operation(summary = "获取基表信息")
@GetMapping("/getBaseTableInfo")
public ResultVO<Map<String, Object>> getBaseTableInfo(String tableNames) {
return tableService.getBaseTableInfo(tableNames);

View File

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.*;

View File

@@ -28,16 +28,20 @@ public class DataSourceAnnoOperation {
@Around("@annotation(com.taixingyiji.base.module.datasource.annotation.DatasourceAnno)")
public Object aroundAdvice(ProceedingJoinPoint pjp) throws Throwable {
// 获取方法签名
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
// 获取方法
Method method = methodSignature.getMethod();
// 获取方法上面的注解
DatasourceAnno dataSourceAnno = method.getAnnotation(DatasourceAnno.class);
String key = dataSourceAnno.value();
DBContextHolder.clearDataSource();
DBContextHolder.setDataSource(key);
return pjp.proceed();
try {
// 获取方法签名
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
// 获取方法
Method method = methodSignature.getMethod();
// 获取方法上面的注解
DatasourceAnno dataSourceAnno = method.getAnnotation(DatasourceAnno.class);
String key = dataSourceAnno.value();
DBContextHolder.clearDataSource();
DBContextHolder.setDataSource(key);
return pjp.proceed();
} finally {
DBContextHolder.clearDataSource();
}
}
}

View File

@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
/**
* @author lhc
@@ -51,25 +51,25 @@ public class DataSourceAop {
@Before("log()")
public void doBefore(JoinPoint joinPoint) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes != null) {
HttpServletRequest request = attributes.getRequest();
if (isMulti) {
String key = request.getParameter("datasourceKey");
if (StringUtils.isBlank(key)) {
DBContextHolder.setDataSource(DataUnit.MASTER);
} else {
DBContextHolder.setDataSource(key);
}
}
}
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// if (attributes != null) {
// HttpServletRequest request = attributes.getRequest();
// if (isMulti) {
// String key = request.getParameter("datasourceKey");
// if (StringUtils.isBlank(key)) {
// DBContextHolder.setDataSource(DataUnit.MASTER);
// } else {
// DBContextHolder.setDataSource(key);
// }
// }
// }
}
@After("log()")
public void doAfter() {
if (isMulti) {
DBContextHolder.clearDataSource();
}
// if (isMulti) {
// DBContextHolder.clearDataSource();
// }
}
}

View File

@@ -6,9 +6,9 @@ import com.taixingyiji.base.module.datasource.annotation.DatasourceAnno;
import com.taixingyiji.base.module.datasource.entity.DatasourceConfig;
import com.taixingyiji.base.module.datasource.service.DataSourceService;
import com.taixingyiji.base.module.datasource.utils.DataUnit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
* @author lhc
* @date 2020-09-23
*/
@Api(tags = "数据源信息管理接口")
@Tag(name = "数据源信息管理接口")
@RestController
@RequestMapping("/datasource")
public class DataSourceController {
@@ -26,78 +26,77 @@ public class DataSourceController {
DataSourceService dataSourceService;
@GetMapping("hasSource")
@ApiOperation(value = "判断是否配置数据源")
@Operation(summary = "判断是否配置数据源")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO isFirst() {
return dataSourceService.hasSource();
}
@GetMapping("list")
@ApiOperation(value = "获取数据源信息列表")
@Operation(summary = "获取数据源信息列表")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO getDataSourceList(WebPageInfo webPageInfo, DatasourceConfig datasourceConfig) {
return ResultVO.getSuccess(dataSourceService.list(webPageInfo, datasourceConfig));
}
@PostMapping("test")
@ApiOperation(value = "测试数据库是否正常连接")
@Operation(summary = "测试数据库是否正常连接")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO getTest(DatasourceConfig datasourceConfig) {
return dataSourceService.test(datasourceConfig);
}
@PostMapping("")
@ApiOperation(value = "新增数据库信息")
@Operation(summary = "新增数据库信息")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO saveDatasource(DatasourceConfig datasourceConfig) {
return dataSourceService.save(datasourceConfig);
}
@PutMapping("")
@ApiOperation(value = "更新数据库信息")
@Operation(summary = "更新数据库信息")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO update(DatasourceConfig datasourceConfig) {
return dataSourceService.update(datasourceConfig);
}
@DeleteMapping("/{id}")
@ApiOperation(value = "删除数据库信息")
@Operation(summary = "删除数据库信息")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO delete(@PathVariable Integer id) {
return dataSourceService.delete(id);
}
@GetMapping("unique")
@ApiOperation(value = "数据库Key或数据库名称是否唯一")
@Operation(summary = "数据库Key或数据库名称是否唯一")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO getUnique(String key, String name) {
return dataSourceService.getUnique(key, name);
}
@PutMapping("enabled/{id}")
@ApiOperation(value = "启用/禁用")
@Operation(summary = "启用/禁用")
@DatasourceAnno(DataUnit.SQLITE)
@ApiImplicitParam(name = "status", value = "启用为1禁用为0", required = true)
public ResultVO enableDatasource(@PathVariable Integer id, @RequestParam Integer status) {
public ResultVO enableDatasource(@PathVariable Integer id, @Parameter(description = "启用为1禁用为0", required = true) @RequestParam Integer status) {
return dataSourceService.enableDatasource(id, status);
}
@PutMapping("default/{id}")
@ApiOperation(value = "设置默认数据库")
@Operation(summary = "设置默认数据库")
@DatasourceAnno(value = DataUnit.SQLITE)
public ResultVO setDefault(@PathVariable Integer id) {
return dataSourceService.setDefault(id);
}
@GetMapping("all")
@ApiOperation(value = "获取全部列表(启用)")
@Operation(summary = "获取全部列表(启用)")
@DatasourceAnno(value = DataUnit.SQLITE)
public ResultVO getAllList() {
return dataSourceService.getAllList();
}
@PostMapping("token")
@ApiOperation(value = "token校验")
@Operation(summary = "token校验")
@DatasourceAnno(value = DataUnit.SQLITE)
public ResultVO validateToken(String token) {
return dataSourceService.validateToken(token);

View File

@@ -4,8 +4,8 @@ import com.taixingyiji.base.common.ResultVO;
import com.taixingyiji.base.module.datasource.annotation.DatasourceAnno;
import com.taixingyiji.base.module.datasource.service.DatasourceConfigService;
import com.taixingyiji.base.module.datasource.utils.DataUnit;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
* @author lhc
* @date 2020-09-23
*/
@Api(tags = "数据源配置管理接口")
@Tag(name = "数据源配置管理接口")
@RestController
@RequestMapping("dataconfig")
public class DatasourceConfigController {
@@ -23,21 +23,21 @@ public class DatasourceConfigController {
@PostMapping(value = "add")
@DatasourceAnno(DataUnit.SQLITE)
@ApiOperation(value = "新增")
@Operation(summary = "新增")
public ResultVO add(Integer id) {
return datasourceConfigService.add(id);
}
@GetMapping("")
@DatasourceAnno(DataUnit.SQLITE)
@ApiOperation(value = "列表显示数据源状态")
@Operation(summary = "列表显示数据源状态")
public ResultVO getRuntimeList() {
return datasourceConfigService.getRuntimeList();
}
@DeleteMapping("/{key}")
@DatasourceAnno(DataUnit.SQLITE)
@ApiOperation(value = "终止数据源使用")
@Operation(summary = "终止数据源使用")
public ResultVO deleteRuntimeSource(@PathVariable String key) {
return datasourceConfigService.deleteRuntimeSource(key);
}

View File

@@ -4,7 +4,7 @@ import com.taixingyiji.base.common.ResultVO;
import com.taixingyiji.base.module.datasource.annotation.DatasourceAnno;
import com.taixingyiji.base.module.datasource.service.DatasourceTypeService;
import com.taixingyiji.base.module.datasource.utils.DataUnit;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -23,7 +23,7 @@ public class DatasourceTypeController {
DatasourceTypeService datasourceTypeService;
@GetMapping("all")
@ApiOperation(value = "获取全部数据库类型信息")
@Operation(summary = "获取全部数据库类型信息")
@DatasourceAnno(DataUnit.SQLITE)
public ResultVO getAllInfo() {
return ResultVO.getSuccess(datasourceTypeService.getAllInfo());

View File

@@ -1,8 +1,7 @@
package com.taixingyiji.base.module.datasource.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -24,7 +23,7 @@ import java.util.Date;
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@ApiModel
@Schema
public class DatasourceConfig implements Serializable {
private static final long serialVersionUID = 188640098731075764L;
@@ -37,69 +36,34 @@ public class DatasourceConfig implements Serializable {
@GeneratedValue(generator="JDBC")
private Integer datasourceId;
@ApiModelProperty(
value = "驱动包地址",
dataType = "String"
)
@Schema(description = "驱动包地址")
private String driverClassName;
@ApiModelProperty(
value = "数据库连接url",
example = "",
dataType = "String"
)
@Schema(description = "数据库连接url", example = "")
private String url;
@ApiModelProperty(
value = "数据库用户名",
dataType = "String"
)
@Schema(description = "数据库用户名")
private String username;
@ApiModelProperty(
value = "数据库密码",
dataType = "String"
)
@Schema(description = "数据库密码")
private String password;
@ApiModelProperty(
value = "数据库key(数据库别名)",
example = "",
dataType = "String"
)
@Schema(description = "数据库key(数据库别名)", example = "")
private String commonAlias;
@ApiModelProperty(
value = "数据库类型",
example = "mysql",
dataType = "String"
)
@Schema(description = "数据库类型", example = "mysql")
private String commonType;
@ApiModelProperty(
value = "是否启用数据库",
example = "1",
dataType = "Integer"
)
@Schema(description = "是否启用数据库", example = "1")
private Integer sysEnabled;
@ApiModelProperty(
value = "是否是默认数据库",
example = "1",
dataType = "Integer"
)
@Schema(description = "是否是默认数据库", example = "1")
private Integer isDefault;
@ApiModelProperty(
value = "数据库库名",
dataType = "String"
)
@Schema(description = "数据库库名")
private String schemaName;
@ApiModelProperty(
value = "数据库中文描述",
dataType = "String"
)
@Schema(description = "数据库中文描述")
private String sysDescription;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

View File

@@ -1,7 +1,6 @@
package com.taixingyiji.base.module.datasource.entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -21,7 +20,7 @@ import java.io.Serializable;
@AllArgsConstructor
@Builder(toBuilder = true)
@Data
@ApiModel
@Schema
public class DatasourceType implements Serializable {
private static final long serialVersionUID = 331087641518717829L;
@@ -29,28 +28,16 @@ public class DatasourceType implements Serializable {
@GeneratedValue(generator="JDBC")
private Integer typeId;
@ApiModelProperty(
value = "Key",
dataType = "String"
)
@Schema(description = "Key")
private String typeKey;
@ApiModelProperty(
value = "名称",
dataType = "String"
)
@Schema(description = "名称")
private String typeValue;
@ApiModelProperty(
value = "驱动类地址",
dataType = "String"
)
@Schema(description = "驱动类地址")
private String driver;
@ApiModelProperty(
value = "数据库校验语句",
dataType = "String"
)
@Schema(description = "数据库校验语句")
private String validateQuery;

View File

@@ -1,6 +1,6 @@
package com.taixingyiji.base.module.datasource.utils;
import com.alibaba.druid.pool.DruidDataSource;
import com.taixingyiji.base.common.ServiceException;
import com.taixingyiji.base.common.utils.SpringContextUtil;
import com.taixingyiji.base.common.utils.TokenProccessor;
@@ -24,6 +24,9 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
/**
* @author lhc
@@ -151,7 +154,7 @@ public class DataSourceUtil {
}
/**
* 初始化Druid配置
* 初始化Hikari配置
*
* @param type
*/
@@ -181,7 +184,6 @@ public class DataSourceUtil {
}
return druidDataSource;
}
/**
* 生成token
*/
@@ -205,4 +207,4 @@ public class DataSourceUtil {
}
return token;
}
}
}

View File

@@ -2,6 +2,8 @@ package com.taixingyiji.base.module.druid;
import com.alibaba.druid.support.http.StatViewServlet;
import com.alibaba.druid.support.http.WebStatFilter;
import jakarta.servlet.Filter;
import jakarta.servlet.Servlet;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
@@ -26,29 +28,17 @@ public class DruidConfig implements WebMvcConfigurer {
//配置Druid的监控
//1、配置一个管理后台的Servlet
@Bean
public ServletRegistrationBean<StatViewServlet> statViewServlet(){
ServletRegistrationBean<StatViewServlet> bean = new ServletRegistrationBean<>(new StatViewServlet(), "/druid/*");
Map<String,String> initParams = new HashMap<>();
DruidAuth druidAuth = auth();
// initParams.put("loginUsername",druidAuth.getUsername());
// initParams.put("loginPassword",druidAuth.getPassword());
//默认就是允许所有访问
initParams.put("allow",druidAuth.getAllow());
initParams.put("deny",druidAuth.getDeny());
bean.setInitParameters(initParams);
return bean;
public Object statViewServlet(){
// Temporary placeholder: original Druid StatViewServlet uses javax.servlet APIs which conflict with Jakarta in Spring Boot 4.
// Keep a minimal placeholder bean to let the project compile. Restore real Druid servlet integration after migrating to a Jakarta-compatible Druid release.
return new Object();
}
//2、配置一个web监控的filter
@Bean
public FilterRegistrationBean<WebStatFilter> webStatFilter(){
FilterRegistrationBean<WebStatFilter> bean = new FilterRegistrationBean<>();
bean.setFilter(new WebStatFilter());
Map<String,String> initParams = new HashMap<>(1);
initParams.put("exclusions","*.js,*.css,/druid/*");
bean.setInitParameters(initParams);
bean.setUrlPatterns(Collections.singletonList("/*"));
return bean;
public Object webStatFilter(){
// Temporary placeholder for the WebStatFilter (same reason as above).
return new Object();
}
}

View File

@@ -18,8 +18,8 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.*;
/**

View File

@@ -7,10 +7,10 @@ import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.web.filter.authc.AuthenticatingFilter;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

View File

@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.web.filter.AccessControlFilter;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

View File

@@ -17,7 +17,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.Filter;
import jakarta.servlet.Filter;
import java.util.HashMap;
import java.util.Map;

View File

@@ -2,11 +2,11 @@ package com.taixingyiji.base.module.shiro;
import org.apache.shiro.web.servlet.ShiroHttpServletRequest;
import org.apache.shiro.web.session.mgt.DefaultWebSessionManager;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.util.StringUtils;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import java.io.Serializable;
/**
@@ -14,12 +14,11 @@ import java.io.Serializable;
* @version 1.0
* @className ShiroSessionManager
* @date 2021年04月19日 2:56 下午
* @description 描述
* @description 自定义 Session Manager - 从 Header 中提取 Token
*/
public class ShiroSessionManager extends DefaultWebSessionManager {
private static final String AUTHORIZATION = "X-Access-Token";
private static final String REFERENCED_SESSION_ID_SOURCE = "Stateless request";
public ShiroSessionManager(){
@@ -28,17 +27,21 @@ public class ShiroSessionManager extends DefaultWebSessionManager {
@Override
protected Serializable getSessionId(ServletRequest request, ServletResponse response){
String id = WebUtils.toHttp(request).getHeader(AUTHORIZATION);
System.out.println("id"+id);
String id = null;
if (request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest) request;
id = httpRequest.getHeader(AUTHORIZATION);
System.out.println("Token from header: " + id);
}
if(StringUtils.isEmpty(id)){
//如果没有携带id参数则按照父类的方式在cookie进行获取
System.out.println("super"+super.getSessionId(request, response));
// 如果没有携带 token 则按照父类的方式在 cookie 进行获取
return super.getSessionId(request, response);
}else{
//如果请求头中有 authToken 则其值为sessionId
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE,REFERENCED_SESSION_ID_SOURCE);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID,id);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID,Boolean.TRUE);
} else {
// 如果请求头中有 token 则其值为 sessionId
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_SOURCE, REFERENCED_SESSION_ID_SOURCE);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID, id);
request.setAttribute(ShiroHttpServletRequest.REFERENCED_SESSION_ID_IS_VALID, Boolean.TRUE);
return id;
}
}

View File

@@ -6,8 +6,8 @@ import com.taixingyiji.base.module.tableconfig.entity.OsSysField;
import com.taixingyiji.base.module.tableconfig.entity.OsSysSelect;
import com.taixingyiji.base.module.tableconfig.entity.OsSysTable;
import com.taixingyiji.base.module.tableconfig.service.TableConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
* @date 2020-06-10
* @description 单表配置修改接口
*/
@Api(tags = "单表配置修改接口")
@Tag(name = "单表配置修改接口")
@RestController
@RequestMapping("/tableConfig")
public class TableConfigController {
@@ -24,97 +24,97 @@ public class TableConfigController {
@Autowired
TableConfigService tableConfigService;
@ApiOperation(value = "获取Table表信息")
@Operation(summary = "获取Table表信息")
@GetMapping("/table")
public ResultVO getTableInfo(OsSysTable osSysTable, WebPageInfo webPageInfo) {
return tableConfigService.getTableInfo(osSysTable, webPageInfo);
}
@ApiOperation(value = "新增Table表信息")
@Operation(summary = "新增Table表信息")
@PostMapping("/table")
public ResultVO saveTableInfo(OsSysTable osSysTable) {
return tableConfigService.saveTableInfo(osSysTable);
}
@ApiOperation(value = "批量删除表格信息")
@Operation(summary = "批量删除表格信息")
@DeleteMapping("table")
public ResultVO deleteTable(String ids) {
return tableConfigService.deleteTable(ids);
}
@ApiOperation(value = "编辑表格信息")
@Operation(summary = "编辑表格信息")
@PutMapping("table")
public ResultVO updateTable(OsSysTable osSysTable) {
return tableConfigService.updateTable(osSysTable);
}
@ApiOperation(value = "获取字段信息")
@Operation(summary = "获取字段信息")
@GetMapping("field")
public ResultVO getFieldList(OsSysField osSysField, WebPageInfo webPageInfo){
return tableConfigService.getFieldList(osSysField, webPageInfo);
}
@ApiOperation(value = "新增字段信息")
@Operation(summary = "新增字段信息")
@PostMapping("field")
public ResultVO saveFieldInfo(OsSysField osSysField){
return tableConfigService.saveFieldInfo(osSysField);
}
@ApiOperation(value = "修改字段信息")
@Operation(summary = "修改字段信息")
@PutMapping("field")
public ResultVO updateFieldInfo(OsSysField osSysField) {
return tableConfigService.updateFieldInfo(osSysField);
}
@ApiOperation(value = "删除字段信息")
@Operation(summary = "删除字段信息")
@DeleteMapping("field")
public ResultVO deleteField(String ids) {
return tableConfigService.deleteField(ids);
}
@ApiOperation(value = "字段排序上移")
@Operation(summary = "字段排序上移")
@PutMapping("field/upMove")
public ResultVO upMove(Integer id) {
return tableConfigService.upMove(id);
}
@ApiOperation(value = "字段排序上移")
@Operation(summary = "字段排序上移")
@PutMapping("field/downMove")
public ResultVO downMove(Integer id) {
return tableConfigService.downMove(id);
}
@ApiOperation(value = "字段排序")
@Operation(summary = "字段排序")
@PutMapping("field/sort")
public ResultVO fieldSort(Integer tableId) {
return tableConfigService.fieldSort(tableId);
}
@ApiOperation(value = "获取下拉选项列表")
@Operation(summary = "获取下拉选项列表")
@GetMapping("select")
public ResultVO getSelectList(OsSysSelect osSysSelect) {
return tableConfigService.getSelectList(osSysSelect);
}
@ApiOperation(value = "新增下拉列表")
@Operation(summary = "新增下拉列表")
@PostMapping("select")
public ResultVO saveSelectInfo(OsSysSelect osSysSelect) {
return tableConfigService.saveSelectInfo(osSysSelect);
}
@ApiOperation(value = "更新下拉列表")
@Operation(summary = "更新下拉列表")
@PutMapping("select")
public ResultVO updateSelectInfo(OsSysSelect osSysSelect) {
return tableConfigService.updateSelectInfo(osSysSelect);
}
@ApiOperation(value = "删除下拉列表")
@Operation(summary = "删除下拉列表")
@DeleteMapping("select")
public ResultVO delete(String ids) {
return tableConfigService.deleteSelectInfo(ids);
}
@ApiOperation(value = "获取table下拉框")
@Operation(summary = "获取table下拉框")
@GetMapping("tableSelect")
public ResultVO getTableSelect(){
return tableConfigService.getTableSelect();

View File

@@ -6,8 +6,8 @@ import com.taixingyiji.base.module.datasource.entity.DatasourceConfig;
import com.taixingyiji.base.module.tableconfig.entity.FieldInfo;
import com.taixingyiji.base.module.tableconfig.entity.TableInfo;
import com.taixingyiji.base.module.tableconfig.service.TableGenService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
* @date 2020-06-10
* @description 自动填充生成表单数据接口
*/
@Api(tags = "自动填充表单数据接口")
@Tag(name = "自动填充表单数据接口")
@RestController
@RequestMapping("/tableGen")
public class TableGenController {
@@ -27,37 +27,37 @@ public class TableGenController {
@Autowired
TableGenService tableGenService;
@ApiOperation(value = "自动生成序列")
@Operation(summary = "自动生成序列")
@PostMapping("genAllSequence")
public ResultVO genAllSequence() {
return tableGenService.genAllSequence();
}
@ApiOperation(value = "获取table表接口")
@Operation(summary = "获取table表接口")
@GetMapping("list")
public ResultVO getTableList(WebPageInfo webPageInfo, TableInfo tableInfo, DatasourceConfig datasourceConfig) {
return tableGenService.getTableList(webPageInfo, tableInfo, datasourceConfig);
}
@ApiOperation(value = "获取字段接口")
@Operation(summary = "获取字段接口")
@GetMapping("fieldList")
public ResultVO getFieldList(WebPageInfo webPageInfo, FieldInfo fieldInfo, DatasourceConfig datasourceConfig, String tableName) {
return tableGenService.getFieldList(webPageInfo, fieldInfo,datasourceConfig,tableName);
}
@ApiOperation(value = "自动填充Table表信息")
@Operation(summary = "自动填充Table表信息")
@PostMapping("genTable")
public ResultVO genTable( DatasourceConfig datasourceConfig) {
return tableGenService.genTable(datasourceConfig);
}
@ApiOperation(value = "自动填充Field表信息")
@Operation(summary = "自动填充Field表信息")
@PostMapping("genField")
public ResultVO genField(DatasourceConfig datasourceConfig,String tableAlias) {
return tableGenService.genField(datasourceConfig,tableAlias);
}
@ApiOperation(value = "自动生成全部信息")
@Operation(summary = "自动生成全部信息")
@PostMapping("genAll")
public ResultVO genAll(DatasourceConfig datasourceConfig) {
return tableGenService.genAll(datasourceConfig);

View File

@@ -1,6 +1,6 @@
package com.taixingyiji.base.module.tableconfig.entity;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -15,28 +15,15 @@ import java.io.Serializable;
public class FieldInfo implements Serializable {
private static final long serialVersionUID = 3537487795273818036L;
@ApiModelProperty(
value = "字段名",
dataType = "String"
)
@Schema(description = "字段名")
private String columnName;
@ApiModelProperty(
value = "数据类型",
dataType = "String"
)
@Schema(description = "数据类型")
private String dataType;
@ApiModelProperty(
value = "键类型,1为主键0为非主键",
dataType = "Integer",
allowableValues = "1"
)
@Schema(description = "键类型,1为主键0为非主键", allowableValues = {"1"})
private Integer columnKey;
@ApiModelProperty(
value = "注释",
dataType = "String"
)
@Schema(description = "注释")
private String columnComment;
}

View File

@@ -1,6 +1,6 @@
package com.taixingyiji.base.module.tableconfig.entity;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -20,16 +20,11 @@ import java.io.Serializable;
public class TableInfo implements Serializable {
private static final long serialVersionUID = -277016779002661446L;
@ApiModelProperty(
value = "表名",
dataType = "String"
)
@Schema(description = "表名")
private String tableName;
@ApiModelProperty(
value = "表描述",
dataType = "String"
)
@Schema(description = "表描述")
@Builder.Default
private String tableComment = "";
}

View File

@@ -45,7 +45,7 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.5.3-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.taixingyiji</groupId>
@@ -54,14 +54,23 @@
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@@ -2,19 +2,14 @@ package com.taixingyiji.config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
@EnableDiscoveryClient
@EnableFeignClients

View File

@@ -20,7 +20,7 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.5.3-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.taixingyiji</groupId>
@@ -58,6 +58,14 @@
<artifactId>spring-web</artifactId>
<version>5.3.28</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
@@ -70,14 +78,9 @@
<version>2.13.4</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>

View File

@@ -2,17 +2,12 @@ package com.taixingyiji.es;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
//@EnableDiscoveryClient
//@EnableFeignClients

View File

@@ -1,13 +0,0 @@
package com.taixingyiji.es;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(EsApplication.class);
}
}

View File

@@ -28,7 +28,7 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.5.3-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>

View File

@@ -12,9 +12,11 @@
<artifactId>hcframe-redis-starter</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -30,4 +32,4 @@
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>
</project>
</project>

View File

@@ -9,14 +9,11 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
/**
* @description redis配置类
* @author lhc
* @date 2020-06-15
*/
@Configuration
public class RedisConfig {
@@ -32,18 +29,20 @@ public class RedisConfig {
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory){
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>();
redisTemplate.setConnectionFactory(redisConnectionFactory);
// 使用Jackson2JsonRedisSerialize 替换默认序列化(默认采用的是JDK序列化)
Jackson2JsonRedisSerializer<Object> jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer<>(Object.class);
RedisSerializer<String> redisSerializer = new StringRedisSerializer();
ObjectMapper om = new ObjectMapper();
om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance ,
ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
jackson2JsonRedisSerializer.setObjectMapper(om);
redisTemplate.setKeySerializer(redisSerializer);
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer);
redisTemplate.setHashKeySerializer(jackson2JsonRedisSerializer);
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
// 1. 使用官方推荐的静态工厂方法
RedisSerializer<Object> jsonSerializer = RedisSerializer.json();
RedisSerializer<String> stringSerializer = new StringRedisSerializer();
// 2. 设置序列化器
redisTemplate.setKeySerializer(stringSerializer);
redisTemplate.setValueSerializer(jsonSerializer);
// Hash 类型建议 Key 使用 StringValue 使用 JSON
redisTemplate.setHashKeySerializer(stringSerializer);
redisTemplate.setHashValueSerializer(jsonSerializer);
redisTemplate.afterPropertiesSet();
return redisTemplate;
}
}
}

View File

@@ -24,7 +24,16 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.5.3-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
</dependency>
<!-- Ensure Spring Boot web and autoconfigure are available for SB4 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
</dependencies>
<build>

View File

@@ -2,17 +2,12 @@ package com.taixingyiji.test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@SpringBootApplication
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
//@EnableDiscoveryClient
//@EnableFeignClients

File diff suppressed because it is too large Load Diff

View File

@@ -13,8 +13,8 @@
<artifactId>hcframe-user</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
</properties>
<dependencies>
<dependency>
@@ -25,7 +25,7 @@
<dependency>
<groupId>com.taixingyiji</groupId>
<artifactId>hcframe-base</artifactId>
<version>1.2.2-SNAPSHOT</version>
<version>1.2.5.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.taixingyiji</groupId>
@@ -37,11 +37,14 @@
<artifactId>hcframe-cloud-starter</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
<version>26.0.1</version>
</dependency>
</dependencies>
<build>

View File

@@ -4,27 +4,25 @@ import com.taixingyiji.base.module.datasource.config.DataSourceConfiguration;
import net.unicon.cas.client.configuration.CasClientConfigurationProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import tk.mybatis.spring.annotation.MapperScan;
@SpringBootApplication()
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableSwagger2
@ServletComponentScan
@EnableCaching
@MapperScan(basePackages = "com.taixingyiji.**.dao")
@ComponentScan(basePackages = {"com.taixingyiji.**"}, excludeFilters = @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {DataSourceConfiguration.class}))
@EnableDiscoveryClient
@Import(CasClientConfigurationProperties.class)
//@EnableCasClient
// @ServletComponentScan removed for Spring Boot 3 compatibility
// @EnableCasClient
public class UserApplication {
public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args);

View File

@@ -91,4 +91,9 @@ public class ShiroRealmConfig implements SystemRealm {
return map;
}
@Override
public void setTimeoutLogoutLog(String userId) {
// no-op implementation: set nothing or handle logout log if needed
}
}

View File

@@ -25,8 +25,8 @@ import com.taixingyiji.base.module.log.annotation.LogAnno;
import com.taixingyiji.base.module.tableconfig.entity.OsSysTable;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Date;

View File

@@ -82,7 +82,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_ROLE")
.on("ROLE_ID", "OS_REL_USER_ROLE", "ROLE_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_USER_ROLE")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_MENU.DELETED", 1)
.andEqual("OS_SYS_MENU.MENU_STATUS", 1)
@@ -108,7 +108,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_MENU")
.on("MENU_ID", "OS_REL_ROLE_MENU", "MENU_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_USER_GROUP")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_MENU.DELETED", 1)
.andEqual("OS_SYS_MENU.OS_ID", OS_ID)
@@ -133,7 +133,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_MENU")
.on("MENU_ID", "OS_REL_ROLE_MENU", "MENU_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_DEPT_ROLE")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_MENU.DELETED", 1)
.andEqual("OS_SYS_MENU.OS_ID", OS_ID)
@@ -160,7 +160,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_MENU")
.on("MENU_ID", "OS_REL_ROLE_MENU", "MENU_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_DEPT_GROUP")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_MENU.DELETED", 1)
.andEqual("OS_SYS_ROLE_GROUP.DELETED", 1)
@@ -183,7 +183,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_OS")
.on("OS_ID", "OS_REL_ROLE_OS", "OS_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_USER_ROLE")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_OS.DELETED", 1)
.andEqual("OS_SYS_OS.ENABLED", 1)
@@ -209,7 +209,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_OS")
.on("OS_ID", "OS_REL_ROLE_OS", "OS_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_USER_GROUP")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_OS.DELETED", 1)
.andEqual("OS_SYS_OS.OS_ID", OS_ID)
@@ -234,7 +234,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_OS")
.on("OS_ID", "OS_REL_ROLE_OS", "OS_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_DEPT_ROLE")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_OS.DELETED", 1)
.andEqual("OS_SYS_OS.OS_ID", OS_ID)
@@ -261,7 +261,7 @@ public class AuthDaoImpl implements AuthDao {
.join("OS_SYS_OS")
.on("OS_ID", "OS_REL_ROLE_OS", "OS_ID")
.build();
Condition condition = Condition.creatCriteria(selectCondition)
Condition condition = Condition.creatCriteria(selectCondition, "OS_REL_DEPT_GROUP")
.andEqual("OS_SYS_ROLE.DELETED", 1)
.andEqual("OS_SYS_OS.DELETED", 1)
.andEqual("OS_SYS_ROLE_GROUP.DELETED", 1)

View File

@@ -14,9 +14,9 @@ import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.Map;

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
<version>4.0.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.taixingyiji</groupId>
@@ -25,11 +25,12 @@
<module>hcframe-spider</module>
</modules>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
<spring-alibaba.version>2.2.5.RELEASE</spring-alibaba.version>
<spring-cloud.version>Hoxton.SR7</spring-cloud.version>
<spring-boot.version>2.7.18</spring-boot.version>
<spring-boot.version>4.0.2</spring-boot.version>
<java.cas.client.version>3.5.0</java.cas.client.version>
</properties>
<dependencyManagement>
@@ -56,20 +57,10 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.7.18</version>
<version>${spring-boot.version}</version>
</dependency>
</dependencies>
@@ -78,7 +69,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.8</version>
<version>1.18.42</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -92,6 +83,16 @@
<artifactId>guava</artifactId>
<version>33.5.0-jre</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<!-- hutool工具类-->
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-all -->
@@ -100,33 +101,44 @@
<artifactId>hutool-all</artifactId>
<version>5.8.42</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>2.7.18</version>
<version>4.0.2</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<release>21</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>21</release>
<encoding>UTF-8</encoding>
<fork>true</fork>
<executable>${env.JAVA_HOME}/bin/javac</executable>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.42</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>