Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
guns1.1
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李庆科
guns1.1
Commits
98758caf
Commit
98758caf
authored
May 27, 2026
by
李庆科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:微服务版,提交
parent
0c7c7bb5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
21 deletions
+108
-21
pom.xml
guns-main-project/pom.xml
+39
-7
ProjectStartApplication.java
.../main/java/cn/stylefeng/guns/ProjectStartApplication.java
+10
-1
application-dev.yml
guns-main-project/src/main/resources/application-dev.yml
+18
-7
application-local.yml
guns-main-project/src/main/resources/application-local.yml
+24
-6
application-prod.yml
guns-main-project/src/main/resources/application-prod.yml
+17
-0
No files found.
guns-main-project/pom.xml
View file @
98758caf
...
@@ -15,6 +15,22 @@
...
@@ -15,6 +15,22 @@
<packaging>
jar
</packaging>
<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>
<dependencies>
<!--企业版功能-->
<!--企业版功能-->
...
@@ -45,13 +61,6 @@
...
@@ -45,13 +61,6 @@
<version>
${roses.kernel.version}
</version>
<version>
${roses.kernel.version}
</version>
</dependency>
</dependency>
<!--缓存,默认增加内存缓存-->
<dependency>
<groupId>
com.javaguns.roses
</groupId>
<artifactId>
cache-spring-boot-starter-memory
</artifactId>
<version>
${roses.kernel.version}
</version>
</dependency>
<!--数据库驱动,可根据自己需要自行删减-->
<!--数据库驱动,可根据自己需要自行删减-->
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
...
@@ -72,6 +81,29 @@
...
@@ -72,6 +81,29 @@
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
</dependency>
</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>
</dependencies>
<build>
<build>
...
...
guns-main-project/src/main/java/cn/stylefeng/guns/ProjectStartApplication.java
View file @
98758caf
...
@@ -4,9 +4,18 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -4,9 +4,18 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
;
import
org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
@Slf4j
@Slf4j
@SpringBootApplication
(
scanBasePackages
=
{
"cn.stylefeng"
},
exclude
=
{
FlywayAutoConfiguration
.
class
})
@EnableDiscoveryClient
@EnableFeignClients
(
basePackages
=
{
"cn.stylefeng"
})
@SpringBootApplication
(
scanBasePackages
=
{
"cn.stylefeng"
},
exclude
=
{
FlywayAutoConfiguration
.
class
}
)
public
class
ProjectStartApplication
{
public
class
ProjectStartApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
guns-main-project/src/main/resources/application-dev.yml
View file @
98758caf
...
@@ -5,15 +5,27 @@ server:
...
@@ -5,15 +5,27 @@ server:
spring
:
spring
:
datasource
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://
192.168.31.180:3306/guns_paperles
s?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
url
:
jdbc:mysql://
localhost:3306/gun
s?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true&allowMultiQueries=true
username
:
root
username
:
root
password
:
"
Aa123456!"
password
:
123456
# 连接池大小根据实际情况调整
# 连接池大小根据实际情况调整
max-active
:
100
max-active
:
100
max-pool-prepared-statement-per-connection-size
:
100
max-pool-prepared-statement-per-connection-size
:
100
devops
:
# feign远程调用配置
serverHost
:
https://gunsdev.com/api
feign
:
project-unique-code
:
lieGWtTqjD4af9iANmte0y09mIC90dQ9
client
:
project-interaction-secret-key
:
7DzPxnUBiRRJogRdgUfuAyfq87UcChlf
config
:
\ No newline at end of file
default
:
loggerLevel
:
basic
connectTimeout
:
500
readTimeout
:
5000
# eureka配置
eureka
:
client
:
service-url
:
defaultZone
:
http://localhost:9991/eureka/
instance
:
prefer-ip-address
:
true
guns-main-project/src/main/resources/application-local.yml
View file @
98758caf
# Mysql数据库
# Mysql数据库
spring
:
spring
:
application
:
name
:
guns-service
datasource
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
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
username
:
root
password
:
123456
password
:
123456
...
@@ -10,7 +13,23 @@ spring:
...
@@ -10,7 +13,23 @@ spring:
maxActive
:
100
maxActive
:
100
maxPoolPreparedStatementPerConnectionSize
:
100
maxPoolPreparedStatementPerConnectionSize
:
100
devops
:
# feign远程调用配置
serverHost
:
https://gunsdev.com/api
feign
:
project-unique-code
:
lieGWtTqjD4af9iANmte0y09mIC90dQ9
client
:
project-interaction-secret-key
:
7DzPxnUBiRRJogRdgUfuAyfq87UcChlf
config
:
\ No newline at end of file
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
guns-main-project/src/main/resources/application-prod.yml
View file @
98758caf
...
@@ -9,3 +9,20 @@ spring:
...
@@ -9,3 +9,20 @@ spring:
# 连接池大小根据实际情况调整
# 连接池大小根据实际情况调整
maxActive
:
100
maxActive
:
100
maxPoolPreparedStatementPerConnectionSize
:
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment