mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
修改绑定设备时返回设备id
This commit is contained in:
parent
a1b3d69ff1
commit
351ce4526b
@ -70,7 +70,7 @@ public class EqDeviceController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/bindDevice")
|
||||
public R<Boolean> bindDevice(EqAppHomeBo bo){
|
||||
public R<Long> bindDevice(EqAppHomeBo bo){
|
||||
String equipmentCode = bo.getEquipmentCode();
|
||||
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
||||
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
||||
|
||||
@ -51,7 +51,7 @@ public class EqShowUserEquipmentController extends BaseController {
|
||||
String equipmentCode = bo.getEquipmentCode();
|
||||
if (equipmentCode == null) throw new ServiceException("设备编码不能为空");
|
||||
if (bo.getUserId() == null) throw new ServiceException("用户ID不能为空");//分享用户要使用家庭主体的用户id
|
||||
return R.ok(eqEquipmentService.bindDevice(bo));
|
||||
return R.ok(eqEquipmentService.bindDevice(bo) != null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -80,10 +80,11 @@ public interface IEqEquipmentService {
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*
|
||||
* @param bo
|
||||
* @return
|
||||
*/
|
||||
Boolean bindDevice(EqAppHomeBo bo);
|
||||
Long bindDevice(EqAppHomeBo bo);
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
|
||||
@ -302,7 +302,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean bindDevice(EqAppHomeBo bo) {
|
||||
public Long bindDevice(EqAppHomeBo bo) {
|
||||
|
||||
String equipmentCode = bo.getEquipmentCode(); //这里的设备编码改成了设备mac地址
|
||||
//通过设备mac地址查询设备编码
|
||||
@ -363,7 +363,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
||||
}else{
|
||||
baseMapper.insert(add);
|
||||
}
|
||||
return true;
|
||||
return add.getEquipmentId();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user