fix():把saas缓存对象换成缓存列表
parent
2623669eb0
commit
6dd3d73f62
|
@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.hutool.core.lang.ansi.AnsiEncoder.encode;
|
||||
|
||||
|
@ -26,7 +27,7 @@ public abstract class CacheAbsBasic<K,V> implements CacheBasic<K,V>{
|
|||
|
||||
@Override
|
||||
public void put(K key, V value) {
|
||||
redisService.setCacheObject(encodeKey(key), value); // 编码 --> 缓存基础的对象 Integer String 实体类等
|
||||
redisService.setCacheObject(encodeKey(key), value,30L, TimeUnit.MINUTES); // 编码 --> 缓存基础的对象 Integer String 实体类等
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,9 +4,6 @@ import com.alibaba.fastjson2.JSON;
|
|||
import com.muyu.common.domain.MessageTemplateType;
|
||||
import com.muyu.common.domain.SysCar;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.server.service.MessageTemplateTypeService;
|
||||
import com.muyu.server.service.SysCarService;
|
||||
import com.muyu.server.service.impl.SysCarServiceImpl;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -16,6 +13,7 @@ import javax.annotation.PostConstruct;
|
|||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
/**
|
||||
*
|
||||
* @author liuxinyue
|
||||
* @Package:com.muyu.mqtt.configure
|
||||
* @Project:cloud-server
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.CarType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 车辆类型缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 16:31:44
|
||||
*/
|
||||
@Component
|
||||
public class CarTypeCacheService extends CacheAbsBasic<String, CarType> {
|
||||
public class CarTypeCacheService extends CacheAbsBasic<String, List<CarType>> {
|
||||
/**
|
||||
* 缓存key前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.DataType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 数据类型缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 10:57:24
|
||||
*/
|
||||
@Component
|
||||
public class DataTypeCacheService extends CacheAbsBasic<String, DataType> {
|
||||
public class DataTypeCacheService extends CacheAbsBasic<String, List<DataType>> {
|
||||
/**
|
||||
* key前缀
|
||||
* @return
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||
* @Data 2024-09-29 20:53:46
|
||||
*/
|
||||
@Component
|
||||
public class ElectronicFenceCacheService extends CacheAbsBasic<String, ElectronicFence>{
|
||||
public class ElectronicFenceCacheService extends CacheAbsBasic<String, List<ElectronicFence>>{
|
||||
/**
|
||||
* key前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.database.ElectronicFenceGroup;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 围栏组缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-29 20:57:46
|
||||
*/
|
||||
@Component
|
||||
public class ElectronicFenceGroupCacheService extends CacheAbsBasic<String, ElectronicFenceGroup>{
|
||||
public class ElectronicFenceGroupCacheService extends CacheAbsBasic<String, List<ElectronicFenceGroup>>{
|
||||
/**
|
||||
* key前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.Enterprise;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yuping
|
||||
* @package com.muyu.cache
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @date 2024/9/29 20:21 企业缓存
|
||||
*/
|
||||
@Component
|
||||
public class EnterpriseCacheService extends CacheAbsBasic<String, Enterprise>{
|
||||
public class EnterpriseCacheService extends CacheAbsBasic<String, List<Enterprise>>{
|
||||
/**
|
||||
* 缓存前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.MessageTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 报文缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 11:01:13
|
||||
*/
|
||||
@Component
|
||||
public class MessageTemplateCacheService extends CacheAbsBasic<String, MessageTemplate>{
|
||||
public class MessageTemplateCacheService extends CacheAbsBasic<String, List<MessageTemplate>>{
|
||||
/**
|
||||
* key前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.MessageTemplateType;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 报文模版类型缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 11:04:43
|
||||
*/
|
||||
@Component
|
||||
public class MessageTemplateTypeCacheService extends CacheAbsBasic<String, MessageTemplateType>{
|
||||
public class MessageTemplateTypeCacheService extends CacheAbsBasic<String, List<MessageTemplateType>>{
|
||||
/**
|
||||
* 缓存key前缀
|
||||
* @return
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.muyu.cache;
|
||||
|
||||
import com.muyu.common.domain.SysCar;
|
||||
import com.muyu.common.domain.resp.SysCarVo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 车辆缓存
|
||||
|
@ -10,14 +13,14 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 16:35:14
|
||||
*/
|
||||
@Component
|
||||
public class SysCarCacheService extends CacheAbsBasic<String, SysCar>{
|
||||
public class SysCarCacheService extends CacheAbsBasic<String, List<SysCarVo>>{
|
||||
/**
|
||||
* key前缀
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "car:";
|
||||
return "car";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.SysCarFault;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 故障缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-29 21:10:31
|
||||
*/
|
||||
@Component
|
||||
public class SysCarFaultCacheService extends CacheAbsBasic<String, SysCarFault>{
|
||||
public class SysCarFaultCacheService extends CacheAbsBasic<String, List<SysCarFault>>{
|
||||
/**
|
||||
* 缓存前缀
|
||||
* @return
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.SysCarFaultMessage;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 站内信缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-29 21:13:19
|
||||
*/
|
||||
@Component
|
||||
public class SysCarFaultMessageCacheService extends CacheAbsBasic<String, SysCarFaultMessage>{
|
||||
public class SysCarFaultMessageCacheService extends CacheAbsBasic<String, List<SysCarFaultMessage>>{
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "sysCarFaultMessage";
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.muyu.cache;
|
|||
import com.muyu.common.domain.Template;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 报文模版缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 18:21:46
|
||||
*/
|
||||
@Component
|
||||
public class TemplateCacheService extends CacheAbsBasic<String, Template>{
|
||||
public class TemplateCacheService extends CacheAbsBasic<String, List<Template>>{
|
||||
/**
|
||||
* 缓存key前缀
|
||||
* @return
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.muyu.cache;
|
||||
|
||||
import com.muyu.common.domain.WarnRule;
|
||||
import com.muyu.common.domain.resp.WarnRuleResp;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 预警规则缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 16:37:09
|
||||
*/
|
||||
@Component
|
||||
public class WarnRuleCacheService extends CacheAbsBasic<String, WarnRule>{
|
||||
public class WarnRuleCacheService extends CacheAbsBasic<String, List<WarnRuleResp>>{
|
||||
/**
|
||||
* 缓存key前缀
|
||||
* @return
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.muyu.cache;
|
||||
|
||||
import com.muyu.common.domain.WarnStrategy;
|
||||
import com.muyu.common.domain.resp.WarnStrategyResp;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 预警策略缓存
|
||||
|
@ -10,7 +12,7 @@ import org.springframework.stereotype.Component;
|
|||
* @Data 2024-09-30 16:38:35
|
||||
*/
|
||||
@Component
|
||||
public class WarnStrategyCacheService extends CacheAbsBasic<String, WarnStrategy> {
|
||||
public class WarnStrategyCacheService extends CacheAbsBasic<String, List<WarnStrategyResp>> {
|
||||
/**
|
||||
* 缓存key前缀
|
||||
* @return
|
||||
|
|
Loading…
Reference in New Issue