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 b1cd38ac
authored
Sep 10, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
打印错误提示,增加类型
1 parent
649a4130
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 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 @
b1cd38a
...
...
@@ -5,6 +5,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.DeviceStatusModel;
import
cn.com.glsx.devicemonitor.api.feign.factory.DeviceServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
...
@@ -26,7 +27,7 @@ public interface DeviceFeignService {
* @param sn
* @return
*/
@GetMapping
(
value
=
"/getDeviceBySn"
)
@GetMapping
(
value
=
"/getDeviceBySn"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
DeviceDTO
>
getDeviceBySn
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sn"
)
String
sn
);
/**
...
...
@@ -36,7 +37,7 @@ public interface DeviceFeignService {
* @param offlineTime
* @return
*/
@GetMapping
(
value
=
"/getDeviceStatusBySn"
)
@GetMapping
(
value
=
"/getDeviceStatusBySn"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sn"
)
String
sn
,
Long
offlineTime
);
/**
...
...
@@ -45,6 +46,6 @@ public interface DeviceFeignService {
* @param sn 设备号
* @return
*/
@GetMapping
(
value
=
"/getDevicesTotalCount"
)
@GetMapping
(
value
=
"/getDevicesTotalCount"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
getDevicesTotalCount
(
@RequestParam
(
value
=
"sn"
)
String
sn
);
}
src/main/java/cn/com/glsx/devicemonitor/api/feign/GpsBsService.java
View file @
b1cd38a
...
...
@@ -7,6 +7,7 @@ import cn.com.glsx.devicemonitor.api.dto.response.GpsLocation;
import
cn.com.glsx.devicemonitor.api.feign.factory.GpsBsServiceFallbackFactory
;
import
com.glsx.plat.core.web.R
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
...
@@ -34,7 +35,7 @@ import java.util.List;
public
interface
GpsBsService
{
@GetMapping
(
value
=
"/devicemonitorinfo"
)
@GetMapping
(
value
=
"/devicemonitorinfo"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
@NotBlank
(
message
=
"设备号不能为空"
)
@RequestParam
(
value
=
"sns"
)
String
sns
,
@NotBlank
(
message
=
"设备编码不能为空"
)
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
...
...
@@ -44,7 +45,7 @@ public interface GpsBsService {
* @param gpsBsLastBatchRequest
* @return
*/
@PostMapping
(
value
=
"/lastgpsbs/batch"
)
@PostMapping
(
value
=
"/lastgpsbs/batch"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
List
<
GpsBsData
>>
getLastGpsBsBatch
(
@RequestBody
GpsBsLastBatchRequest
gpsBsLastBatchRequest
);
/**
...
...
@@ -54,7 +55,7 @@ public interface GpsBsService {
* @param deviceCode
* @return
*/
@GetMapping
(
value
=
"/single"
)
@GetMapping
(
value
=
"/single"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
R
<
GpsBsData
>
getLastGpsBsBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
);
/**
...
...
@@ -64,7 +65,7 @@ public interface GpsBsService {
* @param deviceCode
* @return
*/
@GetMapping
(
value
=
"/single/history"
)
@GetMapping
(
value
=
"/single/history"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
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 @
b1cd38a
...
...
@@ -17,19 +17,19 @@ public class DeviceServiceFallbackImpl implements DeviceFeignService {
@Override
public
R
<
DeviceDTO
>
getDeviceBySn
(
String
sn
)
{
log
.
info
(
"getDeviceBySn 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"getDeviceBySn 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
<
DeviceStatusModel
>
getDeviceStatusBySn
(
String
sn
,
Long
offlineTime
)
{
log
.
info
(
"getDeviceStatusBySn 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"getDeviceStatusBySn 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getDevicesTotalCount
(
String
sn
)
{
log
.
info
(
"getDevicesTotalCount 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"getDevicesTotalCount 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
}
src/main/java/cn/com/glsx/devicemonitor/api/feign/fallback/GpsBsServiceFallbackImpl.java
View file @
b1cd38a
...
...
@@ -44,25 +44,25 @@ public class GpsBsServiceFallbackImpl implements GpsBsService {
@Override
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo
(
String
sns
,
String
deviceCode
)
{
log
.
info
(
"listDeviceMonitorInfo 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"listDeviceMonitorInfo 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBatch
(
GpsBsLastBatchRequest
gpsBsLastBatchRequest
)
{
log
.
info
(
"getLastGpsBsBatch 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"getLastGpsBsBatch 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsBySn
(
String
sn
,
String
deviceCode
)
{
log
.
info
(
"getLastGpsBsBySn 熔断啦==="
,
cause
.
getMessage
());
log
.
info
(
"getLastGpsBsBySn 熔断啦===
{}
"
,
cause
.
getMessage
());
return
R
.
ok
(
"无数据"
);
}
@Override
public
R
getLastGpsBsHistoryBySn
(
String
sn
,
String
deviceCode
,
String
startTime
,
String
endTime
)
{
log
.
info
(
"getLastGpsBsHistoryBySn 熔断啦==="
,
cause
.
getMessage
());
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