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
dd3478d1
Commit
dd3478d1
authored
Apr 26, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.0
parent
4f29e256
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
api-server/src/main/java/com/zq/api/ApiApplication.java
+2
-0
api-server/src/main/java/com/zq/api/config/FeignConfig.java
+4
-0
api-server/src/main/java/com/zq/api/task/ConfigTask.java
+18
-0
No files found.
api-server/src/main/java/com/zq/api/ApiApplication.java
View file @
dd3478d1
...
@@ -10,8 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
...
@@ -10,8 +10,10 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@EnableAsync
@EnableAsync
@EnableScheduling
@EnableFeignClients
@EnableFeignClients
@MapperScan
(
"com.zq.api.dao"
)
@MapperScan
(
"com.zq.api.dao"
)
@EnableDiscoveryClient
@EnableDiscoveryClient
...
...
api-server/src/main/java/com/zq/api/config/FeignConfig.java
View file @
dd3478d1
...
@@ -28,6 +28,10 @@ public class FeignConfig {
...
@@ -28,6 +28,10 @@ public class FeignConfig {
if
(
headerNames
!=
null
)
{
if
(
headerNames
!=
null
)
{
while
(
headerNames
.
hasMoreElements
())
{
while
(
headerNames
.
hasMoreElements
())
{
String
name
=
headerNames
.
nextElement
();
String
name
=
headerNames
.
nextElement
();
// 跳过content-length
if
(
name
.
equals
(
"content-length"
))
{
continue
;
}
String
values
=
request
.
getHeader
(
name
);
String
values
=
request
.
getHeader
(
name
);
template
.
header
(
name
,
values
);
template
.
header
(
name
,
values
);
}
}
...
...
api-server/src/main/java/com/zq/api/task/ConfigTask.java
0 → 100644
View file @
dd3478d1
package
com
.
zq
.
api
.
task
;
import
com.zq.api.config.ConfigCache
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
@Component
@RequiredArgsConstructor
public
class
ConfigTask
{
@Scheduled
(
cron
=
"0/5 * * * * ?"
)
public
void
updateConfig
()
{
ConfigCache
.
init
();
}
}
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