zoukankan      html  css  js  c++  java
  • WeChatCallBack.php框架基类实现

    <?php

    /**

    *

    *wechat basic callback

    *

    **/

    require_once dirname(__FILE__)  .   '/../common/GlobalDefine.php' ;

    class WeChatCallback {

        protected $_postObject;

        protected $_fromUserName;

        protected $_toUserName;

        protected $_createTime;

        protected $_msgType;

        protected $_msgId;

        protected $_time;

        pubilc function getToUserName() {

          return $this->_toUserName;

        }

        // 组装提示信息,HINT_TPL在GlobalDefine.php中定义

        protected function init($postObj) {

          $resultStr = sprintf ( HINT_TPL, $this->_fromUserName,

          $this->_toUserName,&this->_time, 'text', $hint ) ;

          return $resultStr;

        }

        pubilc function init($postObj) {

          // 获取参数

          $this->_postObject = $postObj;

          if ($this->_postObject == false) {

            return false;

          }

          $this->_fromUserName = ( string ) trim ( $ this->_postObject->FromUserName );

          $this->_createTime = ( int ) trim ( $this->_postObject->MsgId );

          $this->_time = time ();

          if(!($this->_fromUserName && $this->_toUserName && $this->_msgType)) {

            return false;

          }

          return true;

        }

        public function process() {

          // HINT_NOT_IMPLEMEMT在GlobalDefine.php中定义的一个提示信息

          return $this->makeHint (HINT_NOT_IMPLEMEMT) ;

        }

    }

    ?>

  • 相关阅读:
    FineReport 子窗口刷新父页面
    Swagger rest API 描述
    maven properties 动态转换
    elasticsearch postman操作
    学习网站
    python | 干货:VSCode 13款插件和8个快捷键,工作效率提升10倍
    python | 5大SQL数据清洗方法
    python | 阿里云发短信教程详细(2) -Python3
    python | 阿里云短信发送服务
    python | Linux各目录及每个目录的详细介绍
  • 原文地址:https://www.cnblogs.com/iifranky7/p/3975155.html
Copyright © 2011-2022 走看看