完成基本京粉功能推送,订单统计,订单拉取的稳定版初版

This commit is contained in:
Leo
2024-11-11 00:02:27 +08:00
parent 19f1095a7c
commit 9c1c18b71d
38 changed files with 4628 additions and 185 deletions

View File

@@ -1,4 +1,4 @@
package cn.van.business.controller;
package cn.van.business.controller.jd;
import cn.van.business.util.JDUtils;
import org.springframework.web.bind.annotation.RequestMapping;

View File

@@ -0,0 +1,85 @@
package cn.van.business.controller.wx;
import cn.van.business.model.wx.WxMessage;
import cn.van.business.util.WxMessageConsumer;
import com.alibaba.fastjson2.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author Leo
* @version 1.0
* @create 2023/12/18 0018 下午 05:12V
* @description
*/
@Controller
@RequestMapping("/wx")
@RestController
public class WXListener {
private static final Logger logger = LoggerFactory.getLogger(WXListener.class);
@Autowired
private WxMessageConsumer wxMessageConsumer;
/**
* {
* "event": 10009,
* "wxid": "wxid_kr145nk7l0an31",
* "data": {
* "type": "D0003",* "des": "鏀跺埌娑堟伅",
* "data": {
* "timeStamp": "1702951964728",
* "fromType": 1,
* "msgType": 1,
* "msgSource": 0,
* "fromWxid": "wxid_ytpc72mdoskt22",
* "finalFromWxid": "",
* "atWxidList": [],
* "silence": 0,
* "membercount": 0,
* "signature": "v1_MllZwZMZ",
* "msg": "785",
* "msgBase64": "Nzg1"
* },
* "timestamp": "1702951964740",
* "wxid": "wxid_kr145nk7l0an31",
* "port": 16888,
* "pid": 10468,
* "flag": "7777"
* }
* }
**/
@RequestMapping("/message")
public String message(@RequestBody String requestBody) throws Exception {
WxMessage message = JSONObject.parseObject(requestBody, WxMessage.class);
wxMessageConsumer.consume(message);
return "OK";
}
//@RequestMapping("/test")
//public String test(@RequestBody String requestBody) {
//
// System.out.println("测试接口收到数据:");
// System.out.println(requestBody);
// return "OK";
//}
//@RequestMapping("/receive_msg")
//public String receiveMsg(@RequestBody String requestBody) throws Exception {
//
// System.out.println("测试接口收到数据:");
// System.out.println(requestBody);
// WxMessage message = JSONObject.parseObject(requestBody, WxMessage.class);
// wxMessageConsumer.consume(message);
//
// return "OK";
//}
}