微信接口开发
This commit is contained in:
parent
735296b0f9
commit
037480cc32
@ -534,7 +534,7 @@ public class WechatAppletController extends BaseController {
|
||||
}
|
||||
|
||||
@GetMapping("/getToken")
|
||||
public String getToken(@RequestParam String appId) {
|
||||
public String getToken(@RequestParam String appId) throws Exception {
|
||||
return iWechatAppletService.getAccessToken(appId);
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package com.stdiet.custom.service;
|
||||
|
||||
public interface IWechatAppletService {
|
||||
|
||||
public String getAccessToken(String appId);
|
||||
public String getAccessToken(String appId) throws Exception;
|
||||
|
||||
public void postRecipesMessage(String appId, String openId, String name, String startDate, String endDate, String remark);
|
||||
public void postRecipesMessage(String appId, String openId, String name, String startDate, String endDate, String remark) throws Exception;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class WeChartAppletServiceImp implements IWechatAppletService {
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Override
|
||||
public String getAccessToken(String appId) {
|
||||
public String getAccessToken(String appId) throws Exception {
|
||||
String accessToken = redisCache.getCacheObject(appId);
|
||||
if (StringUtils.isNull(accessToken)) {
|
||||
String appSecret = "";
|
||||
@ -50,7 +50,7 @@ public class WeChartAppletServiceImp implements IWechatAppletService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postRecipesMessage(String appId, String openId, String name, String startDate, String endDate, String remark) {
|
||||
public void postRecipesMessage(String appId, String openId, String name, String startDate, String endDate, String remark) throws Exception {
|
||||
String accessToken = getAccessToken(appId);
|
||||
if (StringUtils.isNull(accessToken)) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user