Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
cloud-backend
Commits
07802ff2
Commit
07802ff2
authored
Aug 05, 2023
by
wilmiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.0
parent
edb57498
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
65 additions
and
37 deletions
+65
-37
admin-server/src/main/resources/bootstrap.yml
+13
-4
api-server/src/main/resources/bootstrap.yml
+9
-6
config-server/src/main/resources/application.yml
+3
-4
eureka-server/src/main/resources/bootstrap.yml
+6
-6
file-server/src/main/java/com/zq/file/controller/FileController.java
+4
-1
file-server/src/main/java/com/zq/file/utils/UploadUtils.java
+3
-1
file-server/src/main/resources/bootstrap.yml
+6
-4
gateway-server/src/main/resources/application.yml
+5
-3
gateway-server/src/main/resources/bootstrap.yml
+3
-4
user-server/src/main/resources/bootstrap.yml
+13
-4
No files found.
admin-server/src/main/resources/bootstrap.yml
View file @
07802ff2
...
...
@@ -14,12 +14,21 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
feign
:
client
:
config
:
default
:
connect-timeout
:
2000
#连接超时时间
read-timeout
:
10000
#读超时时间
ribbon
:
# ribbon服务列表刷新间隔(单位ms)
ServerListRefreshInterval
:
2000
api-server/src/main/resources/bootstrap.yml
View file @
07802ff2
...
...
@@ -14,12 +14,11 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
...
...
@@ -27,5 +26,9 @@ feign:
client
:
config
:
default
:
connectTimeout
:
5000
#连接超时时间
readTimeout
:
10000
#读超时时间
connect-timeout
:
2000
#连接超时时间
read-timeout
:
10000
#读超时时间
ribbon
:
# ribbon服务列表刷新间隔(单位ms)
ServerListRefreshInterval
:
2000
config-server/src/main/resources/application.yml
View file @
07802ff2
...
...
@@ -22,12 +22,11 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
...
...
eureka-server/src/main/resources/
application
.yml
→
eureka-server/src/main/resources/
bootstrap
.yml
View file @
07802ff2
...
...
@@ -6,8 +6,8 @@ spring:
security
:
user
:
name
:
admin
password
:
123456
eureka
:
password
:
GXfy2021
eureka
:
# 相关文章:https://blog.csdn.net/weixin_49149614/article/details/121059046
instance
:
#设置使用IP注册就会优先使用IP,hostname则无效
prefer-ip-address
:
true
...
...
@@ -17,10 +17,10 @@ eureka:
enable-self-preservation
:
false
# 主动检测失效间隔,配置成3秒,默认60000
eviction-interval-timer-in-ms
:
3000
#
禁用use-read-only-response-cache只读缓存或者减少response-cache-update-interval-ms更新缓存的时间间隔都可以更快的同步实例信息
# use-read-only-response-cache: false
#
减少readWrite 和 readOnly 同步时间间隔。
response-cache-update-interval-ms
:
3000
#
拉取服务的时候,不从ReadOnlyCacheMap里查,直接从ReadWriteCacheMap取。
use-read-only-response-cache
:
false
# 关闭从ReadOnlyCacheMap拉取数据。
#
缩短ReadWriteCacheMap向ReadOnlyCacheMap同步的时间间隔,默认30秒
response-cache-update-interval-ms
:
3000
# 减少readWrite 和 readOnly 同步时间间隔。readWrite更新到readOnly
client
:
# 表示是否将自己注册到Eureka Server,默认为true。
register-with-eureka
:
false
...
...
file-server/src/main/java/com/zq/file/controller/FileController.java
View file @
07802ff2
package
com
.
zq
.
file
.
controller
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.UploadUtils
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.common.vo.UploadVo
;
import
com.zq.file.utils.UploadUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
...
...
@@ -11,6 +11,9 @@ import org.slf4j.LoggerFactory;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author wilmiam
*/
@Api
(
tags
=
"上传相关"
)
@RestController
@RequestMapping
(
"/file"
)
...
...
xxx-common-utils/src/main/java/com/zq/common
/utils/UploadUtils.java
→
file-server/src/main/java/com/zq/file
/utils/UploadUtils.java
View file @
07802ff2
package
com
.
zq
.
common
.
utils
;
package
com
.
zq
.
file
.
utils
;
import
com.zq.common.exception.BusinessException
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.utils.UuidUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.FileUtils
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
file-server/src/main/resources/bootstrap.yml
View file @
07802ff2
...
...
@@ -14,12 +14,14 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
ribbon
:
# ribbon服务列表刷新间隔(单位ms)
ServerListRefreshInterval
:
2000
gateway-server/src/main/resources/application.yml
View file @
07802ff2
...
...
@@ -5,19 +5,21 @@ spring:
name
:
GATEWAY-SERVER
cloud
:
gateway
:
default-filters
:
default-filters
:
# 剔除响应头中重复的值 RETAIN_FIRST:只保留第一个 RETAIN_LAST:保留最后一个 RETAIN_UNIQUE:去除重复
-
DedupeResponseHeader=Access-Control-Allow-Origin, RETAIN_UNIQUE
discovery
:
locator
:
enabled
:
true
lower-case-service-id
:
true
globalcors
:
cors-configurations
:
'
[/**]'
:
#这里有个allowCredentials: true这个东西是设置允许访问携带cookie的,这点一定要和前端对应!
allowCredentials
:
true
#可以填写多个域名用","隔开 例如:"http://www.xiaolc.cn,https://spring.io" "*"代表允许所有
allowedOriginPatterns
:
"
*"
allowedMethods
:
"
PUT,
POST,
GET,
OPTIONS,
DELETE"
allowedHeaders
:
"
*"
maxAge
:
3600
allowedMethods
:
"
GET,
POST,
DELETE,
PUT,
OPTIONS"
routes
:
-
id
:
api
uri
:
lb://API-SERVER
...
...
gateway-server/src/main/resources/bootstrap.yml
View file @
07802ff2
...
...
@@ -14,12 +14,11 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
user-server/src/main/resources/bootstrap.yml
View file @
07802ff2
...
...
@@ -14,12 +14,21 @@ spring:
eureka
:
instance
:
prefer-ip-address
:
true
lease-renewal-interval-in-seconds
:
5
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
15
#告诉服务端多少秒没收到心跳将我踢出掉。
lease-renewal-interval-in-seconds
:
2
#向服务端发送心跳间隔
lease-expiration-duration-in-seconds
:
6
#告诉服务端多少秒没收到心跳将我踢出掉
instance-id
:
${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client
:
# 客户端拉取readOnly缓存的时间间隔,默认是30s
registry-fetch-interval-seconds
:
3
# 拉取注册表信息间隔时间
registry-fetch-interval-seconds
:
2
#从服务端注册表中获取注册信息的时间间隔
serviceUrl
:
defaultZone
:
@
register.url@
feign
:
client
:
config
:
default
:
connect-timeout
:
2000
#连接超时时间
read-timeout
:
10000
#读超时时间
ribbon
:
# ribbon服务列表刷新间隔(单位ms)
ServerListRefreshInterval
:
2000
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