com.zopen.wechat.mp.service.WechatHttpUrl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zopen-ato-starter Show documentation
Show all versions of zopen-ato-starter Show documentation
Alibaba Tencent And Others For Spring Boot.
package com.zopen.wechat.mp.service;
/**
* 请求地址
*
* @author [email protected]
* @since 2019/10/27
*/
public class WechatHttpUrl {
// 小程序 - 通过 js_code 获取 open_id 和 session_key(参数:appid、secret、js_code)
public static final String MINI_PROGRAM_CODE_TO_SESSION = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code";
// 小程序 - 敏感词检测
public static final String MINI_RISKY_CHECK = "https://api.weixin.qq.com/wxa/msg_sec_check?access_token=%s";
// 小程序 - 获取小程序码
public static final String MINI_GET_UNLIMITED = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=%s";
// 公众号、小程序 - 获取接口访问用的 access_token_api(参数:appid、secret)
public static final String MP_GET_ACCESS_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
// 公众号 - 获取 jsapi_ticket
public static final String MP_GET_TICKET = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi";
// 公众号 - 获取用户信息(未关注公众号:需要用户手动同意;公众号会话或菜单发起:静默授权):可获取用户昵称头像等信息(参数:appid、redirect_uri、state)
public static final String OAUTH2_AUTHORIZE_USER_INFO = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_userinfo&state=%s#wechat_redirect";
// 公众号 - 获取用户信息(静默授权):只能获取 open_id(参数:appid、redirect_uri、state)
public static final String OAUTH2_AUTHORIZE_BASE = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";
// 公众号 - 获取网页授权 access_token_web(参数:appid、secret、code)
public static final String OAUTH2_ACCESS_TOKEN = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code";
// 公众号 - 获取用户信息(参数:access_token_web、openid)
public static final String OAUTH2_USER_INFO = "https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s&lang=zh_CN";
// 公众号 - 发送模板消息(参数:access_token_api)
public static final String POST_TEMPLATE_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=%s";
// 小程序 - 发送模板消息(参数:access_token_api)
public static final String MINI_SEND_TEMPLATE_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=%s";
// 小程序 - 发送订阅消息(参数:access_token_api)
public static final String MINI_SEND_SUBSCRIBE_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=%s";
}