Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 41be91ae
authored
Oct 19, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
行程油耗等
1 parent
2e0f353f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletions
src/main/java/cn/com/glsx/stdinterface/factory/RouteOilMileageFallbackFactory.java
src/main/java/cn/com/glsx/stdinterface/fallback/RouteOilMileageFallbackImpl.java
src/main/resources/META-INF/spring.factories
src/main/java/cn/com/glsx/stdinterface/factory/RouteOilMileageFallbackFactory.java
0 → 100644
View file @
41be91a
package
cn
.
com
.
glsx
.
stdinterface
.
factory
;
import
cn.com.glsx.stdinterface.api.RouteOilMileageClient
;
import
cn.com.glsx.stdinterface.fallback.RouteOilMileageFallbackImpl
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.stereotype.Component
;
@Component
public
class
RouteOilMileageFallbackFactory
implements
FallbackFactory
<
RouteOilMileageClient
>
{
@Override
public
RouteOilMileageClient
create
(
Throwable
throwable
)
{
RouteOilMileageFallbackImpl
fallback
=
new
RouteOilMileageFallbackImpl
();
fallback
.
setCause
(
throwable
);
return
fallback
;
}
}
src/main/java/cn/com/glsx/stdinterface/fallback/RouteOilMileageFallbackImpl.java
0 → 100644
View file @
41be91a
package
cn
.
com
.
glsx
.
stdinterface
.
fallback
;
import
cn.com.glsx.stdinterface.api.RouteOilMileageClient
;
import
cn.com.glsx.stdinterface.dto.RouteOilMileageDto
;
import
com.glsx.plat.core.web.R
;
import
lombok.Setter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
import
java.util.List
;
@Slf4j
@Component
public
class
RouteOilMileageFallbackImpl
implements
RouteOilMileageClient
{
@Setter
private
Throwable
cause
;
@Override
public
R
<
List
<
RouteOilMileageDto
>>
getListBySn
(
String
sn
,
String
beginTime
,
String
endTime
)
{
log
.
warn
(
"getListBySn 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
@Override
public
R
<
Integer
>
insert
(
RouteOilMileageDto
routeOilMileageDto
)
{
log
.
warn
(
"insert 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
@Override
public
R
<
Integer
>
storeIgnoreExists
(
Collection
<
RouteOilMileageDto
>
collection
)
{
log
.
warn
(
"storeIgnoreExists 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
}
src/main/resources/META-INF/spring.factories
View file @
41be91a
...
@@ -6,4 +6,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
...
@@ -6,4 +6,5 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
cn.com.glsx.stdinterface.factory.ElectricFenceFallbackFactory,\
cn.com.glsx.stdinterface.factory.ElectricFenceFallbackFactory,\
cn.com.glsx.stdinterface.fallback.ElectricFenceFallbackImpl,\
cn.com.glsx.stdinterface.fallback.ElectricFenceFallbackImpl,\
cn.com.glsx.stdinterface.factory.ElectricInStoreFallbackFactory,\
cn.com.glsx.stdinterface.factory.ElectricInStoreFallbackFactory,\
cn.com.glsx.stdinterface.fallback.ElectricInStoreFallbackImpl
cn.com.glsx.stdinterface.fallback.ElectricInStoreFallbackImpl,\
cn.com.glsx.stdinterface.fallback.RouteOilMileageFallbackImpl
Write
Preview
Markdown
is supported
Attach a file
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 post a comment