class DeviceUnbindEvent(BaseEvent): event = 'device_unbind' device_type = StringField('DeviceType') device_id = StringField('DeviceID') session_id = StringField('SessionID') content = Base64DecodeField('Content') open_id = StringField('OpenID')
class WiFiConnectedEvent(BaseEvent): event = 'wificconnected' connect_time = IntegerField('ConnectTime') expire_time = IntegerField('ExpireTime') vendor_id = StringField('VendorId') shop_id = StringField('PlaceId') bssid = StringField('DeviceNo')
class ViewMiniProgramEvent(BaseEvent): """ 从菜单进入小程序事件 """ event = 'view_miniprogram' page_path = StringField('EventKey') # 小程序路径 menu_id = StringField('MenuId') # 菜单ID
class DeviceEventReply(BaseReply): type = 'device_event' event = StringField('Event') device_type = StringField('DeviceType') device_id = StringField('DeviceID') session_id = StringField('SessionID') content = Base64EncodeField('Content')
class VideoMessage(BaseMessage): """ 视频消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'video' media_id = StringField('MediaId') thumb_media_id = StringField('ThumbMediaId')
class ImageMessage(BaseMessage): """ 图片消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'image' media_id = StringField('MediaId') image = StringField('PicUrl')
class CardSkuRemindEvent(BaseEvent): """ 卡券库存报警事件 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#10 """ event = 'card_sku_remind' card_id = StringField('CardId') detail = StringField('Detail')
class UserEnterSessionFromCardEvent(BaseEvent): """ 从卡券进入公众号会话事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#8 """ event = 'user_enter_session_from_card' card_id = StringField('CardId') code = StringField('UserCardCode')
class UserDeleteCardEvent(BaseEvent): """ 卡券删除事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#4 """ event = 'user_del_card' card_id = StringField('CardId') code = StringField('UserCardCode')
class SubmitMembercardUserInfo(BaseEvent): """ 会员卡激活事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#12 """ event = 'submit_membercard_user_info' card_id = StringField('CardId') card_code = StringField('UserCardCode')
class UserScanProductEnterSessionEvent(BaseEvent): """ 进入公众号事件 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1455872179 """ event = 'user_scan_product_enter_session' standard = StringField('KeyStandard') key = StringField('KeyStr')
class VoiceMessage(BaseMessage): """ 语音消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'voice' media_id = StringField('MediaId') format = StringField('Format') recognition = StringField('Recognition')
class ComponentUpdateauthorizedMessage(BaseComponentMessage): """ 更新授权通知 """ type = 'updateauthorized' authorizer_appid = StringField('AuthorizerAppid') authorization_code = StringField('AuthorizationCode') authorization_code_expired_time = StringField( 'AuthorizationCodeExpiredTime') pre_auth_code = StringField('PreAuthCode')
class LinkMessage(BaseMessage): """ 链接消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'link' title = StringField('Title') description = StringField('Description') url = StringField('Url')
class ScanEvent(BaseEvent): """ 用户扫描二维码事件 详情请参阅 https://mp.weixin.qq.com/wiki?id=mp1421140454 """ event = 'scan' scene_id = StringField('EventKey') ticket = StringField('Ticket')
class UserViewCard(BaseEvent): """ 进入会员卡事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#7 """ event = 'user_view_card' card_id = StringField('CardId') code = StringField('UserCardCode') outer_str = StringField('OuterStr')
class UpdateInvoiceStatusEvent(BaseEvent): """ 发票状态更新事件 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1497082828_r1cI2 """ event = 'update_invoice_status' status = StringField('Status') # 发票报销状态 card_id = StringField('CardId') # 发票 Card ID code = StringField('Code') # 发票 Code
class UserScanProductAsyncEvent(BaseEvent): """ 地理位置信息异步推送事件 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1455872179 """ event = 'user_scan_product_async' standard = StringField('KeyStandard') key = StringField('KeyStr') region_code = StringField('RegionCode')
class UserScanProductVerifyActionEvent(BaseEvent): """ 商品审核结果事件 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1455872179 """ event = 'user_scan_product_verify_action' standard = StringField('KeyStandard') key = StringField('KeyStr') result = StringField('Result') reason = StringField('ReasonMsg')
class UpdateMemberCard(BaseEvent): """ 会员卡内容更新事件 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#9 """ event = 'update_member_card' card_id = StringField('CardId') code = StringField('UserCardCode') modify_bonus = IntegerField('ModifyBonus') modify_balance = IntegerField('ModifyBalance')
class UserGiftingCardEvent(BaseEvent): """ 转赠事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#3 """ event = 'user_gifting_card' card_id = StringField('CardId') code = StringField('UserCardCode') is_return_back = IntegerField('IsReturnBack') friend = StringField('FriendUserName') is_chat_room = IntegerField('IsChatRoom')
class UserAuthorizeInvoiceEvent(BaseEvent): """ 用户授权发票事件 (会包含一个订单号,不成功就失败) 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1497082828_r1cI2 """ event = 'user_authorize_invoice' success_order_id = StringField('SuccOrderId') # 授权成功的订单号 fail_order_id = StringField('FailOrderId') # 授权失败的订单号 app_id = StringField('AppId') # 用于接收事件推送的公众号的AppId auth_source = StringField('Source') # 授权来源,web表示来自微信内H5,app标识来自app
class UserPayFromPayCell(BaseEvent): """ 卡券买单事件推送 详情请参阅 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#6 """ event = 'user_pay_from_pay_cell' card_id = StringField('CardId') code = StringField('UserCardCode') trans_id = StringField('TransId') location_id = IntegerField('LocationId') fee = IntegerField('Fee') original_fee = IntegerField('OriginalFee')
class UserScanProductEvent(BaseEvent): """ 打开商品主页事件 详情请参考 https://mp.weixin.qq.com/wiki?id=mp1455872179 """ event = 'user_scan_product' standard = StringField('KeyStandard') key = StringField('KeyStr') country = StringField('Country') province = StringField('Province') city = StringField('City') sex = IntegerField('Sex') scene = IntegerField('Scene')
class LocationMessage(BaseMessage): """ 地理位置消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'location' location_x = StringField('Location_X') location_y = StringField('Location_Y') scale = StringField('Scale') label = StringField('Label') @property def location(self): return self.location_x, self.location_y
class TextReply(BaseReply): """ 文本回复 详情请参阅 http://mp.weixin.qq.com/wiki/9/2c15b20a16019ae613d413e30cac8ea1.html """ type = 'text' content = StringField('Content')
class LocationSelectEvent(BaseEvent): """ 弹出地理位置选择器的事件 详情请参阅 https://mp.weixin.qq.com/wiki?id=mp1421141016 """ event = 'location_select' key = StringField('EventKey') location_info = BaseField('SendLocationInfo', {}) @property def location_x(self): return self.location_info['Location_X'] @property def location_y(self): return self.location_info['Location_Y'] @property def location(self): return self.location_x, self.location_y @property def scale(self): return self.location_info['Scale'] @property def label(self): return self.location_info['Label'] @property def poiname(self): return self.location_info['Poiname']
class UserEnterTempSessionEvent(BaseEvent): """ 小程序用户进入客服消息 详情请参阅 https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/customer-message/receive.html """ event = 'user_enter_tempsession' session_from = StringField('SessionFrom')
class TextMessage(BaseMessage): """ 文本消息 详情请参阅 http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html """ type = 'text' content = StringField('Content')
class CardPassCheckEvent(BaseEvent): """ 卡券审核事件推送 https://developers.weixin.qq.com/doc/offiaccount/Cards_and_Offer/Coupons_Vouchers_and_Cards_Event_Push_Messages.html#1 """ event = 'card_pass_check' card_id = StringField('CardId')