微信接口开发
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user