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 f184bf0c
authored
Jun 13, 2022
by
向延琳
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
电量批量接口
1 parent
421fa7ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
src/main/java/cn/com/glsx/stdinterface/api/BatteryClient.java
src/main/java/cn/com/glsx/stdinterface/fallback/BatteryFallbackImpl.java
src/main/java/cn/com/glsx/stdinterface/api/BatteryClient.java
View file @
f184bf0
...
@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -8,6 +8,9 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Collection
;
import
java.util.List
;
/**
/**
* @author xiangyanlin
* @author xiangyanlin
* @date 2022/4/12
* @date 2022/4/12
...
@@ -31,4 +34,13 @@ public interface BatteryClient {
...
@@ -31,4 +34,13 @@ public interface BatteryClient {
*/
*/
@GetMapping
(
"/queryOneBySn"
)
@GetMapping
(
"/queryOneBySn"
)
R
<
DevicePowerDTO
>
getDevicePowerBySn
(
@RequestParam
(
"sn"
)
String
sn
);
R
<
DevicePowerDTO
>
getDevicePowerBySn
(
@RequestParam
(
"sn"
)
String
sn
);
/**
* 根据设备sn获取设备电量
* @param sn 设备号
* @return 设备电量
*/
@GetMapping
(
"/queryListBySn"
)
R
<
List
<
DevicePowerDTO
>>
getDevicePowerListBySn
(
@RequestParam
(
"sn"
)
Collection
<
String
>
sn
);
}
}
src/main/java/cn/com/glsx/stdinterface/fallback/BatteryFallbackImpl.java
View file @
f184bf0
...
@@ -7,6 +7,9 @@ import lombok.Setter;
...
@@ -7,6 +7,9 @@ import lombok.Setter;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Collection
;
import
java.util.List
;
/**
/**
* @author xiangyanlin
* @author xiangyanlin
* @date 2022/4/12
* @date 2022/4/12
...
@@ -29,4 +32,10 @@ public class BatteryFallbackImpl implements BatteryClient {
...
@@ -29,4 +32,10 @@ public class BatteryFallbackImpl implements BatteryClient {
log
.
warn
(
"getDevicePowerBySn 熔断啦 {}"
,
cause
.
getMessage
());
log
.
warn
(
"getDevicePowerBySn 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
return
R
.
ok
(
"服务异常"
);
}
}
@Override
public
R
<
List
<
DevicePowerDTO
>>
getDevicePowerListBySn
(
Collection
<
String
>
sn
)
{
log
.
warn
(
"getDevicePowerListBySn 熔断啦 {}"
,
cause
.
getMessage
());
return
R
.
ok
(
"服务异常"
);
}
}
}
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