Merge pull request 'feat(新增/修改): 新增nacos、修改项目结构' (#1) from dev into master
Reviewed-on: #1
This commit is contained in:
commit
91439bfac5
|
@ -0,0 +1,23 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>common</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>common-result</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>common-result</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -1,4 +1,4 @@
|
||||||
package cn.bunny.enums;
|
package cn.bunny.common.result.enums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
|
@ -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.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
|
@ -28,6 +28,22 @@
|
||||||
<artifactId>jaxb-api</artifactId>
|
<artifactId>jaxb-api</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--mysql-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- mysql连接池 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zaxxer</groupId>
|
||||||
|
<artifactId>HikariCP</artifactId>
|
||||||
|
<version>5.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-spring-boot3-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- 数据库代码生成器 - 新版 -->
|
<!-- 数据库代码生成器 - 新版 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
@ -50,5 +66,6 @@
|
||||||
<!-- <artifactId>velocity-engine-core</artifactId> -->
|
<!-- <artifactId>velocity-engine-core</artifactId> -->
|
||||||
<!-- <version>2.0</version> -->
|
<!-- <version>2.0</version> -->
|
||||||
<!-- </dependency> -->
|
<!-- </dependency> -->
|
||||||
|
<!-- spring-web -->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<module>service-utils</module>
|
<module>service-utils</module>
|
||||||
<module>common-utils</module>
|
<module>common-utils</module>
|
||||||
<module>spring-security</module>
|
<module>spring-security</module>
|
||||||
|
<module>common-result</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -22,6 +22,15 @@
|
||||||
<artifactId>common-utils</artifactId>
|
<artifactId>common-utils</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>common-result</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- redis -->
|
<!-- redis -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.common.service.exception;
|
package cn.bunny.common.service.exception;
|
||||||
|
|
||||||
import cn.bunny.enums.ResultCodeEnum;
|
import cn.bunny.common.result.enums.ResultCodeEnum;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package cn.bunny.common.service.exception;
|
package cn.bunny.common.service.exception;
|
||||||
|
|
||||||
import cn.bunny.common.constant.CommonMessageConstant;
|
import cn.bunny.common.constant.CommonMessageConstant;
|
||||||
import cn.bunny.common.result.Result;
|
import cn.bunny.common.result.utils.Result;
|
||||||
import cn.bunny.enums.ResultCodeEnum;
|
import cn.bunny.common.result.enums.ResultCodeEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.common.service.utils;
|
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 com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package cn.bunny.security.filter;
|
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.JwtHelper;
|
||||||
import cn.bunny.common.service.utils.ResponseUtil;
|
import cn.bunny.common.service.utils.ResponseUtil;
|
||||||
import cn.bunny.entity.system.Login;
|
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.custom.CustomUser;
|
||||||
import cn.bunny.security.handelr.SecurityAuthenticationFailureHandler;
|
import cn.bunny.security.handelr.SecurityAuthenticationFailureHandler;
|
||||||
import cn.bunny.security.handelr.SecurityAuthenticationSuccessHandler;
|
import cn.bunny.security.handelr.SecurityAuthenticationSuccessHandler;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package cn.bunny.security.handelr;
|
package cn.bunny.security.handelr;
|
||||||
|
|
||||||
import cn.bunny.common.result.Result;
|
import cn.bunny.common.result.utils.Result;
|
||||||
import cn.bunny.enums.ResultCodeEnum;
|
import cn.bunny.common.result.enums.ResultCodeEnum;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package cn.bunny.security.handelr;
|
package cn.bunny.security.handelr;
|
||||||
|
|
||||||
import cn.bunny.common.result.Result;
|
import cn.bunny.common.result.utils.Result;
|
||||||
import cn.bunny.enums.ResultCodeEnum;
|
import cn.bunny.common.result.enums.ResultCodeEnum;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.security.handelr;
|
package cn.bunny.security.handelr;
|
||||||
|
|
||||||
import cn.bunny.common.result.Result;
|
import cn.bunny.common.result.utils.Result;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import jakarta.servlet.ServletException;
|
import jakarta.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.security.handelr;
|
package cn.bunny.security.handelr;
|
||||||
|
|
||||||
import cn.bunny.common.result.Result;
|
import cn.bunny.common.result.utils.Result;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import jakarta.servlet.ServletException;
|
import jakarta.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
2024-05-10 15:13:33.089 INFO [CommandCenter] Begin listening at port 8719
|
|
@ -0,0 +1,91 @@
|
||||||
|
2024-05-10 15:13:33.055 INFO Add child <sentinel_default_context> to node <machine-root>
|
||||||
|
2024-05-10 15:13:33.055 INFO Add child <sentinel_spring_webflux_context> to node <machine-root>
|
||||||
|
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 <sentinel_spring_webflux_context>
|
||||||
|
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 </favicon.ico> to node <sentinel_spring_webflux_context>
|
||||||
|
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
|
|
@ -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
|
|
@ -26,17 +26,6 @@
|
||||||
<groupId>com.alibaba.fastjson2</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson2</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--mysql-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- mysql连接池 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.zaxxer</groupId>
|
|
||||||
<artifactId>HikariCP</artifactId>
|
|
||||||
<version>5.1.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- mybatis-plus -->
|
<!-- mybatis-plus -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
|
@ -57,10 +46,5 @@
|
||||||
<groupId>org.springframework.security</groupId>
|
<groupId>org.springframework.security</groupId>
|
||||||
<artifactId>spring-security-test</artifactId>
|
<artifactId>spring-security-test</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- spring-web -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -22,6 +22,8 @@
|
||||||
<module>model</module>
|
<module>model</module>
|
||||||
<module>service</module>
|
<module>service</module>
|
||||||
<module>module</module>
|
<module>module</module>
|
||||||
|
<module>server-gateway</module>
|
||||||
|
<module>service-client</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -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
|
|
@ -0,0 +1,62 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>bunny-template-mirror-server</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>server-gateway</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>server-gateway</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<docker.repostory>192.168.3.98:1100</docker.repostory>
|
||||||
|
<docker.host>192.168.3.98:2375</docker.host>
|
||||||
|
<docker.registry.name>bunny-service-gateway</docker.registry.name>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- gateway -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- loadbalancer依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
<version>4.1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 服务注册 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
<version>2023.0.0.0-RC1</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- config -->
|
||||||
|
<!-- <dependency> -->
|
||||||
|
<!-- <groupId>com.alibaba.cloud</groupId> -->
|
||||||
|
<!-- <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> -->
|
||||||
|
<!-- <version>2023.0.0.0-RC1</version> -->
|
||||||
|
<!-- </dependency> -->
|
||||||
|
|
||||||
|
<!-- 服务保护组件 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
<version>2023.0.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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<String> index() {
|
||||||
|
return Result.success("欢迎访问。。。");
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
|
@ -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}
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -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 );
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>bunny-template-mirror-server</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service-client</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>service-client</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -8,39 +8,18 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>service</artifactId>
|
<artifactId>service</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>service</name>
|
<name>service</name>
|
||||||
<url>https://maven.apache.org</url>
|
<url>https://maven.apache.org</url>
|
||||||
|
<modules>
|
||||||
|
<module>service-main</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<docker.repostory>192.168.3.98:1100</docker.repostory>
|
|
||||||
<docker.host>192.168.3.98:2375</docker.host>
|
|
||||||
<docker.registry.name>bunny-service</docker.registry.name>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>cn.bunny</groupId>
|
|
||||||
<artifactId>spring-security</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.bunny</groupId>
|
|
||||||
<artifactId>module-mail</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.bunny</groupId>
|
|
||||||
<artifactId>module-minio</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- service-utils -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>cn.bunny</groupId>
|
|
||||||
<artifactId>service-utils</artifactId>
|
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 单元测试 -->
|
<!-- 单元测试 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
@ -52,66 +31,5 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- websocket -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- asp 切面 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.aspectj</groupId>
|
|
||||||
<artifactId>aspectjrt</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.aspectj</groupId>
|
|
||||||
<artifactId>aspectjweaver</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>com.spotify</groupId>
|
|
||||||
<artifactId>docker-maven-plugin</artifactId>
|
|
||||||
<version>1.2.2</version>
|
|
||||||
<!--将插件绑定在某个phase执行-->
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>build-image</id>
|
|
||||||
<!--将插件绑定在package这个phase(阶段)上。也就是说,用户只需执行mvn package,就会自动执行mvn docker:build-->
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>build</goal>
|
|
||||||
<goal>push</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<serverId>harbor</serverId>
|
|
||||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
|
||||||
<!-- 配置docker主机地址 -->
|
|
||||||
<dockerHost>http://${docker.host}</dockerHost>
|
|
||||||
<!--指定生成的镜像名-->
|
|
||||||
<imageName>
|
|
||||||
${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version}
|
|
||||||
</imageName>
|
|
||||||
<!-- 指定 dockerfile 路径-->
|
|
||||||
<dockerDirectory>${project.basedir}</dockerDirectory>
|
|
||||||
<!-- 是否跳过docker构建 -->
|
|
||||||
<skipDockerBuild>false</skipDockerBuild>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,107 @@
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>service</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service-main</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>service-main</name>
|
||||||
|
<url>https://maven.apache.org</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<docker.repostory>192.168.3.98:1100</docker.repostory>
|
||||||
|
<docker.host>192.168.3.98:2375</docker.host>
|
||||||
|
<docker.registry.name>bunny-service</docker.registry.name>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>spring-security</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- service-utils -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>service-utils</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>module-mail</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.bunny</groupId>
|
||||||
|
<artifactId>module-minio</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- websocket -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!-- asp 切面 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjweaver</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>1.2.2</version>
|
||||||
|
<!--将插件绑定在某个phase执行-->
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>build-image</id>
|
||||||
|
<!--将插件绑定在package这个phase(阶段)上。也就是说,用户只需执行mvn package,就会自动执行mvn docker:build-->
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build</goal>
|
||||||
|
<goal>push</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<serverId>harbor</serverId>
|
||||||
|
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||||
|
<!-- 配置docker主机地址 -->
|
||||||
|
<dockerHost>http://${docker.host}</dockerHost>
|
||||||
|
<!--指定生成的镜像名-->
|
||||||
|
<imageName>
|
||||||
|
${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version}
|
||||||
|
</imageName>
|
||||||
|
<!-- 指定 dockerfile 路径-->
|
||||||
|
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||||
|
<!-- 是否跳过docker构建 -->
|
||||||
|
<skipDockerBuild>false</skipDockerBuild>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.service.controller;
|
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.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.service.controller;
|
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.Login;
|
||||||
import cn.bunny.entity.system.SysUserinfo;
|
import cn.bunny.entity.system.SysUserinfo;
|
||||||
import cn.bunny.service.service.SysUserService;
|
import cn.bunny.service.service.SysUserService;
|
|
@ -1,6 +1,6 @@
|
||||||
package cn.bunny.service.controller;
|
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.entity.email.EmailSend;
|
||||||
import cn.bunny.service.service.EmailService;
|
import cn.bunny.service.service.EmailService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
|
@ -0,0 +1,16 @@
|
||||||
|
-----------------▄██-█▄---------
|
||||||
|
-----------------███▄██▄--------
|
||||||
|
-----------------███████--------
|
||||||
|
-----------------▀███████-------
|
||||||
|
-------------------██████▄▄-----
|
||||||
|
-------------------█████████▄---
|
||||||
|
-------------------██████▄████--
|
||||||
|
-------▄███████████████████████-
|
||||||
|
-----▄███████████████████████▀--
|
||||||
|
---▄██████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
---███████████████████████------
|
||||||
|
-▄▄██████████████████████▀------
|
||||||
|
-█████████████████▀█████--------
|
||||||
|
-▀██████████████▀▀-▀█████▄------
|
||||||
|
-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
@ -0,0 +1,61 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<configuration debug="false" xmlns="http://ch.qos.logback/xml/ns/logback"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://ch.qos.logback/xml/ns/logback
|
||||||
|
https://raw.githubusercontent.com/enricopulatzo/logback-XSD/master/src/main/xsd/logback.xsd">
|
||||||
|
|
||||||
|
<appender name="STOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>
|
||||||
|
%cyan([%thread]) %yellow(%-5level) %green(%logger{100}).%boldRed(%method)-%boldMagenta(%line) - %blue(%msg%n)
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- additivity:false 禁止重复打印日志 -->
|
||||||
|
|
||||||
|
<!-- 让SpringBoot内部日志ERROR级别 减少日志输出 -->
|
||||||
|
<logger name="org.springframework" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 让mybatis整合包日志ERROR 减少日志输出 -->
|
||||||
|
<logger name="org.mybatis" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 让ibatis 日志ERROR 减少日志输出 -->
|
||||||
|
<logger name="org.apache.ibatis" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 让 tomcat包打印日志 日志ERROR 减少日志输出 -->
|
||||||
|
<logger name="org.apache" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- 我们自己开发的程序为DEBUG -->
|
||||||
|
<logger name="com.redpig" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
|
||||||
|
<logger name="com.baomidou" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="com.zaxxer" level="ERROR" additivity="false">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- Activiti日志 -->
|
||||||
|
<logger name="org.activiti" level="ERROR" />
|
||||||
|
<logger name="org.activiti.engine.impl.persistence.entity" level="DEBUG" />
|
||||||
|
<logger name="_org.springframework" level="ERROR" />
|
||||||
|
<logger name="springfox.documentation" level="ERROR" />
|
||||||
|
|
||||||
|
<!-- root级别开debug 子目录根据需要关闭 -->
|
||||||
|
<root level="DEBUG">
|
||||||
|
<appender-ref ref="STOUT"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
Loading…
Reference in New Issue