bug
jiangqs
2023-08-16 2e9c442b4961dc30423e8b8fa1361c45e63ef620
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.ruoyi.system.controller.conslole;
 
import com.esotericsoftware.minlog.Log;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.springframework.web.bind.annotation.*;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
/**
 * @ClassName QYWXCallBackController
 * @Description TODO
 * @Author jqs
 * @Date 2023/8/16 16:56
 * @Version 1.0
 */
@Api(value = "企业微信通知控制", tags = "企业微信通知控制", description = "企业微信通知控制")
@RestController
@RequestMapping("/qywx")
public class QYWXCallBackController {
 
 
    @ApiOperation(value = "消息与事件接收配置")
    @RequestMapping(value = "/qywxNotify",
            method = RequestMethod.POST,consumes = "text/xml",produces = "text/xml;charset=utf-8")
    public String wechatPlatformEvent(@PathVariable String APPID,
                                      HttpServletRequest request,
                                      HttpServletResponse response
    ) throws Exception {
        String nonce = request.getParameter("nonce");
        String timestamp = request.getParameter("timestamp");
        String signature = request.getParameter("signature");
        String msgSignature = request.getParameter("msg_signature");
        String encType =  request.getParameter("encrypt_type");
        String xml =  IOUtils.toString(request.getReader());
        Log.info("企业微信回调"+xml);
        return "SUCCESS";
    }
}