From 980002581465b0fc2bf35e608c31340392620d26 Mon Sep 17 00:00:00 2001 From: zhangbinhub Date: Sun, 24 Aug 2025 23:38:35 +0800 Subject: [PATCH 1/5] =?UTF-8?q?[Upgrade]=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/feign/CommonOauthServer.kt | 13 ------ .../hystrix/CommonOauthServerHystrix.kt | 7 ---- .../openinner/OpenInnerTokenController.kt | 41 ------------------- .../zhangbinhub/admin/oauth/vo/MenuVo.kt | 10 ----- .../admin/oauth/vo/ModuleFuncVo.kt | 4 -- 5 files changed, 75 deletions(-) delete mode 100644 modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/controller/openinner/OpenInnerTokenController.kt diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/feign/CommonOauthServer.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/feign/CommonOauthServer.kt index 622ee641..99305682 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/feign/CommonOauthServer.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/feign/CommonOauthServer.kt @@ -2,7 +2,6 @@ package io.gitee.zhangbinhub.admin.resource.server.feign import io.gitee.zhangbinhub.admin.common.api.CommonPath import io.gitee.zhangbinhub.admin.common.api.OauthApi -import io.gitee.zhangbinhub.admin.common.vo.BooleanInfoVo import io.gitee.zhangbinhub.admin.common.vo.InnerInfoVo import io.gitee.zhangbinhub.admin.resource.server.hystrix.CommonOauthServerHystrix import io.gitee.zhangbinhub.admin.resource.server.vo.* @@ -25,18 +24,6 @@ interface CommonOauthServer { @GetMapping(value = [CommonPath.innerBasePath + OauthApi.appInfo], produces = [MediaType.APPLICATION_JSON_VALUE]) fun appInfo(@RequestParam(name = "access_token") token: String): ApplicationVo - /** - * 指定用户是否具有指定的功能权限 - */ - @GetMapping( - value = [CommonPath.openInnerBasePath + OauthApi.moduleFunc + "/{userId}/{moduleFuncCode}"], - produces = [MediaType.APPLICATION_JSON_VALUE] - ) - fun hasModuleFunc( - @PathVariable(name = "userId") userId: String, - @PathVariable(name = "moduleFuncCode") moduleFuncCode: String - ): BooleanInfoVo - /** * 获取所属机构及其所有子机构列表(所属机构) */ diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/CommonOauthServerHystrix.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/CommonOauthServerHystrix.kt index 5165bc48..bd553c89 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/CommonOauthServerHystrix.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/CommonOauthServerHystrix.kt @@ -5,7 +5,6 @@ import feign.FeignException import io.gitee.zhangbinhub.acp.boot.log.LogAdapter import io.gitee.zhangbinhub.acp.boot.vo.ErrorVo import io.gitee.zhangbinhub.admin.common.base.BaseFeignHystrix -import io.gitee.zhangbinhub.admin.common.vo.BooleanInfoVo import io.gitee.zhangbinhub.admin.common.vo.InnerInfoVo import io.gitee.zhangbinhub.admin.resource.server.feign.CommonOauthServer import io.gitee.zhangbinhub.admin.resource.server.vo.* @@ -45,12 +44,6 @@ class CommonOauthServerHystrix(logAdapter: LogAdapter, objectMapper: ObjectMappe return ApplicationVo() } - override fun hasModuleFunc(userId: String, moduleFuncCode: String): BooleanInfoVo { - val errMsg = "找不到对应的功能权限信息" - logAdapter.error(errMsg) - return BooleanInfoVo(result = false) - } - override fun currAndAllChildrenForOrg(): List { val errMsg = "获取机构列表失败" logAdapter.error(errMsg) diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/controller/openinner/OpenInnerTokenController.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/controller/openinner/OpenInnerTokenController.kt deleted file mode 100644 index 29e25348..00000000 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/controller/openinner/OpenInnerTokenController.kt +++ /dev/null @@ -1,41 +0,0 @@ -package io.gitee.zhangbinhub.admin.oauth.controller.openinner - -import io.gitee.zhangbinhub.acp.boot.exceptions.WebException -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.admin.common.api.CommonPath -import io.gitee.zhangbinhub.admin.common.api.OauthApi -import io.gitee.zhangbinhub.admin.common.vo.BooleanInfoVo -import io.gitee.zhangbinhub.admin.oauth.service.ModuleFuncService -import io.gitee.zhangbinhub.admin.resource.server.base.BaseResourceServerController -import io.swagger.v3.oas.annotations.Operation -import io.swagger.v3.oas.annotations.tags.Tag -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.http.MediaType -import org.springframework.http.ResponseEntity -import org.springframework.validation.annotation.Validated -import org.springframework.web.bind.annotation.* - -/** - * @since JDK 11 - */ -@Validated -@RestController -@RequestMapping(CommonPath.openInnerBasePath) -@Tag(name = "认证信息(内部开放接口)") -class OpenInnerTokenController @Autowired -constructor( - logAdapter: LogAdapter, - private val moduleFuncService: ModuleFuncService -) : BaseResourceServerController(logAdapter) { - @Operation(summary = "判断指定用户是否具有指定的权限") - @GetMapping( - value = [OauthApi.moduleFunc + "/{userId}/{moduleFuncCode}"], - produces = [MediaType.APPLICATION_JSON_VALUE] - ) - @Throws(WebException::class) - fun userHasModuleFunc( - @PathVariable(name = "userId") userId: String, - @PathVariable(name = "moduleFuncCode") moduleFuncCode: String - ): ResponseEntity = - ResponseEntity.ok(BooleanInfoVo(result = moduleFuncService.hasModuleFunc(userId, moduleFuncCode))) -} diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/MenuVo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/MenuVo.kt index 69d11e5a..eaf9a739 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/MenuVo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/MenuVo.kt @@ -1,9 +1,6 @@ package io.gitee.zhangbinhub.admin.oauth.vo import io.swagger.v3.oas.annotations.media.Schema -import jakarta.validation.constraints.Max -import jakarta.validation.constraints.Min -import jakarta.validation.constraints.NotBlank /** * @since JDK 11 @@ -18,27 +15,21 @@ data class MenuVo( var appId: String? = null, @Schema(description = "菜单名称") - @NotBlank(message = "菜单名称不能为空") var name: String? = null, @Schema(description = "菜单图标") - @NotBlank(message = "菜单图标不能为空") var iconType: String? = null, @Schema(description = "链接路径") - @NotBlank(message = "链接路径不能为空") var path: String? = null, @Schema(description = "上级菜单ID") - @NotBlank(message = "上级菜单ID不能为空") var parentId: String? = null, @Schema(description = "菜单是否启用") var enabled: Boolean = true, @Schema(description = "链接打开模式;0-内嵌,1-新标签页") - @Min(value = 0, message = "打开模式只能为 0 或 1") - @Max(value = 1, message = "打开模式只能为 0 或 1") var openType: Int = 0, @Schema(description = "序号") @@ -46,5 +37,4 @@ data class MenuVo( @Schema(description = "关联角色ID") var roleIds: MutableList = mutableListOf() - ) diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/ModuleFuncVo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/ModuleFuncVo.kt index b5c3f028..443e0c2d 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/ModuleFuncVo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/ModuleFuncVo.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.oauth.vo import io.swagger.v3.oas.annotations.media.Schema -import jakarta.validation.constraints.NotBlank /** * @since JDK 11 @@ -16,15 +15,12 @@ data class ModuleFuncVo( var appId: String? = null, @Schema(description = "模块名称") - @NotBlank(message = "模块名称不能为空") var name: String? = null, @Schema(description = "模块编码") - @NotBlank(message = "模块编码不能为空") var code: String? = null, @Schema(description = "上级ID") - @NotBlank(message = "上级ID不能为空") var parentId: String? = null, @Schema(description = "关联角色ID") -- Gitee From 47ef97105d643b8ed1093a9a7a5eab544bfa1456 Mon Sep 17 00:00:00 2001 From: zhangbinhub Date: Sun, 24 Aug 2025 23:39:25 +0800 Subject: [PATCH 2/5] =?UTF-8?q?[Upgrade]=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/version_history.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/version_history.md b/doc/version_history.md index 5e3ba5b6..be5e0c42 100644 --- a/doc/version_history.md +++ b/doc/version_history.md @@ -1,5 +1,10 @@ ## 版本更新记录 +##### v7.0.2 + +- Global + - [Upgrade] 删除无用代码 + ##### v7.0.1 - Global -- Gitee From 1dae525c47b8be2e0ac2b8ee7044ff196e994b24 Mon Sep 17 00:00:00 2001 From: zhangbinhub Date: Mon, 25 Aug 2025 13:51:31 +0800 Subject: [PATCH 3/5] =?UTF-8?q?[Upgrade]=20=E5=88=A0=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/modules/log-server/src/main/resources/logback-spring.xml b/modules/log-server/src/main/resources/logback-spring.xml index 02436488..b07269a2 100644 --- a/modules/log-server/src/main/resources/logback-spring.xml +++ b/modules/log-server/src/main/resources/logback-spring.xml @@ -134,37 +134,6 @@ - - - ${logPatternFileServer} - UTF8 - - - ${LOG_HOME}/${APP_NAME}/%d{yyyy-MM-dd}/ROUTE.%i.log - - 100MB - 180 - - - ALL - - - - - ${logPatternFileServer} - UTF8 - - - ${LOG_HOME}/${APP_NAME}/%d{yyyy-MM-dd}/ROUTE.error.%i.log - - 100MB - 180 - - - ERROR - - - ${logPatternFileServer} @@ -212,10 +181,6 @@ - - - - -- Gitee From 8e80622fed08b146dbe4d656927f4691b6b7523d Mon Sep 17 00:00:00 2001 From: zhangbinhub Date: Tue, 26 Aug 2025 13:49:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?[Upgrade]=20=E4=BC=98=E5=8C=96=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/version_history.md | 4 +++ .../admin/gateway/conf/RouteConfiguration.kt | 7 ---- .../admin/gateway/log/RouteLogService.kt | 9 +++--- .../admin/log/service/LogService.kt | 32 +------------------ .../src/main/resources/logback-spring.xml | 1 - 5 files changed, 9 insertions(+), 44 deletions(-) diff --git a/doc/version_history.md b/doc/version_history.md index be5e0c42..66e020f0 100644 --- a/doc/version_history.md +++ b/doc/version_history.md @@ -4,6 +4,10 @@ - Global - [Upgrade] 删除无用代码 +- gateway-server + - [Upgrade] 优化路由日志 +- log-server + - [Upgrade] 优化路由日志 ##### v7.0.1 diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteConfiguration.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteConfiguration.kt index cd427dfd..00a4f0e0 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteConfiguration.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteConfiguration.kt @@ -53,13 +53,6 @@ class RouteConfiguration @Autowired constructor(private val routeLogService: Rou } } - @Bean - fun logRequestFilter(routeLogBridge: RouteLogBridge): GlobalFilter = GlobalFilter { exchange, chain -> - chain!!.filter(exchange.also { - routeLogBridge.sendMessage(routeLogService.createRouteLogMessage(it)) - }) - } - @Bean fun logResponseFilter(routeLogBridge: RouteLogBridge): GlobalFilter = object : GlobalFilter, Ordered { override fun filter(exchange: ServerWebExchange?, chain: GatewayFilterChain?): Mono { diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogService.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogService.kt index 89979ebd..e016c02e 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogService.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogService.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.gateway.log import com.fasterxml.jackson.databind.ObjectMapper -import io.gitee.zhangbinhub.acp.boot.constant.AcpCoreConstant import io.gitee.zhangbinhub.acp.boot.log.LogAdapter import io.gitee.zhangbinhub.acp.boot.tools.IpTools import io.gitee.zhangbinhub.acp.cloud.constant.AcpCloudConstant @@ -75,8 +74,8 @@ constructor( token = authList[1] } } - token?.apply { - serverWebExchange.request.queryParams["access_token"]?.let { + if (token == null) { + serverWebExchange.request.queryParams[GateWayConstant.GATEWAY_HEADER_RESPONSE_TOKEN_FIELD]?.let { if (it.isNotEmpty()) { token = it[0] } @@ -107,7 +106,7 @@ constructor( tmpUri = tmpUri.substring(8) } if (tmpUri.contains("/")) { - routeLogMessage.path = tmpUri.substring(tmpUri.indexOf("/")) + routeLogMessage.path = tmpUri.substringAfter("/") } else { routeLogMessage.path = tmpUri } @@ -115,7 +114,7 @@ constructor( if (routeLogMessage.serverId == null && uriStr.startsWith(prefix)) { val tmpUri = uriStr.substring(prefix.length) if (tmpUri.contains("/")) { - routeLogMessage.serverId = tmpUri.substring(0, tmpUri.indexOf("/")) + routeLogMessage.serverId = tmpUri.substringBefore("/") } else { routeLogMessage.serverId = tmpUri } diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogService.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogService.kt index 58c91a46..36b185a8 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogService.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogService.kt @@ -9,7 +9,6 @@ import io.gitee.zhangbinhub.admin.common.vo.CustomerQueryPageVo import io.gitee.zhangbinhub.admin.log.base.BaseLogEntity import io.gitee.zhangbinhub.admin.log.base.BaseRepository import io.gitee.zhangbinhub.admin.log.base.BaseService -import io.gitee.zhangbinhub.admin.log.constant.LogConstant import io.gitee.zhangbinhub.admin.log.entity.LoginLog import io.gitee.zhangbinhub.admin.log.entity.OperateLog import io.gitee.zhangbinhub.admin.log.entity.RouteLog @@ -21,8 +20,6 @@ import io.gitee.zhangbinhub.admin.resource.server.tools.TokenUserTools import io.gitee.zhangbinhub.admin.resource.server.vo.ApplicationVo import io.gitee.zhangbinhub.admin.resource.server.vo.TokenUserInfoVo import jakarta.persistence.criteria.Predicate -import kotlinx.coroutines.delay -import kotlinx.coroutines.runBlocking import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional @@ -79,34 +76,7 @@ constructor( logAdapter.error(e.message, e) } } - if (routeLog.responseStatus != null) {// 响应日志 - var optionalRouteLog = routeLogRepository.findByLogIdAndRequestTime(routeLog.logId, routeLog.requestTime) - var count = 1 - while (optionalRouteLog.isEmpty) { - runBlocking { - delay(LogConstant.ROUTE_LOG_QUERY_INTERVAL_TIME) - } - optionalRouteLog = routeLogRepository.findByLogIdAndRequestTime(routeLog.logId, routeLog.requestTime) - if (++count >= LogConstant.ROUTE_LOG_QUERY_MAX_NUMBER) { - break - } - } - optionalRouteLog.ifPresent { - it.token = routeLog.token - it.clientId = routeLog.clientId - it.clientName = routeLog.clientName - it.identify = routeLog.identify - it.userId = routeLog.userId - it.loginNo = routeLog.loginNo - it.userName = routeLog.userName - it.processTime = routeLog.processTime - it.responseTime = routeLog.responseTime - it.responseStatus = routeLog.responseStatus - routeLogRepository.save(it) - } - } else {// 请求日志 - routeLogRepository.save(routeLog) - } + routeLogRepository.save(routeLog) } @Transactional diff --git a/modules/log-server/src/main/resources/logback-spring.xml b/modules/log-server/src/main/resources/logback-spring.xml index b07269a2..31802bfb 100644 --- a/modules/log-server/src/main/resources/logback-spring.xml +++ b/modules/log-server/src/main/resources/logback-spring.xml @@ -185,5 +185,4 @@ - \ No newline at end of file -- Gitee From 7f50cbc24b0d49d01c9fdd8cae830de4c53283a2 Mon Sep 17 00:00:00 2001 From: zhangbinhub Date: Wed, 27 Aug 2025 10:36:58 +0800 Subject: [PATCH 5/5] [Upgrade] v7.0.2 --- README.md | 4 ++-- doc/version_history.md | 2 ++ gradle/libs.versions.toml | 2 +- gradle/moduleVersion.gradle | 18 +++++++++--------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index fda8af14..f21499b4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # acp-admin-cloud -###### v7.0.1 [版本更新日志](doc/version_history.md) +###### v7.0.2 [版本更新日志](doc/version_history.md) - 使用Application Construction Platform 应用构建平台作为脚手架 - 基于 Spring Cloud 的微服务版本,基于 Spring Boot @@ -11,7 +11,7 @@ - [Spring Boot 3.5.4](https://projects.spring.io/spring-boot) - [Spring Boot Admin 3.5.2](https://github.com/codecentric/spring-boot-admin) -- [Acp 2025.7.2](https://gitee.com/zhangbinhub/acp) +- [Acp 2025.8.0](https://gitee.com/zhangbinhub/acp) - [sensitive](https://github.com/houbb/sensitive) ## 技术栈 diff --git a/doc/version_history.md b/doc/version_history.md index 66e020f0..4c797120 100644 --- a/doc/version_history.md +++ b/doc/version_history.md @@ -3,6 +3,8 @@ ##### v7.0.2 - Global + - [Upgrade] 升级依赖 + - Acp 2025.8.0 - [Upgrade] 删除无用代码 - gateway-server - [Upgrade] 优化路由日志 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7bf48b8a..d46d03b2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ kotlin = "2.1.21" jreleaser = "1.19.0" ######################## dependencies ##################### -acp = "2025.7.2" +acp = "2025.8.0" springBoot = "3.5.4" springBootAdmin = "3.5.2" sensitive = "1.7.0" diff --git a/gradle/moduleVersion.gradle b/gradle/moduleVersion.gradle index d5b52527..99d72c0d 100644 --- a/gradle/moduleVersion.gradle +++ b/gradle/moduleVersion.gradle @@ -1,27 +1,27 @@ project(':acp-admin-cloud-constant') { - version '7.0.1' + version '7.0.2' } project(':acp-admin-cloud-dependencies') { - version '7.0.1' + version '7.0.2' } project(':acp-admin-cloud-dependencies-resource-server') { - version '7.0.1' + version '7.0.2' } project(':admin-server') { - version '7.0.1' + version '7.0.2' } project(':deploy-server') { - version '7.0.1' + version '7.0.2' } project(':gateway-server') { - version '7.0.1' + version '7.0.2' } project(':log-server') { - version '7.0.1' + version '7.0.2' } project(':oauth-server') { - version '7.0.1' + version '7.0.2' } project(':workflow-server') { - version '7.0.1' + version '7.0.2' } \ No newline at end of file -- Gitee