|
|
@@ -13,10 +13,10 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
|
* IotServiceImpl$
|
|
|
@@ -63,7 +63,7 @@ public class IotService {
|
|
|
* @return token
|
|
|
*/
|
|
|
public void setToken() {
|
|
|
- redisCache.setCacheObject(CacheConstants.IOT_TOKEN, queryToken());
|
|
|
+ redisCache.setCacheObject(CacheConstants.IOT_TOKEN, queryToken(), 30, TimeUnit.MINUTES);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -77,7 +77,7 @@ public class IotService {
|
|
|
return token;
|
|
|
}
|
|
|
token = queryToken();
|
|
|
- redisCache.setCacheObject(CacheConstants.IOT_TOKEN, token);
|
|
|
+ redisCache.setCacheObject(CacheConstants.IOT_TOKEN, token, 30, TimeUnit.MINUTES);
|
|
|
return token;
|
|
|
}
|
|
|
|