短信配置缓存
This commit is contained in:
parent
a43ed499ab
commit
ad3a8748ba
|
|
@ -1,8 +1,8 @@
|
||||||
package net.maku.message.cache;
|
package net.maku.system.cache;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import net.maku.framework.common.cache.RedisCache;
|
import net.maku.framework.common.cache.RedisCache;
|
||||||
import net.maku.message.sms.config.SmsConfig;
|
import net.maku.sms.config.SmsConfig;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -15,18 +15,19 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class SmsPlatformCache {
|
public class SmsConfigCache {
|
||||||
private final RedisCache redisCache;
|
private final RedisCache redisCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信平台轮询KEY
|
* 短信平台轮询KEY
|
||||||
*/
|
*/
|
||||||
private final String SMS_ROUND_KEY = "message:sms:round";
|
private final String SMS_ROUND_KEY = "sys:sms:round";
|
||||||
|
private final String SMS_ROUND_CODE_KEY = "sys:sms:round:code";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 短信平台列表KEY
|
* 短信平台列表KEY
|
||||||
*/
|
*/
|
||||||
private final String SMS_PLATFORM_KEY = "message:sms:platform";
|
private final String SMS_PLATFORM_KEY = "sys:sms:platform";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取短信轮询值
|
* 获取短信轮询值
|
||||||
|
|
@ -35,6 +36,13 @@ public class SmsPlatformCache {
|
||||||
return redisCache.increment(SMS_ROUND_KEY);
|
return redisCache.increment(SMS_ROUND_KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取短信编码轮询值
|
||||||
|
*/
|
||||||
|
public Long getRoundCodeValue() {
|
||||||
|
return redisCache.increment(SMS_ROUND_CODE_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
public List<SmsConfig> list() {
|
public List<SmsConfig> list() {
|
||||||
return (List<SmsConfig>) redisCache.get(SMS_PLATFORM_KEY);
|
return (List<SmsConfig>) redisCache.get(SMS_PLATFORM_KEY);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user