diff --git a/README.md b/README.md index b6656486063ae1633cc9eb290b3bba54eb8ea178..fda8af149a949d8b0b3b67354fef3a2fbf4a5e59 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # acp-admin-cloud -###### v7.0.0 [版本更新日志](doc/version_history.md) +###### v7.0.1 [版本更新日志](doc/version_history.md) - 使用Application Construction Platform 应用构建平台作为脚手架 - 基于 Spring Cloud 的微服务版本,基于 Spring Boot @@ -10,8 +10,8 @@ ## 相关组件版本 - [Spring Boot 3.5.4](https://projects.spring.io/spring-boot) -- [Spring Boot Admin 3.5.1](https://github.com/codecentric/spring-boot-admin) -- [Acp 2025.7.1](https://gitee.com/zhangbinhub/acp) +- [Spring Boot Admin 3.5.2](https://github.com/codecentric/spring-boot-admin) +- [Acp 2025.7.2](https://gitee.com/zhangbinhub/acp) - [sensitive](https://github.com/houbb/sensitive) ## 技术栈 @@ -63,11 +63,8 @@ - 各服务在 **Nacos** 上进行注册,**gateway** 和其他各个服务通过 **Nacos** 发现和查找目标服务进行访问 - 各服务将互相调用的断路信息通过 **admin server** 进行监控 -- **【依赖中间件 redis】 gateway server** 根据制定的策略路由到指定服务;路由定义从 **Redis** - 获取,缓存至本地;基于动态路由配置可根据实际情况扩展实现灰度发布 +- **【依赖中间件 redis】 gateway server** 根据制定的策略路由到指定服务; - **【依赖中间件 redis】 oauth server** 存储 **token** 至 **Redis** -- **【依赖中间件 redis、kafka】 route server** 修改路由信息后更新至 **Redis** ,通过 **Kafka** 通知 **gateway server** - 动态更新路由 - **【依赖中间件 kafka】** 发布和订阅 **Bus** 总线事件 server** 更新缓存 - **【依赖中间件 kafka】** 各深度定制开发的服务通过 **kafka** 发送日志消息,**log server** 从 **Kafka** 中消费消息并进行日志的统一记录 diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/CommonPath.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/CommonPath.kt index 5d8411371231ab1c10e35c5dbb5ab24b57bc26ee..01c3eb4c1e2cdc0134840a01ad026c6ca1086b71 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/CommonPath.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/CommonPath.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.common.api /** - * @author zhang by 01/02/2019 * @since JDK 11 */ object CommonPath { diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/OauthApi.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/OauthApi.kt index 14362c6cfb584b45799def5f41a6665906a6d107..24ec9ab38bd93b9f2d9fcf2a6140fc34ad58b9d7 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/OauthApi.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/api/OauthApi.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.common.api /** - * @author zhang by 18/01/2019 * @since JDK 11 */ object OauthApi { @@ -31,7 +30,6 @@ object OauthApi { const val token = "/token" const val logOut = "/logout" const val onlineInfo = "/online-info" - const val currToken = "/token-info" const val moduleFunc = "/module-func" const val authentication = "/authentication" const val currUser = "/user-info" diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/CommonConstant.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/CommonConstant.kt index a2336095f55f616a9ecb87063899c1c88c033064..06467ae5559a1e3d7bc4cb9638a7698823f65716 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/CommonConstant.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/CommonConstant.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.common.constant /** - * @author zhang by 02/02/2019 * @since JDK 11 */ object CommonConstant { diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/ModuleFuncCode.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/ModuleFuncCode.kt index 822097af3c79ed3b4c38905f60d38bbc8a9c3e4d..261bf7ae9dde5e6f5ccb7efe80bc321b1afc5d3a 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/ModuleFuncCode.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/ModuleFuncCode.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.common.constant /** - * @author zhang by 15/01/2019 * @since JDK 11 */ object ModuleFuncCode { diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RoleCode.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RoleCode.kt index fececc2af84e9a7e9a7252f3fbf8f9eb3ef3c25e..631edf099f5e7731163a35067c88001983e7c194 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RoleCode.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RoleCode.kt @@ -5,7 +5,6 @@ package io.gitee.zhangbinhub.admin.common.constant * 新建角色时,需要向该接口中增加对应的编码 * 系统中配置的角色编码不应包含前缀prefix * - * @author zhang by 28/12/2018 * @since JDK 11 */ object RoleCode { diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RouteConstant.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RouteConstant.kt index 78e4296e9f5c73ecb0eac774b5fd7e609d23ae70..7dc909896e98eb1e599eb9690f7d1df81d9c3442 100644 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RouteConstant.kt +++ b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RouteConstant.kt @@ -1,16 +1,9 @@ package io.gitee.zhangbinhub.admin.common.constant /** - * @author zhang by 30/01/2019 * @since JDK 11 */ object RouteConstant { - const val UPDATE_ROUTE_CONSUMER = "acpUpdateRouteConsumer" - const val UPDATE_ROUTE_INPUT = "acpUpdateRouteInput" - const val UPDATE_ROUTE_OUTPUT = "acpUpdateRouteOutput" - const val UPDATE_ROUTE_DESCRIPTION = "acp-update-gateway-routes" - const val ROUTES_DEFINITION_KEY = "acp_cloud_gateway_routes_definition_key" - const val UPDATE_GATEWAY_ROUTES = "acp_update_gateway_routes" const val ROUTE_LOG_CONSUMER = "acpRouteLogConsumer" const val ROUTE_LOG_INPUT = "acpRouteLogInput" const val ROUTE_LOG_OUTPUT = "acpRouteLogOutput" diff --git a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RuntimeName.kt b/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RuntimeName.kt deleted file mode 100644 index bcdb0820de6dcd49e7a8e099f7a3b7b7f781e92f..0000000000000000000000000000000000000000 --- a/common/acp-admin-cloud-constant/src/main/kotlin/io/gitee/zhangbinhub/admin/common/constant/RuntimeName.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.gitee.zhangbinhub.admin.common.constant - -/** - * @author zhang by 01/02/2019 - * @since JDK 11 - */ -object RuntimeName diff --git a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt index 31bee9ae7f131735e77022c776378c1bf83eb6ea..5b92175e1bb264c48f9224f364b2c31a3dce4cae 100644 --- a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt +++ b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt @@ -5,7 +5,6 @@ import io.gitee.zhangbinhub.acp.boot.log.LogAdapter import io.gitee.zhangbinhub.admin.common.base.BaseController /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseResourceServerController(private val logAdapter: LogAdapter) : BaseController() { diff --git a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt index 2987fc58c67907735d222d979c995cad7389c296..a79297d82408b3e3878c041df37d1c6a9b33aa5b 100644 --- a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "模块功能配置详细信息") diff --git a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt index 496274b779a1c2374d38e8890aa543b783e04bc2..d3e18fc6d3dba3a649114e1808f88c6a03a9e999 100644 --- a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 17/01/2019 * @since JDK 11 */ @Schema(description = "机构详细信息") diff --git a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt index 1ec4a46ea9e17f3ce1613fdeeeee05f9782c2e42..9bf5dea10fff4dcd10c416f24551099fe9b10974 100644 --- a/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server-reactive/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @Schema(description = "运行配置信息") diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/AcpAdminResourceServerFeignClientAutoConfiguration.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/AcpAdminResourceServerFeignClientAutoConfiguration.kt index ddf5e3362456f93944403c963e6c574fffd2c291..b943bfaf9375d00bfca8419f1936f4a040632b81 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/AcpAdminResourceServerFeignClientAutoConfiguration.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/AcpAdminResourceServerFeignClientAutoConfiguration.kt @@ -10,7 +10,6 @@ import org.springframework.cloud.openfeign.EnableFeignClients import org.springframework.context.annotation.Bean /** - * @author zhang by 12/12/2019 * @since JDK 11 */ @AutoConfiguration(after = [BlockingLoadBalancerClientAutoConfiguration::class]) diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt index 31bee9ae7f131735e77022c776378c1bf83eb6ea..5b92175e1bb264c48f9224f364b2c31a3dce4cae 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/base/BaseResourceServerController.kt @@ -5,7 +5,6 @@ import io.gitee.zhangbinhub.acp.boot.log.LogAdapter import io.gitee.zhangbinhub.admin.common.base.BaseController /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseResourceServerController(private val logAdapter: LogAdapter) : BaseController() { 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 483a45f541574b6954528b35cd6f1e5fbaef9f23..622ee6412413c098aebcf5d0342740ed71270f3b 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 @@ -12,7 +12,6 @@ import org.springframework.util.MultiValueMap import org.springframework.web.bind.annotation.* /** - * @author zhang by 14/11/2019 * @since JDK 11 */ @FeignClient(value = "oauth-server", fallbackFactory = CommonOauthServerHystrix::class) 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 5c5af100d49f52d5018fe80843804cdec55247cf..5165bc482377fad0fcae85092042f3d21bf9e80f 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 @@ -13,7 +13,6 @@ import org.springframework.http.HttpStatus import org.springframework.util.MultiValueMap /** - * @author zhang by 14/11/2019 * @since JDK 11 */ class CommonOauthServerHystrix(logAdapter: LogAdapter, objectMapper: ObjectMapper) : diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/WorkFlowServerHystrix.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/WorkFlowServerHystrix.kt index 3658a5bd348669fe7eb67eb5eb2ad05902c3919a..3bf9628ac92552ece0011704b07b1b05ca0a4121 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/WorkFlowServerHystrix.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/hystrix/WorkFlowServerHystrix.kt @@ -11,7 +11,6 @@ import io.gitee.zhangbinhub.admin.resource.server.po.ProcessTerminationPo import io.gitee.zhangbinhub.admin.resource.server.vo.* /** - * @author zhang by 20/12/2019 * @since JDK 11 */ class WorkFlowServerHystrix(logAdapter: LogAdapter, objectMapper: ObjectMapper) : diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt index 2987fc58c67907735d222d979c995cad7389c296..a79297d82408b3e3878c041df37d1c6a9b33aa5b 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/ModuleFuncVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "模块功能配置详细信息") diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt index 496274b779a1c2374d38e8890aa543b783e04bc2..d3e18fc6d3dba3a649114e1808f88c6a03a9e999 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/OrganizationVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 17/01/2019 * @since JDK 11 */ @Schema(description = "机构详细信息") diff --git a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt index 1ec4a46ea9e17f3ce1613fdeeeee05f9782c2e42..9bf5dea10fff4dcd10c416f24551099fe9b10974 100644 --- a/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt +++ b/common/acp-admin-cloud-dependencies-resource-server/src/main/kotlin/io/gitee/zhangbinhub/admin/resource/server/vo/RuntimeConfigVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.resource.server.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @Schema(description = "运行配置信息") diff --git a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/base/BaseFeignHystrix.kt b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/base/BaseFeignHystrix.kt index c0a5936197235f931619c01178a807bed0dd4072..3f2b2a6e349d55b3cf619b9a514b9a81b5d74c86 100644 --- a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/base/BaseFeignHystrix.kt +++ b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/base/BaseFeignHystrix.kt @@ -8,7 +8,6 @@ import io.gitee.zhangbinhub.acp.core.common.CommonTools import org.springframework.cloud.openfeign.FallbackFactory /** - * @author zhang by 01/02/2019 * @since JDK 11 */ abstract class BaseFeignHystrix protected constructor( diff --git a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/BooleanInfoVo.kt b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/BooleanInfoVo.kt index 832c91f3d94583d107582b15bd73dd04efce62d3..4c50231b3b33855bd72bd651b03e771d46e51b5b 100644 --- a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/BooleanInfoVo.kt +++ b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/BooleanInfoVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.common.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Schema(description = "布尔响应信息") diff --git a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/CustomerQueryPageVo.kt b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/CustomerQueryPageVo.kt index daa05e07601ce31c53fcaca6a1a94e7f7d6ffb02..b387c0a2213706410a7d52d8afa8c84e1989fdfb 100644 --- a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/CustomerQueryPageVo.kt +++ b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/CustomerQueryPageVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.common.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 04/11/2019 * @since JDK 11 */ @Schema(description = "自定义分页查询结果") diff --git a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InfoVo.kt b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InfoVo.kt index 6aa591279c8871fdf152ca87ecd0726a8ef1e6b2..d9fe55f312604f74ae5544dc27a17c7d616b33a5 100644 --- a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InfoVo.kt +++ b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InfoVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.common.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Schema(description = "响应信息") diff --git a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InnerInfoVo.kt b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InnerInfoVo.kt index 512d33f29996633571b7ee569c2b1f808df68d55..a3a017ed1b739eb12ce4152b0d2fca9811f12685 100644 --- a/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InnerInfoVo.kt +++ b/common/acp-admin-cloud-dependencies/src/main/kotlin/io/gitee/zhangbinhub/admin/common/vo/InnerInfoVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.common.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Schema(description = "内部响应信息") diff --git a/common/acp-admin-cloud-dependencies/src/test/java/io/gitee/zhangbinhub/admin/common/test/SimpleTest.java b/common/acp-admin-cloud-dependencies/src/test/java/io/gitee/zhangbinhub/admin/common/test/SimpleTest.java index 77273a0aa4969b7796ef88c25ddb5ae1c110d5ab..2bbba9c35e2193ac47d20678ed7c7f4f0406a851 100644 --- a/common/acp-admin-cloud-dependencies/src/test/java/io/gitee/zhangbinhub/admin/common/test/SimpleTest.java +++ b/common/acp-admin-cloud-dependencies/src/test/java/io/gitee/zhangbinhub/admin/common/test/SimpleTest.java @@ -5,7 +5,6 @@ import org.joda.time.DateTime; import org.junit.jupiter.api.Test; /** - * @author zhang by 15/01/2019 * @since JDK 11 */ class SimpleTest { diff --git a/deploy/docker/middleware/.env b/deploy/docker/middleware/.env index 9b5af9f1893155117d99fc91fd4bdc818ab7aaa4..48f703b72fab95e8e989592b509fa678f8e303fa 100644 --- a/deploy/docker/middleware/.env +++ b/deploy/docker/middleware/.env @@ -1,2 +1,2 @@ -HOST_MACHINE_IP=10.100.207.37 +HOST_MACHINE_IP=10.100.107.155 KAFKA_CLUSTER_ID=acp_admin_cloud_test \ No newline at end of file diff --git a/deploy/k8s-demo/9.service.yaml b/deploy/k8s-demo/9.service.yaml index 89848a8571955d1130a1d547d3d851671794c6af..77a87b37598a105d2c6c782bc71c09d2c7646bf1 100644 --- a/deploy/k8s-demo/9.service.yaml +++ b/deploy/k8s-demo/9.service.yaml @@ -380,66 +380,6 @@ spec: --- apiVersion: apps/v1 kind: Deployment -metadata: - annotations: - deployment.kubernetes.io/revision: "1" - generation: 1 - labels: - k8s-app: route-server - qcloud-app: route-server - managedFields: - - manager: tke-platform-api - operation: Update - - manager: kube-controller-manager - operation: Update - name: route-server - namespace: acp -spec: - progressDeadlineSeconds: 600 - replicas: 1 - revisionHistoryLimit: 10 - selector: - matchLabels: - k8s-app: route-server - qcloud-app: route-server - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - k8s-app: route-server - qcloud-app: route-server - spec: - containers: - - envFrom: - - configMapRef: - name: acp-conf - env: - - name: acp_jvm_param - value: "-Xms256m -Xmx512m" - image: route-server-2.2.0 - imagePullPolicy: IfNotPresent - name: route-server - resources: - limits: - cpu: "1000m" - memory: 1Gi - requests: - cpu: 500m - memory: 256Mi - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - dnsPolicy: ClusterFirst - imagePullSecrets: - - name: qcloudregistrykey - restartPolicy: Always - terminationGracePeriodSeconds: 30 ---- -apiVersion: apps/v1 -kind: Deployment metadata: annotations: deployment.kubernetes.io/revision: "1" diff --git a/doc/nacos_config_export_dev.zip b/doc/nacos_config_export_dev.zip index c500787d9efe2f53c9d57d34e25be7211d9b7c0c..f90923e1cee73246a2e1335d6bec602b407ee6a7 100644 Binary files a/doc/nacos_config_export_dev.zip and b/doc/nacos_config_export_dev.zip differ diff --git a/doc/version_history.md b/doc/version_history.md index 9fb72c59b98fcc7f41280ee16bcce94991e1146e..5e3ba5b6a9436f626b02be3897dddd19d5f424fe 100644 --- a/doc/version_history.md +++ b/doc/version_history.md @@ -1,5 +1,15 @@ ## 版本更新记录 +##### v7.0.1 + +- Global + - [Upgrade] 升级依赖 + - Acp 2025.7.2 + - Spring Boot Admin 3.5.2 + - [Delete] 移除`route-server`服务 +- gateway-server + - [Upgrade] 路由定义放于配置中心中 + ##### v7.0.0 - Global diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b03f12dcce0279780e4d2f3d9be3deb5c0d1666f..7bf48b8a39f391c374468335f69e01c01ca7d0ef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,9 +3,9 @@ kotlin = "2.1.21" jreleaser = "1.19.0" ######################## dependencies ##################### -acp = "2025.7.1" +acp = "2025.7.2" springBoot = "3.5.4" -springBootAdmin = "3.5.1" +springBootAdmin = "3.5.2" sensitive = "1.7.0" sensitiveDeepCopy = "0.0.1" mysql = "9.3.0" diff --git a/gradle/moduleVersion.gradle b/gradle/moduleVersion.gradle index 9557a128235d95b67cea7393483bb6de48321429..d5b52527f0894cbba300d64165bb05e729d31142 100644 --- a/gradle/moduleVersion.gradle +++ b/gradle/moduleVersion.gradle @@ -1,30 +1,27 @@ project(':acp-admin-cloud-constant') { - version '7.0.0' + version '7.0.1' } project(':acp-admin-cloud-dependencies') { - version '7.0.0' + version '7.0.1' } project(':acp-admin-cloud-dependencies-resource-server') { - version '7.0.0' + version '7.0.1' } project(':admin-server') { - version '7.0.0' + version '7.0.1' } project(':deploy-server') { - version '7.0.0' + version '7.0.1' } project(':gateway-server') { - version '7.0.0' + version '7.0.1' } project(':log-server') { - version '7.0.0' + version '7.0.1' } project(':oauth-server') { - version '7.0.0' -} -project(':route-server') { - version '7.0.0' + version '7.0.1' } project(':workflow-server') { - version '7.0.0' + version '7.0.1' } \ No newline at end of file diff --git a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseRepository.kt b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseRepository.kt index e2444b9c54af059afd634d29fff944469c0ac761..d218cdaf61b7831b2e351f795667c9d1ed460051 100644 --- a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseRepository.kt +++ b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseRepository.kt @@ -5,7 +5,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor import org.springframework.data.repository.NoRepositoryBean /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @NoRepositoryBean diff --git a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseService.kt b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseService.kt index a1b06ce783c1b5f383e57d7f1a09237a0b39e3fa..c58edcebe4b17c4f935d24a8996b659975c3e11b 100644 --- a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseService.kt +++ b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/base/BaseService.kt @@ -6,7 +6,6 @@ import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseService { diff --git a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/CustomerApiConfiguration.kt b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/CustomerApiConfiguration.kt index de8c69ba0d0a4001461af6c8a61906127e943de6..a5b6521f0089ccafa0212f7b15cffbddcbd90a56 100644 --- a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/CustomerApiConfiguration.kt +++ b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/CustomerApiConfiguration.kt @@ -10,7 +10,6 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration /** - * @author zhang by 27/12/2018 * @since JDK 11 */ @Configuration(proxyBeanMethods = false) diff --git a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/DeployServerCustomerConfiguration.kt b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/DeployServerCustomerConfiguration.kt index 6d76201f4941ff3f4be21f699d535987d8fa5114..fb1a28823bf4656af6f3e4f4d6130b45f921c5b3 100644 --- a/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/DeployServerCustomerConfiguration.kt +++ b/modules/deploy-server/src/main/kotlin/io/gitee/zhangbinhub/admin/deploy/conf/DeployServerCustomerConfiguration.kt @@ -5,7 +5,6 @@ import org.springframework.cloud.context.config.annotation.RefreshScope import org.springframework.stereotype.Component /** - * @author zhang by 30/01/2019 * @since JDK 11 */ @Component diff --git a/modules/gateway-server/README.md b/modules/gateway-server/README.md index fa1b63ca86fbb9f9aa3b2d566c51317e035d77e2..40cab3dd06b1a34ef21c49fd6b8cb6ebd172fdb1 100644 --- a/modules/gateway-server/README.md +++ b/modules/gateway-server/README.md @@ -15,6 +15,4 @@ user.name: ${spring.security.user.name} user.password: ${spring.security.user.password} ``` -- 2、固定路由配置定义于[application.yaml](src/main/resources/application.yaml)中 -- 3、动态路由配置由[路由服务](../route-server/README.md)进行管理 -- 4、接收路由服务发送的“更新路由”消息,从redis中获取路由信息并进行动态更新 \ No newline at end of file +- 2、路由配置放在配置中心中 \ No newline at end of file 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 8e66d6bea18827ae4a89ce1dc4b417fa30fd1166..cd427dfd091c101ccbd09b016aed9a8adebb60ae 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 @@ -3,13 +3,11 @@ package io.gitee.zhangbinhub.admin.gateway.conf import com.fasterxml.jackson.databind.ObjectMapper import io.gitee.zhangbinhub.admin.common.constant.RouteConstant import io.gitee.zhangbinhub.admin.gateway.constant.GateWayConstant -import io.gitee.zhangbinhub.admin.gateway.consumer.UpdateRouteConsumerProcess import io.gitee.zhangbinhub.admin.gateway.log.RouteLogBridge import io.gitee.zhangbinhub.admin.gateway.log.RouteLogService import org.reactivestreams.Publisher import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.autoconfigure.AutoConfigureBefore -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.cloud.gateway.filter.GatewayFilterChain import org.springframework.cloud.gateway.filter.GlobalFilter import org.springframework.cloud.gateway.filter.NettyWriteResponseFilter @@ -33,12 +31,6 @@ import reactor.core.publisher.Mono @Configuration(proxyBeanMethods = false) @AutoConfigureBefore(BindingServiceConfiguration::class) class RouteConfiguration @Autowired constructor(private val routeLogService: RouteLogService) { - @Bean(RouteConstant.UPDATE_ROUTE_CONSUMER) - @ConditionalOnMissingBean(name = [RouteConstant.UPDATE_ROUTE_CONSUMER]) - fun updateRouteConsumer(updateRouteConsumerProcess: UpdateRouteConsumerProcess): (String) -> Unit { - return { updateRouteConsumerProcess.accept(it) } - } - @Bean fun routeLogBridge(streamBridge: StreamBridge, objectMapper: ObjectMapper) = RouteLogBridge(streamBridge, objectMapper, RouteConstant.ROUTE_LOG_OUTPUT) diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteEnvironmentPostProcessor.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteEnvironmentPostProcessor.kt index 103946628257e2a8e153d880b2165342dff985c9..80097ce0f7cfe6b9a17abaed920d86a53107dab7 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteEnvironmentPostProcessor.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/conf/RouteEnvironmentPostProcessor.kt @@ -1,51 +1,17 @@ package io.gitee.zhangbinhub.admin.gateway.conf import io.gitee.zhangbinhub.acp.boot.tools.EnvironmentTools -import io.gitee.zhangbinhub.acp.core.common.CommonTools import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import io.gitee.zhangbinhub.admin.gateway.constant.GateWayConstant import org.springframework.boot.SpringApplication import org.springframework.boot.env.EnvironmentPostProcessor -import org.springframework.cloud.function.context.FunctionProperties import org.springframework.core.env.ConfigurableEnvironment import org.springframework.util.MimeTypeUtils /** - * @author zhang by 17/12/2018 00:41 * @since JDK 11 */ class RouteEnvironmentPostProcessor : EnvironmentPostProcessor { - private val overridePropertiesName = "acpCloudRouteOverrideProperties" private val defaultPropertiesName = "acpCloudRouteDefaultProperties" - private val functionDefinitionProperties = "${FunctionProperties.PREFIX}.definition" - private val updateRouteConsumerBindName = "${RouteConstant.UPDATE_ROUTE_CONSUMER}-in-0" - - private fun initConsumer(environment: ConfigurableEnvironment) { - val overrides: MutableMap = HashMap() - var definition = RouteConstant.UPDATE_ROUTE_CONSUMER - if (environment.containsProperty(functionDefinitionProperties)) { - val property = environment.getProperty(functionDefinitionProperties) - if (property != null && property.contains(definition)) { - return - } - definition = "$property;$definition" - } - overrides[functionDefinitionProperties] = definition - EnvironmentTools.addOrReplaceProperty(environment.propertySources, overrides, overridePropertiesName, true) - - val default: MutableMap = HashMap() - "spring.cloud.stream".let { prefix -> - default["$prefix.function.bindings.$updateRouteConsumerBindName"] = RouteConstant.UPDATE_ROUTE_INPUT - val destination = RouteConstant.UPDATE_ROUTE_DESCRIPTION - val groupId = GateWayConstant.UPDATE_ROUTE_GROUP_PREFIX + CommonTools.getUuid32() - default["$prefix.bindings.${RouteConstant.UPDATE_ROUTE_INPUT}.destination"] = destination - default["$prefix.bindings.${RouteConstant.UPDATE_ROUTE_INPUT}.contentType"] = - MimeTypeUtils.APPLICATION_JSON_VALUE - default["$prefix.bindings.${RouteConstant.UPDATE_ROUTE_INPUT}.group"] = groupId - EnvironmentTools.addOrReplaceProperty(environment.propertySources, default, defaultPropertiesName, false) - } - } - private fun initProducer(environment: ConfigurableEnvironment) { val default: MutableMap = HashMap() "spring.cloud.stream.bindings.${RouteConstant.ROUTE_LOG_OUTPUT}".let { prefix -> @@ -69,7 +35,6 @@ class RouteEnvironmentPostProcessor : EnvironmentPostProcessor { } override fun postProcessEnvironment(environment: ConfigurableEnvironment?, application: SpringApplication?) { - initConsumer(environment!!) - initProducer(environment) + initProducer(environment!!) } } diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/constant/GateWayConstant.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/constant/GateWayConstant.kt index 498d0f2525d6e539ac4368d9e6821713983eb9f9..bbeaea14a010568c89570424e9ebcfbbdf22ad27 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/constant/GateWayConstant.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/constant/GateWayConstant.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.gateway.constant /** - * @author zhang by 17/03/2019 * @since JDK 11 */ object GateWayConstant { diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/consumer/UpdateRouteConsumerProcess.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/consumer/UpdateRouteConsumerProcess.kt deleted file mode 100644 index 4fc0562738e3b9adf88933f135e9a4233edaa6b9..0000000000000000000000000000000000000000 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/consumer/UpdateRouteConsumerProcess.kt +++ /dev/null @@ -1,30 +0,0 @@ -package io.gitee.zhangbinhub.admin.gateway.consumer - -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import io.gitee.zhangbinhub.admin.gateway.repo.RouteRedisRepository -import org.springframework.stereotype.Component -import java.util.function.Consumer - -/** - * @author zhang by 18/03/2019 - * @since JDK 11 - */ -@Component -class UpdateRouteConsumerProcess( - private val logAdapter: LogAdapter, - private val routeRedisRepository: RouteRedisRepository -) : Consumer { - override fun accept(message: String) { - logAdapter.info("收到 kafka 消息:$message") - if (RouteConstant.UPDATE_GATEWAY_ROUTES == message) { - Thread { - logAdapter.info("开始更新路由信息...") - routeRedisRepository.refreshRoute() - logAdapter.info("更新路由信息完成!") - }.apply { - this.isDaemon = true - }.start() - } - } -} diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogBridge.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogBridge.kt index bec402a7b1659e496f692b710a0bfc969894e4e2..16a79fa18aa97f88651e117ab441ea3a6e3df5e3 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogBridge.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogBridge.kt @@ -5,7 +5,6 @@ import org.springframework.cloud.stream.function.StreamBridge import org.springframework.messaging.support.MessageBuilder /** - * @author zhang by 18/03/2019 * @since JDK 11 */ class RouteLogBridge( diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogMessage.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogMessage.kt index 3cc13087e8cfe2a28e14486de8ee654e3fd3dcef..26ef59a7bd5301d9339380d876fbf88abf90ab06 100644 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogMessage.kt +++ b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/log/RouteLogMessage.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.gateway.log /** - * @author zhang by 21/05/2019 * @since JDK 11 */ data class RouteLogMessage( 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 082358badb6703856deeb99da7b94b86d9ceee8e..89979ebd4c167c7fecd833e87e5ed0baba7d92bd 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 @@ -21,7 +21,6 @@ import java.net.UnknownHostException import java.nio.charset.Charset /** - * @author zhang by 15/05/2019 * @since JDK 11 */ @Component diff --git a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/repo/RouteRedisRepository.kt b/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/repo/RouteRedisRepository.kt deleted file mode 100644 index e1a6da2fd8c7da5a938d4254c4e55bf780a1b45c..0000000000000000000000000000000000000000 --- a/modules/gateway-server/src/main/kotlin/io/gitee/zhangbinhub/admin/gateway/repo/RouteRedisRepository.kt +++ /dev/null @@ -1,78 +0,0 @@ -package io.gitee.zhangbinhub.admin.gateway.repo - -import com.fasterxml.jackson.databind.ObjectMapper -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import jakarta.annotation.PostConstruct -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.cloud.gateway.event.RefreshRoutesEvent -import org.springframework.cloud.gateway.route.RouteDefinition -import org.springframework.cloud.gateway.route.RouteDefinitionRepository -import org.springframework.cloud.gateway.support.NotFoundException -import org.springframework.context.ApplicationEventPublisher -import org.springframework.data.redis.core.StringRedisTemplate -import org.springframework.stereotype.Component -import org.springframework.util.ObjectUtils -import reactor.core.publisher.Flux -import reactor.core.publisher.Mono -import java.util.* - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -@Component -class RouteRedisRepository @Autowired constructor( - private val logAdapter: LogAdapter, - private val stringRedisTemplate: StringRedisTemplate, - private val objectMapper: ObjectMapper, - private val publisher: ApplicationEventPublisher -) : RouteDefinitionRepository { - private val routes = Collections.synchronizedMap(LinkedHashMap()) - - @PostConstruct - fun loadRouteDefinitions() { - synchronized(this) { - routes.clear() - val values: MutableList = mutableListOf() - try { - stringRedisTemplate.opsForList().range(RouteConstant.ROUTES_DEFINITION_KEY, 0, -1)?.let { - for (route in it) { - values.add(objectMapper.readValue(route, RouteDefinition::class.java)) - } - } - } catch (e: Exception) { - logAdapter.error(e.message, e) - } - logAdapter.info("redis 中路由定义条数: {}, {}", values.size, values) - values.forEach { routeDefinition -> - routes[routeDefinition.id] = routeDefinition - } - } - } - - fun refreshRoute() { - loadRouteDefinitions() - publisher.publishEvent(RefreshRoutesEvent(this)) - } - - override fun getRouteDefinitions(): Flux { - return Flux.fromIterable(LinkedHashMap(routes).values) - } - - override fun save(route: Mono): Mono = route.flatMap { routeDefinition -> - if (ObjectUtils.isEmpty(routeDefinition.id)) { - return@flatMap Mono.error(IllegalArgumentException("id may not be empty")) - } - routes[routeDefinition.id] = routeDefinition - Mono.empty() - } - - override fun delete(routeId: Mono): Mono = routeId.flatMap { id: String -> - if (routes.containsKey(id)) { - routes.remove(id) - return@flatMap Mono.empty() - } - Mono.error(NotFoundException("RouteDefinition not found: $routeId")) - } -} diff --git a/modules/gateway-server/src/main/resources/application.yaml b/modules/gateway-server/src/main/resources/application.yaml index 4cc12819ce127a044a87dec75d4a1efbc7ca8b67..ac54758c9b7e0a38b203cbd4a30db96cae3dcc6a 100644 --- a/modules/gateway-server/src/main/resources/application.yaml +++ b/modules/gateway-server/src/main/resources/application.yaml @@ -38,43 +38,6 @@ spring: max-idle-time: 10000 loadbalancer: use404: true - routes: - - id: deploy-server-api - uri: lb://deploy-server - predicates: - - Path=/api/deploy/** - filters: - - StripPrefix=1 - - id: log-server-api - uri: lb://log-server - predicates: - - Path=/api/log/** - filters: - - StripPrefix=1 - - id: route-server-api - uri: lb://route-server - predicates: - - Path=/api/route/** - filters: - - StripPrefix=1 - - id: oauth-server-api - uri: lb://oauth-server - predicates: - - Path=/api/oauth/** - filters: - - StripPrefix=1 - - id: oauth-server-open - uri: lb://oauth-server - predicates: - - Path=/open/oauth/** - filters: - - RewritePath=/open/oauth/(?.*),/open/$\{segment} - # - name: RequestRateLimiter - # args: - # redis-rate-limiter.replenishRate: 10 - # redis-rate-limiter.burstCapacity: 20 - # rate-limiter: "#{@myRateLimiter}" - # key-resolver: "#{@userKeyResolver}" config: import: - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml?group=${spring.cloud.nacos.discovery.group} diff --git a/modules/log-server/README.md b/modules/log-server/README.md index 8e0e53d04075a72ca5288b3741e2f03832a93ddc..2850c0f73224dfeadf54ad3a31bb4efaf3c5e0b7 100644 --- a/modules/log-server/README.md +++ b/modules/log-server/README.md @@ -1,4 +1,4 @@ -### route-server +### log-server 日志服务 diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseLogEntity.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseLogEntity.kt index e6e4ae397c32934ecb54dbb7589e329c93aa43d1..3095ec06a2f658a5b6d241ceddc0759d00441ac1 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseLogEntity.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseLogEntity.kt @@ -5,7 +5,6 @@ import jakarta.persistence.Column import jakarta.persistence.MappedSuperclass /** - * @author zhang by 24/12/2019 * @since JDK 11 */ @MappedSuperclass diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseRepository.kt index 9fad0138622980063fb91d49832a49b6cc14e706..47690f87169a7a55547b0b9e1a35aca8a5b6e66a 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseRepository.kt @@ -5,7 +5,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor import org.springframework.data.repository.NoRepositoryBean /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @NoRepositoryBean diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseService.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseService.kt index 9a1947775d497d6346ef0bf9efa9b65b0a675453..1563687e4d54013b841955929cadc51d20b5da59 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseService.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/base/BaseService.kt @@ -6,7 +6,6 @@ import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseService { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/CustomerApiConfiguration.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/CustomerApiConfiguration.kt index 5cdae58ed1d8da0da53a5cbb8a2553d9cf25af98..7042cbd565ff6c748c5e646b21cbdcca34807c6b 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/CustomerApiConfiguration.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/CustomerApiConfiguration.kt @@ -10,7 +10,6 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration /** - * @author zhang by 27/12/2018 * @since JDK 11 */ @Configuration(proxyBeanMethods = false) diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/LogServerCustomerConfiguration.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/LogServerCustomerConfiguration.kt index 3374abb344093bb095511bc6ae97bdb581ed3547..616a8d2cc8c8e41cb419ac938f4c9b5621125ea6 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/LogServerCustomerConfiguration.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/LogServerCustomerConfiguration.kt @@ -5,7 +5,6 @@ import org.springframework.cloud.context.config.annotation.RefreshScope import org.springframework.stereotype.Component /** - * @author zhang by 30/01/2019 * @since JDK 11 */ @Component diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogConfiguration.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogConfiguration.kt index d81f66cae730f18ab0048fda71c85edfdf8c8d0f..c4c1036c5316818d2e714f1eab4193e831a06f00 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogConfiguration.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogConfiguration.kt @@ -9,7 +9,6 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration /** - * @author zhang by 10/09/2019 * @since JDK 11 */ @Configuration(proxyBeanMethods = false) diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogEnvironmentPostProcessor.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogEnvironmentPostProcessor.kt index 4afb6bab39e9d7af95e1a6a50e54ca8270c4252c..aea159ccdafe8def3cbb9073be120b8749ee466d 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogEnvironmentPostProcessor.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/conf/RouteLogEnvironmentPostProcessor.kt @@ -9,7 +9,6 @@ import org.springframework.core.env.ConfigurableEnvironment import org.springframework.util.MimeTypeUtils /** - * @author zhang by 10/09/2019 * @since JDK 11 */ class RouteLogEnvironmentPostProcessor : EnvironmentPostProcessor { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/constant/LogConstant.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/constant/LogConstant.kt index 24c03a9740afbc02008115f283cf6a7f596dcb6e..417de088540b826fb26b55c8d3edac6f30b69570 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/constant/LogConstant.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/constant/LogConstant.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.log.constant /** - * @author zhang by 22/11/2019 * @since JDK 11 */ object LogConstant { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/consumer/RouteLogConsumerProcess.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/consumer/RouteLogConsumerProcess.kt index 4603cb48c4b3e1307d7c4c6c32e84f02e4f731a2..eee7b2b7f78a551e94b4714f257b523c9c7cc7b7 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/consumer/RouteLogConsumerProcess.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/consumer/RouteLogConsumerProcess.kt @@ -5,8 +5,8 @@ import io.gitee.zhangbinhub.acp.boot.log.LogAdapter import io.gitee.zhangbinhub.acp.core.common.task.BaseAsyncTask import io.gitee.zhangbinhub.acp.core.common.task.threadpool.ThreadPoolService import io.gitee.zhangbinhub.admin.log.conf.LogServerCustomerConfiguration -import io.gitee.zhangbinhub.admin.log.service.LogService import io.gitee.zhangbinhub.admin.log.message.RouteLogMessage +import io.gitee.zhangbinhub.admin.log.service.LogService import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking @@ -15,7 +15,6 @@ import org.springframework.stereotype.Component import java.util.function.Consumer /** - * @author zhang by 18/03/2019 * @since JDK 11 */ @Component @@ -36,20 +35,20 @@ class RouteLogConsumerProcess( runBlocking { if (logServerCustomerConfiguration.routeLogEnabled) { launch(Dispatchers.IO) { - logService.doRouteLog(it, message) + logService.doRouteLog(message) } } it.token?.apply { if (it.responseStatus != null) { if (logServerCustomerConfiguration.operateLogEnabled) { launch(Dispatchers.IO) { - logService.doOperateLog(it, message) + logService.doOperateLog(message) } } if (it.responseStatus == HttpStatus.OK.value()) { if (it.applyToken) { launch(Dispatchers.IO) { - logService.doLoginLog(it, message) + logService.doLoginLog(message) } } } diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/controller/LogController.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/controller/LogController.kt index 5c0bd128707ed45485acb9feb1b28e572d597814..0e13148ae5086625163e9b0f2bd1dd3598f1227b 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/controller/LogController.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/controller/LogController.kt @@ -38,7 +38,6 @@ import org.springframework.web.bind.annotation.* import java.io.File /** - * @author zhang by 30/01/2019 * @since JDK 11 */ @Validated diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLog.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLog.kt index 057572870e58a56d441cc724a2ae04df46ba1bc9..888a66b0e41f2f1e46a666ab31dd8529602a6f2f 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLog.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLog.kt @@ -6,7 +6,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLogHistory.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLogHistory.kt index 8e64963813deca5e4a74b9a140ab8cac2be0b1f4..63c70c626c3b1000fe5ab2fc644d87f7e25d0e38 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLogHistory.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/LoginLogHistory.kt @@ -6,7 +6,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLog.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLog.kt index bc2ea3745c5e83afd89f20889326d770039325b8..227fdcfbb857a5c5ddb36cbe0e554891159690ad 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLog.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLog.kt @@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLogHistory.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLogHistory.kt index eb4318c20f28ded3d68609ae1f53d6213c165441..74e498a94b903ee1e872f2edd67db6f252557a02 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLogHistory.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/OperateLogHistory.kt @@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLog.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLog.kt index dee204c4e2e5449d5bdcd9ed0ddd2cf916e23776..49f7ab91a2ed90604b59509b69dc49db71df5ebc 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLog.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLog.kt @@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLogHistory.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLogHistory.kt index baf4fdfdd01fd919c04f138dae5a5281e65a2047..21ac77e2418dd8af569e07e0830be055b5269c6a 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLogHistory.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/entity/RouteLogHistory.kt @@ -5,7 +5,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Entity diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/message/RouteLogMessage.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/message/RouteLogMessage.kt index 1830799601e9a057d6285a093e1b691a596e9432..a8a3d91c67c666e03b331ad7efbfba8745cf0835 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/message/RouteLogMessage.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/message/RouteLogMessage.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.log.message /** - * @author zhang by 21/05/2019 * @since JDK 11 */ data class RouteLogMessage( diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/po/LogQueryPo.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/po/LogQueryPo.kt index 0a4bc8a85f4553f76ea31f6e7260738be7de4605..5841c6246b2c5d262ca6e2b62e54f08ea8a2aadc 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/po/LogQueryPo.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/po/LogQueryPo.kt @@ -4,7 +4,6 @@ import io.gitee.zhangbinhub.admin.common.base.BaseQueryPo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 21/05/2019 * @since JDK 11 */ @Schema(description = "日志查询参数") diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogHistoryRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogHistoryRepository.kt index 05ca8f400ea6d3e7c7b4ac97cedc08d67a5bb3a8..af5d37bbf17a61a099168cb71af846040736ec86 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogHistoryRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogHistoryRepository.kt @@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.query.Param /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface LoginLogHistoryRepository : BaseRepository { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogRepository.kt index cd780eea676df9d275d2a316f091cdb24f58585a..6b13e611f3c880085f55a6e85cdc9f69af29db87 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/LoginLogRepository.kt @@ -5,7 +5,6 @@ import io.gitee.zhangbinhub.admin.log.entity.LoginLog import org.springframework.data.jpa.repository.Query /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface LoginLogRepository : BaseRepository { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogHistoryRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogHistoryRepository.kt index c7d3e1bc9f3948f0a5af88cbb9f115820c08473c..cf5c15964dd0de4d76cbaf9a7c0ffe0949266a55 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogHistoryRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogHistoryRepository.kt @@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.query.Param /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface OperateLogHistoryRepository : BaseRepository { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogRepository.kt index 723e65989f01be3fa47eedf02a9205a3e12b6a0b..f70add8093383200247c845c8c1b633a63788b98 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/OperateLogRepository.kt @@ -4,7 +4,6 @@ import io.gitee.zhangbinhub.admin.log.base.BaseRepository import io.gitee.zhangbinhub.admin.log.entity.OperateLog /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface OperateLogRepository : BaseRepository diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogHistoryRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogHistoryRepository.kt index 6794e20bb843d0ddaac9c7584019c719410e291d..cd7fbe62def1fdc75bc2c66485183ae2b654f79b 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogHistoryRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogHistoryRepository.kt @@ -7,7 +7,6 @@ import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.query.Param /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface RouteLogHistoryRepository : BaseRepository { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogRepository.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogRepository.kt index 7f6a832b9e467f9eb41c6820335a221939a1896d..fd8fc2d90e66928600ce554b88f0abb26a0762ed 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogRepository.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/repo/RouteLogRepository.kt @@ -5,7 +5,6 @@ import io.gitee.zhangbinhub.admin.log.entity.RouteLog import java.util.* /** - * @author zhang by 21/05/2019 * @since JDK 11 */ interface RouteLogRepository : BaseRepository { diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogDailyHistory.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogDailyHistory.kt index 9497397924eaa5ab4c9e14f45bbcd445e0365ad0..d7102453755355449f31538bdd1a64c90fca38da 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogDailyHistory.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogDailyHistory.kt @@ -16,7 +16,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.stereotype.Component /** - * @author zhang by 12/09/2019 * @since JDK 11 */ @Component("LogDailyHistory") diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogFileBackUpTask.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogFileBackUpTask.kt index b75e8ebe63027c2d4a6125220e601f9464523fa3..8914cc3b68eb9a45e89d0db0195e5ac1ec47d7ed 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogFileBackUpTask.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/schedule/LogFileBackUpTask.kt @@ -14,7 +14,6 @@ import org.springframework.stereotype.Component import java.io.File /** - * @author zhang by 30/01/2019 * @since JDK 11 */ @Component("LogFileBackUpTask") diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogHistoryService.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogHistoryService.kt index 9fdf918c01e0865ef9b0abd62be6a1bc64dacc7d..5ee0b2d80e6350356cec944862cfd97430f019c6 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogHistoryService.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/service/LogHistoryService.kt @@ -17,7 +17,6 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 12/09/2019 * @since JDK 11 */ @Service 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 1f55f588221624f7ad4f71e7a538b7e274a859bc..58c91a46b80b2bac0359b2a3f0fe807bd8518757 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 @@ -13,7 +13,6 @@ 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 -import io.gitee.zhangbinhub.admin.log.message.RouteLogMessage import io.gitee.zhangbinhub.admin.log.po.LogQueryPo import io.gitee.zhangbinhub.admin.log.repo.* import io.gitee.zhangbinhub.admin.log.vo.LoginLogVo @@ -29,7 +28,6 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 15/05/2019 * @since JDK 11 */ @Service @@ -51,25 +49,26 @@ constructor( /** * 路由消息转为对应的实体对象 */ + @Throws(WebException::class) private fun messageToEntity(message: String, cls: Class): T { return objectMapper.readValue(message, cls) ?: throw WebException("日志消息转换失败") } - private fun getTokenInfo(token: String): TokenUserInfoVo = tokenUserTools.getUserInfoFromToken() + private fun getTokenInfo(token: String): TokenUserInfoVo = tokenUserTools.getUserInfoFromToken(token) private fun getAppInfo(token: String): ApplicationVo = commonOauthServer.appInfo(token) @Transactional - fun doRouteLog(routeLogMessage: RouteLogMessage, message: String) { + fun doRouteLog(message: String) { val routeLog = messageToEntity(message, RouteLog::class.java) - if (routeLogMessage.token != null) { + if (routeLog.token != null) { try { - getAppInfo(routeLogMessage.token!!).let { app -> + getAppInfo(routeLog.token!!).let { app -> routeLog.clientId = app.id routeLog.clientName = app.appName routeLog.identify = app.identify if (!CommonTools.isNullStr(app.id)) { - getTokenInfo(routeLogMessage.token!!).let { + getTokenInfo(routeLog.token!!).let { routeLog.userId = it.id.toString() routeLog.loginNo = it.loginNo.toString() routeLog.userName = it.name.toString() @@ -80,7 +79,7 @@ constructor( logAdapter.error(e.message, e) } } - if (routeLogMessage.responseStatus != null) {// 响应日志 + if (routeLog.responseStatus != null) {// 响应日志 var optionalRouteLog = routeLogRepository.findByLogIdAndRequestTime(routeLog.logId, routeLog.requestTime) var count = 1 while (optionalRouteLog.isEmpty) { @@ -111,15 +110,15 @@ constructor( } @Transactional - fun doOperateLog(routeLogMessage: RouteLogMessage, message: String) { + fun doOperateLog(message: String) { try { val operateLog = messageToEntity(message, OperateLog::class.java) - getAppInfo(routeLogMessage.token!!).let { app -> + getAppInfo(operateLog.token!!).let { app -> operateLog.clientId = app.id operateLog.clientName = app.appName operateLog.identify = app.identify if (!CommonTools.isNullStr(app.id)) { - getTokenInfo(routeLogMessage.token!!).let { + getTokenInfo(operateLog.token!!).let { operateLog.userId = it.id.toString() operateLog.loginNo = it.loginNo.toString() operateLog.userName = it.name.toString() @@ -134,15 +133,15 @@ constructor( } @Transactional - suspend fun doLoginLog(routeLogMessage: RouteLogMessage, message: String) { + suspend fun doLoginLog(message: String) { try { val loginLog = messageToEntity(message, LoginLog::class.java) - getAppInfo(routeLogMessage.token!!).let { app -> + getAppInfo(loginLog.token!!).let { app -> if (!CommonTools.isNullStr(app.id)) { loginLog.clientId = app.id loginLog.clientName = app.appName loginLog.identify = app.identify - getTokenInfo(routeLogMessage.token!!).let { + getTokenInfo(loginLog.token!!).let { loginLog.userId = it.id.toString() loginLog.loginNo = it.loginNo.toString() loginLog.userName = it.name.toString() @@ -168,7 +167,7 @@ constructor( } } - fun doPageQuery( + private fun doPageQuery( baseRepository: BaseRepository, logQueryPo: LogQueryPo ): CustomerQueryPageVo = diff --git a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/vo/LoginLogVo.kt b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/vo/LoginLogVo.kt index 0f1fc835dced7ce5c2dd3ff20853c1523e839c9f..795466b7989c3dac22256cb024270536ef28f173 100644 --- a/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/vo/LoginLogVo.kt +++ b/modules/log-server/src/main/kotlin/io/gitee/zhangbinhub/admin/log/vo/LoginLogVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.log.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 08/03/2019 * @since JDK 11 */ @Schema(description = "登录次数统计") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseRepository.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseRepository.kt index d77b1b0ecfdc97fd2a63bf4f07842bf70fb32a57..01314161d6f65895a304c6eee031da7d931078b4 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseRepository.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseRepository.kt @@ -5,7 +5,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor import org.springframework.data.repository.NoRepositoryBean /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @NoRepositoryBean diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseService.kt index 30cc5d6c8656f518a8b2ed3ca46bf3a852568ab9..0dc2d08be7733a146d6777a0de4be4b3d8a810bc 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/BaseService.kt @@ -6,7 +6,6 @@ import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseService { diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseService.kt index c63adc75552f7b698c0ba65f1eec28b4b9caaf1b..a261b7be1a738cc2e797b65d5e8e63a91a79edcd 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseService.kt @@ -15,7 +15,6 @@ import org.springframework.beans.BeanUtils import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 26/12/2018 * @since JDK 11 */ @Transactional(readOnly = true) diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseTreeEntity.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseTreeEntity.kt index ea892b8b2756fff6d829a2e22f22ed59fc23fe11..11af1ea7412641c8b9113876c0051a86190fc132 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseTreeEntity.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/base/OauthBaseTreeEntity.kt @@ -7,7 +7,6 @@ import jakarta.persistence.MappedSuperclass import jakarta.persistence.Transient /** - * @author zhang by 20/01/2019 * @since JDK 11 */ @MappedSuperclass diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/conf/CustomerApiConfiguration.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/conf/CustomerApiConfiguration.kt index 02c767d6bde0665a234401154c6e1b2cc4147ce8..2bae84445310c5d5798e6c5dd9b0b8f1d7bc104a 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/conf/CustomerApiConfiguration.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/conf/CustomerApiConfiguration.kt @@ -11,7 +11,6 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration /** - * @author zhang by 27/12/2018 * @since JDK 11 */ @Configuration(proxyBeanMethods = false) diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/constant/BusEventMessage.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/constant/BusEventMessage.kt index 070eab1bc79413e2dba99810789bcb81aeae817d..174ee031edc272be2a3558980a77b31626019971 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/constant/BusEventMessage.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/constant/BusEventMessage.kt @@ -1,7 +1,6 @@ package io.gitee.zhangbinhub.admin.oauth.constant /** - * @author zhang by 17/02/2020 * @since JDK 11 */ object BusEventMessage { diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationPo.kt index 431709af1c5a1dd2297b534c75412b799fa5d7a1..9ab695bac78c6f807c590789285774022ddb1c07 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationPo.kt @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotBlank /** - * @author zhang by 13/01/2019 * @since JDK 11 */ @Schema(description = "应用配置参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationQueryPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationQueryPo.kt index 8f5f53961978ea0c091d56682f89fe2590e6d948..b37d3c4361a5b237ac5c638660fda5ede74e4742 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationQueryPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ApplicationQueryPo.kt @@ -4,7 +4,6 @@ import io.gitee.zhangbinhub.admin.common.base.BaseQueryPo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 13/01/2019 * @since JDK 11 */ @Schema(description = "应用配置查询参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/MenuPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/MenuPo.kt index e506aa319e3e9c27546e4f25535f4e101da1f717..2f6225c888c6e68525248e08da6c1fb8e01264d3 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/MenuPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/MenuPo.kt @@ -6,7 +6,6 @@ import jakarta.validation.constraints.Min import jakarta.validation.constraints.NotBlank /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "菜单配置参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ModuleFuncPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ModuleFuncPo.kt index fa9d859cd039826a9a11351d2067116652d8a2d0..45132a6be0d4ddf98f0800890cc9a2163962bb48 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ModuleFuncPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/ModuleFuncPo.kt @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotBlank /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "模块功能配置参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/OrganizationPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/OrganizationPo.kt index f661f3f3222a8270ea1a7d5fef017583167630e9..2a43d9515497de8b13d1c68317726cbc3e322486 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/OrganizationPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/OrganizationPo.kt @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotBlank /** - * @author zhang by 17/01/2019 * @since JDK 11 */ @Schema(description = "机构配置参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimePo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimePo.kt index ce0b5cadcd51edef9066e2ff8ab596ca6e3dc527..5fe809d1e282e5ceaf76bfc4fbafb8cc36d3f0c0 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimePo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimePo.kt @@ -5,7 +5,6 @@ import jakarta.validation.constraints.NotBlank import jakarta.validation.constraints.NotNull /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Schema(description = "运行配置参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimeQueryPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimeQueryPo.kt index 84cd54256bf48f5698e32ccdf325475d76bf5f90..195e9acfe22da8e4b9dc71a022b55883722dd032 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimeQueryPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/RuntimeQueryPo.kt @@ -4,7 +4,6 @@ import io.gitee.zhangbinhub.admin.common.base.BaseQueryPo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Schema(description = "运行配置查询参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/UserInfoPo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/UserInfoPo.kt index 54a5e8e905176a56bcee41c47383f3ad5b40d212..62fb6afb5f103d63d5fa8138a69534f2f7b58416 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/UserInfoPo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/po/UserInfoPo.kt @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotBlank /** - * @author zhang by 08/01/2019 * @since JDK 11 */ @Schema(description = "更新当前用户信息参数") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/ApplicationService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/ApplicationService.kt index 2a56a549e604b67a559d480a5d78530bf4de5864..9284796091782d1e9c408e00409e15cf72866b6d 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/ApplicationService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/ApplicationService.kt @@ -17,7 +17,6 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 13/01/2019 * @since JDK 11 */ @Service diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/MenuService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/MenuService.kt index e827f30a39cadaf79857e447eb53469d32f8d6e6..a64453b8bb845fc9700e3a66596ba55c788beb20 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/MenuService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/MenuService.kt @@ -14,7 +14,6 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 26/12/2018 * @since JDK 11 */ @Service diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/RuntimeConfigService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/RuntimeConfigService.kt index 5201ed8e385da21f57af1a968ccb81772b71db62..e20d7ae52397099bfd65b6122b1a09fb41138d3a 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/RuntimeConfigService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/RuntimeConfigService.kt @@ -22,7 +22,6 @@ import org.springframework.transaction.annotation.Transactional import java.util.concurrent.ConcurrentHashMap /** - * @author zhang by 11/01/2019 * @since JDK 11 */ @Service diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/UserService.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/UserService.kt index 30aa67a2f3d653e8f1d662a36387db43a65235fc..183474e5a55dfa338b8489782029bf1e1737c1bb 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/UserService.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/service/UserService.kt @@ -25,7 +25,6 @@ import org.springframework.stereotype.Service import org.springframework.transaction.annotation.Transactional /** - * @author zhang by 19/12/2018 * @since JDK 11 */ @Service 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 33c089d482f70ad6025358eb7702cbf08e66a482..69d11e5afa7dafac2b892f52078f425d49a441a8 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 @@ -6,7 +6,6 @@ import jakarta.validation.constraints.Min import jakarta.validation.constraints.NotBlank /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "菜单配置详细信息") 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 816b724b91e149d8373c2fdcab958736aa6590fd..b5c3f028d39c77ea455c0803615d960dbbae7505 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 @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.validation.constraints.NotBlank /** - * @author zhang by 19/01/2019 * @since JDK 11 */ @Schema(description = "模块功能配置详细信息") diff --git a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/OnlineInfoVo.kt b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/OnlineInfoVo.kt index f4f6a2926269cbc6b8d7e7b1fab4a594973c581e..ecc788df77bbda0c07c8bd52dccf1db91d3f6a5a 100644 --- a/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/OnlineInfoVo.kt +++ b/modules/oauth-server/src/main/kotlin/io/gitee/zhangbinhub/admin/oauth/vo/OnlineInfoVo.kt @@ -3,7 +3,6 @@ package io.gitee.zhangbinhub.admin.oauth.vo import io.swagger.v3.oas.annotations.media.Schema /** - * @author zhang by 08/03/2019 * @since JDK 11 */ @Schema(description = "在线用户数统计") diff --git a/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestJpa.kt b/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestJpa.kt index b7e3ba532e34300b11a15df716b4bbadf14f1dc1..b2f06c436f4495ee68b03322b028a164652f6f5a 100644 --- a/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestJpa.kt +++ b/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestJpa.kt @@ -14,7 +14,6 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.test.annotation.Rollback /** - * @author zhang by 03/08/2019 * @since JDK 11 */ internal class TestJpa : BaseTest() { diff --git a/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestSerialNumber.kt b/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestSerialNumber.kt index 4385277baa08cb22bc066a936b9f0c58f06337c0..bcbe6db8264ac3d5dd2a552934e86cbcef745b12 100644 --- a/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestSerialNumber.kt +++ b/modules/oauth-server/src/test/kotlin/io/gitee/zhangbinhub/admin/oauth/nobuild/TestSerialNumber.kt @@ -7,7 +7,6 @@ import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired /** - * @author zhang by 03/08/2019 * @since JDK 11 */ internal class TestSerialNumber : BaseTest() { diff --git a/modules/route-server/Dockerfile b/modules/route-server/Dockerfile deleted file mode 100644 index b30240e91de637e3a06dcaa74a9e689af33de8dd..0000000000000000000000000000000000000000 --- a/modules/route-server/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM eclipse-temurin:17-jdk-alpine -ARG appJar -ARG workspace=/workspace -COPY build/libs/$appJar $workspace/app.jar -COPY build/resources/main $workspace/ -RUN chmod 777 -R $workspace -WORKDIR $workspace -ENTRYPOINT ["sh", "-c", "java ${JAVA_TOOL_OPTIONS} -jar app.jar"] \ No newline at end of file diff --git a/modules/route-server/README.md b/modules/route-server/README.md deleted file mode 100644 index 944eb24b93b64f8bc6f166a0ec6e928a2081831f..0000000000000000000000000000000000000000 --- a/modules/route-server/README.md +++ /dev/null @@ -1,14 +0,0 @@ -### route-server - -路由服务 - -##### 一、说明 - -- 1、提供路由信息配置功能 -- 2、提供路由动态更新接口,收到请求后,将路由信息序列化至redis,同时发送更新消息给网关 -- 3、接口详情请在浏览器中访问 /doc.html 页面 - -##### 二、数据初始化 - -首次启动时,如果必要的路由数据不存在,则会自动进行初始化 -[```io.gitee.zhangbinhub.admin.route.init.DataInitialization```](src/main/kotlin/io/gitee/zhangbinhub/admin/route/init/DataInitialization.kt) diff --git a/modules/route-server/build.gradle b/modules/route-server/build.gradle deleted file mode 100644 index 1dcee965bcb3e20d745fe21363212c55d35f267c..0000000000000000000000000000000000000000 --- a/modules/route-server/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -apply from: "$rootDir/gradle/application.gradle" -dependencies { - implementation project(":acp-admin-cloud-dependencies-resource-server") - // 数据库及驱动 - implementation "org.springframework.boot:spring-boot-starter-data-jpa" - implementation "com.mysql:mysql-connector-j:${libs.versions.mysql.get()}" - - testImplementation "org.springframework.boot:spring-boot-starter-test" -} \ No newline at end of file diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/RouteServerApplication.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/RouteServerApplication.kt deleted file mode 100644 index 84189752bf98e1f48f6586e0aba72965bc460cda..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/RouteServerApplication.kt +++ /dev/null @@ -1,14 +0,0 @@ -package io.gitee.zhangbinhub.admin.route - -import io.gitee.zhangbinhub.acp.cloud.annotation.AcpCloudAtomApplication -import org.springframework.boot.runApplication - -/** - * @since JDK 11 - */ -@AcpCloudAtomApplication -class RouteServerApplication - -fun main(args: Array) { - runApplication(*args) -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseRepository.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseRepository.kt deleted file mode 100644 index 08f6a86f3712f14baefc71bbcb5b4d231c616a42..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseRepository.kt +++ /dev/null @@ -1,12 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.base - -import org.springframework.data.jpa.repository.JpaRepository -import org.springframework.data.jpa.repository.JpaSpecificationExecutor -import org.springframework.data.repository.NoRepositoryBean - -/** - * @author zhang by 15/01/2019 - * @since JDK 11 - */ -@NoRepositoryBean -interface BaseRepository : JpaSpecificationExecutor, JpaRepository diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseService.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseService.kt deleted file mode 100644 index 9903bb0581e62092b398d24529f82ba46abe722f..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/base/BaseService.kt +++ /dev/null @@ -1,30 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.base - -import io.gitee.zhangbinhub.acp.core.common.CommonTools -import io.gitee.zhangbinhub.admin.common.po.QueryParam -import org.springframework.data.domain.PageRequest -import org.springframework.data.domain.Sort - -/** - * @author zhang by 15/01/2019 - * @since JDK 11 - */ -abstract class BaseService { - - protected fun buildPageRequest(queryParam: QueryParam): PageRequest = - if (CommonTools.isNullStr(queryParam.orderName) || CommonTools.isNullStr(queryParam.orderCommand)) { - PageRequest.of(queryParam.currPage!! - 1, queryParam.pageSize!!) - } else { - var direction: Sort.Direction = Sort.Direction.ASC - if (queryParam.orderCommand!!.startsWith("desc", ignoreCase = true)) { - direction = Sort.Direction.DESC - } - PageRequest.of( - queryParam.currPage!! - 1, - queryParam.pageSize!!, - direction, - *queryParam.orderName!!.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - ) - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/CustomerApiConfiguration.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/CustomerApiConfiguration.kt deleted file mode 100644 index ad46836b4a9242a9d9a89d525e7e02dd9b887f91..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/CustomerApiConfiguration.kt +++ /dev/null @@ -1,35 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.conf - -import io.gitee.zhangbinhub.acp.boot.base.BaseApiConfiguration -import io.gitee.zhangbinhub.admin.route.constant.RouteApi -import io.swagger.v3.oas.models.OpenAPI -import org.springdoc.core.models.GroupedOpenApi -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.beans.factory.annotation.Value -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration - -/** - * @author zhang by 27/12/2018 - * @since JDK 11 - */ -@Configuration(proxyBeanMethods = false) -class CustomerApiConfiguration @Autowired -constructor( - @Value("\${info.version}") - version: String?, -) : BaseApiConfiguration(version) { - @Bean - fun createRestApi(): OpenAPI = buildApiInfo( - "Route Server API", - "Route Server API", - "ZhangBin", - "https://gitee.com/zhangbinhub", - "zhangbin1010@qq.com" - ) - - @Bean - fun gatewayApi(): GroupedOpenApi = GroupedOpenApi.builder() - .group("1.网关接口").pathsToMatch("${RouteApi.basePath}/**") - .build() -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteConfiguration.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteConfiguration.kt deleted file mode 100644 index 3bd9024450a62fd9d37050c19b82a65e2357c194..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteConfiguration.kt +++ /dev/null @@ -1,21 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.conf - -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import io.gitee.zhangbinhub.admin.route.producer.UpdateRouteBridge -import org.springframework.boot.autoconfigure.AutoConfigureBefore -import org.springframework.cloud.stream.config.BindingServiceConfiguration -import org.springframework.cloud.stream.function.StreamBridge -import org.springframework.context.annotation.Bean -import org.springframework.context.annotation.Configuration - -/** - * @author zhang by 17/05/2019 - * @since JDK 11 - */ -@Configuration(proxyBeanMethods = false) -@AutoConfigureBefore(BindingServiceConfiguration::class) -class RouteConfiguration { - @Bean - fun updateRouteBridge(streamBridge: StreamBridge) = - UpdateRouteBridge(streamBridge, RouteConstant.UPDATE_ROUTE_OUTPUT) -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteUpdateEnvironmentPostProcessor.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteUpdateEnvironmentPostProcessor.kt deleted file mode 100644 index 4087ca8f06c349fb1f198757ab02fdace5311a80..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/conf/RouteUpdateEnvironmentPostProcessor.kt +++ /dev/null @@ -1,39 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.conf - -import io.gitee.zhangbinhub.acp.boot.tools.EnvironmentTools -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import org.springframework.boot.SpringApplication -import org.springframework.boot.env.EnvironmentPostProcessor -import org.springframework.core.env.ConfigurableEnvironment -import org.springframework.util.MimeTypeUtils - -/** - * @author zhang by 17/05/2019 - * @since JDK 11 - */ -class RouteUpdateEnvironmentPostProcessor : EnvironmentPostProcessor { - private val defaultPropertiesName = "acpCloudRouteDefaultProperties" - - override fun postProcessEnvironment(environment: ConfigurableEnvironment?, application: SpringApplication?) { - val default: MutableMap = HashMap() - "spring.cloud.stream.bindings.${RouteConstant.UPDATE_ROUTE_OUTPUT}".let { prefix -> - environment!!.getProperty("$prefix.destination", RouteConstant.UPDATE_ROUTE_DESCRIPTION) - .let { destination -> - if (destination == RouteConstant.UPDATE_ROUTE_OUTPUT) { - RouteConstant.UPDATE_ROUTE_DESCRIPTION - } else { - destination - } - }.let { destination -> - default["$prefix.destination"] = destination - default["$prefix.contentType"] = MimeTypeUtils.APPLICATION_JSON_VALUE - EnvironmentTools.addOrReplaceProperty( - environment.propertySources, - default, - defaultPropertiesName, - false - ) - } - } - } -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/constant/RouteApi.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/constant/RouteApi.kt deleted file mode 100644 index 16a0c6b42b00355fc7fb3a99c85a4b72b9003d5b..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/constant/RouteApi.kt +++ /dev/null @@ -1,11 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.constant - -/** - * @author zhang by 10/01/2019 - * @since JDK 11 - */ -object RouteApi { - const val basePath = "/route" - const val gateWayRouteConfig = "/gateway-route" - const val gateWayRouteRefresh = "$gateWayRouteConfig/refresh" -} \ No newline at end of file diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/controller/RouteController.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/controller/RouteController.kt deleted file mode 100644 index c0b7136bdfc2b59bc9fdf404257be14852ffea79..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/controller/RouteController.kt +++ /dev/null @@ -1,106 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.controller - -import cn.dev33.satoken.annotation.SaCheckRole -import io.gitee.zhangbinhub.acp.boot.exceptions.WebException -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.acp.cloud.annotation.AcpCloudDuplicateSubmission -import io.gitee.zhangbinhub.acp.core.common.CommonTools -import io.gitee.zhangbinhub.admin.common.constant.RoleCode -import io.gitee.zhangbinhub.admin.common.vo.CustomerQueryPageVo -import io.gitee.zhangbinhub.admin.common.vo.InfoVo -import io.gitee.zhangbinhub.admin.resource.server.base.BaseResourceServerController -import io.gitee.zhangbinhub.admin.route.constant.RouteApi -import io.gitee.zhangbinhub.admin.route.entity.Route -import io.gitee.zhangbinhub.admin.route.po.RoutePo -import io.gitee.zhangbinhub.admin.route.po.RouteQueryPo -import io.gitee.zhangbinhub.admin.route.producer.UpdateRouteBridge -import io.gitee.zhangbinhub.admin.route.service.RouteService -import io.swagger.v3.oas.annotations.Operation -import io.swagger.v3.oas.annotations.Parameter -import io.swagger.v3.oas.annotations.responses.ApiResponse -import io.swagger.v3.oas.annotations.responses.ApiResponses -import io.swagger.v3.oas.annotations.tags.Tag -import jakarta.validation.Valid -import jakarta.validation.constraints.NotEmpty -import jakarta.validation.constraints.NotNull -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.http.HttpStatus -import org.springframework.http.MediaType -import org.springframework.http.ResponseEntity -import org.springframework.validation.annotation.Validated -import org.springframework.web.bind.annotation.* - -/** - * @author zhang by 28/02/2019 - * @since JDK 11 - */ -@Validated -@RestController -@RequestMapping(RouteApi.basePath) -@Tag(name = "网关路由信息") -class RouteController @Autowired -constructor( - logAdapter: LogAdapter, - private val routeService: RouteService, - private val updateRouteBridge: UpdateRouteBridge -) : BaseResourceServerController(logAdapter) { - - @Operation(summary = "新建路由信息", description = "路由ID、路由URI、断言、过滤器、序号") - @ApiResponses(ApiResponse(responseCode = "201", description = "创建成功")) - @SaCheckRole(RoleCode.SUPER) - @PutMapping(value = [RouteApi.gateWayRouteConfig], produces = [MediaType.APPLICATION_JSON_VALUE]) - @AcpCloudDuplicateSubmission - fun add(@RequestBody @Valid routePo: RoutePo): ResponseEntity = - routeService.doCreate(routePo).let { - ResponseEntity.status(HttpStatus.CREATED).body(it) - } - - @Operation(summary = "删除路由配置信息") - @ApiResponses(ApiResponse(responseCode = "400", description = "参数校验不通过;")) - @SaCheckRole(RoleCode.SUPER) - @DeleteMapping(value = [RouteApi.gateWayRouteConfig], produces = [MediaType.APPLICATION_JSON_VALUE]) - fun delete( - @Parameter(description = "id列表", required = true) - @NotEmpty(message = "id不能为空") - @NotNull(message = "id不能为空") - @RequestBody - idList: List - ): ResponseEntity { - routeService.doDelete(idList) - return ResponseEntity.ok(InfoVo(message = "删除成功")) - } - - @Operation(summary = "更新路由信息", description = "可更新路由ID、路由URI、断言、过滤器、序号") - @ApiResponses(ApiResponse(responseCode = "400", description = "参数校验不通过;路由信息ID不能为空;找不到信息;")) - @SaCheckRole(RoleCode.SUPER) - @PatchMapping(value = [RouteApi.gateWayRouteConfig], produces = [MediaType.APPLICATION_JSON_VALUE]) - @AcpCloudDuplicateSubmission - @Throws(WebException::class) - fun update(@RequestBody @Valid routePo: RoutePo): ResponseEntity { - if (CommonTools.isNullStr(routePo.id)) { - throw WebException("配置ID不能为空") - } - return ResponseEntity.ok(routeService.doUpdate(routePo)) - } - - @Operation(summary = "查询路由信息列表", description = "查询条件:路由ID、是否启用") - @ApiResponses(ApiResponse(responseCode = "400", description = "参数校验不通过;")) - @SaCheckRole(RoleCode.SUPER) - @PostMapping(value = [RouteApi.gateWayRouteConfig], produces = [MediaType.APPLICATION_JSON_VALUE]) - @Throws(WebException::class) - fun query(@RequestBody routeQueryPo: RouteQueryPo): ResponseEntity> = - ResponseEntity.ok(routeService.doQuery(routeQueryPo)) - - @Operation(summary = "刷新路由配置信息") - @ApiResponses(ApiResponse(responseCode = "403", description = "没有权限执行该操作;")) - @SaCheckRole(RoleCode.SUPER) - @PostMapping(value = [RouteApi.gateWayRouteRefresh], produces = [MediaType.APPLICATION_JSON_VALUE]) - @AcpCloudDuplicateSubmission - @Throws(WebException::class) - fun refresh(): ResponseEntity { - routeService.doRefresh() - updateRouteBridge.doNotifyUpdateRoute() - return ResponseEntity.accepted().body(InfoVo(message = "刷新路由缓存成功,稍后网关将刷新路由配置信息")) - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/FilterDefinition.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/FilterDefinition.kt deleted file mode 100644 index fb228a7604fd832d4cafca2819e50346a9ef9ce0..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/FilterDefinition.kt +++ /dev/null @@ -1,41 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.definition - -import jakarta.validation.ValidationException -import org.springframework.util.StringUtils.tokenizeToStringArray - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -class FilterDefinition { - - var name: String? = null - - private var args: MutableMap = LinkedHashMap() - - fun getArgs(): Map { - return args - } - - fun setArgs(args: MutableMap) { - this.args = args - } - - constructor() - - constructor(text: String) { - val eqIdx = text.indexOf('=') - if (eqIdx <= 0) { - throw ValidationException( - "Unable to parse PredicateDefinition text '" + text + "'" + - ", must be of the form name=value" - ) - } - name = text.substring(0, eqIdx) - val args = tokenizeToStringArray(text.substring(eqIdx + 1), ",") - for (i in args.indices) { - this.args[NameUtils.generateName(i)] = args[i] - } - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/NameUtils.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/NameUtils.kt deleted file mode 100644 index d1536192b6bf96d9fb884d699c546367d01801ca..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/NameUtils.kt +++ /dev/null @@ -1,15 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.definition - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -internal object NameUtils { - - private const val GENERATED_NAME_PREFIX = "_genkey_" - - fun generateName(i: Int): String { - return GENERATED_NAME_PREFIX + i - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/PredicateDefinition.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/PredicateDefinition.kt deleted file mode 100644 index 467a26d0c76d213cb71cb5ba74b9e07ebf88acd0..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/PredicateDefinition.kt +++ /dev/null @@ -1,41 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.definition - -import jakarta.validation.ValidationException -import org.springframework.util.StringUtils.tokenizeToStringArray - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -class PredicateDefinition { - - var name: String? = null - - private var args: MutableMap = LinkedHashMap() - - fun getArgs(): Map { - return args - } - - fun setArgs(args: MutableMap) { - this.args = args - } - - constructor() - - constructor(text: String) { - val eqIdx = text.indexOf('=') - if (eqIdx <= 0) { - throw ValidationException( - "Unable to parse PredicateDefinition text '" + text + "'" + - ", must be of the form name=value" - ) - } - name = text.substring(0, eqIdx) - val args = tokenizeToStringArray(text.substring(eqIdx + 1), ",") - for (i in args.indices) { - this.args[NameUtils.generateName(i)] = args[i] - } - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteConstant.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteConstant.kt deleted file mode 100644 index bc64c20094a51897a83a4fb0d458f0be80769156..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteConstant.kt +++ /dev/null @@ -1,12 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.definition - -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant.ROUTES_DEFINITION_KEY - -/** - * @author zhang by 18/03/2019 - * @since JDK 11 - */ -object RouteConstant { - const val ROUTES_LOCK_KEY = ROUTES_DEFINITION_KEY + "_lock" - const val ROUTES_LOCK_TIME_OUT: Long = 1000 -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteDefinition.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteDefinition.kt deleted file mode 100644 index 5f9d4c9cee0c030f6f332d058fce89ee0b4df1ab..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/definition/RouteDefinition.kt +++ /dev/null @@ -1,48 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.definition - -import jakarta.validation.ValidationException -import org.springframework.util.StringUtils.tokenizeToStringArray -import java.net.URI -import java.util.* - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -class RouteDefinition { - - var id = UUID.randomUUID().toString() - - var predicates: MutableList = mutableListOf() - - var filters: MutableList = mutableListOf() - - var uri: URI? = null - - var metadata: MutableMap = mutableMapOf() - - var order = 0 - - constructor() - - constructor(text: String) { - val eqIdx = text.indexOf('=') - if (eqIdx <= 0) { - throw ValidationException( - "Unable to parse RouteDefinition text '" + text + "'" + - ", must be of the form name=value" - ) - } - - id = text.substring(0, eqIdx) - - val args = tokenizeToStringArray(text.substring(eqIdx + 1), ",") - - uri = URI.create(args[0]) - - for (i in 1 until args.size) { - this.predicates.add(PredicateDefinition(args[i])) - } - } - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/entity/Route.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/entity/Route.kt deleted file mode 100644 index cee18b2ff7dcfd6405380680c4a4c413e7ccdf49..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/entity/Route.kt +++ /dev/null @@ -1,51 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.entity - -import io.swagger.v3.oas.annotations.media.Schema -import jakarta.persistence.* - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -@Entity -@Table(name = "t_gateway_route") -@Schema(description = "网关路由配置") -data class Route( - @Id - @GeneratedValue(strategy = GenerationType.UUID) - @Column(length = 36, nullable = false) - @Schema(description = "ID") - var id: String = "", - - @Schema(description = "路由ID") - @Column(nullable = false) - var routeId: String? = null, - - @Schema(description = "路由URI") - @Column(nullable = false) - var uri: String? = null, - - @Schema(description = "路由断言") - @Lob - @Column(nullable = false, length = 65535) - var predicates: String = "", - - @Schema(description = "路由过滤器") - @Lob - @Column(length = 65535) - var filters: String? = null, - - @Schema(description = "元数据") - @Lob - @Column(length = 65535) - var metadata: String? = null, - - @Schema(description = "路由序号") - var orderNum: Int = 0, - - @Schema(description = "是否启用") - var enabled: Boolean = false, - - @Schema(description = "备注") - var remarks: String? = null -) \ No newline at end of file diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/init/DataInitialization.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/init/DataInitialization.kt deleted file mode 100644 index 639fea1b7b0e45129cd36fb21e311b6382452f14..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/init/DataInitialization.kt +++ /dev/null @@ -1,35 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.init - -import io.gitee.zhangbinhub.acp.boot.init.AcpInitialization -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.admin.route.service.InitDataService -import io.gitee.zhangbinhub.admin.route.service.RouteService -import org.springframework.stereotype.Component - -@Component -class DataInitialization( - private val logAdapter: LogAdapter, - private val routeService: RouteService, - private val initDataService: InitDataService -) : AcpInitialization { - override val name: String - get() = "Data Initialization" - - override val order: Int - get() = 1 - - override fun doInit() { - val innerRouteIdList = listOf( - InitDataService.WORK_FLOW_SERVER_API_ROUTE_ID, - InitDataService.WORK_FLOW_UI_ROUTE_ID, - InitDataService.WORK_FLOW_UI_SERVER_ROUTE_ID - ) - routeService.getRouteListByRouteIdList(innerRouteIdList).let { routeList -> - if (routeList.isEmpty()) { - logAdapter.info(">>>>>>>>>>>>>>>>>>>> begin init route data...") - initDataService.doInitRoute() - logAdapter.info(">>>>>>>>>>>>>>>>>>>> init route data has finished!") - } - } - } -} \ No newline at end of file diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RoutePo.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RoutePo.kt deleted file mode 100644 index f05f7fb9c80a9edb0140bcbdb7a02298545ed8e8..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RoutePo.kt +++ /dev/null @@ -1,41 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.po - -import io.swagger.v3.oas.annotations.media.Schema -import jakarta.validation.constraints.NotBlank - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -@Schema(description = "网关路由配置参数") -data class RoutePo( - @Schema(description = "ID") - var id: String? = null, - - @Schema(description = "路由ID", requiredMode = Schema.RequiredMode.REQUIRED) - @get:NotBlank(message = "路由ID不能为空") - var routeId: String? = null, - - @Schema(description = "路由URI", requiredMode = Schema.RequiredMode.REQUIRED) - @get:NotBlank(message = "路由URI不能为空") - var uri: String? = null, - - @Schema(description = "路由断言", requiredMode = Schema.RequiredMode.REQUIRED) - @get:NotBlank(message = "路由断言不能为空") - var predicates: String? = null, - - @Schema(description = "路由过滤器") - var filters: String? = null, - - @Schema(description = "元数据") - var metadata: String? = null, - - @Schema(description = "路由序号") - var orderNum: Int = 0, - - @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) - var enabled: Boolean? = null, - - @Schema(description = "备注") - var remarks: String? = null -) diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RouteQueryPo.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RouteQueryPo.kt deleted file mode 100644 index d075418ace1fe1c90d7868540d7d55be35aad54d..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/po/RouteQueryPo.kt +++ /dev/null @@ -1,18 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.po - -import io.gitee.zhangbinhub.admin.common.base.BaseQueryPo -import io.swagger.v3.oas.annotations.media.Schema -import jakarta.validation.constraints.NotBlank - -/** - * @author zhang by 17/03/2019 - * @since JDK 11 - */ -@Schema(description = "网关路由配置查询参数") -data class RouteQueryPo( - @Schema(description = "路由ID") - @get:NotBlank(message = "路由ID不能为空") - var routeId: String? = null, - @Schema(description = "是否启用") - var enabled: Boolean? = null -) : BaseQueryPo() diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/producer/UpdateRouteBridge.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/producer/UpdateRouteBridge.kt deleted file mode 100644 index 7be28e31b2f6a99dfbd8df98ac8bf73a4dbd0054..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/producer/UpdateRouteBridge.kt +++ /dev/null @@ -1,21 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.producer - -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant -import org.springframework.cloud.stream.function.StreamBridge -import org.springframework.messaging.support.MessageBuilder - -/** - * @author zhang by 18/03/2019 - * @since JDK 11 - */ -class UpdateRouteBridge( - private val streamBridge: StreamBridge, - private val bindName: String -) { - fun doNotifyUpdateRoute() { - streamBridge.send( - bindName, - MessageBuilder.withPayload(RouteConstant.UPDATE_GATEWAY_ROUTES).build() - ) - } -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/repo/RouteRepository.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/repo/RouteRepository.kt deleted file mode 100644 index 38b3d81b5d1d3df7257bf6f1a081055ebb9363e1..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/repo/RouteRepository.kt +++ /dev/null @@ -1,23 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.repo - -import io.gitee.zhangbinhub.admin.route.base.BaseRepository -import io.gitee.zhangbinhub.admin.route.entity.Route - -/** - * @since JDK 11 - */ -interface RouteRepository : BaseRepository { - - fun findAllByEnabled(enabled: Boolean): List - - fun findAllByRouteIdIn(routeIdList: List): List - - /** - * 删除路由 - * - * @param idList id列表 - * @param enabled 启用状态 - */ - fun deleteByIdInAndEnabled(idList: List, enabled: Boolean) - -} diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/InitDataService.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/InitDataService.kt deleted file mode 100644 index c5173cac27d6df2f308b453d7a377a48dad77d76..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/InitDataService.kt +++ /dev/null @@ -1,67 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.service - -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.admin.route.entity.Route -import io.gitee.zhangbinhub.admin.route.repo.RouteRepository -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.stereotype.Service -import org.springframework.transaction.annotation.Transactional - -@Service -@Transactional(readOnly = true) -class InitDataService @Autowired constructor( - private val logAdapter: LogAdapter, - private val routeRepository: RouteRepository -) { - companion object { - const val WORK_FLOW_SERVER_API_ROUTE_ID = "workflow-server-api" - const val WORK_FLOW_UI_ROUTE_ID = "workflow-ui" - const val WORK_FLOW_UI_SERVER_ROUTE_ID = "workflow-ui-server" - } - - @Transactional - fun doInitRoute() { - routeRepository.save( - Route( - routeId = WORK_FLOW_SERVER_API_ROUTE_ID, - enabled = true, - orderNum = 0, - uri = "lb://workflow-server", - predicates = "[\"Path=/api/workflow/**\"]", - filters = "[\"StripPrefix=1\"]", - metadata = "{}", - remarks = "工作流服务接口" - ) - ).also { route -> - logAdapter.info("Init Route ${route.remarks}[${route.routeId}]") - } - routeRepository.save( - Route( - routeId = WORK_FLOW_UI_ROUTE_ID, - enabled = true, - orderNum = 0, - uri = "lb://workflow-server", - predicates = "[\"Path=/api/warm-flow-ui/**\"]", - filters = "[\"StripPrefix=1\"]", - metadata = "{}", - remarks = "工作流设计器" - ) - ).also { route -> - logAdapter.info("Init Route ${route.remarks}[${route.routeId}]") - } - routeRepository.save( - Route( - routeId = WORK_FLOW_UI_SERVER_ROUTE_ID, - enabled = true, - orderNum = 0, - uri = "lb://workflow-server", - predicates = "[\"Path=/api/warm-flow/**\"]", - filters = "[\"StripPrefix=1\"]", - metadata = "{}", - remarks = "工作流设计器服务" - ) - ).also { route -> - logAdapter.info("Init Route ${route.remarks}[${route.routeId}]") - } - } -} \ No newline at end of file diff --git a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/RouteService.kt b/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/RouteService.kt deleted file mode 100644 index 14f8c0c46a386e6249de394f7c6c21dfd3f92225..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/kotlin/io/gitee/zhangbinhub/admin/route/service/RouteService.kt +++ /dev/null @@ -1,147 +0,0 @@ -package io.gitee.zhangbinhub.admin.route.service - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.type.TypeFactory -import io.gitee.zhangbinhub.acp.boot.exceptions.WebException -import io.gitee.zhangbinhub.acp.boot.log.LogAdapter -import io.gitee.zhangbinhub.acp.cloud.lock.DistributedLock -import io.gitee.zhangbinhub.acp.core.common.CommonTools -import io.gitee.zhangbinhub.admin.route.base.BaseService -import io.gitee.zhangbinhub.admin.common.constant.RouteConstant.ROUTES_DEFINITION_KEY -import io.gitee.zhangbinhub.admin.common.vo.CustomerQueryPageVo -import io.gitee.zhangbinhub.admin.route.definition.FilterDefinition -import io.gitee.zhangbinhub.admin.route.definition.PredicateDefinition -import io.gitee.zhangbinhub.admin.route.definition.RouteConstant -import io.gitee.zhangbinhub.admin.route.definition.RouteDefinition -import io.gitee.zhangbinhub.admin.route.entity.Route -import io.gitee.zhangbinhub.admin.route.po.RoutePo -import io.gitee.zhangbinhub.admin.route.po.RouteQueryPo -import io.gitee.zhangbinhub.admin.route.repo.RouteRepository -import jakarta.persistence.criteria.Predicate -import org.springframework.beans.factory.annotation.Autowired -import org.springframework.data.redis.core.StringRedisTemplate -import org.springframework.stereotype.Service -import org.springframework.transaction.annotation.Transactional -import java.net.URI - -/** - * @author zhang by 01/03/2019 - * @since JDK 11 - */ -@Service -@Transactional(readOnly = true) -class RouteService @Autowired -constructor( - private val logAdapter: LogAdapter, - private val routeRepository: RouteRepository, - private val stringRedisTemplate: StringRedisTemplate, - private val objectMapper: ObjectMapper, - private val distributedLock: DistributedLock -) : BaseService() { - - private fun doSave(route: Route, routePo: RoutePo): Route = - route.copy( - uri = routePo.uri, - routeId = routePo.routeId, - predicates = routePo.predicates!!, - filters = routePo.filters, - metadata = routePo.metadata, - enabled = routePo.enabled ?: false, - orderNum = routePo.orderNum, - remarks = routePo.remarks - ).let { - routeRepository.save(it) - } - - @Transactional - fun doCreate(routePo: RoutePo): Route = doSave(Route(), routePo) - - @Transactional - @Throws(WebException::class) - fun doUpdate(routePo: RoutePo): Route = doSave(routeRepository.getReferenceById(routePo.id!!), routePo) - - @Transactional - fun doDelete(idList: List) = routeRepository.deleteByIdInAndEnabled(idList, false) - - fun getRouteListByRouteIdList(routeIdList: List): List = - routeRepository.findAllByRouteIdIn(routeIdList) - - fun doQuery(routeQueryPo: RouteQueryPo): CustomerQueryPageVo = - routeRepository.findAll({ root, _, criteriaBuilder -> - val predicateList: MutableList = mutableListOf() - if (routeQueryPo.enabled != null) { - predicateList.add(criteriaBuilder.equal(root.get("enabled"), routeQueryPo.enabled)) - } - if (!CommonTools.isNullStr(routeQueryPo.routeId)) { - predicateList.add( - criteriaBuilder.like( - root.get("routeId").`as`(String::class.java), - "%" + routeQueryPo.routeId + "%" - ) - ) - } - criteriaBuilder.and(*predicateList.toTypedArray()) - }, buildPageRequest(routeQueryPo.queryParam!!)).let { page -> - CustomerQueryPageVo( - currPage = routeQueryPo.queryParam!!.currPage!!, - pageSize = routeQueryPo.queryParam!!.pageSize!!, - totalElements = page.totalElements, - content = page.content - ) - } - - @Transactional - @Throws(WebException::class) - fun doRefresh() { - val routeList = routeRepository.findAllByEnabled(true) - logAdapter.info("查询到启用的路由信息共 " + routeList.size + " 条") - try { - if (distributedLock.getLock(RouteConstant.ROUTES_LOCK_KEY, RouteConstant.ROUTES_LOCK_TIME_OUT)) { - try { - stringRedisTemplate.delete(ROUTES_DEFINITION_KEY) - logAdapter.info("清理 Redis 缓存完成") - for (route in routeList) { - val routeDefinition = RouteDefinition() - routeDefinition.id = route.routeId!! - routeDefinition.uri = URI(route.uri!!) - routeDefinition.order = route.orderNum - routeDefinition.predicates = objectMapper.readValue( - route.predicates, - TypeFactory.defaultInstance() - .constructCollectionLikeType(MutableList::class.java, PredicateDefinition::class.java) - ) - routeDefinition.filters = if (!CommonTools.isNullStr(route.filters)) { - objectMapper.readValue( - route.filters, - TypeFactory.defaultInstance() - .constructCollectionLikeType(MutableList::class.java, FilterDefinition::class.java) - ) - } else { - mutableListOf() - } - routeDefinition.metadata = if (!CommonTools.isNullStr(route.metadata)) { - objectMapper.readValue( - route.metadata, - TypeFactory.defaultInstance() - .constructMapLikeType(MutableMap::class.java, String::class.java, Any::class.java) - ) - } else { - mutableMapOf() - } - stringRedisTemplate.opsForList() - .rightPush(ROUTES_DEFINITION_KEY, objectMapper.writeValueAsString(routeDefinition)) - } - logAdapter.info("路由信息更新至 Redis,共 " + routeList.size + " 条") - } finally { - distributedLock.releaseLock(RouteConstant.ROUTES_LOCK_KEY) - } - } else { - throw WebException("系统正在进行路由信息更新,请稍后重试") - } - } catch (e: Exception) { - throw WebException(e.message) - } - - } - -} diff --git a/modules/route-server/src/main/resources/META-INF/spring.factories b/modules/route-server/src/main/resources/META-INF/spring.factories deleted file mode 100644 index 52bd4cd911e3eb01637ecc503490143e36c0abed..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.env.EnvironmentPostProcessor=\ - io.gitee.zhangbinhub.admin.route.conf.RouteUpdateEnvironmentPostProcessor \ No newline at end of file diff --git a/modules/route-server/src/main/resources/application.yaml b/modules/route-server/src/main/resources/application.yaml deleted file mode 100644 index e30b725fd343e656e47fd2163b09be5bed1d1195..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/resources/application.yaml +++ /dev/null @@ -1,50 +0,0 @@ -server: - shutdown: graceful - port: ${acp_server_port:0} - undertow: - threads: - worker: 1000 -spring: - profiles: - active: ${acp_profile_active:dev} - application: - name: route-server - thymeleaf: - cache: false - cloud: - loadbalancer: - cache: - ttl: 5s - nacos: - username: ${acp_nacos_username:nacos} - password: ${acp_nacos_password:nacos} - server-addr: ${acp_nacos_addr:127.0.0.1:8848} - discovery: - namespace: ${acp_nacos_namespace:acp-cloud-admin} - cluster-name: ${spring.profiles.active} - group: ${spring.profiles.active} - metadata: - user.name: ${acp.cloud.resource-server.client-id} - user.password: ${acp.cloud.resource-server.client-secret} - config: - namespace: ${spring.cloud.nacos.discovery.namespace} - cluster-name: ${spring.cloud.nacos.discovery.cluster-name} - config: - import: - - optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml?group=${spring.cloud.nacos.discovery.group} - - optional:nacos:atom-server-common-${spring.profiles.active}.yaml?group=${spring.cloud.nacos.discovery.group} -logging: - file: - path: ${acp_log_path:logs}/${spring.application.name} - name: ${logging.file.path}/${spring.application.name}.log -info: - version: '@version@' - app-name: ${spring.application.name} - tags: - environment: ${spring.profiles.active} -acp: - cloud: - log-server: - client: - enabled: true - log-type: ROUTE \ No newline at end of file diff --git a/modules/route-server/src/main/resources/chars-scan-config.properties b/modules/route-server/src/main/resources/chars-scan-config.properties deleted file mode 100644 index 1f83309481dac75aff936b1425e5bc715cc9071a..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/resources/chars-scan-config.properties +++ /dev/null @@ -1,6 +0,0 @@ -chars.scan.prefix=:\uFF1A,\uFF0C'"\u2018\u201C=| +()\uFF08\uFF09 -chars.scan.scanList=1,2,3,4,9 -chars.scan.replaceList=1,2,3,4,9 -chars.scan.defaultReplace=12 -chars.scan.replaceHash=none -chars.scan.whiteList="" \ No newline at end of file diff --git a/modules/route-server/src/main/resources/logback-spring.xml b/modules/route-server/src/main/resources/logback-spring.xml deleted file mode 100644 index 2fe7764f2f504c2ea4f2cb76f28e710c0bfb9d74..0000000000000000000000000000000000000000 --- a/modules/route-server/src/main/resources/logback-spring.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseRepository.kt b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseRepository.kt index 5d2694034063e85cd014597195fed5b6c9558a47..e2138237a330865f906a6e6afd3abef7a72a9c39 100644 --- a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseRepository.kt +++ b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseRepository.kt @@ -5,7 +5,6 @@ import org.springframework.data.jpa.repository.JpaSpecificationExecutor import org.springframework.data.repository.NoRepositoryBean /** - * @author zhang by 15/01/2019 * @since JDK 11 */ @NoRepositoryBean diff --git a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseService.kt b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseService.kt index 9b65888938f8701bb8eca671ae579043c9a666a7..3d6149ad96f2df388d16269abdb8e2044da6b1f9 100644 --- a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseService.kt +++ b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/base/BaseService.kt @@ -6,7 +6,6 @@ import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort /** - * @author zhang by 15/01/2019 * @since JDK 11 */ abstract class BaseService { diff --git a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/conf/CustomerApiConfiguration.kt b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/conf/CustomerApiConfiguration.kt index a1d4279ef10031b07517a03163b47acc64b48d02..d66c1552155290e67866b511325413d1b1a17322 100644 --- a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/conf/CustomerApiConfiguration.kt +++ b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/conf/CustomerApiConfiguration.kt @@ -11,7 +11,6 @@ import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration /** - * @author zhang by 27/12/2018 * @since JDK 11 */ @Configuration(proxyBeanMethods = false) diff --git a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/entity/MyProcessInstance.kt b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/entity/MyProcessInstance.kt index 88a73bed6e97b7f0c2c5299056174c748393b619..37a5e0047f5777e662284abe2abfb39a2651528b 100644 --- a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/entity/MyProcessInstance.kt +++ b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/entity/MyProcessInstance.kt @@ -4,7 +4,6 @@ import io.swagger.v3.oas.annotations.media.Schema import jakarta.persistence.* /** - * @author zhang by 14/06/2019 * @since JDK 11 */ @Entity diff --git a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/service/WorkFlowDefinitionService.kt b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/service/WorkFlowDefinitionService.kt index 3d7cc957be768a2cb19b1a654624930d9b400c86..ebc7db9a7d124b012e9dfadd7bd8e7a96ebd1b06 100644 --- a/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/service/WorkFlowDefinitionService.kt +++ b/modules/workflow-server/src/main/kotlin/io/gitee/zhangbinhub/admin/workflow/service/WorkFlowDefinitionService.kt @@ -25,13 +25,6 @@ class WorkFlowDefinitionService( private val defService: DefService, private val fileDownLoadHandle: FileDownLoadHandle ) : BaseWorkFlowService() { - @Throws(WebException::class) - private fun parseProcessDefinition(content: String): DefJson = try { - FlowEngine.jsonConvert.strToBean(content, DefJson::class.java) - } catch (e: Exception) { - throw WebException(e.message) - } - private fun definitionToVo(definition: Definition): ProcessDefinitionVo = ProcessDefinitionVo().apply { this.id = definition.id.toString() this.flowCode = definition.flowCode @@ -86,7 +79,7 @@ class WorkFlowDefinitionService( this.flowCode = processDefinitionPo.flowCode this.flowName = processDefinitionPo.flowName this.category = processDefinitionPo.category - if (!defService.saveAndInitNode(this)) { + if (!defService.checkAndSave(this)) { throw WebException("流程创建失败!") } } diff --git a/modules/workflow-server/src/main/resources/init-sql/mysql/warm-flow-all.sql b/modules/workflow-server/src/main/resources/init-sql/mysql/warm-flow-all.sql index 05bb94127b4298fd9de268e06d9384bacdacfbc2..7f67eb26bec6bb4c8a56e5792b290dcd3eca0147 100644 --- a/modules/workflow-server/src/main/resources/init-sql/mysql/warm-flow-all.sql +++ b/modules/workflow-server/src/main/resources/init-sql/mysql/warm-flow-all.sql @@ -3,6 +3,7 @@ CREATE TABLE IF NOT EXISTS `flow_definition` `id` bigint NOT NULL COMMENT '主键id', `flow_code` varchar(40) NOT NULL COMMENT '流程编码', `flow_name` varchar(100) NOT NULL COMMENT '流程名称', + `model_value` varchar(40) NOT NULL DEFAULT 'CLASSICS' COMMENT '设计器模型(CLASSICS经典模型 MIMIC仿钉钉模型)', `category` varchar(100) DEFAULT NULL COMMENT '流程类别', `version` varchar(20) NOT NULL COMMENT '流程版本', `is_publish` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发布(0未发布 1已发布 9失效)', @@ -116,7 +117,7 @@ CREATE TABLE IF NOT EXISTS `flow_his_task` `target_node_name` varchar(200) DEFAULT NULL COMMENT '结束节点名称', `approver` varchar(40) DEFAULT NULL COMMENT '审批者', `cooperate_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '协作方式(1审批 2转办 3委派 4会签 5票签 6加签 7减签)', - `collaborator` varchar(40) DEFAULT NULL COMMENT '协作人', + `collaborator` varchar(500) DEFAULT NULL COMMENT '协作人', `skip_type` varchar(10) NOT NULL COMMENT '流转类型(PASS通过 REJECT退回 NONE无动作)', `flow_status` varchar(20) NOT NULL COMMENT '流程状态(0待提交 1审批中 2审批通过 4终止 5作废 6撤销 8已完成 9已退回 10失效 11拿回)', `form_custom` char(1) DEFAULT 'N' COMMENT '审批表单是否自定义(Y是 N否)', diff --git a/modules/workflow-server/src/test/kotlin/io/gitee/zhangbinhub/admin/workflow/test/nobuild/TestWorkflow.kt b/modules/workflow-server/src/test/kotlin/io/gitee/zhangbinhub/admin/workflow/test/nobuild/TestWorkflow.kt deleted file mode 100644 index cdc8c0e90bb3b58b2babe8204fea4116e11bdfe8..0000000000000000000000000000000000000000 --- a/modules/workflow-server/src/test/kotlin/io/gitee/zhangbinhub/admin/workflow/test/nobuild/TestWorkflow.kt +++ /dev/null @@ -1,132 +0,0 @@ -package io.gitee.zhangbinhub.admin.workflow.test.nobuild - -import io.gitee.zhangbinhub.admin.common.constant.WorkFlowConstant -import io.gitee.zhangbinhub.admin.resource.server.po.ProcessStartPo -import io.gitee.zhangbinhub.admin.resource.server.po.ProcessTerminationPo -import io.gitee.zhangbinhub.admin.workflow.po.WorkFlowDefinitionPo -import io.gitee.zhangbinhub.admin.workflow.test.BaseTest -import org.junit.jupiter.api.Test - -private const val s = "2e49eb85-a3d2-11ee-8162-2216b93ea7e2" - -class TestWorkflow : BaseTest() { - @Test - fun createDefinition() { - val xmlStr = """ - - - - - Flow_0k4vls0 - - - Flow_0k4vls0 - Flow_048xmdv - - - - Flow_048xmdv - Flow_1c9bjqd - - - - Flow_1c9bjqd - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - """.trimIndent() - workFlowDefinitionService!!.doCreate( - WorkFlowDefinitionPo( - content = xmlStr, remarks = "测试流程" - ) - ).apply { - println(this) - } - } - - @Test - fun deploy() { - workFlowDefinitionService!!.doDeploy("5a90498f-c5cd-4685-a11b-003cffb3dcf2") - } - - @Test - fun start() { - val userId = "2034848b-2bbd-47b6-a6fc-ff390afcb140" - println( - "process id: ${ - workFlowService!!.startFlow( - ProcessStartPo( - processDefinitionKey = "test_process2", - businessKey = "businessKey", - title = "测试标题", - description = "这是一个测试流程", - params = mutableMapOf(Pair(WorkFlowConstant.assigneeUser, userId)) - ), userId - ) - }" - ) - } - - @Test - fun queryTaskList() { - val userId = "2034848b-2bbd-47b6-a6fc-ff390afcb140" - val processId = "2e49eb85-a3d2-11ee-8162-2216b93ea7e2" - workFlowService!!.findTaskList(processId, userId).forEach { - println(it) - } - } - - @Test - fun getDefinition() { - val processId = "2e49eb85-a3d2-11ee-8162-2216b93ea7e2" - print(workFlowService!!.findProcessDefinition(processId)) - } - - @Test - fun delete() { - val processId = "afbfb2a2-a3c3-11ee-a439-2216b93ea7e2" - workFlowService!!.deleteProcessInstance( - ProcessTerminationPo( - processInstanceId = processId, - reason = "test delete" - ) - ) - } - - @Test - fun queryHighlight() { - val processId = "2e49eb85-a3d2-11ee-8162-2216b93ea7e2" - println(objectMapper!!.writeValueAsString(workFlowService!!.findHighlightElement(processId))) - } -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 03f2efee4601d3af0d6914c6c3717eea96c070b6..f6c7a3827a9e80b9faa304c5a0de61d4393e3796 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,8 +15,6 @@ include 'log-server' project(':log-server').projectDir = new File('modules','log-server') include 'oauth-server' project(':oauth-server').projectDir = new File('modules','oauth-server') -include 'route-server' -project(':route-server').projectDir = new File('modules','route-server') include 'workflow-server' project(':workflow-server').projectDir = new File('modules','workflow-server') include 'deploy-server'