-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathafdian.json
136 lines (136 loc) · 3.4 KB
/
afdian.json
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
[
{
"id": "5e8440329847327e",
"type": "tab",
"label": "爱发电订单通知",
"disabled": false,
"info": "借助爱发电平台 Webhook ,发送 telegram 通知\r\n\r\nhttps://afdian.net/dashboard/dev\r\n\r\n配置 Webhook url 为\r\n\r\nhttp://x.x.x.x:1880/afdian-order\r\n",
"env": []
},
{
"id": "f9f827304e337a81",
"type": "http in",
"z": "5e8440329847327e",
"name": "接收爱发电 Webhook",
"url": "/afdian-order",
"method": "post",
"upload": false,
"swaggerDoc": "",
"x": 180,
"y": 180,
"wires": [
[
"c2fdf82f1cbde732",
"270faafc0952d2a8"
]
]
},
{
"id": "c2fdf82f1cbde732",
"type": "json",
"z": "5e8440329847327e",
"name": "格式化数据",
"property": "payload",
"action": "obj",
"pretty": false,
"x": 450,
"y": 180,
"wires": [
[
"f81db0332f26b620",
"efac1eeca8cedb26"
]
]
},
{
"id": "a183d61d9738cd19",
"type": "http response",
"z": "5e8440329847327e",
"name": "响应 200 状态码",
"statusCode": "200",
"headers": {},
"x": 660,
"y": 100,
"wires": []
},
{
"id": "270faafc0952d2a8",
"type": "change",
"z": "5e8440329847327e",
"name": "设定回传数据",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"ec\":200,\"em\":\"ok\"}",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 480,
"y": 100,
"wires": [
[
"a183d61d9738cd19"
]
]
},
{
"id": "f81db0332f26b620",
"type": "template",
"z": "5e8440329847327e",
"name": "由模板生成消息",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\n \"action\": \"send_message\",\n \"data\":{\n \"chat_id\": -100,\n \"text\": \"[爱发电] 有新的订单被处理,收款 {{payload.data.order.total_amount}} 元\"\n }\n}",
"output": "str",
"x": 660,
"y": 180,
"wires": [
[
"f8483f6f486c6bc8"
]
]
},
{
"id": "f8483f6f486c6bc8",
"type": "websocket out",
"z": "5e8440329847327e",
"name": "pgm 发送",
"server": "d57d2813420fedfb",
"client": "",
"x": 860,
"y": 180,
"wires": []
},
{
"id": "efac1eeca8cedb26",
"type": "debug",
"z": "5e8440329847327e",
"name": "调试订单数据",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 660,
"y": 240,
"wires": []
},
{
"id": "d57d2813420fedfb",
"type": "websocket-listener",
"path": "/ws",
"wholemsg": "false"
}
]