Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dict
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
陈洁
dict
Commits
4d33d54a
Commit
4d33d54a
authored
Nov 20, 2018
by
yong.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update feign code
parent
77cd8dc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
feign-client/src/main/java/com/freemud/feign/IDictFeignService.java
+16
-1
feign-client/src/main/resources/application.yml
+8
-1
No files found.
feign-client/src/main/java/com/freemud/feign/IDictFeignService.java
View file @
4d33d54a
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @Date: 2018/11/20 10:04
* @Date: 2018/11/20 10:04
* @Description:
* @Description:
*/
*/
@FeignClient
(
name
=
"dictionary"
,
path
=
"/dict"
)
@FeignClient
(
name
=
"dictionary"
,
path
=
"/dict"
,
fallback
=
IDictFeignServiceFallback
.
class
)
public
interface
IDictFeignService
{
public
interface
IDictFeignService
{
@GetMapping
(
value
=
"/dictDatas/{dictTypeCd}"
)
@GetMapping
(
value
=
"/dictDatas/{dictTypeCd}"
)
...
@@ -22,3 +22,18 @@ public interface IDictFeignService {
...
@@ -22,3 +22,18 @@ public interface IDictFeignService {
@GetMapping
(
value
=
"/dictData/{dictTypeCd}/{dictCd}"
)
@GetMapping
(
value
=
"/dictData/{dictTypeCd}/{dictCd}"
)
ResDto
<
DictDataDto
>
dictData
(
@RequestParam
(
"dictTypeCd"
)
String
dictTypeCd
,
@RequestParam
(
"dictCd"
)
String
dictCd
);
ResDto
<
DictDataDto
>
dictData
(
@RequestParam
(
"dictTypeCd"
)
String
dictTypeCd
,
@RequestParam
(
"dictCd"
)
String
dictCd
);
}
}
@Component
class
IDictFeignServiceFallback
implements
IDictFeignService
{
@Override
public
ResDto
dictDatas
(
String
dictTypeCd
)
{
return
new
ResDto
();
}
@Override
public
ResDto
<
DictDataDto
>
dictData
(
String
dictTypeCd
,
String
dictCd
)
{
DictDataDto
dictDataDto
=
new
DictDataDto
();
return
new
ResDto
<>(
dictDataDto
);
}
}
feign-client/src/main/resources/application.yml
View file @
4d33d54a
...
@@ -20,6 +20,13 @@ eureka:
...
@@ -20,6 +20,13 @@ eureka:
serviceUrl
:
serviceUrl
:
defaultZone
:
http://localhost:8761/eureka/
defaultZone
:
http://localhost:8761/eureka/
feign
:
hystrix
:
enabled
:
true
hystrix
:
threadpool
:
default
:
coreSize
:
100
#并发执行的最大线程数,默认10
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