|
@@ -5,6 +5,7 @@ import com.yunfeiyun.agmp.common.enums.RedisCacheKey;
|
|
|
import com.yunfeiyun.agmp.common.framework.manager.RedisCacheManager;
|
|
import com.yunfeiyun.agmp.common.framework.manager.RedisCacheManager;
|
|
|
import com.yunfeiyun.agmp.common.utils.DictUtils;
|
|
import com.yunfeiyun.agmp.common.utils.DictUtils;
|
|
|
import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
|
|
import com.yunfeiyun.agmp.iot.common.domain.TosDevicetype;
|
|
|
|
|
+import com.yunfeiyun.agmp.iot.common.service.TypeCacheService;
|
|
|
import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDevicetypeListResVo;
|
|
import com.yunfeiyun.agmp.iotm.device.domain.resvo.IotDevicetypeListResVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.domain.resvo.TosDevicetypeResVo;
|
|
import com.yunfeiyun.agmp.iotm.device.domain.resvo.TosDevicetypeResVo;
|
|
|
import com.yunfeiyun.agmp.iotm.device.mapper.TosDevicetypeMapper;
|
|
import com.yunfeiyun.agmp.iotm.device.mapper.TosDevicetypeMapper;
|
|
@@ -31,13 +32,14 @@ public class TosDevicetypeServiceImpl implements ITosDevicetypeService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TosDevicetypeMapper tosDevicetypeMapper;
|
|
private TosDevicetypeMapper tosDevicetypeMapper;
|
|
|
@Resource
|
|
@Resource
|
|
|
- private RedisCacheManager redisCacheManager;
|
|
|
|
|
|
|
+ private TypeCacheService typeCacheService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@PostConstruct
|
|
@PostConstruct
|
|
|
public void init(){
|
|
public void init(){
|
|
|
List<TosDevicetype> tosDevicetypeList = tosDevicetypeMapper.selectTosDevicetypeList(null);
|
|
List<TosDevicetype> tosDevicetypeList = tosDevicetypeMapper.selectTosDevicetypeList(null);
|
|
|
for(TosDevicetype tosDevicetype : tosDevicetypeList){
|
|
for(TosDevicetype tosDevicetype : tosDevicetypeList){
|
|
|
- redisCacheManager.setCacheObject(RedisCacheKey.IOT_DEVICE_TYPE,tosDevicetype.getDevtypeCode(),tosDevicetype);
|
|
|
|
|
|
|
+ typeCacheService.setCache(tosDevicetype);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -72,7 +74,7 @@ public class TosDevicetypeServiceImpl implements ITosDevicetypeService
|
|
|
@Override
|
|
@Override
|
|
|
public int insertTosDevicetypeByTosMsg(TosDevicetype tosDevicetype){
|
|
public int insertTosDevicetypeByTosMsg(TosDevicetype tosDevicetype){
|
|
|
int result = tosDevicetypeMapper.insertTosDevicetype(tosDevicetype);
|
|
int result = tosDevicetypeMapper.insertTosDevicetype(tosDevicetype);
|
|
|
- redisCacheManager.setCacheObject(RedisCacheKey.IOT_DEVICE_TYPE,tosDevicetype.getDevtypeCode(),tosDevicetype);
|
|
|
|
|
|
|
+ typeCacheService.setCache(tosDevicetype);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -85,7 +87,7 @@ public class TosDevicetypeServiceImpl implements ITosDevicetypeService
|
|
|
@Override
|
|
@Override
|
|
|
public int updateTosDevicetypeByTosMsg(TosDevicetype tosDevicetype){
|
|
public int updateTosDevicetypeByTosMsg(TosDevicetype tosDevicetype){
|
|
|
int result = tosDevicetypeMapper.updateTosDevicetype(tosDevicetype);
|
|
int result = tosDevicetypeMapper.updateTosDevicetype(tosDevicetype);
|
|
|
- redisCacheManager.setCacheObject(RedisCacheKey.IOT_DEVICE_TYPE,tosDevicetype.getDevtypeCode(),tosDevicetype);
|
|
|
|
|
|
|
+ typeCacheService.setCache(tosDevicetype);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -109,7 +111,7 @@ public class TosDevicetypeServiceImpl implements ITosDevicetypeService
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
result = tosDevicetypeMapper.deleteTosDevicetypeByDevtypeBid(tosDevicetype.getDevtypeBid());
|
|
result = tosDevicetypeMapper.deleteTosDevicetypeByDevtypeBid(tosDevicetype.getDevtypeBid());
|
|
|
- redisCacheManager.deleteObject(RedisCacheKey.IOT_DEVICE_TYPE,tosDevicetype.getDevtypeCode());
|
|
|
|
|
|
|
+ typeCacheService.deleteCache(tosDevicetype);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|