mirror of https://gitee.com/stylefeng/roses
【7.1.6】【statistics】整理
parent
06ee603e38
commit
95793512fb
|
@ -12,9 +12,9 @@ import java.util.Map;
|
||||||
* @author xixiaowei
|
* @author xixiaowei
|
||||||
* @date 2022/2/9 16:36
|
* @date 2022/2/9 16:36
|
||||||
*/
|
*/
|
||||||
public class InterfaceStatisticsMemoryCache extends AbstractMemoryCacheOperator<Map<Long,Integer>> {
|
public class InterfaceStatisticsMemoryCache extends AbstractMemoryCacheOperator<Map<Long, Integer>> {
|
||||||
|
|
||||||
public InterfaceStatisticsMemoryCache(TimedCache<String, Map<Long,Integer>> timedCache) {
|
public InterfaceStatisticsMemoryCache(TimedCache<String, Map<Long, Integer>> timedCache) {
|
||||||
super(timedCache);
|
super(timedCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,9 @@ import java.util.Map;
|
||||||
* @author xixiaowei
|
* @author xixiaowei
|
||||||
* @date 2022/2/9 16:38
|
* @date 2022/2/9 16:38
|
||||||
*/
|
*/
|
||||||
public class InterfaceStatisticsRedisCache extends AbstractRedisCacheOperator<Map<Long,Integer>> {
|
public class InterfaceStatisticsRedisCache extends AbstractRedisCacheOperator<Map<Long, Integer>> {
|
||||||
|
|
||||||
public InterfaceStatisticsRedisCache(RedisTemplate<String, Map<Long,Integer>> redisTemplate) {
|
public InterfaceStatisticsRedisCache(RedisTemplate<String, Map<Long, Integer>> redisTemplate) {
|
||||||
super(redisTemplate);
|
super(redisTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ public class StatisticsUrlContext implements CommandLineRunner {
|
||||||
/**
|
/**
|
||||||
* 需要被统计的url集合,key是url,value是stat_url_id
|
* 需要被统计的url集合,key是url,value是stat_url_id
|
||||||
*/
|
*/
|
||||||
private static Map<String,Long> STATISTICS_KEY_VALUES = new HashMap<>(10);
|
private static Map<String, Long> STATISTICS_KEY_VALUES = new HashMap<>(10);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取需要统计的url集合
|
* 获取需要统计的url集合
|
||||||
|
@ -39,7 +39,7 @@ public class StatisticsUrlContext implements CommandLineRunner {
|
||||||
* @author fengshuonan
|
* @author fengshuonan
|
||||||
* @date 2022/2/10 21:37
|
* @date 2022/2/10 21:37
|
||||||
*/
|
*/
|
||||||
public static List<SysStatisticsUrl> getUrls(){
|
public static List<SysStatisticsUrl> getUrls() {
|
||||||
return STATISTICS_URLS;
|
return STATISTICS_URLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class StatisticsUrlContext implements CommandLineRunner {
|
||||||
* @author fengshuonan
|
* @author fengshuonan
|
||||||
* @date 2022/2/10 21:37
|
* @date 2022/2/10 21:37
|
||||||
*/
|
*/
|
||||||
public static Long getStatUrlId(String url){
|
public static Long getStatUrlId(String url) {
|
||||||
return STATISTICS_KEY_VALUES.get(url);
|
return STATISTICS_KEY_VALUES.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public class StatisticsUrlContext implements CommandLineRunner {
|
||||||
public void run(String... args) throws Exception {
|
public void run(String... args) throws Exception {
|
||||||
STATISTICS_URLS = sysStatisticsUrlService.list();
|
STATISTICS_URLS = sysStatisticsUrlService.list();
|
||||||
for (SysStatisticsUrl statisticsUrl : STATISTICS_URLS) {
|
for (SysStatisticsUrl statisticsUrl : STATISTICS_URLS) {
|
||||||
STATISTICS_KEY_VALUES.put(statisticsUrl.getStatUrl(),statisticsUrl.getStatUrlId());
|
STATISTICS_KEY_VALUES.put(statisticsUrl.getStatUrl(), statisticsUrl.getStatUrlId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue