forked from dyf/fys-Multi-tenant
设备主题
This commit is contained in:
@ -105,7 +105,6 @@ public class Device extends TenantEntity {
|
||||
@Schema(name = "设备状态")
|
||||
private Integer deviceStatus;
|
||||
|
||||
|
||||
/**
|
||||
* 绑定状态
|
||||
* 0 未绑定
|
||||
@ -127,4 +126,17 @@ public class Device extends TenantEntity {
|
||||
private Date bindingTime;
|
||||
|
||||
private String sendMsg;
|
||||
|
||||
/**
|
||||
* 发布主题(格式:A/{device_id})
|
||||
* pub_topic
|
||||
*/
|
||||
private String pubTopic;
|
||||
|
||||
/**
|
||||
* 订阅主题(格式:B/{device_id})
|
||||
* sub_topic
|
||||
*/
|
||||
private String subTopic;
|
||||
|
||||
}
|
||||
|
@ -186,6 +186,10 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||
device.setCreateByName(loginUser.getNickname());
|
||||
device.setTypeName(deviceTypes.getTypeName());
|
||||
device.setDeviceType(deviceTypes.getId());
|
||||
if (device.getDeviceImei() != null) {
|
||||
device.setPubTopic("A/" + device.getDeviceImei());
|
||||
device.setSubTopic("B/" + device.getDeviceImei());
|
||||
}
|
||||
|
||||
deviceMapper.insert(device);
|
||||
|
||||
|
Reference in New Issue
Block a user