Browse Source

mp:增加消息推送的接口

YunaiV 2 years ago
parent
commit
f0cdc8d296

+ 17 - 1
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/open/MpOpenController.java

@@ -22,7 +22,12 @@ public class MpOpenController {
     @Resource
     private MpServiceFactory mpServiceFactory;
 
-    @ApiOperation("校验签名") // 参见 https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html 文档
+    /**
+     * 接收微信公众号的校验签名
+     *
+     * 对应 <a href="https://developers.weixin.qq.com/doc/offiaccount/Basic_Information/Access_Overview.html">文档</a>
+     */
+    @ApiOperation("校验签名") // 参见
     @GetMapping(value = "/{appId}", produces = "text/plain;charset=utf-8")
     public String checkSignature(@PathVariable("appId") String appId,
                                  MpOpenCheckSignatureReqVO reqVO) {
@@ -37,4 +42,15 @@ public class MpOpenController {
         return "非法请求";
     }
 
+    /**
+     * 接收微信公众号的消息推送
+     *
+     * <a href="https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html">文档</a>
+     */
+    @ApiOperation("处理消息")
+    @PostMapping(value = "/{appId}", produces = "application/xml; charset=UTF-8")
+    public String handleMessage() {
+        return "123";
+    }
+
 }