diff --git a/common/common-result/pom.xml b/common/common-result/pom.xml new file mode 100644 index 0000000..436690b --- /dev/null +++ b/common/common-result/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + cn.bunny + common + 0.0.1-SNAPSHOT + + + common-result + jar + + common-result + https://maven.apache.org + + + UTF-8 + + + + + + diff --git a/model/src/main/java/cn/bunny/enums/ResultCodeEnum.java b/common/common-result/src/main/java/cn/bunny/common/result/enums/ResultCodeEnum.java similarity index 96% rename from model/src/main/java/cn/bunny/enums/ResultCodeEnum.java rename to common/common-result/src/main/java/cn/bunny/common/result/enums/ResultCodeEnum.java index 009f0c0..dc0c7c7 100644 --- a/model/src/main/java/cn/bunny/enums/ResultCodeEnum.java +++ b/common/common-result/src/main/java/cn/bunny/common/result/enums/ResultCodeEnum.java @@ -1,4 +1,4 @@ -package cn.bunny.enums; +package cn.bunny.common.result.enums; import lombok.Getter; diff --git a/common/common-utils/src/main/java/cn/bunny/common/result/Result.java b/common/common-result/src/main/java/cn/bunny/common/result/utils/Result.java similarity index 97% rename from common/common-utils/src/main/java/cn/bunny/common/result/Result.java rename to common/common-result/src/main/java/cn/bunny/common/result/utils/Result.java index 2b0bcd7..80c8119 100644 --- a/common/common-utils/src/main/java/cn/bunny/common/result/Result.java +++ b/common/common-result/src/main/java/cn/bunny/common/result/utils/Result.java @@ -1,6 +1,6 @@ -package cn.bunny.common.result; +package cn.bunny.common.result.utils; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.enums.ResultCodeEnum; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; diff --git a/common/common-utils/pom.xml b/common/common-utils/pom.xml index 44d76da..8a8ecaf 100644 --- a/common/common-utils/pom.xml +++ b/common/common-utils/pom.xml @@ -28,6 +28,22 @@ jaxb-api 2.1 + + + mysql + mysql-connector-java + + + + com.zaxxer + HikariCP + 5.1.0 + + + + com.baomidou + mybatis-plus-spring-boot3-starter + com.baomidou @@ -50,5 +66,6 @@ - + + diff --git a/common/pom.xml b/common/pom.xml index deea179..709f207 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -15,6 +15,7 @@ service-utils common-utils spring-security + common-result diff --git a/common/service-utils/pom.xml b/common/service-utils/pom.xml index 3a851e6..b47c877 100644 --- a/common/service-utils/pom.xml +++ b/common/service-utils/pom.xml @@ -22,6 +22,15 @@ common-utils 0.0.1-SNAPSHOT + + cn.bunny + common-result + 0.0.1-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-web + org.springframework.boot diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/exception/BunnyException.java b/common/service-utils/src/main/java/cn/bunny/common/service/exception/BunnyException.java index fb87984..c755c16 100644 --- a/common/service-utils/src/main/java/cn/bunny/common/service/exception/BunnyException.java +++ b/common/service-utils/src/main/java/cn/bunny/common/service/exception/BunnyException.java @@ -1,6 +1,6 @@ package cn.bunny.common.service.exception; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.enums.ResultCodeEnum; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.ToString; diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java b/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java index 715dfc0..edd996c 100644 --- a/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java +++ b/common/service-utils/src/main/java/cn/bunny/common/service/exception/GlobalExceptionHandler.java @@ -1,8 +1,8 @@ package cn.bunny.common.service.exception; import cn.bunny.common.constant.CommonMessageConstant; -import cn.bunny.common.result.Result; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.utils.Result; +import cn.bunny.common.result.enums.ResultCodeEnum; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; diff --git a/common/service-utils/src/main/java/cn/bunny/common/service/utils/ResponseUtil.java b/common/service-utils/src/main/java/cn/bunny/common/service/utils/ResponseUtil.java index 3e822a0..f815119 100644 --- a/common/service-utils/src/main/java/cn/bunny/common/service/utils/ResponseUtil.java +++ b/common/service-utils/src/main/java/cn/bunny/common/service/utils/ResponseUtil.java @@ -1,6 +1,6 @@ package cn.bunny.common.service.utils; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.HttpStatus; diff --git a/common/spring-security/src/main/java/cn/bunny/security/filter/TokenLoginFilter.java b/common/spring-security/src/main/java/cn/bunny/security/filter/TokenLoginFilter.java index b78ac46..1a68dac 100644 --- a/common/spring-security/src/main/java/cn/bunny/security/filter/TokenLoginFilter.java +++ b/common/spring-security/src/main/java/cn/bunny/security/filter/TokenLoginFilter.java @@ -1,10 +1,10 @@ package cn.bunny.security.filter; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import cn.bunny.common.service.utils.JwtHelper; import cn.bunny.common.service.utils.ResponseUtil; import cn.bunny.entity.system.Login; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.enums.ResultCodeEnum; import cn.bunny.security.custom.CustomUser; import cn.bunny.security.handelr.SecurityAuthenticationFailureHandler; import cn.bunny.security.handelr.SecurityAuthenticationSuccessHandler; diff --git a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAccessDeniedHandler.java b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAccessDeniedHandler.java index 9e99251..f7747b0 100644 --- a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAccessDeniedHandler.java +++ b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAccessDeniedHandler.java @@ -1,7 +1,7 @@ package cn.bunny.security.handelr; -import cn.bunny.common.result.Result; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.utils.Result; +import cn.bunny.common.result.enums.ResultCodeEnum; import com.alibaba.fastjson2.JSON; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; diff --git a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationEntryPoint.java b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationEntryPoint.java index 046cd3d..8fd92c3 100644 --- a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationEntryPoint.java +++ b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationEntryPoint.java @@ -1,7 +1,7 @@ package cn.bunny.security.handelr; -import cn.bunny.common.result.Result; -import cn.bunny.enums.ResultCodeEnum; +import cn.bunny.common.result.utils.Result; +import cn.bunny.common.result.enums.ResultCodeEnum; import com.alibaba.fastjson2.JSON; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; diff --git a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationFailureHandler.java b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationFailureHandler.java index 7e12db2..34c21f6 100644 --- a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationFailureHandler.java +++ b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationFailureHandler.java @@ -1,6 +1,6 @@ package cn.bunny.security.handelr; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import com.alibaba.fastjson2.JSON; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; diff --git a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationSuccessHandler.java b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationSuccessHandler.java index 65acd8a..5a8727e 100644 --- a/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationSuccessHandler.java +++ b/common/spring-security/src/main/java/cn/bunny/security/handelr/SecurityAuthenticationSuccessHandler.java @@ -1,6 +1,6 @@ package cn.bunny.security.handelr; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import com.alibaba.fastjson2.JSON; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; diff --git a/logs/service-gateway/sentinel/command-center.log.2024-05-10.0 b/logs/service-gateway/sentinel/command-center.log.2024-05-10.0 new file mode 100644 index 0000000..0ed8876 --- /dev/null +++ b/logs/service-gateway/sentinel/command-center.log.2024-05-10.0 @@ -0,0 +1 @@ +2024-05-10 15:13:33.089 INFO [CommandCenter] Begin listening at port 8719 diff --git a/logs/service-gateway/sentinel/sentinel-record.log.2024-05-10.0 b/logs/service-gateway/sentinel/sentinel-record.log.2024-05-10.0 new file mode 100644 index 0000000..295bc00 --- /dev/null +++ b/logs/service-gateway/sentinel/sentinel-record.log.2024-05-10.0 @@ -0,0 +1,91 @@ +2024-05-10 15:13:33.055 INFO Add child to node +2024-05-10 15:13:33.055 INFO Add child to node +2024-05-10 15:13:33.059 INFO App name resolved from property csp.sentinel.app.name: service-gateway +2024-05-10 15:13:33.060 INFO [SentinelConfig] Application type resolved: 0 +2024-05-10 15:13:33.061 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc, aliasName=com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.061 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc, aliasName=com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.063 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.metric.extension.MetricCallbackInit, aliasName=com.alibaba.csp.sentinel.metric.extension.MetricCallbackInit, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.063 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit, aliasName=com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.064 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc, aliasName=com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.065 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.init.InitFunc, provider=com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc, aliasName=com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.066 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc +2024-05-10 15:13:33.066 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc +2024-05-10 15:13:33.066 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.metric.extension.MetricCallbackInit +2024-05-10 15:13:33.067 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit +2024-05-10 15:13:33.067 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc +2024-05-10 15:13:33.067 INFO [InitExecutor] Found init func: com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc +2024-05-10 15:13:33.068 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.transport.CommandCenter, provider=com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter, aliasName=com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.068 INFO [CommandCenterProvider] CommandCenter resolved: com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter +2024-05-10 15:13:33.070 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.BasicInfoCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.BasicInfoCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.071 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchActiveRuleCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchActiveRuleCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.071 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchClusterNodeByIdCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchClusterNodeByIdCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.071 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchClusterNodeHumanCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchClusterNodeHumanCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.071 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchJsonTreeCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchJsonTreeCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.073 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchOriginCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchOriginCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.073 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchSimpleClusterNodeCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchSimpleClusterNodeCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.074 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchSystemStatusCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchSystemStatusCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.074 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchTreeCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchTreeCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.074 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.ModifyRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.ModifyRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.075 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.OnOffGetCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.OnOffGetCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.075 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.OnOffSetCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.OnOffSetCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.075 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.SendMetricCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.SendMetricCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.076 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.VersionCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.VersionCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.076 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.cluster.FetchClusterModeCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.cluster.FetchClusterModeCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.076 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.cluster.ModifyClusterModeCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.cluster.ModifyClusterModeCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.077 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.ApiCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.ApiCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.077 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.GetParamFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.GetParamFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.078 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.ModifyParamFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.command.handler.ModifyParamFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.078 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterServerFlowConfigHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterServerFlowConfigHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.079 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.079 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterParamFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterParamFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.080 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterServerConfigHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterServerConfigHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.081 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterServerTransportConfigHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterServerTransportConfigHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.081 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyServerNamespaceSetHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyServerNamespaceSetHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.081 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.082 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterParamFlowRulesCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.ModifyClusterParamFlowRulesCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.082 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterServerInfoCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterServerInfoCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.083 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterMetricCommandHandler, aliasName=com.alibaba.csp.sentinel.cluster.server.command.handler.FetchClusterMetricCommandHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.083 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.ModifyClusterClientConfigHandler, aliasName=com.alibaba.csp.sentinel.command.handler.ModifyClusterClientConfigHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.084 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.command.CommandHandler, provider=com.alibaba.csp.sentinel.command.handler.FetchClusterClientConfigHandler, aliasName=com.alibaba.csp.sentinel.command.handler.FetchClusterClientConfigHandler, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.086 WARNING No SPI configuration file, filename=META-INF/services/com.alibaba.csp.sentinel.command.CommandHandlerInterceptor, classloader=jdk.internal.loader.ClassLoaders$AppClassLoader@36baf30c +2024-05-10 15:13:33.087 INFO [CommandCenterInit] Starting command center: com.alibaba.csp.sentinel.transport.command.SimpleHttpCommandCenter +2024-05-10 15:13:33.087 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.transport.init.CommandCenterInitFunc with order -1 +2024-05-10 15:13:33.088 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.transport.HeartbeatSender, provider=com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender, aliasName=com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.090 WARNING [SimpleHttpHeartbeatSender] Dashboard server address not configured or not available +2024-05-10 15:13:33.090 INFO [HeartbeatSenderProvider] HeartbeatSender activated: com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender +2024-05-10 15:13:33.090 INFO [HeartbeatSenderInit] Heartbeat interval not configured in config property or invalid, using sender default: 10000 +2024-05-10 15:13:33.091 INFO [HeartbeatSenderInit] HeartbeatSender started: com.alibaba.csp.sentinel.transport.heartbeat.SimpleHttpHeartbeatSender +2024-05-10 15:13:33.091 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.transport.init.HeartbeatSenderInitFunc with order -1 +2024-05-10 15:13:33.093 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.cluster.client.init.DefaultClusterClientInitFunc with order 0 +2024-05-10 15:13:33.094 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.metric.extension.MetricCallbackInit with order 2147483647 +2024-05-10 15:13:33.095 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.init.ParamFlowStatisticSlotCallbackInit with order 2147483647 +2024-05-10 15:13:33.099 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.cluster.server.processor.RequestProcessor, provider=com.alibaba.csp.sentinel.cluster.server.processor.FlowRequestProcessor, aliasName=com.alibaba.csp.sentinel.cluster.server.processor.FlowRequestProcessor, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.100 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.cluster.server.processor.RequestProcessor, provider=com.alibaba.csp.sentinel.cluster.server.processor.ParamFlowRequestProcessor, aliasName=com.alibaba.csp.sentinel.cluster.server.processor.ParamFlowRequestProcessor, isSingleton=true, isDefault=false, order=0 +2024-05-10 15:13:33.101 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.cluster.TokenService, provider=com.alibaba.csp.sentinel.cluster.flow.DefaultTokenService, aliasName=com.alibaba.csp.sentinel.cluster.flow.DefaultTokenService, isSingleton=true, isDefault=true, order=0 +2024-05-10 15:13:33.101 INFO [TokenServiceProvider] Global token service resolved: com.alibaba.csp.sentinel.cluster.flow.DefaultTokenService +2024-05-10 15:13:33.101 INFO [DefaultClusterServerInitFunc] Default entity codec and processors registered +2024-05-10 15:13:33.101 INFO [InitExecutor] Executing com.alibaba.csp.sentinel.cluster.server.init.DefaultClusterServerInitFunc with order 2147483647 +2024-05-10 15:13:33.104 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.SlotChainBuilder, provider=com.alibaba.csp.sentinel.slots.DefaultSlotChainBuilder, aliasName=com.alibaba.csp.sentinel.slots.DefaultSlotChainBuilder, isSingleton=true, isDefault=true, order=0 +2024-05-10 15:13:33.105 INFO [SlotChainProvider] Global slot chain builder resolved: com.alibaba.csp.sentinel.slots.DefaultSlotChainBuilder +2024-05-10 15:13:33.105 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.nodeselector.NodeSelectorSlot, aliasName=com.alibaba.csp.sentinel.slots.nodeselector.NodeSelectorSlot, isSingleton=false, isDefault=false, order=-10000 +2024-05-10 15:13:33.106 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot, aliasName=com.alibaba.csp.sentinel.slots.clusterbuilder.ClusterBuilderSlot, isSingleton=false, isDefault=false, order=-9000 +2024-05-10 15:13:33.106 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.logger.LogSlot, aliasName=com.alibaba.csp.sentinel.slots.logger.LogSlot, isSingleton=true, isDefault=false, order=-8000 +2024-05-10 15:13:33.106 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.statistic.StatisticSlot, aliasName=com.alibaba.csp.sentinel.slots.statistic.StatisticSlot, isSingleton=true, isDefault=false, order=-7000 +2024-05-10 15:13:33.107 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.block.authority.AuthoritySlot, aliasName=com.alibaba.csp.sentinel.slots.block.authority.AuthoritySlot, isSingleton=true, isDefault=false, order=-6000 +2024-05-10 15:13:33.107 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.system.SystemSlot, aliasName=com.alibaba.csp.sentinel.slots.system.SystemSlot, isSingleton=true, isDefault=false, order=-5000 +2024-05-10 15:13:33.107 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.block.flow.FlowSlot, aliasName=com.alibaba.csp.sentinel.slots.block.flow.FlowSlot, isSingleton=true, isDefault=false, order=-2000 +2024-05-10 15:13:33.108 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.block.degrade.DegradeSlot, aliasName=com.alibaba.csp.sentinel.slots.block.degrade.DegradeSlot, isSingleton=true, isDefault=false, order=-1000 +2024-05-10 15:13:33.108 INFO [SpiLoader] Found SPI implementation for SPI com.alibaba.csp.sentinel.slotchain.ProcessorSlot, provider=com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowSlot, aliasName=com.alibaba.csp.sentinel.slots.block.flow.param.ParamFlowSlot, isSingleton=true, isDefault=false, order=-3000 +2024-05-10 15:13:33.112 INFO Add child to node +2024-05-10 15:13:33.113 INFO [AuthorityRuleManager] Authority rules loaded: {} +2024-05-10 15:13:33.115 INFO [SystemRuleManager] Current system check status: false, highestSystemLoad: 1.797693e+308, highestCpuUsage: 1.797693e+308, maxRt: 9223372036854775807, maxThread: 9223372036854775807, maxQps: 1.797693e+308 +2024-05-10 15:13:33.117 INFO [ParamFlowRuleManager] No parameter flow rules, clearing all parameter metrics +2024-05-10 15:13:33.117 INFO [ParamFlowRuleManager] Parameter flow rules received: {} +2024-05-10 15:13:33.118 INFO [FlowRuleManager] Flow rules loaded: {} +2024-05-10 15:13:33.120 INFO [MetricWriter] Creating new MetricWriter, singleFileSize=52428800, totalFileCount=6 +2024-05-10 15:13:33.121 INFO [DegradeRuleManager] Degrade rules loaded: {} +2024-05-10 15:13:33.123 WARNING No SPI configuration file, filename=META-INF/services/com.alibaba.csp.sentinel.metric.extension.MetricExtension, classloader=jdk.internal.loader.ClassLoaders$AppClassLoader@36baf30c +2024-05-10 15:13:33.123 INFO [MetricExtensionProvider] No existing MetricExtension found +2024-05-10 15:13:33.470 INFO Add child to node +2024-05-10 15:13:34.123 INFO [MetricWriter] New metric file created: logs/service-gateway/sentinel\service-gateway-metrics.log.2024-05-10 +2024-05-10 15:13:34.124 INFO [MetricWriter] New metric index file created: logs/service-gateway/sentinel\service-gateway-metrics.log.2024-05-10.idx diff --git a/logs/service-gateway/sentinel/service-gateway-metrics.log.2024-05-10 b/logs/service-gateway/sentinel/service-gateway-metrics.log.2024-05-10 new file mode 100644 index 0000000..1b52818 --- /dev/null +++ b/logs/service-gateway/sentinel/service-gateway-metrics.log.2024-05-10 @@ -0,0 +1,3 @@ +1715325213000|2024-05-10 15:13:33|/favicon.ico|1|0|1|1|14|0|0|1 +1715325213000|2024-05-10 15:13:33|/|1|0|1|0|52|0|0|1 +1715325213000|2024-05-10 15:13:33|__total_inbound_traffic__|2|0|2|1|33|0|0|0 diff --git a/logs/service-gateway/sentinel/service-gateway-metrics.log.2024-05-10.idx b/logs/service-gateway/sentinel/service-gateway-metrics.log.2024-05-10.idx new file mode 100644 index 0000000..e69de29 diff --git a/model/pom.xml b/model/pom.xml index 7ae09e8..d08cb29 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -26,17 +26,6 @@ com.alibaba.fastjson2 fastjson2 - - - mysql - mysql-connector-java - - - - com.zaxxer - HikariCP - 5.1.0 - com.baomidou @@ -57,10 +46,5 @@ org.springframework.security spring-security-test - - - org.springframework.boot - spring-boot-starter-web - diff --git a/pom.xml b/pom.xml index f651ded..c6bfcbb 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,8 @@ model service module + server-gateway + service-client diff --git a/server-gateway/Dockerfile b/server-gateway/Dockerfile new file mode 100644 index 0000000..f07f8d1 --- /dev/null +++ b/server-gateway/Dockerfile @@ -0,0 +1,21 @@ +FROM openjdk:17 +MAINTAINER bunny + +#系统编码 +ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 + +# 设置时区,构建镜像时执行的命令 +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo "Asia/Shanghai" > /etc/timezone + +# 设定工作目录 +WORKDIR /home/bunny + +# 复制jar包 +COPY target/*.jar /home/bunny/app.jar + +#启动容器时的进程 +ENTRYPOINT ["java","-jar","/home/bunny/app.jar"] + +#暴露 8080 端口 +EXPOSE 8500 \ No newline at end of file diff --git a/server-gateway/pom.xml b/server-gateway/pom.xml new file mode 100644 index 0000000..d60d984 --- /dev/null +++ b/server-gateway/pom.xml @@ -0,0 +1,62 @@ + + 4.0.0 + + cn.bunny + bunny-template-mirror-server + 0.0.1-SNAPSHOT + + + server-gateway + jar + + server-gateway + https://maven.apache.org + + + UTF-8 + 192.168.3.98:1100 + 192.168.3.98:2375 + bunny-service-gateway + + + + + + org.springframework.cloud + spring-cloud-starter-gateway + 4.1.2 + + + org.projectlombok + lombok + + + + + org.springframework.cloud + spring-cloud-starter-loadbalancer + 4.1.2 + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + 2023.0.0.0-RC1 + + + + + + + + + + + com.alibaba.cloud + spring-cloud-starter-alibaba-sentinel + 2023.0.1.0 + + + diff --git a/server-gateway/src/main/java/cn/bunny/service/gateway/GatewayApplication.java b/server-gateway/src/main/java/cn/bunny/service/gateway/GatewayApplication.java new file mode 100644 index 0000000..a45d16e --- /dev/null +++ b/server-gateway/src/main/java/cn/bunny/service/gateway/GatewayApplication.java @@ -0,0 +1,16 @@ +package cn.bunny.service.gateway; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@ComponentScan("cn.bunny") +@Slf4j +public class GatewayApplication { + public static void main(String[] args) { + log.info("启动网关..."); + SpringApplication.run(GatewayApplication.class, args); + } +} \ No newline at end of file diff --git a/server-gateway/src/main/java/cn/bunny/service/gateway/config/CorsConfig.java b/server-gateway/src/main/java/cn/bunny/service/gateway/config/CorsConfig.java new file mode 100644 index 0000000..a032e57 --- /dev/null +++ b/server-gateway/src/main/java/cn/bunny/service/gateway/config/CorsConfig.java @@ -0,0 +1,37 @@ +package cn.bunny.service.gateway.config; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.reactive.CorsWebFilter; +import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource; + +@Configuration +@Slf4j +public class CorsConfig { + /** + * * 解决跨域 + */ + @Bean + protected CorsWebFilter addCorsMappings() { + log.info("CorsConfig===>开始跨域注册表..."); + + // 当allowCredentials设置为true时,allowedOrigins属性不能使用通配符"*",而是需要显式列出允许的源或使用allowedOriginPatterns + CorsConfiguration config = new CorsConfiguration(); + // 设置跨域请求地址 + // config.addAllowedOrigin("*"); + config.addAllowedMethod("*"); + config.addAllowedHeader("*"); + // 使用allowedOriginPatterns属性:在Spring Framework 5.3及更高版本中, + // 您可以使用allowedOriginPatterns属性,它允许您使用正则表达式模式来匹配允许的源。这样,您可以更灵活地配置允许的源。例如 + // 使用"https?://example.com"来匹配http://example.com和https://example.com两个源。 + config.addAllowedOriginPattern("*"); + config.setAllowCredentials(true); + + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/api/**", config); + + return new CorsWebFilter(source); + } +} \ No newline at end of file diff --git a/server-gateway/src/main/java/cn/bunny/service/gateway/controller/IndexController.java b/server-gateway/src/main/java/cn/bunny/service/gateway/controller/IndexController.java new file mode 100644 index 0000000..1f232cd --- /dev/null +++ b/server-gateway/src/main/java/cn/bunny/service/gateway/controller/IndexController.java @@ -0,0 +1,17 @@ +package cn.bunny.service.gateway.controller; + +import com.alibaba.nacos.api.model.v2.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RequestMapping("/") +@RestController +@Slf4j +public class IndexController { + @GetMapping() + public Result index() { + return Result.success("欢迎访问。。。"); + } +} diff --git a/server-gateway/src/main/resources/application-dev.yml b/server-gateway/src/main/resources/application-dev.yml new file mode 100644 index 0000000..e1f8308 --- /dev/null +++ b/server-gateway/src/main/resources/application-dev.yml @@ -0,0 +1,11 @@ +bunny: + nacos: + server-addr: z-bunny.cn:8848 + discovery: + namespace: spzx + + redis: + host: 47.120.65.66 + port: 6379 + database: 2 + password: "02120212" \ No newline at end of file diff --git a/server-gateway/src/main/resources/application.yml b/server-gateway/src/main/resources/application.yml new file mode 100644 index 0000000..f9b812f --- /dev/null +++ b/server-gateway/src/main/resources/application.yml @@ -0,0 +1,47 @@ +server: + port: 8500 +spring: + profiles: + active: dev + application: + name: service-gateway +# main: +# web-application-type: reactive + # allow-bean-definition-overriding: true + + cloud: + sentinel: + log: + dir: logs/${spring.application.name}/sentinel + nacos: + discovery: + namespace: ${bunny.nacos.discovery.namespace} + server-addr: ${bunny.nacos.server-addr} + log-name: logs/${spring.application.name} + + gateway: + discovery: + locator: + enabled: true + # 路由 +# routes: +# - id: service-product +# uri: lb://service-product +# predicates: +# - Path=/*/product/** + data: + redis: + host: ${bunny.redis.host} + port: ${bunny.redis.port} + database: ${bunny.redis.database} + password: ${bunny.redis.password} + +logging: + level: + cn.bunny.product.mapper: debug + cn.bunny.product.controller: info + cn.bunny.product.service: info + pattern: + dateformat: HH:mm:ss:SSS + file: + path: logs/${spring.application.name} \ No newline at end of file diff --git a/service/src/main/resources/banner.txt b/server-gateway/src/main/resources/banner.txt similarity index 100% rename from service/src/main/resources/banner.txt rename to server-gateway/src/main/resources/banner.txt diff --git a/server-gateway/src/main/resources/favicon.ico b/server-gateway/src/main/resources/favicon.ico new file mode 100644 index 0000000..1ba397c Binary files /dev/null and b/server-gateway/src/main/resources/favicon.ico differ diff --git a/service/src/main/resources/logback.xml b/server-gateway/src/main/resources/logback.xml similarity index 100% rename from service/src/main/resources/logback.xml rename to server-gateway/src/main/resources/logback.xml diff --git a/server-gateway/src/test/java/cn/bunny/AppTest.java b/server-gateway/src/test/java/cn/bunny/AppTest.java new file mode 100644 index 0000000..34b54ff --- /dev/null +++ b/server-gateway/src/test/java/cn/bunny/AppTest.java @@ -0,0 +1,38 @@ +package cn.bunny; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/service-client/pom.xml b/service-client/pom.xml new file mode 100644 index 0000000..cc8e314 --- /dev/null +++ b/service-client/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + cn.bunny + bunny-template-mirror-server + 0.0.1-SNAPSHOT + + + service-client + jar + + service-client + https://maven.apache.org + + + UTF-8 + + + + + + diff --git a/service/pom.xml b/service/pom.xml index 9343227..e96729f 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -8,40 +8,19 @@ service - jar + pom service https://maven.apache.org + + service-main + UTF-8 - 192.168.3.98:1100 - 192.168.3.98:2375 - bunny-service - + - - cn.bunny - spring-security - 0.0.1-SNAPSHOT - - - cn.bunny - module-mail - 0.0.1-SNAPSHOT - - - cn.bunny - module-minio - 0.0.1-SNAPSHOT - - - - cn.bunny - service-utils - 0.0.1-SNAPSHOT - - + junit junit @@ -52,66 +31,5 @@ org.springframework.boot spring-boot-starter-test - - - org.springframework.boot - spring-boot-starter-websocket - - - - org.aspectj - aspectjrt - - - org.aspectj - aspectjweaver - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - true - - - - com.spotify - docker-maven-plugin - 1.2.2 - - - - build-image - - package - - build - push - - - - - harbor - http://${docker.repostory} - - http://${docker.host} - - - ${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version} - - - ${project.basedir} - - false - - - - diff --git a/service/Dockerfile b/service/service-main/Dockerfile similarity index 100% rename from service/Dockerfile rename to service/service-main/Dockerfile diff --git a/service/service-main/pom.xml b/service/service-main/pom.xml new file mode 100644 index 0000000..61996d4 --- /dev/null +++ b/service/service-main/pom.xml @@ -0,0 +1,107 @@ + + 4.0.0 + + cn.bunny + service + 0.0.1-SNAPSHOT + + + service-main + jar + + service-main + https://maven.apache.org + + + UTF-8 + 192.168.3.98:1100 + 192.168.3.98:2375 + bunny-service + + + + + cn.bunny + spring-security + 0.0.1-SNAPSHOT + + + + cn.bunny + service-utils + 0.0.1-SNAPSHOT + + + cn.bunny + module-mail + 0.0.1-SNAPSHOT + + + cn.bunny + module-minio + 0.0.1-SNAPSHOT + + + + org.springframework.boot + spring-boot-starter-websocket + + + + org.aspectj + aspectjrt + + + org.aspectj + aspectjweaver + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + com.spotify + docker-maven-plugin + 1.2.2 + + + + build-image + + package + + build + push + + + + + harbor + http://${docker.repostory} + + http://${docker.host} + + + ${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version} + + + ${project.basedir} + + false + + + + + diff --git a/service/src/main/java/cn/bunny/service/ServiceApplication.java b/service/service-main/src/main/java/cn/bunny/service/ServiceApplication.java similarity index 100% rename from service/src/main/java/cn/bunny/service/ServiceApplication.java rename to service/service-main/src/main/java/cn/bunny/service/ServiceApplication.java diff --git a/service/src/main/java/cn/bunny/service/aop/annotation/AutoFill.java b/service/service-main/src/main/java/cn/bunny/service/aop/annotation/AutoFill.java similarity index 100% rename from service/src/main/java/cn/bunny/service/aop/annotation/AutoFill.java rename to service/service-main/src/main/java/cn/bunny/service/aop/annotation/AutoFill.java diff --git a/service/src/main/java/cn/bunny/service/aop/aspect/AutoFillAspect.java b/service/service-main/src/main/java/cn/bunny/service/aop/aspect/AutoFillAspect.java similarity index 100% rename from service/src/main/java/cn/bunny/service/aop/aspect/AutoFillAspect.java rename to service/service-main/src/main/java/cn/bunny/service/aop/aspect/AutoFillAspect.java diff --git a/service/src/main/java/cn/bunny/service/controller/BaseController.java b/service/service-main/src/main/java/cn/bunny/service/controller/BaseController.java similarity index 98% rename from service/src/main/java/cn/bunny/service/controller/BaseController.java rename to service/service-main/src/main/java/cn/bunny/service/controller/BaseController.java index 046b69d..c383e52 100644 --- a/service/src/main/java/cn/bunny/service/controller/BaseController.java +++ b/service/service-main/src/main/java/cn/bunny/service/controller/BaseController.java @@ -1,6 +1,6 @@ package cn.bunny.service.controller; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; diff --git a/service/src/main/java/cn/bunny/service/controller/IndexController.java b/service/service-main/src/main/java/cn/bunny/service/controller/IndexController.java similarity index 96% rename from service/src/main/java/cn/bunny/service/controller/IndexController.java rename to service/service-main/src/main/java/cn/bunny/service/controller/IndexController.java index 5710b9a..dfaa2dc 100644 --- a/service/src/main/java/cn/bunny/service/controller/IndexController.java +++ b/service/service-main/src/main/java/cn/bunny/service/controller/IndexController.java @@ -1,6 +1,6 @@ package cn.bunny.service.controller; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import cn.bunny.entity.system.Login; import cn.bunny.entity.system.SysUserinfo; import cn.bunny.service.service.SysUserService; diff --git a/service/src/main/java/cn/bunny/service/controller/MailController.java b/service/service-main/src/main/java/cn/bunny/service/controller/MailController.java similarity index 98% rename from service/src/main/java/cn/bunny/service/controller/MailController.java rename to service/service-main/src/main/java/cn/bunny/service/controller/MailController.java index 997d037..58f363f 100644 --- a/service/src/main/java/cn/bunny/service/controller/MailController.java +++ b/service/service-main/src/main/java/cn/bunny/service/controller/MailController.java @@ -1,6 +1,6 @@ package cn.bunny.service.controller; -import cn.bunny.common.result.Result; +import cn.bunny.common.result.utils.Result; import cn.bunny.entity.email.EmailSend; import cn.bunny.service.service.EmailService; import io.swagger.v3.oas.annotations.Operation; diff --git a/service/src/main/java/cn/bunny/service/controller/SysMenuController.java b/service/service-main/src/main/java/cn/bunny/service/controller/SysMenuController.java similarity index 100% rename from service/src/main/java/cn/bunny/service/controller/SysMenuController.java rename to service/service-main/src/main/java/cn/bunny/service/controller/SysMenuController.java diff --git a/service/src/main/java/cn/bunny/service/mapper/SysMenuMapper.java b/service/service-main/src/main/java/cn/bunny/service/mapper/SysMenuMapper.java similarity index 100% rename from service/src/main/java/cn/bunny/service/mapper/SysMenuMapper.java rename to service/service-main/src/main/java/cn/bunny/service/mapper/SysMenuMapper.java diff --git a/service/src/main/java/cn/bunny/service/mapper/SysRoleMapper.java b/service/service-main/src/main/java/cn/bunny/service/mapper/SysRoleMapper.java similarity index 100% rename from service/src/main/java/cn/bunny/service/mapper/SysRoleMapper.java rename to service/service-main/src/main/java/cn/bunny/service/mapper/SysRoleMapper.java diff --git a/service/src/main/java/cn/bunny/service/mapper/SysUserMapper.java b/service/service-main/src/main/java/cn/bunny/service/mapper/SysUserMapper.java similarity index 100% rename from service/src/main/java/cn/bunny/service/mapper/SysUserMapper.java rename to service/service-main/src/main/java/cn/bunny/service/mapper/SysUserMapper.java diff --git a/service/src/main/java/cn/bunny/service/security/CustomAuthorizationManagerServiceImpl.java b/service/service-main/src/main/java/cn/bunny/service/security/CustomAuthorizationManagerServiceImpl.java similarity index 100% rename from service/src/main/java/cn/bunny/service/security/CustomAuthorizationManagerServiceImpl.java rename to service/service-main/src/main/java/cn/bunny/service/security/CustomAuthorizationManagerServiceImpl.java diff --git a/service/src/main/java/cn/bunny/service/security/CustomUserDetailsService.java b/service/service-main/src/main/java/cn/bunny/service/security/CustomUserDetailsService.java similarity index 100% rename from service/src/main/java/cn/bunny/service/security/CustomUserDetailsService.java rename to service/service-main/src/main/java/cn/bunny/service/security/CustomUserDetailsService.java diff --git a/service/src/main/java/cn/bunny/service/service/EmailService.java b/service/service-main/src/main/java/cn/bunny/service/service/EmailService.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/EmailService.java rename to service/service-main/src/main/java/cn/bunny/service/service/EmailService.java diff --git a/service/src/main/java/cn/bunny/service/service/SysMenuService.java b/service/service-main/src/main/java/cn/bunny/service/service/SysMenuService.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/SysMenuService.java rename to service/service-main/src/main/java/cn/bunny/service/service/SysMenuService.java diff --git a/service/src/main/java/cn/bunny/service/service/SysRoleService.java b/service/service-main/src/main/java/cn/bunny/service/service/SysRoleService.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/SysRoleService.java rename to service/service-main/src/main/java/cn/bunny/service/service/SysRoleService.java diff --git a/service/src/main/java/cn/bunny/service/service/SysUserService.java b/service/service-main/src/main/java/cn/bunny/service/service/SysUserService.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/SysUserService.java rename to service/service-main/src/main/java/cn/bunny/service/service/SysUserService.java diff --git a/service/src/main/java/cn/bunny/service/service/impl/EmailServiceImpl.java b/service/service-main/src/main/java/cn/bunny/service/service/impl/EmailServiceImpl.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/impl/EmailServiceImpl.java rename to service/service-main/src/main/java/cn/bunny/service/service/impl/EmailServiceImpl.java diff --git a/service/src/main/java/cn/bunny/service/service/impl/SysMenuServiceImpl.java b/service/service-main/src/main/java/cn/bunny/service/service/impl/SysMenuServiceImpl.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/impl/SysMenuServiceImpl.java rename to service/service-main/src/main/java/cn/bunny/service/service/impl/SysMenuServiceImpl.java diff --git a/service/src/main/java/cn/bunny/service/service/impl/SysRoleServiceImpl.java b/service/service-main/src/main/java/cn/bunny/service/service/impl/SysRoleServiceImpl.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/impl/SysRoleServiceImpl.java rename to service/service-main/src/main/java/cn/bunny/service/service/impl/SysRoleServiceImpl.java diff --git a/service/src/main/java/cn/bunny/service/service/impl/SysUserServiceImpl.java b/service/service-main/src/main/java/cn/bunny/service/service/impl/SysUserServiceImpl.java similarity index 100% rename from service/src/main/java/cn/bunny/service/service/impl/SysUserServiceImpl.java rename to service/service-main/src/main/java/cn/bunny/service/service/impl/SysUserServiceImpl.java diff --git a/service/src/main/java/cn/bunny/service/task/TemplateTask.java b/service/service-main/src/main/java/cn/bunny/service/task/TemplateTask.java similarity index 100% rename from service/src/main/java/cn/bunny/service/task/TemplateTask.java rename to service/service-main/src/main/java/cn/bunny/service/task/TemplateTask.java diff --git a/service/src/main/java/cn/bunny/service/websocket/WebSocketServer.java b/service/service-main/src/main/java/cn/bunny/service/websocket/WebSocketServer.java similarity index 100% rename from service/src/main/java/cn/bunny/service/websocket/WebSocketServer.java rename to service/service-main/src/main/java/cn/bunny/service/websocket/WebSocketServer.java diff --git a/service/src/main/resources/application-dev.yml b/service/service-main/src/main/resources/application-dev.yml similarity index 100% rename from service/src/main/resources/application-dev.yml rename to service/service-main/src/main/resources/application-dev.yml diff --git a/service/src/main/resources/application.yml b/service/service-main/src/main/resources/application.yml similarity index 100% rename from service/src/main/resources/application.yml rename to service/service-main/src/main/resources/application.yml diff --git a/service/service-main/src/main/resources/banner.txt b/service/service-main/src/main/resources/banner.txt new file mode 100644 index 0000000..cc77fc2 --- /dev/null +++ b/service/service-main/src/main/resources/banner.txt @@ -0,0 +1,16 @@ +-----------------▄██-█▄--------- +-----------------███▄██▄-------- +-----------------███████-------- +-----------------▀███████------- +-------------------██████▄▄----- +-------------------█████████▄--- +-------------------██████▄████-- +-------▄███████████████████████- +-----▄███████████████████████▀-- +---▄██████████████████████------ +---███████████████████████------ +---███████████████████████------ +-▄▄██████████████████████▀------ +-█████████████████▀█████-------- +-▀██████████████▀▀-▀█████▄------ +-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------ \ No newline at end of file diff --git a/service/src/main/resources/favicon.ico b/service/service-main/src/main/resources/favicon.ico similarity index 100% rename from service/src/main/resources/favicon.ico rename to service/service-main/src/main/resources/favicon.ico diff --git a/service/service-main/src/main/resources/logback.xml b/service/service-main/src/main/resources/logback.xml new file mode 100644 index 0000000..04ecbe3 --- /dev/null +++ b/service/service-main/src/main/resources/logback.xml @@ -0,0 +1,61 @@ + + + + + + + %cyan([%thread]) %yellow(%-5level) %green(%logger{100}).%boldRed(%method)-%boldMagenta(%line) - %blue(%msg%n) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/service/src/main/resources/mapper/SysMenuMapper.xml b/service/service-main/src/main/resources/mapper/SysMenuMapper.xml similarity index 100% rename from service/src/main/resources/mapper/SysMenuMapper.xml rename to service/service-main/src/main/resources/mapper/SysMenuMapper.xml diff --git a/service/src/main/resources/mapper/SysRoleMapper.xml b/service/service-main/src/main/resources/mapper/SysRoleMapper.xml similarity index 100% rename from service/src/main/resources/mapper/SysRoleMapper.xml rename to service/service-main/src/main/resources/mapper/SysRoleMapper.xml diff --git a/service/src/main/resources/mapper/SysUserMapper.xml b/service/service-main/src/main/resources/mapper/SysUserMapper.xml similarity index 100% rename from service/src/main/resources/mapper/SysUserMapper.xml rename to service/service-main/src/main/resources/mapper/SysUserMapper.xml diff --git a/service/src/test/java/cn/bunny/CustomPasswordEncoderTest.java b/service/service-main/src/test/java/cn/bunny/CustomPasswordEncoderTest.java similarity index 100% rename from service/src/test/java/cn/bunny/CustomPasswordEncoderTest.java rename to service/service-main/src/test/java/cn/bunny/CustomPasswordEncoderTest.java