提交 c691a3e5 作者: zhenjie

添加微信报错信息查询接口

上级 7e3d801b
...@@ -90,4 +90,11 @@ public class WxController extends BaseController { ...@@ -90,4 +90,11 @@ public class WxController extends BaseController {
public ResultBody getAppletQRCode(@ApiParam(value = "小程序路径", example = "pages/welcome/index") @RequestParam String page, @ApiParam(value = "参数", example = "name=123&sex=456") @RequestParam String scene) { public ResultBody getAppletQRCode(@ApiParam(value = "小程序路径", example = "pages/welcome/index") @RequestParam String page, @ApiParam(value = "参数", example = "name=123&sex=456") @RequestParam String scene) {
return wxService.getUnLimitedQRCode(page, scene); return wxService.getUnLimitedQRCode(page, scene);
} }
@ApiOperation(value = "查询rid信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("rid")
public ResultBody rid(@RequestParam String rid) throws Exception {
return wxService.rid(rid);
}
} }
...@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest;
public interface WxService { public interface WxService {
/** /**
* 小程序登录调用接口 * 小程序登录调用接口
*
* @param wxLoginVO * @param wxLoginVO
* @return * @return
*/ */
...@@ -21,6 +22,7 @@ public interface WxService { ...@@ -21,6 +22,7 @@ public interface WxService {
/** /**
* pc扫码登录 * pc扫码登录
*
* @param wxLoginVO * @param wxLoginVO
* @return * @return
*/ */
...@@ -28,36 +30,42 @@ public interface WxService { ...@@ -28,36 +30,42 @@ public interface WxService {
/** /**
* 获取AccessToken * 获取AccessToken
*
* @return * @return
*/ */
String getAccessToken(); String getAccessToken();
/** /**
* 获取稳定AccessToken * 获取稳定AccessToken
*
* @return * @return
*/ */
String getStableAccessToken() throws Exception; String getStableAccessToken() throws Exception;
/** /**
* 获取公众号AccessToken * 获取公众号AccessToken
*
* @return * @return
*/ */
String getSubAccessToken(); String getSubAccessToken();
/** /**
* 监控微信公众号的事件变化通知 * 监控微信公众号的事件变化通知
*
* @param request * @param request
*/ */
String receiveSubAccountEvents(HttpServletRequest request); String receiveSubAccountEvents(HttpServletRequest request);
/** /**
* 公众号推送模板消息-不需要用户同意 * 公众号推送模板消息-不需要用户同意
*
* @return * @return
*/ */
ResultBody sendSubTemplateMsg(WxMsgVO ws); ResultBody sendSubTemplateMsg(WxMsgVO ws);
/** /**
* 获取不限制的小程序码 * 获取不限制的小程序码
*
* @param path * @param path
* @param scene * @param scene
*/ */
...@@ -65,12 +73,14 @@ public interface WxService { ...@@ -65,12 +73,14 @@ public interface WxService {
/** /**
* 小程序推送订阅号消息-需用户同意订阅 * 小程序推送订阅号消息-需用户同意订阅
*
* @param appletMsgVO * @param appletMsgVO
*/ */
ResultBody sendAppletMsg(AppletMsgVO appletMsgVO); ResultBody sendAppletMsg(AppletMsgVO appletMsgVO);
/** /**
* 生成小程序链接 * 生成小程序链接
*
* @param path * @param path
* @param query * @param query
* @return * @return
...@@ -85,4 +95,6 @@ public interface WxService { ...@@ -85,4 +95,6 @@ public interface WxService {
* @return * @return
*/ */
String getUserPhoneNumber(Integer id, String code); String getUserPhoneNumber(Integer id, String code);
ResultBody rid(String rid) throws Exception;
} }
...@@ -310,4 +310,13 @@ public class WxServiceImpl implements WxService { ...@@ -310,4 +310,13 @@ public class WxServiceImpl implements WxService {
} }
return null; return null;
} }
@Override
public ResultBody rid(String rid) throws Exception {
JSONObject param = new JSONObject();
param.put("rid", rid);
String url = "https://api.weixin.qq.com/cgi-bin/openapi/rid/get?access_token=" + this.getSubAccessToken();
String res = HttpHelper.httpPost(url, param.toString());
return ResultBody.success(res);
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论