Commit e4ef1c81902b3bfae136ef70120be092005bc538
1 parent
edc6a8ad
修改:IOT 物模型接口接口优化
Showing
2 changed files
with
6 additions
and
4 deletions
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/dal/mysql/thinkmodelfunction/IotThinkModelFunctionMapper.java
| @@ -29,9 +29,10 @@ public interface IotThinkModelFunctionMapper extends BaseMapperX<IotThinkModelFu | @@ -29,9 +29,10 @@ public interface IotThinkModelFunctionMapper extends BaseMapperX<IotThinkModelFu | ||
| 29 | IotThinkModelFunctionDO::getType, type); | 29 | IotThinkModelFunctionDO::getType, type); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | - default List<IotThinkModelFunctionDO> selectListByProductIdAndTypes(Long productId, List<Integer> list) { | 32 | + default List<IotThinkModelFunctionDO> selectListByProductIdAndIdentifiersAndTypes(Long productId, List<String> list, List<Integer> list1){ |
| 33 | return selectList(new LambdaQueryWrapperX<IotThinkModelFunctionDO>() | 33 | return selectList(new LambdaQueryWrapperX<IotThinkModelFunctionDO>() |
| 34 | .eq(IotThinkModelFunctionDO::getProductId, productId) | 34 | .eq(IotThinkModelFunctionDO::getProductId, productId) |
| 35 | - .in(IotThinkModelFunctionDO::getType, list)); | 35 | + .in(IotThinkModelFunctionDO::getIdentifier, list) |
| 36 | + .in(IotThinkModelFunctionDO::getType, list1)); | ||
| 36 | } | 37 | } |
| 37 | } | 38 | } |
| 38 | \ No newline at end of file | 39 | \ No newline at end of file |
yudao-module-iot/yudao-module-iot-biz/src/main/java/cn/iocoder/yudao/module/iot/service/thinkmodelfunction/IotThinkModelFunctionServiceImpl.java
| @@ -175,9 +175,10 @@ public class IotThinkModelFunctionServiceImpl implements IotThinkModelFunctionSe | @@ -175,9 +175,10 @@ public class IotThinkModelFunctionServiceImpl implements IotThinkModelFunctionSe | ||
| 175 | newFunctionList.add(getServiceFunction); | 175 | newFunctionList.add(getServiceFunction); |
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | - // 2. 获取数据库中的旧事件和服务列表 | ||
| 179 | - List<IotThinkModelFunctionDO> oldFunctionList = thinkModelFunctionMapper.selectListByProductIdAndTypes( | 178 | + // 2. 获取数据库中的默认的旧事件和服务列表 |
| 179 | + List<IotThinkModelFunctionDO> oldFunctionList = thinkModelFunctionMapper.selectListByProductIdAndIdentifiersAndTypes( | ||
| 180 | productId, | 180 | productId, |
| 181 | + Arrays.asList("post", "set", "get"), | ||
| 181 | Arrays.asList(IotThingModelTypeEnum.EVENT.getType(), IotThingModelTypeEnum.SERVICE.getType()) | 182 | Arrays.asList(IotThingModelTypeEnum.EVENT.getType(), IotThingModelTypeEnum.SERVICE.getType()) |
| 182 | ); | 183 | ); |
| 183 | 184 |