Commit 373ecf52 authored by 赵啸非's avatar 赵啸非

修改设备新增等

parent a3b22133
...@@ -298,9 +298,7 @@ public class DeviceApiController { ...@@ -298,9 +298,7 @@ public class DeviceApiController {
if (ObjectUtils.isEmpty(platformEntity)) { if (ObjectUtils.isEmpty(platformEntity)) {
throw new AppException("所属系统平台不存在!"); throw new AppException("所属系统平台不存在!");
} }
if (ObjectUtils.isEmpty(req.getPlatformCode())) {
throw new AppException("当前产品Code为空!");
}
ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode())); ProductEntity productEntity = productService.selectOne(new ProductQuery().productCode(req.getProductCode()));
if (ObjectUtils.isEmpty(productEntity)) { if (ObjectUtils.isEmpty(productEntity)) {
throw new AppException("所属产品编码不存在"); throw new AppException("所属产品编码不存在");
......
...@@ -56,10 +56,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D ...@@ -56,10 +56,10 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
@Override @Override
protected void validData(DeviceEntity entity, Context context) throws AppException { protected void validData(DeviceEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getPlatformId())) { if (ObjectUtils.isEmpty(entity.getPlatformId())) {
throw new AppException("所属平台不能为空!"); throw new AppException("所属平台不能为空!");
} }
if (!ObjectUtils.isEmpty(entity.getProductId())) { if (ObjectUtils.isEmpty(entity.getProductId())) {
throw new AppException("所属产品不能为空!"); throw new AppException("所属产品不能为空!");
} }
......
...@@ -4,8 +4,8 @@ POST {{baseUrl}}/device/list ...@@ -4,8 +4,8 @@ POST {{baseUrl}}/device/list
Content-Type: application/json Content-Type: application/json
{ {
"page":1, "page": 1,
"size":10 "size": 10
} }
...@@ -14,21 +14,21 @@ POST {{baseUrl}}/device/save ...@@ -14,21 +14,21 @@ POST {{baseUrl}}/device/save
Content-Type: application/json Content-Type: application/json
{ {
"deviceName":"gosxaj", "deviceName": "gosxaj",
"deviceCode":"ksdmo7", "deviceCode": "ksdmo7",
"deviceType":1, "deviceType": 1,
"deviceMac":"a3ku15", "deviceMac": "a3ku15",
"ip":"5ffz2e", "ip": "5ffz2e",
"centernum":"pcou8p", "centernum": "pcou8p",
"port":"0ujj4h", "port": "0ujj4h",
"siteNum":"8aw47p", "siteNum": "8aw47p",
"deviceFirmId":922, "deviceFirmId": 922,
"deviceFirmname":"cwzu1n", "deviceFirmname": "cwzu1n",
"deviceOnlineStatus":0, "deviceOnlineStatus": 0,
"status":0, "status": 0,
"deviceRemark":"plxklr", "deviceRemark": "plxklr",
"onlineTime":"1646755200000", "onlineTime": "1646755200000",
"offlineTime":"1646755200000" "offlineTime": "1646755200000"
} }
> {% > {%
...@@ -56,8 +56,8 @@ POST {{baseUrl}}/api/getToken ...@@ -56,8 +56,8 @@ POST {{baseUrl}}/api/getToken
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"admin", "loginName": "admin",
"password":"admin" "password": "admin"
} }
> {% > {%
...@@ -71,8 +71,7 @@ POST {{baseUrl}}/api/register ...@@ -71,8 +71,7 @@ POST {{baseUrl}}/api/register
Content-Type: application/json Content-Type: application/json
{ {
"deviceCode":"a12345678" "deviceCode": "a12345678"
} }
> {% > {%
...@@ -85,32 +84,33 @@ Accept: application/json ...@@ -85,32 +84,33 @@ Accept: application/json
###设备更新与保存 ###设备新增
POST {{baseUrl}}/api/saveOrUpdate POST {{baseUrl}}/api/receive
Authorization: {{authToken}} Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"deviceName":"测试接口创建设备1", "receiveMethod": 1,
"deviceCode":"abcd1234", "deviceName": "测试接口创建设备1",
"deviceMac":"A1:12:23:12:23:11", "deviceCode": "A1:12:23:12:23:11",
"siteCode":"adfasfdasfdasf", "siteId": 123,
"siteName":"测试站点", "siteCode": "adfasfdasfdasf",
"platformId":1, "siteName": "测试站点",
"productId":1, "platformCode": "phxt",
"deviceRemark":"车是是是打发斯蒂芬" "productCode": "pdj",
"deviceRemark": "车是是是打发斯蒂芬"
} }
###设备上报 ###设备上报
POST {{baseUrl}}/api/upload POST {{baseUrl}}/api/upload
Content-Type: application/json Content-Type: application/json
Authorization: Bearer {{authToken}} Authorization: Bearer {{authToken}}
{ {
"deviceNum":"AB:DD:DF:FD:AD:FA:DA:SS", "deviceNum": "AB:DD:DF:FD:AD:FA:DA:SS",
"action":"upload" "action": "upload"
} }
...@@ -120,8 +120,8 @@ Content-Type: application/json ...@@ -120,8 +120,8 @@ Content-Type: application/json
Authorization: Bearer {{authToken}} Authorization: Bearer {{authToken}}
{ {
"deviceNum":"AB:DD:DF:FD:AD:FA:DA:bb", "deviceNum": "AB:DD:DF:FD:AD:FA:DA:bb",
"action":"upload" "action": "upload"
} }
...@@ -131,7 +131,7 @@ POST {{baseUrl}}/test/upload?deviceId=2 ...@@ -131,7 +131,7 @@ POST {{baseUrl}}/test/upload?deviceId=2
Content-Type: application/json Content-Type: application/json
{ {
"req": 1 "req": 1
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment