| | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | @Configuration |
| | | @Slf4j |
| | | public class WechatMsgUtil { |
| | | |
| | | private String appId; |
| | | |
| | | private String appSecret; |
| | | |
| | | private String templateId=""; |
| | | |
| | | // 获取access_token |
| | | private String getAccessToken() { |
| | |
| | | } |
| | | |
| | | // 发送模板消息 |
| | | public void sendTemplateMsg(String openId, String templateId, |
| | | public void sendTemplateMsg(String openId, |
| | | Map<String, String> content) { |
| | | try { |
| | | String accessToken = getAccessToken(); |