...
|
...
|
@@ -72,7 +72,7 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
@Value("${tencentmkt.shareUrl}")
|
|
|
private String shareUrl;
|
|
|
|
|
|
public static final String TENCENT_MKT__ACTIVITY_CACHEKEY = "yh:activity:tencentmkt:activitykey";
|
|
|
public static final String TENCENT_MKT__ACTIVITY_CACHEKEY = "yh:activity:tencentmkt:";
|
|
|
|
|
|
@Override
|
|
|
public ApiResponse sendSms(String area, String mobile) throws ServiceException {
|
...
|
...
|
@@ -201,7 +201,7 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
}
|
|
|
|
|
|
public TencentMktActivityBO getActivityInfoByCode(String activityCode) {
|
|
|
TencentMktActivityBO activityBO = CacheKeyHelper.string2Value(yhValueOperations.get(TENCENT_MKT__ACTIVITY_CACHEKEY), TencentMktActivityBO.class);
|
|
|
TencentMktActivityBO activityBO = CacheKeyHelper.string2Value(yhValueOperations.get(getCacheKey(activityCode)), TencentMktActivityBO.class);
|
|
|
if(activityBO != null) {
|
|
|
log.info("obtain tencent mkt activity from cache, activityId: {}, activityName: {}", activityBO.getId(), activityBO.getActivityName());
|
|
|
return activityBO;
|
...
|
...
|
@@ -215,13 +215,17 @@ public class TencentMktServiceImpl implements ITencentMktService { |
|
|
}
|
|
|
|
|
|
activityBO = TencentMktActivityConvert.db2bo(db);
|
|
|
yhValueOperations.set(TENCENT_MKT__ACTIVITY_CACHEKEY, CacheKeyHelper.value2String(activityBO));
|
|
|
yhRedisTemplate.longExpire(TENCENT_MKT__ACTIVITY_CACHEKEY, 1, TimeUnit.MINUTES);
|
|
|
yhValueOperations.set(getCacheKey(activityCode), CacheKeyHelper.value2String(activityBO));
|
|
|
yhRedisTemplate.longExpire(getCacheKey(activityCode), 1, TimeUnit.MINUTES);
|
|
|
|
|
|
log.debug("tencent mkt activity, activityId: {}, activityName: {}", activityBO.getId(), activityBO.getActivityName());
|
|
|
return activityBO;
|
|
|
}
|
|
|
|
|
|
private String getCacheKey(String activityCode) {
|
|
|
return TENCENT_MKT__ACTIVITY_CACHEKEY+activityCode;
|
|
|
}
|
|
|
|
|
|
|
|
|
@Override
|
|
|
public TencentMktBO getActivityInfo(String activityCode) {
|
...
|
...
|
|