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

修改设备新增等

parent a3b22133
......@@ -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("所属产品编码不存在");
......
......@@ -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("所属产品不能为空!");
}
......
......@@ -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/saveOrUpdate
###设备新增
POST {{baseUrl}}/api/receive
Authorization: {{authToken}}
Content-Type: application/json
{
"deviceName":"测试接口创建设备1",
"deviceCode":"abcd1234",
"deviceMac":"A1:12:23:12:23:11",
"siteCode":"adfasfdasfdasf",
"siteName":"测试站点",
"platformId":1,
"productId":1,
"deviceRemark":"车是是是打发斯蒂芬"
"receiveMethod": 1,
"deviceName": "测试接口创建设备1",
"deviceCode": "A1:12:23:12:23:11",
"siteId": 123,
"siteCode": "adfasfdasfdasf",
"siteName": "测试站点",
"platformCode": "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
}
......
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