Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
373ecf52
Commit
373ecf52
authored
May 31, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改设备新增等
parent
a3b22133
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
42 deletions
+40
-42
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
...n/java/com/mortals/xhx/busiz/web/DeviceApiController.java
+1
-3
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+2
-2
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
.../java/com/mortals/httpclient/device/DeviceController.http
+37
-37
No files found.
device-manager/src/main/java/com/mortals/xhx/busiz/web/DeviceApiController.java
View file @
373ecf52
...
...
@@ -298,9 +298,7 @@ public class DeviceApiController {
if
(
ObjectUtils
.
isEmpty
(
platformEntity
))
{
throw
new
AppException
(
"所属系统平台不存在!"
);
}
if
(
ObjectUtils
.
isEmpty
(
req
.
getPlatformCode
()))
{
throw
new
AppException
(
"当前产品Code为空!"
);
}
ProductEntity
productEntity
=
productService
.
selectOne
(
new
ProductQuery
().
productCode
(
req
.
getProductCode
()));
if
(
ObjectUtils
.
isEmpty
(
productEntity
))
{
throw
new
AppException
(
"所属产品编码不存在"
);
...
...
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
373ecf52
...
...
@@ -56,10 +56,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override
protected
void
validData
(
DeviceEntity
entity
,
Context
context
)
throws
AppException
{
if
(
!
ObjectUtils
.
isEmpty
(
entity
.
getPlatformId
()))
{
if
(
ObjectUtils
.
isEmpty
(
entity
.
getPlatformId
()))
{
throw
new
AppException
(
"所属平台不能为空!"
);
}
if
(
!
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
{
if
(
ObjectUtils
.
isEmpty
(
entity
.
getProductId
()))
{
throw
new
AppException
(
"所属产品不能为空!"
);
}
...
...
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
View file @
373ecf52
...
...
@@ -4,8 +4,8 @@ POST {{baseUrl}}/device/list
Content-Type: application/json
{
"page":
1,
"size":
10
"page":
1,
"size":
10
}
...
...
@@ -14,21 +14,21 @@ POST {{baseUrl}}/device/save
Content-Type: application/json
{
"deviceName":
"gosxaj",
"deviceCode":
"ksdmo7",
"deviceType":
1,
"deviceMac":
"a3ku15",
"ip":
"5ffz2e",
"centernum":
"pcou8p",
"port":
"0ujj4h",
"siteNum":
"8aw47p",
"deviceFirmId":
922,
"deviceFirmname":
"cwzu1n",
"deviceOnlineStatus":
0,
"status":
0,
"deviceRemark":
"plxklr",
"onlineTime":
"1646755200000",
"offlineTime":
"1646755200000"
"deviceName":
"gosxaj",
"deviceCode":
"ksdmo7",
"deviceType":
1,
"deviceMac":
"a3ku15",
"ip":
"5ffz2e",
"centernum":
"pcou8p",
"port":
"0ujj4h",
"siteNum":
"8aw47p",
"deviceFirmId":
922,
"deviceFirmname":
"cwzu1n",
"deviceOnlineStatus":
0,
"status":
0,
"deviceRemark":
"plxklr",
"onlineTime":
"1646755200000",
"offlineTime":
"1646755200000"
}
> {%
...
...
@@ -56,8 +56,8 @@ POST {{baseUrl}}/api/getToken
Content-Type: application/json
{
"loginName":"admin",
"password":"admin"
"loginName":
"admin",
"password":
"admin"
}
> {%
...
...
@@ -71,8 +71,7 @@ POST {{baseUrl}}/api/register
Content-Type: application/json
{
"deviceCode":"a12345678"
"deviceCode": "a12345678"
}
> {%
...
...
@@ -85,32 +84,33 @@ Accept: application/json
###设备
更新与保存
POST {{baseUrl}}/api/
saveOrUpdat
e
###设备
新增
POST {{baseUrl}}/api/
receiv
e
Authorization: {{authToken}}
Content-Type: application/json
{
"
deviceName":"测试接口创建设备1"
,
"device
Code":"abcd1234
",
"device
Mac":
"A1:12:23:12:23:11",
"site
Code":"adfasfdasfdasf"
,
"site
Name":"测试站点
",
"
platformId":1
,
"p
roductId":1
,
"
deviceRemark":"车是是是打发斯蒂芬"
"
receiveMethod": 1
,
"device
Name": "测试接口创建设备1
",
"device
Code":
"A1:12:23:12:23:11",
"site
Id": 123
,
"site
Code": "adfasfdasfdasf
",
"
siteName": "测试站点"
,
"p
latformCode": "phxt"
,
"
productCode": "pdj",
"deviceRemark": "车是是是打发斯蒂芬"
}
###设备上报
POST {{baseUrl}}/api/upload
Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"deviceNum":"AB:DD:DF:FD:AD:FA:DA:SS",
"action":"upload"
"deviceNum":
"AB:DD:DF:FD:AD:FA:DA:SS",
"action":
"upload"
}
...
...
@@ -120,8 +120,8 @@ Content-Type: application/json
Authorization: Bearer {{authToken}}
{
"deviceNum":"AB:DD:DF:FD:AD:FA:DA:bb",
"action":"upload"
"deviceNum":
"AB:DD:DF:FD:AD:FA:DA:bb",
"action":
"upload"
}
...
...
@@ -131,7 +131,7 @@ POST {{baseUrl}}/test/upload?deviceId=2
Content-Type: application/json
{
"req": 1
"req": 1
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment