shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
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
42
43
44
45
46
47
package com.iplatform.base.controller;
 
import com.iplatform.base.WechatBaseController;
import com.iplatform.core.SimpleVariable;
import com.walker.infrastructure.arguments.Variable;
import com.walker.web.ResponseValue;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.ArrayList;
import java.util.List;
 
/**
 * 微信公众号等公共回调,统一在这里配置,暂时还没用上。
 * @author 时克英
 * @date 2023-08-27
 * @date 2023-08-28 该对象不再使用, 公众号通知暂停使用(微信政策调整),这里仅用于测试。
 */
@Deprecated
@RestController
@RequestMapping("/pay/notify/wechat")
public class WechatCallbackApi extends WechatBaseController {
 
    @RequestMapping("/message_template")
    public ResponseValue messageTemplateCallback(@RequestBody String raw){
        logger.debug("微信公众号通知回调:{}", raw);
 
        return ResponseValue.success();
    }
 
    @RequestMapping("/send")
    public ResponseValue testSendMessage(){
        List<Variable> variableList = new ArrayList(8);
//        variableList.add(new SimpleVariable("first", "订单发货提醒"));
//        variableList.add(new SimpleVariable("keyword1", order.getOrderNo()));
//        variableList.add(new SimpleVariable("keyword2", orderInvoice.getExpressName()));
//        variableList.add(new SimpleVariable("keyword3", orderInvoice.getExpressCode()));
//        variableList.add(new SimpleVariable("remark", "欢迎再次光临"));
        variableList.add(new SimpleVariable("character_string2", "12345678"));
        variableList.add(new SimpleVariable("thing13", "一个物流公司"));
        variableList.add(new SimpleVariable("character_string14", "99087653"));
        variableList.add(new SimpleVariable("thing22", "一个商户名称"));
        this.pushNotificationWithTemplate("deliverGoods", variableList, 1392024848028311L);
        return ResponseValue.success();
    }
}