feat: 缓存主设备,区域,类型,单位
parent
3f0a92bed4
commit
044c4ae881
@ -0,0 +1,29 @@
|
||||
package com.xydl.cac.task;
|
||||
|
||||
import com.xydl.cac.entity.Jg;
|
||||
import com.xydl.cac.entity.ModevType;
|
||||
import com.xydl.cac.entity.Zsb;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CacheTask {
|
||||
|
||||
public static HashMap<String, String> unit_Cache = new HashMap<>();
|
||||
public static List<ModevType> modevType_Cache = null;
|
||||
public static List<Jg> jg_Cache = null;
|
||||
public static List<Zsb> zsb_Cache = null;
|
||||
|
||||
@Scheduled(cron = "0 1 * * * ?")
|
||||
private void clearCache() {
|
||||
unit_Cache.clear();
|
||||
modevType_Cache = null;
|
||||
jg_Cache = null;
|
||||
zsb_Cache = null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue