Browse Source

1、分享生成签名功能添加

master
Aug 1 month ago
parent
commit
9e1e959251
4 changed files with 27 additions and 6 deletions
  1. +8
    -4
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/massageController/RecommendController.java
  2. +3
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/RecommendService.java
  3. +14
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/RecommendServiceImpl.java
  4. +2
    -2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/utils/WeChatJSSDK.java

+ 8
- 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/massageController/RecommendController.java View File

@ -7,10 +7,7 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.RecommendService;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -40,6 +37,13 @@ public class RecommendController {
return recommendService.queryRecommendUserList(token, pageBean);
}
//分享生成签名
@ApiOperation(value = "分享生成签名",notes = "分享生成签名")
@GetMapping("/getVipShareSign")
public Result<?> getVipShareSign(String url){
return recommendService.getVipShareSign(url);
}
}

+ 3
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/RecommendService.java View File

@ -13,4 +13,7 @@ public interface RecommendService {
//我的团队-查询直推用户列表
public Result<?> queryRecommendUserList(String token, PageBean pageBean);
//分享生成签名
Result<?> getVipShareSign(String url);
}

+ 14
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/RecommendServiceImpl.java View File

@ -20,6 +20,7 @@ import org.jeecg.modules.hanHaiMember.service.IHanHaiMemberService;
import org.jeecg.modules.massageBanner.entity.MassageBanner;
import org.jeecg.modules.massageConfig.entity.MassageConfig;
import org.jeecg.modules.massageConfig.service.IMassageConfigService;
import org.jeecg.modules.utils.WeChatJSSDK;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
@ -264,4 +265,17 @@ public class RecommendServiceImpl implements RecommendService {
ossClient.shutdown();
return dbpath;
}
//分享生成签名
@Override
public Result<?> getVipShareSign(String url){
try {
Map<String, Object> signPackage = WeChatJSSDK.getSignPackage(url);
return Result.OK("分享成功",signPackage);
}catch (Exception e){
e.printStackTrace();
}
return Result.OK();
}
}

+ 2
- 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/utils/WeChatJSSDK.java View File

@ -20,8 +20,8 @@ import javax.servlet.http.HttpSession;
public class WeChatJSSDK {
private static final String APP_ID = "wxe934cebcbc89d869";
private static final String APP_SECRET = "78e4e80a2096b362114a7afeefd2ef23";
private static final String APP_ID = "wxb1c123a63736f789";
private static final String APP_SECRET = "497549cd0a6a086e59f02f65f470c69a";
private static String accessToken = null; // 用于缓存access_token
private static String jsapiTicket = null; // 用于缓存jsapi_ticket


Loading…
Cancel
Save