Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor-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 4a3f1e71
authored
Sep 14, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增批量查询设备状态接口
1 parent
775697b4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
src/main/java/cn/com/glsx/devicemonitor/api/feign/DeviceFeignService.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/DeviceServiceFallbackImpl.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/DeviceFeignService.java
View file @
4a3f1e7
...
@@ -6,8 +6,12 @@ import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory;
...
@@ -6,8 +6,12 @@ import cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory;
import
com.glsx.plat.core.web.R
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
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
;
/**
/**
* 设备查询相关服务
* 设备查询相关服务
...
@@ -39,6 +43,14 @@ public interface DeviceFeignService {
...
@@ -39,6 +43,14 @@ public interface DeviceFeignService {
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
Long
offlineTime
);
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
Long
offlineTime
);
/**
/**
* 批量获取设备状态
* @param sns
* @param offlineTime
* @return
*/
@PostMapping
(
value
=
"listDeviceStatusBySns"
)
R
<
List
<
DeviceStatusModel
>>
listDeviceStatusBySns
(
@RequestParam
(
value
=
"sns"
)
Collection
<
String
>
sns
,
Long
offlineTime
);
/**
* 获取设备上点总个数
* 获取设备上点总个数
*
*
* @param sn 设备号
* @param sn 设备号
...
...
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/DeviceServiceFallbackImpl.java
View file @
4a3f1e7
...
@@ -8,6 +8,9 @@ import lombok.Setter;
...
@@ -8,6 +8,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
;
@Slf4j
@Slf4j
@Component
@Component
public
class
DeviceServiceFallbackImpl
implements
DeviceFeignService
{
public
class
DeviceServiceFallbackImpl
implements
DeviceFeignService
{
...
@@ -28,6 +31,12 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
...
@@ -28,6 +31,12 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
}
}
@Override
@Override
public
R
<
List
<
DeviceStatusModel
>>
listDeviceStatusBySns
(
Collection
<
String
>
sns
,
Long
offlineTime
)
{
log
.
info
(
"listDeviceStatusBySns 熔断啦==={}"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getDevicesTotalCount
(
String
sn
)
{
public
R
getDevicesTotalCount
(
String
sn
)
{
log
.
info
(
"getDevicesTotalCount 熔断啦==={}"
,
cause
.
getMessage
());
log
.
info
(
"getDevicesTotalCount 熔断啦==={}"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
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