zoukankan      html  css  js  c++  java
  • Delphi XE7 用indy开发微信公众平台(5)- 接收事件推送

    接收事件推送

    原文链接:http://www.cnblogs.com/devinlee/p/4282638.html

    扫下方二维码关注,测试效果

    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;
  • 相关阅读:
    Oracle中Lpad函数和Rpad函数的用法
    SQL中on条件与where条件的区别
    安装sqlServer
    springboot注解加深
    springcloud父项工程pom
    雪花算法
    docker 创建mysql容器
    docker入门
    restful接口规范(安全与幂等)
    mysql
  • 原文地址:https://www.cnblogs.com/devinlee/p/4282638.html
Copyright © 2011-2022 走看看