zoukankan      html  css  js  c++  java
  • 微信公众平台——接收事件推送

    微信公众平台——接收事件推送

    type
    TEventType = (subscribe, unsubscribe, SCAN, LOCATION, CLICK, VIEW);

    function ResponseEvent(M: TMessage; X: IXMLDocument): RawByteString;
    var
    event: TEventType;
    temp, menu: String;
    begin
    temp := X.DocumentElement.ChildNodes.Nodes['Event'].NodeValue;
    event := TEventType(GetEnumValue(TypeInfo(TEventType), temp));
    with X.DocumentElement.ChildNodes do
    case event of
    subscribe:
    begin
    Result := '';
    addlog('事件:' + temp + ', ' + M.FromUserName);
    end;
    unsubscribe:
    begin
    Result := '';
    addlog('事件:' + temp + ', ' + M.FromUserName);
    end;
    SCAN:
    begin
    Result := '';
    addlog('事件:' + temp + ', ' + M.FromUserName);
    end;
    LOCATION:
    begin
    Result := '';
    addlog('事件:' + temp + ', ' + M.FromUserName);
    end;
    CLICK:
    begin
    menu := Nodes['EventKey'].NodeValue;
    addlog('事件:' + temp + ', ' + menu + ', ' + M.FromUserName);
    end;
    VIEW:
    begin
    menu := Nodes['EventKey'].NodeValue;
    Result := '';
    addlog('事件:' + temp + ', ' + menu + ', ' + M.FromUserName);
    end
    else
    begin
    addlog('事件:' + temp + ', ' + M.FromUserName);
    end;
    end;
    end;

  • 相关阅读:
    c语言 12
    c语言中用结构体表示点的坐标,并计算两点之间的距离
    c语言 12
    c语言中结构体数组
    c语言 12-3
    c语言 12-2
    codevs3164 质因数分解
    codevs4438 YJQ Runs Upstairs
    codevs4439 YJQ Requires Food
    codevs4437 YJQ Arranges Sequences
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/8987592.html
Copyright © 2011-2022 走看看