1
0

logSystem-advance

yanglin 20410241e0 bendi преди 6 години
api 20410241e0 bendi преди 6 години
backend 936ba2d4f4 master преди 6 години
common 20410241e0 bendi преди 6 години
components 20410241e0 bendi преди 6 години
console 79b782eb63 host преди 6 години
environments 8f9f76632d 用户记录指针 преди 6 години
frontend 20410241e0 bendi преди 6 години
vagrant 33e8b257f2 master преди 6 години
.bowerrc 8f9f76632d 用户记录指针 преди 6 години
.gitignore ce28beb42c master преди 6 години
LICENSE.md 8f9f76632d 用户记录指针 преди 6 години
README.md 73ebc6fa42 redeam преди 6 години
Vagrantfile 8f9f76632d 用户记录指针 преди 6 години
codeception.yml 8f9f76632d 用户记录指针 преди 6 години
composer.json 8a365b8d63 master преди 6 години
composer.lock 936ba2d4f4 master преди 6 години
init 8f9f76632d 用户记录指针 преди 6 години
init.bat 8f9f76632d 用户记录指针 преди 6 години
newfile.vcf 77ef2c832c user преди 6 години
nohup.out 20410241e0 bendi преди 6 години
requirements.php 8f9f76632d 用户记录指针 преди 6 години
yii.bat 8f9f76632d 用户记录指针 преди 6 години

README.md

This is logsystem for FuZaMei moded by rabbitmq and Yii 2 Advanced



  • rabbitemq-使用规范接口文档(暂时components)
  • composer require php-amqplib/php-amqplib 2.6.* 安装yii2 amqp
  • phpclient.php 调用使用基类
  • console PhpClient::CallMq($n); 推送json数据到 rabbitmq中 channel 频道为 task_queue (后期可配置)
  • curl curl调用 基于nginx input直接输入到 rabbitmq中
  • json 带提供json数据交互形式 文档success 则进入消息队列 error 则返回失败和msg原因

请求接口数据

http://ki.logsystemapi.airent.test.com/api/mqinsert?signature=44D027A88F0D44B12E1DF90691B491C0&timestamp=1&&rabbitdata=你好&
  加密参数
  defined('APP_ID') or define("APP_ID", "disanbo");
  defined('APP_SECRET') or define("APP_SECRET", "di~sanbo1");
  加密方法

备注: unset($params['signature']); //签名本身请不要加密 需要加密的 timestamp params 需要平台提供 APP_ID APP_SECRET

 private static function getSign($params, $appkey, $appSecret, $time)
    {
        $sign = '';
        if (!empty($params)) {
            ksort($params);
            $string = http_build_query($params);
            $result = md5($appkey . $string . $appSecret . $time);
            $sign = strtoupper($result);
        }
        return $sign;
    }

    ?signature=461C772759332891F31A1A8110A98150&timestamp=221&&rabbitdata=hello&

成功返回接口数据

{
  "message": "rabbit insert Ok!",
  "action": "insert",
  "rabbitdata": {
    "r": "api/page",
    "signature": "44D027A88F0D44B12E1DF90691B491C0",
    "timestamp": "1",
    "rabbitdata": "nihao"
  },
  "code": 100
}

失败返回接口

{
    "message": "signature test fail!",
    "code": 201
}
{
    "message": "params key canot be null!",
    "code": 202
}
{
    "message": "params key canot be null!",
    "code": 203
}

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

DIRECTORY STRUCTURE

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
    tests/               contains tests for common classes
components
    phpclient.php/       contains shared rabbitmq class
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for backend application    
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for frontend application
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets
vendor/                  contains dependent 3rd-party packages
environments/            contains environment-based overrides
------
api                      新增接口层应用
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for frontend application
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets