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 5f19867a
authored
Sep 03, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发获取设备上点总个数feign接口
1 parent
0562df1b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
25 deletions
src/main/java/cn/com/glsx/devicemonitor/api/feign/DeviceFeignService.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/GpsBsService.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/DeviceServiceFallbackImpl.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/GpsBsServiceFallbackImpl.java
src/main/java/cn/com/glsx/devicemonitor/api/feign/DeviceFeignService.java
View file @
5f19867
...
...
@@ -38,4 +38,13 @@ public interface DeviceFeignService {
*/
@GetMapping
(
value
=
"/getDeviceStatusBySn"
)
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sn"
)
String
sn
,
Long
offlineTime
);
/**
* 获取设备上点总个数
*
* @param sn 设备号
* @return
*/
@GetMapping
(
value
=
"/getDevicesTotalCount"
)
R
getDevicesTotalCount
(
@RequestParam
(
value
=
"sn"
)
String
sn
);
}
src/main/java/cn/com/glsx/devicemonitor/api/feign/GpsBsService.java
View file @
5f19867
...
...
@@ -35,8 +35,8 @@ public interface GpsBsService {
@GetMapping
(
value
=
"/devicemonitorinfo"
)
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sns"
)
String
sns
,
@NotBlank
(
message
=
"设备编码不能为空"
)
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sns"
)
String
sns
,
@NotBlank
(
message
=
"设备编码不能为空"
)
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
/**
* 通过设备号批量查询 设备位置信息
...
...
@@ -45,7 +45,7 @@ public interface GpsBsService {
* @return
*/
@PostMapping
(
value
=
"/lastgpsbs/batch"
)
public
R
<
List
<
GpsBsData
>>
getLastGpsBsBatch
(
@RequestBody
GpsBsLastBatchRequest
gpsBsLastBatchRequest
);
R
<
List
<
GpsBsData
>>
getLastGpsBsBatch
(
@RequestBody
GpsBsLastBatchRequest
gpsBsLastBatchRequest
);
/**
* 获取单个设备的最新位置和基站数据
...
...
@@ -55,7 +55,7 @@ public interface GpsBsService {
* @return
*/
@GetMapping
(
value
=
"/single"
)
public
R
<
GpsBsData
>
getLastGpsBsBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
R
<
GpsBsData
>
getLastGpsBsBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
/**
* 获取设备的历史轨迹
...
...
@@ -65,6 +65,6 @@ public interface GpsBsService {
* @return
*/
@GetMapping
(
value
=
"/single/history"
)
public
R
<
List
<
GpsLocation
>>
getLastGpsBsHistoryBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
,
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
)
String
endTime
);
R
<
List
<
GpsLocation
>>
getLastGpsBsHistoryBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
,
@RequestParam
(
value
=
"startTime"
)
String
startTime
,
@RequestParam
(
value
=
"endTime"
)
String
endTime
);
}
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/DeviceServiceFallbackImpl.java
View file @
5f19867
...
...
@@ -17,11 +17,19 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
@Override
public
R
<
DeviceDTO
>
getDeviceBySn
(
String
sn
)
{
log
.
info
(
"getDeviceBySn 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
String
sn
,
Long
offlineTime
)
{
log
.
info
(
"getDeviceStatusBySn 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getDevicesTotalCount
(
String
sn
)
{
log
.
info
(
"getDevicesTotalCount 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
}
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/GpsBsServiceFallbackImpl.java
View file @
5f19867
...
...
@@ -33,33 +33,36 @@ import java.util.List;
* @version 1.0.0
* @ClassName GpsBsService.java
* @description: GpsBsService fallback impl
*
* @createTime 2021年05月21日 15:19:00
*/
@Slf4j
@Component
public
class
GpsBsServiceFallbackImpl
implements
GpsBsService
{
@Setter
private
Throwable
cause
;
@Setter
private
Throwable
cause
;
@Override
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
String
sns
,
String
deviceCode
)
{
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
String
sns
,
String
deviceCode
)
{
log
.
info
(
"listDeviceMonitorInfo 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBatch
(
GpsBsLastBatchRequest
gpsBsLastBatchRequest
)
{
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBatch
(
GpsBsLastBatchRequest
gpsBsLastBatchRequest
)
{
log
.
info
(
"getLastGpsBsBatch 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBySn
(
String
sn
,
String
deviceCode
)
{
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBySn
(
String
sn
,
String
deviceCode
)
{
log
.
info
(
"getLastGpsBsBySn 熔断啦==="
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsHistoryBySn
(
String
sn
,
String
deviceCode
,
String
startTime
,
String
endTime
)
{
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsHistoryBySn
(
String
sn
,
String
deviceCode
,
String
startTime
,
String
endTime
)
{
log
.
info
(
"getLastGpsBsHistoryBySn 熔断啦==="
,
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