2017 © Pedro Peláez
 

library lenovo-think-iot

lenovo connect think iot api 2.0

image

caojianfei/lenovo-think-iot

lenovo connect think iot api 2.0

  • Friday, May 11, 2018
  • by caojianfei
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

联想 THINKIOT API 2.0 sdk

此扩展是联想 THINKIOT API 2.0 的 SDK,可以方便的在 Laravel 中集成。由于联想懂得的相关接口还没有稳定,所以暂时没有稳定版本发布。, (*1)

安装

composer install caojianfei/lenovo-think-iot

由于目前没有发布稳定版本,需要手动在composer.json文件的require中指定,像这样:, (*2)

"require": {
    "caojianfei/lenovo-think-iot": "dev-master"
}

配置

[
    'auth' => [
        'appkey' => '',
        'custid' => '',
    ],
    'gateway_url' => '' # 网关地址,默认 http://thinkiotapi.lenovo.com/httpOpenServer/serviceProvide
];
  • 在 Laravel 中自定义配置

在命令行下运行, (*3)

php artisan vendor:publish

然后在 config 目录下的 lenovo-think.php 中修改配置。, (*4)

  • 在其他项目中自定义配置

可以直接在实例化 ThinkManage 这个类的时候第一个参数传入配置或者配置的文件路径。, (*5)

使用

在 Laravel 框架中使用

  • 调用示例

使用 Facade, (*6)

# 查询流量卡信息
Think::queryFlowInfo($iccid);

# 变更资费月套餐接口
Think::cardChangeInfo($iccid, $postageId);

直接使用, (*7)

# 获取 sdk 实例
$think = app('thinkiot');

# 查询流量卡信息
$think->queryFlowInfo($iccid);

# 变更资费月套餐接口
$think->query($iccid, $postageId);

在其他项目中使用


$config = [ 'auth' => [ 'appkey' => '123456', 'custid' => '654321', ], 'gateway_url' => 'url' # 网关地址 ]; #$config 也可以是配置的文件目录,例如 'configs/lenovo-think.php' $think = new \CJF\ThinkIot\ThinkManage($config); # 查询流量卡信息 $think->queryFlowInfo($iccid); # 变更资费月套餐接口 $think->query($iccid, $postageId);

The Versions

11/05 2018

dev-master

9999999-dev

lenovo connect think iot api 2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar caojianfei

11/05 2018

dev-develop

dev-develop

lenovo connect think iot api 2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar caojianfei