Commit e4ef1c81902b3bfae136ef70120be092005bc538

Authored by 安浩浩
1 parent edc6a8ad

修改:IOT 物模型接口接口优化

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 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 33 return selectList(new LambdaQueryWrapperX<IotThinkModelFunctionDO>()
34 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 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 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 180 productId,
  181 + Arrays.asList("post", "set", "get"),
181 182 Arrays.asList(IotThingModelTypeEnum.EVENT.getType(), IotThingModelTypeEnum.SERVICE.getType())
182 183 );
183 184  
... ...