コード例 #1
0
class NoNameMessage(object):
    test_int = IntEntry("TestInt")
    test_string_to_int = IntEntry("TestStringToInt")
    test_float_to_int = IntEntry("TestFloatToInt")
    test_int_none = IntEntry("MIAOMIAOMIAO")

    test_float = FloatEntry("TestFloat")
    test_string_to_float = FloatEntry("TestStringToFloat")
    test_float_none = FloatEntry("WANGWANG")

    test_string = StringEntry("TestString")
    test_int_to_string = StringEntry("TestIntToString")
    test_float_to_string = StringEntry("TestFloatToString")
    test_chinese = StringEntry("TestChinese")
    test_string_none = StringEntry("HAHAHA")

    def __init__(self):
        message = {
            "TestInt": 123,
            "TestFloat": 0.00001,
            "TestString": "hello",
            "TestStringToInt": "123",
            "TestFloatToInt": 123.000,
            "TestStringToFloat": "0.00001",
            "TestIntToString": 123,
            "TestFloatToString": 0.00001,
            "TestChinese": "喵",
        }
        self.__dict__.update(message)
コード例 #2
0
class WeChatEvent(object):
    target = StringEntry('ToUserName')
    source = StringEntry('FromUserName')
    time = IntEntry('CreateTime')

    def __init__(self, message):
        self.__dict__.update(message)
コード例 #3
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class UserScanProductEvent(BaseProductEvent):
    __type__ = 'user_scan_product_event'
    country = StringEntry('Country')
    province = StringEntry('Province')
    city = StringEntry('City')
    sex = IntEntry('Sex')
    scene = IntEntry('Scene')
コード例 #4
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class LocationSelectEvent(SimpleEvent):
    __type__ = 'location_select_event'
    location_x = StringEntry('SendLocationInfo.Location_X')
    location_y = StringEntry('SendLocationInfo.Location_Y')
    scale = StringEntry('SendLocationInfo.Scale')
    label = StringEntry('SendLocationInfo.Label')
    poi_name = StringEntry('SendLocationInfo.Poiname')
コード例 #5
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class WeChatEvent(object, metaclass=EventMetaClass):
    target = StringEntry('ToUserName')
    source = StringEntry('FromUserName')
    time = IntEntry('CreateTime')
    message_id = IntEntry('MsgID', 0)

    def __init__(self, message):
        self.__dict__.update(message)
コード例 #6
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class WeChatMessage(object):
    message_id = IntEntry('MsgId', 0)
    target = StringEntry('ToUserName')
    source = StringEntry('FromUserName')
    time = IntEntry('CreateTime', 0)

    def __init__(self, message):
        self.__dict__.update(message)
コード例 #7
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class UserGetCardEvent(BaseCardEvent):
    __type__ = 'user_get_card_event'
    is_give_by_friend = IntEntry('IsGiveByFriend')
    friend_user_name = StringEntry('FriendUserName')
    outer_id = IntEntry('OuterId')
    old_user_card_code = StringEntry('OldUserCardCode')
    outer_str = StringEntry('OuterStr')
    is_restore_member_card = IntEntry('IsRestoreMemberCard')
    is_recommend_by_friend = IntEntry('IsRecommendByFriend')
コード例 #8
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class CardPayOrderEvent(WeChatEvent):
    __type__ = 'card_pay_order_event'
    order_id = StringEntry('OrderId')
    status = StringEntry('Status')
    create_order_time = IntEntry('CreateOrderTime')
    pay_finish_time = IntEntry('PayFinishTime')
    desc = StringEntry('Desc')
    free_coin_count = StringEntry('FreeCoinCount')
    pay_coin_count = StringEntry('PayCoinCount')
    refund_free_coin_count = StringEntry('RefundFreeCoinCount')
    refund_pay_coin_count = StringEntry('RefundPayCoinCount')
    order_type = StringEntry('OrderType')
    memo = StringEntry('Memo')
    receipt_info = StringEntry('ReceiptInfo')
コード例 #9
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class LocationMessage(WeChatMessage):
    __type__ = 'location'
    location_x = FloatEntry('Location_X')
    location_y = FloatEntry('Location_Y')
    label = StringEntry('Label')
    scale = IntEntry('Scale')

    @property
    def location(self):
        return self.location_x, self.location_y
コード例 #10
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class UserConsumeCardEvent(BaseCardEvent):
    __type__ = 'user_consume_card_event'
    consume_source = StringEntry('ConsumeSource')
    location_name = StringEntry('LocationName')
    staff_open_id = StringEntry('StaffOpenId')
    verify_code = StringEntry('VerifyCode')
    remark_amount = StringEntry('RemarkAmount')
    outer_str = StringEntry('OuterStr')
コード例 #11
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class UserScanProductVerifyActionEvent(WeChatEvent):
    __type__ = 'user_scan_product_verify_action_event'
    key_standard = StringEntry('KeyStandard')
    key_str = StringEntry('KeyStr')
    result = StringEntry('Result')
    reason_msg = StringEntry('ReasonMsg')
コード例 #12
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class SimpleEvent(WeChatEvent):
    key = StringEntry('EventKey')
コード例 #13
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class BaseCardEvent(WeChatEvent):
    card_id = StringEntry('CardId')
    user_card_code = StringEntry('UserCardCode')
コード例 #14
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class UserScanProductAsyncEvent(BaseProductEvent):
    __type__ = 'user_scan_product_async_event'
    region_code = StringEntry('RegionCode')
コード例 #15
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class CardSkuRemindEvent(WeChatEvent):
    __type__ = 'card_sku_remind_event'
    card_id = StringEntry('CardId')
    detail = StringEntry('Detail')
コード例 #16
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class BaseProductEvent(WeChatEvent):
    key_standard = StringEntry('KeyStandard')
    key_str = StringEntry('KeyStr')
    ext_info = StringEntry('ExtInfo')
コード例 #17
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class UserPayFromPayCellEvent(BaseCardEvent):
    __type__ = 'user_pay_from_pay_cell_event'
    trans_id = StringEntry('TransId')
    location_id = IntEntry('LocationId')
    fee = StringEntry('Fee')
    original_fee = StringEntry('OriginalFee')
コード例 #18
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class ScanCodeWaitMsgEvent(ScanCodePushEvent):
    __type__ = 'scancode_waitmsg_event'
    scan_type = StringEntry('ScanCodeInfo.ScanType')
    scan_result = StringEntry('ScanCodeInfo.ScanResult')
コード例 #19
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class LinkMessage(WeChatMessage):
    __type__ = 'link'
    title = StringEntry('Title')
    description = StringEntry('Description')
    url = StringEntry('Url')
コード例 #20
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class VoiceMessage(WeChatMessage):
    __type__ = 'voice'
    media_id = StringEntry('MediaId')
    format = StringEntry('Format')
    recognition = StringEntry('Recognition')
コード例 #21
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class BaseCardCheckEvent(WeChatEvent):
    card_id = StringEntry('CardId')
    refuse_reason = StringEntry('RefuseReason')
コード例 #22
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class ImageMessage(WeChatMessage):
    __type__ = 'image'
    img = StringEntry('PicUrl')
コード例 #23
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class TextMessage(WeChatMessage):
    __type__ = 'text'
    content = StringEntry('Content')
コード例 #24
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class TicketEvent(WeChatEvent):
    key = StringEntry('EventKey')
    ticket = StringEntry('Ticket')
コード例 #25
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class UserViewCardEvent(BaseCardEvent):
    __type__ = 'user_view_card_event'
    outer_str = StringEntry('OuterStr')
コード例 #26
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class ScanCodePushEvent(SimpleEvent):
    __type__ = 'scancode_push_event'
    scan_type = StringEntry('ScanCodeInfo.ScanType')
    scan_result = StringEntry('ScanCodeInfo.ScanResult')
コード例 #27
0
ファイル: events.py プロジェクト: zjdpf/WeRoBot
class TemplateSendJobFinishEvent(WeChatEvent):
    __type__ = 'templatesendjobfinish_event'
    status = StringEntry('Status')
コード例 #28
0
ファイル: messages.py プロジェクト: Lilyonegithub/venv
class VideoMessage(WeChatMessage):
    __type__ = ['video', 'shortvideo']
    media_id = StringEntry('MediaId')
    thumb_media_id = StringEntry('ThumbMediaId')
コード例 #29
0
ファイル: events.py プロジェクト: ziye-now/WeRoBot
class UserGiftingCardEvent(BaseCardEvent):
    __type__ = 'user_gifting_card_event'
    is_return_back = IntEntry('IsReturnBack')
    friend_user_name = StringEntry('FriendUserName')
    is_chat_room = IntEntry('IsChatRoom')