|
@@ -136,6 +136,8 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
|
|
|
|
|
|
|
|
private static final String WX_URL_REDIS_PREFIX = "wx:link:";
|
|
private static final String WX_URL_REDIS_PREFIX = "wx:link:";
|
|
|
|
|
|
|
|
|
|
+ private static final String WX_URL_REDIS_PREFIX_MEMBER = "wx:member:link:";
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询短链
|
|
* 查询短链
|
|
@@ -779,10 +781,22 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
|
|
|
public String getGotoWxAppLink(String linkStr,String appId) {
|
|
public String getGotoWxAppLink(String linkStr,String appId) {
|
|
|
log.info("appid:{}", appId);
|
|
log.info("appid:{}", appId);
|
|
|
log.info("linkStr:{}", linkStr);
|
|
log.info("linkStr:{}", linkStr);
|
|
|
- String key = "course=";
|
|
|
|
|
- String linkStrJson = linkStr.substring(linkStr.indexOf(key) + key.length());
|
|
|
|
|
- JSONObject json = JSON.parseObject(linkStrJson);
|
|
|
|
|
- String wxAppLinkKey = String.format("%s%s%s%s%s%s%s",WX_URL_REDIS_PREFIX,json.get("companyId"),json.get("companyUserId"),json.get("projectId"),json.get("courseId"),json.get("videoId"),appId);
|
|
|
|
|
|
|
+ String wxAppLinkKey = null;
|
|
|
|
|
+ String key;
|
|
|
|
|
+ String linkStrJson;
|
|
|
|
|
+ JSONObject json;
|
|
|
|
|
+ if(linkStr.contains("becomeVip=")){
|
|
|
|
|
+ key = "becomeVip=";
|
|
|
|
|
+ linkStrJson = linkStr.substring(linkStr.indexOf(key) + key.length());
|
|
|
|
|
+ json = JSON.parseObject(linkStrJson);
|
|
|
|
|
+ wxAppLinkKey = String.format("%s%s%s%s%s",WX_URL_REDIS_PREFIX_MEMBER,json.get("companyId"),json.get("companyUserId"),json.get("projectId"),appId);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ key = "course=";
|
|
|
|
|
+ linkStrJson = linkStr.substring(linkStr.indexOf(key) + key.length());
|
|
|
|
|
+ json = JSON.parseObject(linkStrJson);
|
|
|
|
|
+ wxAppLinkKey = String.format("%s%s%s%s%s%s%s",WX_URL_REDIS_PREFIX,json.get("companyId"),json.get("companyUserId"),json.get("projectId"),json.get("courseId"),json.get("videoId"),appId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String linkCache = redisCache.getCacheObject(wxAppLinkKey);
|
|
String linkCache = redisCache.getCacheObject(wxAppLinkKey);
|
|
|
if (StringUtils.isNotBlank(linkCache)) {
|
|
if (StringUtils.isNotBlank(linkCache)) {
|
|
|
return linkCache;
|
|
return linkCache;
|