flc1125 / alidayu by flc1125

阿里大于(鱼)API-SDK;适用任何PHP项目,包括Laravel、Yii、Thinkphp等...
48,330
181
9
Package Data
Maintainer Username: flc1125
Package Create Date: 2016-07-12
Package Last Update: 2024-12-15
Home Page: http://flc.io/2016/09/563.html
Language: PHP
License: MIT
Last Refreshed: 2024-12-17 03:00:24
Package Statistics
Total Downloads: 48,330
Monthly Downloads: 303
Daily Downloads: 14
Total Stars: 181
Total Watchers: 9
Total Forks: 61
Total Open Issues: 3

阿里大于(鱼) - v2.0

Latest Stable Version Total Downloads php>=5.4 License 996.icu LICENSE

PS:阿里短信 https://github.com/flc1125/dysms

更新

v2.0.6 (2017-08-12)

  • fixed #6

v2.0.5 (2017-01-25)

  • 修复autoload.php https://github.com/flc1125/alidayu/issues/5

v2.0.4 (2016-10-25)

  • 新增自动载入功能(不依靠composer)
  • 新增Client::request快捷调用方法

v2.0.3 (2016-10-12)

  • 新增沙箱配置

功能

待测:因个人开发者,阿里大于权限相对较低。暂时无法测试;功能已开发,如测试可用,请告知~~

环境

安装

composer require flc/alidayu

require '/path/to/alidayu/autoload.php';

使用

<?php
use Flc\Alidayu\Client;
use Flc\Alidayu\App;
use Flc\Alidayu\Requests\AlibabaAliqinFcSmsNumSend;
use Flc\Alidayu\Requests\IRequest;

// 配置信息
$config = [
    'app_key'    => '*****',
    'app_secret' => '************',
    // 'sandbox'    => true,  // 是否为沙箱环境,默认false
];


// 使用方法一
$client = new Client(new App($config));
$req    = new AlibabaAliqinFcSmsNumSend;

$req->setRecNum('13312311231')
    ->setSmsParam([
        'number' => rand(100000, 999999)
    ])
    ->setSmsFreeSignName('叶子坑')
    ->setSmsTemplateCode('SMS_15105357');

$resp = $client->execute($req);

// 使用方法二
Client::configure($config);  // 全局定义配置(定义一次即可,无需重复定义)

$resp = Client::request('alibaba.aliqin.fc.sms.num.send', function (IRequest $req) {
    $req->setRecNum('13312311231')
        ->setSmsParam([
            'number' => rand(100000, 999999)
        ])
        ->setSmsFreeSignName('叶子坑')
        ->setSmsTemplateCode('SMS_15105357');
});

// 返回结果
print_r($resp);
print_r($resp->result->model);
?>

帮助

  • 意见、BUG反馈: https://github.com/flc1125/alidayu/issues

支持

  • 官方网址: https://www.alidayu.com/
  • 官方API文档: https://api.alidayu.com/doc2/apiList.htm
  • composer: https://getcomposer.org/

License

  • MIT
  • Anti 996