Commit 98758caf authored by 李庆科's avatar 李庆科

feat:微服务版,提交

parent 0c7c7bb5
......@@ -15,6 +15,22 @@
<packaging>jar</packaging>
<properties>
<spring-cloud.version>2023.0.3</spring-cloud.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!--企业版功能-->
......@@ -45,13 +61,6 @@
<version>${roses.kernel.version}</version>
</dependency>
<!--缓存,默认增加内存缓存-->
<dependency>
<groupId>com.javaguns.roses</groupId>
<artifactId>cache-spring-boot-starter-memory</artifactId>
<version>${roses.kernel.version}</version>
</dependency>
<!--数据库驱动,可根据自己需要自行删减-->
<dependency>
<groupId>mysql</groupId>
......@@ -72,6 +81,29 @@
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<!--缓存实现(内存缓存,供 system-spring-boot-starter 使用)-->
<dependency>
<groupId>com.javaguns.roses</groupId>
<artifactId>cache-spring-boot-starter-memory</artifactId>
<version>${roses.kernel.version}</version>
</dependency>
<!-- 服务注册发现 (Eureka Client) -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- 服务调用 (OpenFeign) -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!-- 负载均衡 (Spring Cloud 2021+需要单独引入) -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
</dependencies>
<build>
......
......@@ -4,9 +4,18 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
@Slf4j
@SpringBootApplication(scanBasePackages = {"cn.stylefeng"}, exclude = {FlywayAutoConfiguration.class})
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"cn.stylefeng"})
@SpringBootApplication(
scanBasePackages = {"cn.stylefeng"},
exclude = {
FlywayAutoConfiguration.class
}
)
public class ProjectStartApplication {
public static void main(String[] args) {
......
......@@ -5,15 +5,27 @@ server:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.31.180:3306/guns_paperless?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
url: jdbc:mysql://localhost:3306/guns?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: "Aa123456!"
password: 123456
# 连接池大小根据实际情况调整
max-active: 100
max-pool-prepared-statement-per-connection-size: 100
devops:
serverHost: https://gunsdev.com/api
project-unique-code: lieGWtTqjD4af9iANmte0y09mIC90dQ9
project-interaction-secret-key: 7DzPxnUBiRRJogRdgUfuAyfq87UcChlf
\ No newline at end of file
# feign远程调用配置
feign:
client:
config:
default:
loggerLevel: basic
connectTimeout: 500
readTimeout: 5000
# eureka配置
eureka:
client:
service-url:
defaultZone: http://localhost:9991/eureka/
instance:
prefer-ip-address: true
# Mysql数据库
spring:
application:
name: guns-service
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/guns_paperless?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
url: jdbc:mysql://localhost:3306/guns?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
password: 123456
......@@ -10,7 +13,23 @@ spring:
maxActive: 100
maxPoolPreparedStatementPerConnectionSize: 100
devops:
serverHost: https://gunsdev.com/api
project-unique-code: lieGWtTqjD4af9iANmte0y09mIC90dQ9
project-interaction-secret-key: 7DzPxnUBiRRJogRdgUfuAyfq87UcChlf
\ No newline at end of file
# feign远程调用配置
feign:
client:
config:
default:
loggerLevel: full
connectTimeout: 500
readTimeout: 5000
httpclient:
enabled: true
max-connections: 200
max-connections-per-route: 50
# eureka配置
eureka:
client:
service-url:
defaultZone: http://localhost:9991/eureka/
instance:
prefer-ip-address: true
......@@ -9,3 +9,20 @@ spring:
# 连接池大小根据实际情况调整
maxActive: 100
maxPoolPreparedStatementPerConnectionSize: 100
# feign远程调用配置
feign:
client:
config:
default:
loggerLevel: basic
connectTimeout: 500
readTimeout: 5000
# eureka配置
eureka:
client:
service-url:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:9991/eureka/}
instance:
prefer-ip-address: true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment