From 037480cc3276a3b163d07fcb670127a5d3ae24eb Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Thu, 13 May 2021 20:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stdiet/web/controller/custom/WechatAppletController.java | 2 +- .../java/com/stdiet/custom/service/IWechatAppletService.java | 4 ++-- .../stdiet/custom/service/impl/WeChartAppletServiceImp.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java index a1c48c6de..f4c6c4834 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/WechatAppletController.java @@ -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); } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/IWechatAppletService.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/IWechatAppletService.java index af555b9c1..61b66e351 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/IWechatAppletService.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/IWechatAppletService.java @@ -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; } diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/WeChartAppletServiceImp.java b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/WeChartAppletServiceImp.java index 300d512bf..4d0a04e99 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/WeChartAppletServiceImp.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/service/impl/WeChartAppletServiceImp.java @@ -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;