|
@@ -28,6 +28,16 @@ public class RelationService extends ServiceImpl<RelationMapper, Relation> {
|
|
|
.eq("openId", openId).orderByDesc("isDefault", "updateTime"));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询用户当前默认设备的绑定信息
|
|
|
+ *
|
|
|
+ * @param openId 用户ID
|
|
|
+ */
|
|
|
+ public Relation getByOpenId(String openId) {
|
|
|
+ return baseMapper.selectOne(new QueryWrapper<Relation>().select("openNum", "deviceName")
|
|
|
+ .eq("openId", openId).eq("isDefault", 1));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 切换默认设备
|
|
|
*/
|
|
@@ -47,8 +57,6 @@ public class RelationService extends ServiceImpl<RelationMapper, Relation> {
|
|
|
|
|
|
/**
|
|
|
* 保存设备绑定关系
|
|
|
- *
|
|
|
- * @return 当前绑定的设备列表
|
|
|
*/
|
|
|
public void saveRelation(Relation relation) {
|
|
|
//保存新纪录
|