Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-devicemonitor
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 b84f8fc5
authored
Sep 13, 2021
by
黄小葱
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改响应格式 swagger2
1 parent
0c529a61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
10 deletions
src/main/java/cn/com/glsx/Application.java
src/main/java/cn/com/glsx/devicemonitor/modules/api/DeviceApiController.java
src/main/java/cn/com/glsx/devicemonitor/modules/api/GpsBsApiController.java
src/main/java/cn/com/glsx/Application.java
View file @
b84f8fc
...
...
@@ -22,7 +22,6 @@ import static java.util.TimeZone.getTimeZone;
*/
@EnableRestAdmin
@EnableDiscoveryClient
@EnableFeignClients
(
basePackages
=
{
"cn.com.glsx.*.api"
})
@EnableTransactionManagement
@EnableMBeanExport
(
registration
=
RegistrationPolicy
.
IGNORE_EXISTING
)
@SpringBootApplication
(
scanBasePackages
=
{
"cn.com.glsx.*"
})
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/api/DeviceApiController.java
View file @
b84f8fc
...
...
@@ -37,7 +37,7 @@ public class DeviceApiController implements DeviceFeignService {
* @return
*/
@Override
@GetMapping
(
value
=
"/getDeviceBySn"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/getDeviceBySn"
)
public
R
getDeviceBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
)
{
DeviceDTO
deviceDTO
=
deviceService
.
getDeviceDTOBySn
(
sn
);
return
R
.
ok
().
data
(
deviceDTO
);
...
...
@@ -52,7 +52,7 @@ public class DeviceApiController implements DeviceFeignService {
* @return
*/
@Override
@GetMapping
(
value
=
"/getDeviceStatusBySn"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/getDeviceStatusBySn"
)
public
R
getDeviceStatusBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"offlineTime"
,
required
=
false
)
Long
offlineTime
)
{
if
(
offlineTime
==
null
||
offlineTime
==
0
)
{
offlineTime
=
ConstantsDevice
.
OFFLINE_TIME_OTHER
;
...
...
@@ -69,7 +69,7 @@ public class DeviceApiController implements DeviceFeignService {
* @return
*/
@Override
@GetMapping
(
value
=
"/getDevicesTotalCount"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/getDevicesTotalCount"
)
@SysLog
(
value
=
"获取设备上点总个数"
,
action
=
OperateType
.
QUERY
)
public
R
getDevicesTotalCount
(
@RequestParam
(
value
=
"sn"
)
String
sn
)
{
log
.
info
(
"开始查询设备上点总个数"
);
...
...
src/main/java/cn/com/glsx/devicemonitor/modules/api/GpsBsApiController.java
View file @
b84f8fc
...
...
@@ -50,7 +50,7 @@ public class GpsBsApiController implements GpsBsService {
* @return
*/
@Override
@PostMapping
(
value
=
"/lastgpsbs/batch"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@PostMapping
(
value
=
"/lastgpsbs/batch"
)
public
R
getLastGpsBsBatch
(
@RequestBody
GpsBsLastBatchRequest
gpsBsLastBatchRequest
)
{
if
(!
gpsBsLastBatchRequest
.
getDeviceTypeRelationEnum
().
getBizDeviceType
().
equals
(
DeviceTypeRelationEnum
.
GPS
.
getBizDeviceType
()))
{
return
R
.
error
(
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getCode
(),
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getMessage
());
...
...
@@ -66,7 +66,7 @@ public class GpsBsApiController implements GpsBsService {
* @return
*/
@Override
@GetMapping
(
value
=
"/single"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/single"
)
public
R
getLastGpsBsBySn
(
@RequestParam
(
value
=
"sn"
)
String
sn
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
)
{
if
(!
DeviceTypeRelationEnum
.
findByDeviceCode
(
deviceCode
).
equals
(
DeviceTypeRelationEnum
.
GPS
))
{
return
R
.
error
(
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getCode
(),
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getMessage
());
...
...
@@ -81,7 +81,7 @@ public class GpsBsApiController implements GpsBsService {
* @return
*/
@Override
@GetMapping
(
value
=
"/single/history"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/single/history"
)
public
R
getLastGpsBsHistoryBySn
(
@RequestBody
LocationHistoryRequest
request
)
{
if
(!
DeviceTypeRelationEnum
.
GPS
.
equals
(
DeviceTypeRelationEnum
.
findByDeviceCode
(
request
.
getDeviceCode
())))
{
return
R
.
error
(
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getCode
(),
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getMessage
());
...
...
@@ -98,7 +98,7 @@ public class GpsBsApiController implements GpsBsService {
*/
@Override
@ApiOperation
(
value
=
"车辆监控信息"
)
@GetMapping
(
value
=
"/devicemonitorinfo"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/devicemonitorinfo"
)
public
R
listDeviceMonitorInfo
(
@RequestParam
(
value
=
"sns"
)
String
sns
,
@RequestParam
(
value
=
"deviceCode"
)
String
deviceCode
)
{
if
(!
DeviceTypeRelationEnum
.
findByDeviceCode
(
deviceCode
).
equals
(
DeviceTypeRelationEnum
.
GPS
))
{
return
R
.
error
(
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getCode
(),
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getMessage
());
...
...
@@ -115,9 +115,9 @@ public class GpsBsApiController implements GpsBsService {
* @return
*/
@ApiOperation
(
value
=
"车辆监控信息"
)
@GetMapping
(
value
=
"/devicemonitorinfo2"
,
consumes
=
MediaType
.
APPLICATION_JSON_VALUE
)
@GetMapping
(
value
=
"/devicemonitorinfo2"
)
@Override
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo2
(
@RequestBody
DeviceLocationRequest
request
)
{
public
R
<
List
<
DeviceLocationBo
>>
listDeviceMonitorInfo2
(
DeviceLocationRequest
request
)
{
if
(!
DeviceTypeRelationEnum
.
findByDeviceCode
(
request
.
getDeviceCode
()).
equals
(
DeviceTypeRelationEnum
.
GPS
))
{
return
R
.
error
(
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getCode
(),
BussinessExceptionEnum
.
UNSUPORT_DEVICE
.
getMessage
());
}
...
...
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