135 lines
3.4 KiB
TypeScript
135 lines
3.4 KiB
TypeScript
/**
|
||
* 微信服务器向应用服务器推送的公众号消息或事件
|
||
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_standard_messages.html
|
||
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Receiving_event_pushes.html
|
||
* https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Template_Message_Interface.html#%E4%BA%8B%E4%BB%B6%E6%8E%A8%E9%80%81
|
||
*
|
||
* 微信推送的数据格式是xml,需要自主转化成json对象
|
||
*/
|
||
export type WechatPublicEventData = {
|
||
ToUserName: string;
|
||
FromUserName: string;
|
||
CreateTime: number;
|
||
MsgID: string;
|
||
MsgType: 'text' | 'image' | 'voice' | 'video' | 'location' | 'link' | 'event';
|
||
Event?: 'subscribe' | 'unsubscribe' | 'SCAN' | 'LOCATION' | 'CLICK' | 'VIEW' | 'TEMPLATESENDJOBFINISH';
|
||
EventKey?: string;
|
||
Ticket?: string;
|
||
Latitude?: string;
|
||
Longitude?: string;
|
||
Precision?: string;
|
||
Status?: string;
|
||
Content?: string;
|
||
MsgDataId?: string;
|
||
PicUrl?: string;
|
||
MediaId?: string;
|
||
Format?: string;
|
||
Recognition?: string;
|
||
ThumbMediaId?: string;
|
||
Location_X?: number;
|
||
Location_Y?: number;
|
||
Scale?: number;
|
||
Label?: string;
|
||
Title?: string;
|
||
Description?: string;
|
||
Url?: string;
|
||
Idx?: number;
|
||
};
|
||
export declare type WechatMpEventData = {
|
||
ToUserName: string;
|
||
FromUserName: string;
|
||
CreateTime: number;
|
||
MsgID: string;
|
||
MsgType: 'text' | 'image' | 'miniprogrampage' | 'event';
|
||
Event?: 'user_enter_tempsession';
|
||
SessionFrom?: string;
|
||
Content?: string;
|
||
MediaId?: string;
|
||
PicUrl?: string;
|
||
Title?: string;
|
||
AppId?: string;
|
||
PagePath?: string;
|
||
ThumbUrl?: string;
|
||
ThumbMediaId?: string;
|
||
};
|
||
type ExpressUserData = {
|
||
name?: string;
|
||
tel?: string;
|
||
mobile?: string;
|
||
company?: string;
|
||
post_code?: string;
|
||
country?: string;
|
||
province?: string;
|
||
city?: string;
|
||
area?: string;
|
||
address?: string;
|
||
};
|
||
export type AddExpressOrderData = {
|
||
order_id: string;
|
||
openid?: string;
|
||
delivery_id: string;
|
||
biz_id: string;
|
||
custom_remark?: string;
|
||
tagid?: number;
|
||
add_source: 0 | 2;
|
||
wx_appid?: string;
|
||
sender: ExpressUserData;
|
||
receiver: ExpressUserData;
|
||
cargo: {
|
||
count: number;
|
||
weight: number;
|
||
space_x: number;
|
||
space_y: number;
|
||
space_z: number;
|
||
detail_list: Array<{
|
||
name: string;
|
||
count: number;
|
||
}>;
|
||
};
|
||
shop: {
|
||
wxa_path?: string;
|
||
img_url?: string;
|
||
goods_name?: string;
|
||
goods_count?: number;
|
||
detail_list?: Array<object>;
|
||
};
|
||
insured: {
|
||
use_insured: 0 | 1;
|
||
insured_value?: number;
|
||
};
|
||
service: {
|
||
service_type: number;
|
||
service_name: string;
|
||
};
|
||
expect_time?: number;
|
||
take_mode?: number;
|
||
};
|
||
export type CancelExpressOrderData = {
|
||
openid?: string;
|
||
delivery_id: string;
|
||
waybill_id: string;
|
||
order_id: string;
|
||
};
|
||
export type getExpressPathData = {
|
||
openId?: string;
|
||
delivery_id: string;
|
||
waybill_id: string;
|
||
};
|
||
export type getWaybillTokenData = {
|
||
openId?: string;
|
||
sender_phone?: string;
|
||
receiver_phone: string;
|
||
delivery_id?: string;
|
||
waybill_id: string;
|
||
goods_info: {
|
||
detail_list: {
|
||
goods_name: string;
|
||
goods_img_url: string;
|
||
goods_desc?: string;
|
||
}[];
|
||
};
|
||
trans_id?: string;
|
||
order_detail_path?: string;
|
||
};
|
||
export {};
|