29 changed files with 4128 additions and 0 deletions
@ -0,0 +1,132 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_command_modbus |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型String, 参数不可以为空 |
|||
// 描述:产品ID,必填 |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述:设备ID,必填 |
|||
//参数status: 类型String, 参数可以为空 |
|||
// 描述:状态可选填: 1:指令已保存 2:指令已发送 3:指令已送达 4:指令已完成 6:指令已取消 999:指令失败 |
|||
//参数startTime: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数endTime: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型String, 参数可以为空 |
|||
// 描述: |
|||
public static function QueryCommandList($appKey, $appSecret, $MasterKey, $productId, $deviceId, $status = "", $startTime = "", $endTime = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_command_modbus/modbus/commands"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
$param["status"] = $status; |
|||
$param["startTime"] = $startTime; |
|||
$param["endTime"] = $endTime; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200904171008"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品ID |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述:设备ID |
|||
//参数commandId: 类型String, 参数不可以为空 |
|||
// 描述:指令ID |
|||
public static function QueryCommand($appKey, $appSecret, $MasterKey, $productId, $deviceId, $commandId) |
|||
{ |
|||
$path = "/aep_command_modbus/modbus/command"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
$param["commandId"] = $commandId; |
|||
|
|||
$version = "20200904172207"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CancelCommand($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_command_modbus/modbus/cancelCommand"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20200404012453"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateCommand($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_command_modbus/modbus/command"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20200404012449"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,129 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_command |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateCommand($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_command/command"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190712225145"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品ID,必填 |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述:设备ID,必填 |
|||
//参数startTime: 类型String, 参数可以为空 |
|||
// 描述:日期格式,年月日时分秒,例如:20200801120130 |
|||
//参数endTime: 类型String, 参数可以为空 |
|||
// 描述:日期格式,年月日时分秒,例如:20200801120130 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数,最大40 |
|||
public static function QueryCommandList($appKey, $appSecret, $MasterKey, $productId, $deviceId, $startTime = "", $endTime = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_device_command/commands"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
$param["startTime"] = $startTime; |
|||
$param["endTime"] = $endTime; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200814163736"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数commandId: 类型String, 参数不可以为空 |
|||
// 描述:创建指令成功响应中返回的id, |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述:设备ID |
|||
public static function QueryCommand($appKey, $appSecret, $MasterKey, $commandId, $productId, $deviceId) |
|||
{ |
|||
$path = "/aep_device_command/command"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["commandId"] = $commandId; |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
|
|||
$version = "20190712225241"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CancelCommand($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_command/cancelCommand"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615023142"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_command_cancel |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CancelAllCommand($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_command_cancel/cancelAllCommand"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20230419143717"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_command_lwm_profile |
|||
{ |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateCommandLwm2mProfile($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_device_command_lwm_profile/commandLwm2mProfile"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20191231141545"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,92 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_control |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:可选填:设备Id |
|||
//参数type: 类型long, 参数可以为空 |
|||
// 描述:可选填枚举值: |
|||
// 1:设备重启 |
|||
// 2:退出平台 |
|||
// 3:重新登录 |
|||
// 4:设备自检 |
|||
// 6:开始发送数据 |
|||
// 7:停止发送数据 |
|||
// 8:恢复出厂设置 |
|||
//参数status: 类型long, 参数可以为空 |
|||
// 描述:可选填:1:指令已保存 |
|||
// 2:指令已发送 |
|||
// 3:指令已送达 |
|||
// 4:指令已完成 |
|||
// 999:指令发送失败 |
|||
//参数startTime: 类型String, 参数可以为空 |
|||
// 描述:精确到毫秒的时间戳 |
|||
//参数endTime: 类型String, 参数可以为空 |
|||
// 描述:精确到毫秒的时间戳 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
public static function QueryRemoteControlList($appKey, $appSecret, $MasterKey, $productId, $searchValue = "", $type = "", $status = "", $startTime = "", $endTime = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_device_control/controls"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["type"] = $type; |
|||
$param["status"] = $status; |
|||
$param["startTime"] = $startTime; |
|||
$param["endTime"] = $endTime; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190507012630"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateRemoteControl($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_control/control"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20181031202247"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_event |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryDeviceEventList($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_event/device/events"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20210327064751"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryDeviceEventTotal($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_event/device/events/total"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20210327064755"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,206 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_group_management |
|||
{ |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateDeviceGroup($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_device_group_management/deviceGroup"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615001622"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateDeviceGroup($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_device_group_management/deviceGroup"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615001615"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数可以为空 |
|||
// 描述:产品Id,单产品分组必填 |
|||
//参数deviceGroupId: 类型long, 参数不可以为空 |
|||
// 描述:分组Id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
public static function DeleteDeviceGroup($appKey, $appSecret, $deviceGroupId, $productId = "", $MasterKey = "") |
|||
{ |
|||
$path = "/aep_device_group_management/deviceGroup"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceGroupId"] = $deviceGroupId; |
|||
|
|||
$version = "20190615001601"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数pageNow: 类型long, 参数不可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数不可以为空 |
|||
// 描述:每页记录数 |
|||
//参数productId: 类型long, 参数可以为空 |
|||
// 描述:支持通过产品id查询单产品分组列表 |
|||
//参数deviceGroupId: 类型long, 参数可以为空 |
|||
// 描述:支持通过分组ID查询 |
|||
//参数deviceGroupName: 类型String, 参数可以为空 |
|||
// 描述:支持通过分组名称查询 |
|||
//参数groupLevel: 类型long, 参数可以为空 |
|||
// 描述:支持通过分组类别查询,0为单产品分组,1为多产品分组 |
|||
public static function QueryDeviceGroupList($appKey, $appSecret, $pageNow, $pageSize, $productId = "", $deviceGroupId = "", $deviceGroupName = "", $groupLevel = "") |
|||
{ |
|||
$path = "/aep_device_group_management/deviceGroups"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["productId"] = $productId; |
|||
$param["deviceGroupId"] = $deviceGroupId; |
|||
$param["deviceGroupName"] = $deviceGroupName; |
|||
$param["groupLevel"] = $groupLevel; |
|||
|
|||
$version = "20230218035819"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数productId: 类型long, 参数可以为空 |
|||
// 描述:产品ID,查询单产品分组下已关联的设备列表或产品下未关联的设备列表时必填 |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:可查询:设备ID,设备名称,设备编号或者IMEI号;仅支持单产品分组查询 |
|||
//参数pageNow: 类型long, 参数不可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数不可以为空 |
|||
// 描述:每页条数 |
|||
//参数deviceGroupId: 类型long, 参数可以为空 |
|||
// 描述:群组ID:1.有值则查询该群组已关联的设备信息列表。2.为空则查询该产品下未关联的设备信息列表 |
|||
public static function QueryGroupDeviceList($appKey, $appSecret, $pageNow, $pageSize, $MasterKey = "", $productId = "", $searchValue = "", $deviceGroupId = "") |
|||
{ |
|||
$path = "/aep_device_group_management/groupDeviceList"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["deviceGroupId"] = $deviceGroupId; |
|||
|
|||
$version = "20190615001540"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateDeviceGroupRelation($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_device_group_management/deviceGroupRelation"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615001526"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function getGroupDetailByDeviceId($appKey, $appSecret, $productId, $deviceId) |
|||
{ |
|||
$path = "/aep_device_group_management/groupOfDeviceId"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
|
|||
$version = "20211014095939"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,317 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_management |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:T-link协议可选填:设备名称,设备编号,设备Id |
|||
// MQTT协议可选填:设备名称,设备编号,设备Id |
|||
// LWM2M协议可选填:设备名称,设备Id ,IMEI号 |
|||
// TUP协议可选填:设备名称,设备Id ,IMEI号 |
|||
// TCP协议可选填:设备名称,设备编号,设备Id |
|||
// HTTP协议可选填:设备名称,设备编号,设备Id |
|||
// JT/T808协议可选填:设备名称,设备编号,设备Id |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数,最大100 |
|||
public static function QueryDeviceList($appKey, $appSecret, $MasterKey, $productId, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_device_management/devices"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190507012134"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryDevice($appKey, $appSecret, $MasterKey, $deviceId, $productId) |
|||
{ |
|||
$path = "/aep_device_management/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["deviceId"] = $deviceId; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20181031202139"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceIds: 类型String, 参数不可以为空 |
|||
// 描述:可以删除多个设备(最多支持200个设备)。多个设备id,中间以逗号 "," 隔开 。样例:05979394b88a45b0842de729c03d99af,06106b8e1d5a458399326e003bcf05b4 |
|||
public static function DeleteDevice($appKey, $appSecret, $MasterKey, $productId, $deviceIds) |
|||
{ |
|||
$path = "/aep_device_management/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceIds"] = $deviceIds; |
|||
|
|||
$version = "20181031202131"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateDevice($appKey, $appSecret, $MasterKey, $deviceId, $body) |
|||
{ |
|||
$path = "/aep_device_management/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["deviceId"] = $deviceId; |
|||
|
|||
$version = "20181031202122"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateDevice($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20181031202117"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function BindDevice($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/bindDevice"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20191024140057"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UnbindDevice($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/unbindDevice"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20191024140103"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数imei: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryProductInfoByImei($appKey, $appSecret, $imei) |
|||
{ |
|||
$path = "/aep_device_management/device/getProductInfoFormApiByImei"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["imei"] = $imei; |
|||
|
|||
$version = "20191213161859"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ListDeviceInfo($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/listByDeviceIds"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20210828062945"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteDeviceByPost($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/deleteDevice"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20211009132842"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ListDeviceActiveStatus($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/listActiveStatus"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20211010063104"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function BatchCreateDevice($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_device_management/batchDevice"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20230330043852"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,90 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_model |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:可填值:属性名称,属性标识符 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
public static function QueryPropertyList($appKey, $appSecret, $MasterKey, $productId, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_device_model/dm/app/model/properties"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190712223330"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:可填: 服务Id, 服务名称,服务标识符 |
|||
//参数serviceType: 类型long, 参数可以为空 |
|||
// 描述:服务类型 |
|||
// 1. 数据上报 |
|||
// 2. 事件上报 |
|||
// 3.数据获取 |
|||
// 4.参数查询 |
|||
// 5.参数配置 |
|||
// 6.指令下发 |
|||
// 7.指令下发响应 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
public static function QueryServiceList($appKey, $appSecret, $MasterKey, $productId, $searchValue = "", $serviceType = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_device_model/dm/app/model/services"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["serviceType"] = $serviceType; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190712224233"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,88 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_device_status |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryDeviceStatus($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_device_status/deviceStatus"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20181031202028"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryDeviceStatusList($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_device_status/deviceStatusList"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20181031202403"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function getDeviceStatusHisInTotal($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_device_status/api/v1/getDeviceStatusHisInTotal"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20190928013529"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function getDeviceStatusHisInPage($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_device_status/getDeviceStatusHisInPage"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20190928013337"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,155 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_edge_gateway |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteEdgeInstanceDevice($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance/devices"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201226000026"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数gatewayDeviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function QueryEdgeInstanceDevice($appKey, $appSecret, $gatewayDeviceId, $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_edge_gateway/instance/devices"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["gatewayDeviceId"] = $gatewayDeviceId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20201226000022"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateEdgeInstance($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201226000017"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function EdgeInstanceDeploy($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance/settings"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201226000010"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function DeleteEdgeInstance($appKey, $appSecret, $id) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20201225235957"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function AddEdgeInstanceDevice($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance/device"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201226000004"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function AddEdgeInstanceDrive($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_edge_gateway/instance/drive"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201225235952"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,131 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_firmware_management |
|||
{ |
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:固件id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateFirmware($appKey, $appSecret, $id, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_firmware_management/firmware"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20190615001705"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询条件,可以根据固件名称模糊查询 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
public static function QueryFirmwareList($appKey, $appSecret, $productId, $searchValue = "", $pageNow = "", $pageSize = "", $MasterKey = "") |
|||
{ |
|||
$path = "/aep_firmware_management/firmwares"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190615001608"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:固件id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function QueryFirmware($appKey, $appSecret, $id, $productId, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_firmware_management/firmware"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20190618151645"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:固件id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数updateBy: 类型String, 参数可以为空 |
|||
// 描述:修改人 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function DeleteFirmware($appKey, $appSecret, $id, $productId, $updateBy = "", $MasterKey = "") |
|||
{ |
|||
$path = "/aep_firmware_management/firmware"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["updateBy"] = $updateBy; |
|||
$param["MasterKey"] = $MasterKey; |
|||
|
|||
$version = "20190615001534"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,171 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_modbus_device_management |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateDevice($appKey, $appSecret, $MasterKey, $deviceId, $body) |
|||
{ |
|||
$path = "/aep_modbus_device_management/modbus/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["deviceId"] = $deviceId; |
|||
|
|||
$version = "20200404012440"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateDevice($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_modbus_device_management/modbus/device"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200404012437"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryDevice($appKey, $appSecret, $MasterKey, $deviceId, $productId) |
|||
{ |
|||
$path = "/aep_modbus_device_management/modbus/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["deviceId"] = $deviceId; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20200404012435"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:设备名称,设备编号,设备Id |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function QueryDeviceList($appKey, $appSecret, $MasterKey, $productId, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_modbus_device_management/modbus/devices"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200404012428"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceIds: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function DeleteDevice($appKey, $appSecret, $MasterKey, $productId, $deviceIds) |
|||
{ |
|||
$path = "/aep_modbus_device_management/modbus/device"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceIds"] = $deviceIds; |
|||
|
|||
$version = "20200404012425"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ListDeviceInfo($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_modbus_device_management/listByDeviceIds"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20210828063614"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,143 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_mq_sub |
|||
{ |
|||
public static function QueryServiceState($appKey, $appSecret) |
|||
{ |
|||
$path = "/aep_mq_sub/mqStat"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201218144210"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function OpenMqService($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_mq_sub/mqStat"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201217094438"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数topicId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryTopicInfo($appKey, $appSecret, $topicId) |
|||
{ |
|||
$path = "/aep_mq_sub/topic"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["topicId"] = $topicId; |
|||
|
|||
$version = "20201218153403"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数topicId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryTopicCacheInfo($appKey, $appSecret, $topicId) |
|||
{ |
|||
$path = "/aep_mq_sub/topic/cache"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["topicId"] = $topicId; |
|||
|
|||
$version = "20201218150354"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static function QueryTopics($appKey, $appSecret) |
|||
{ |
|||
$path = "/aep_mq_sub/topics"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201218153456"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QuerySubRules($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_mq_sub/rule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201218160237"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static function ClosePushService($appKey, $appSecret) |
|||
{ |
|||
$path = "/aep_mq_sub/mqStat"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201217141937"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,105 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_nb_device_management |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function BatchCreateNBDevice($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_nb_device_management/batchNBDevice"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200828140355"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function BatchCancelDevices($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_nb_device_management/cancelledDevices"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20211009093738"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteDeviceByImei($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_nb_device_management/deleteDeviceByImei"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20220226071405"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数imei: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryDeviceByImei($appKey, $appSecret, $productId, $imei, $MasterKey) |
|||
{ |
|||
$path = "/aep_nb_device_management/getDeviceByImei"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["imei"] = $imei; |
|||
|
|||
$version = "20221130175656"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_product_management |
|||
{ |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function QueryProduct($appKey, $appSecret, $productId) |
|||
{ |
|||
$path = "/aep_product_management/product"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20181031202055"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:产品id或者产品名称 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
public static function QueryProductList($appKey, $appSecret, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_product_management/products"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190507004824"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey在该设备所属产品的概况中可以查看 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
public static function DeleteProduct($appKey, $appSecret, $MasterKey, $productId) |
|||
{ |
|||
$path = "/aep_product_management/product"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20181031202029"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateProduct($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_product_management/product"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20220924042921"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateProduct($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_product_management/product"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20220924043504"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_public_product_device |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:公共产品的MasterKey |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryDeviceToken($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_public_product_device/queryDeviceToken"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20230330172346"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,126 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_public_product_management |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryPublicByPublicProductId($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_public_product_management/publicProducts"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20190507003930"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function QueryPublicByProductId($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_public_product_management/publicProductList"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20190507004139"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function InstantiateProduct($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_public_product_management/instantiateProduct"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200801233037"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:设备类型、厂商ID、厂商名称 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
public static function QueryAllPublicProductList($appKey, $appSecret, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_public_product_management/allPublicProductList"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200829005548"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:产品名称 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
//参数productIds: 类型String, 参数可以为空 |
|||
// 描述:私有产品idList |
|||
public static function QueryMyPublicProductList($appKey, $appSecret, $searchValue = "", $pageNow = "", $pageSize = "", $productIds = "") |
|||
{ |
|||
$path = "/aep_public_product_management/myPublicProductList"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["productIds"] = $productIds; |
|||
|
|||
$version = "20200829005359"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,479 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_rule_engine |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function saasCreateRule($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/api/v2/rule/sass/createRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200111000503"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数ruleId: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数productId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function saasQueryRule($appKey, $appSecret, $productId, $ruleId = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_rule_engine/api/v2/rule/sass/queryRule"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["ruleId"] = $ruleId; |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200111000633"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function saasUpdateRule($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/api/v2/rule/sass/updateRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200111000540"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function saasDeleteRuleEngine($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/api/v2/rule/sass/deleteRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20200111000611"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateRule($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/createRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062633"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateRule($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/updateRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062642"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteRule($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/deleteRule"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062626"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数ruleId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数productId: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function GetRules($appKey, $appSecret, $ruleId, $productId = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/getRules"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["ruleId"] = $ruleId; |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20210327062616"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function GetRuleRunStatus($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/getRuleRunningStatus"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062610"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateRuleRunStatus($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/modifyRuleRunningStatus"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062603"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateForward($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/addForward"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062556"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateForward($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/updateForward"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062549"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteForward($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/deleteForward"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210327062539"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数ruleId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数productId: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function GetForwards($appKey, $appSecret, $ruleId, $productId = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/getForwards"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["ruleId"] = $ruleId; |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20210327062531"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数ruleId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function GetWarns($appKey, $appSecret, $ruleId, $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/getWarns"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["ruleId"] = $ruleId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20210423162903"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteWarn($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/deleteWarn"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162859"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateWarn($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/updateWarn"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162906"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateWarn($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/addWarn"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162909"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateAction($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/addAction"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162837"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateAction($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/updateAction"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162842"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteAction($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/deleteAct"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20210423162848"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数ruleId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述: |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述: |
|||
public static function GetActions($appKey, $appSecret, $ruleId, $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_rule_engine/v3/rule/getActions"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["ruleId"] = $ruleId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20211028100156"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,129 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_software_management |
|||
{ |
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:升级包id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateSoftware($appKey, $appSecret, $id, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_software_management/software"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20200529232851"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:升级包id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中可以查询 |
|||
public static function DeleteSoftware($appKey, $appSecret, $id, $productId, $MasterKey) |
|||
{ |
|||
$path = "/aep_software_management/software"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20200529232809"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:升级包ID |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,可在产品概况中查看 |
|||
public static function QuerySoftware($appKey, $appSecret, $id, $productId, $MasterKey) |
|||
{ |
|||
$path = "/aep_software_management/software"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20200529232806"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询条件,可以根据升级包名称模糊查询 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页记录数 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,可以在产品概况中查看 |
|||
public static function QuerySoftwareList($appKey, $appSecret, $productId, $MasterKey, $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_software_management/softwares"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200529232801"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,323 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_software_upgrade_management |
|||
{ |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function OperationalSoftwareUpgradeTask($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/operational"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20200529233236"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数taskStatus: 类型long, 参数可以为空 |
|||
// 描述:子任务状态: |
|||
// 0:未启动,1:等待升级,2:升级执行中,3:升级成功,4:升级失败,5:取消升级 |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询值,设备ID或设备编号(IMEI)或设备名称模糊查询 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页码 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页显示数 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,可在产品概况中查看 |
|||
public static function QuerySoftwareUpgradeSubtasks($appKey, $appSecret, $id, $productId, $MasterKey, $taskStatus = "", $searchValue = "", $pageNow = "", $pageSize = "") |
|||
{ |
|||
$path = "/aep_software_upgrade_management/details"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["taskStatus"] = $taskStatus; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20200529233212"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,产品概况中查看 |
|||
public static function QuerySoftwareUpgradeTask($appKey, $appSecret, $id, $productId, $MasterKey) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20200529233136"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,产品概况可以查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateSoftwareUpgradeTask($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20200529233123"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ModifySoftwareUpgradeTask($appKey, $appSecret, $id, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20200529233103"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中查看 |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ControlSoftwareUpgradeTask($appKey, $appSecret, $id, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/control"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20200529233046"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数updateBy: 类型String, 参数可以为空 |
|||
// 描述:修改人 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,在产品概况中查看 |
|||
public static function DeleteSoftwareUpgradeTask($appKey, $appSecret, $id, $productId, $MasterKey, $updateBy = "") |
|||
{ |
|||
$path = "/aep_software_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["updateBy"] = $updateBy; |
|||
|
|||
$version = "20200529233037"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数可以为空 |
|||
// 描述:主任务id,isSelectDevice为1时必填,为2不必填 |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数isSelectDevice: 类型String, 参数不可以为空 |
|||
// 描述:查询类型(1.查询加入升级设备,2.查询可加入升级设备) |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页,默认1 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页显示数,默认20 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,产品概况中查看 |
|||
//参数deviceIdSearch: 类型String, 参数可以为空 |
|||
// 描述:根据设备id精确查询 |
|||
//参数deviceNameSearch: 类型String, 参数可以为空 |
|||
// 描述:根据设备名称精确查询 |
|||
//参数imeiSearch: 类型String, 参数可以为空 |
|||
// 描述:根据imei号精确查询,仅支持LWM2M协议 |
|||
//参数deviceGroupIdSearch: 类型String, 参数可以为空 |
|||
// 描述:根据群组id精确查询 |
|||
public static function QuerySoftwareUpradeDeviceList($appKey, $appSecret, $productId, $isSelectDevice, $MasterKey, $id = "", $pageNow = "", $pageSize = "", $deviceIdSearch = "", $deviceNameSearch = "", $imeiSearch = "", $deviceGroupIdSearch = "") |
|||
{ |
|||
$path = "/aep_software_upgrade_management/devices"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["isSelectDevice"] = $isSelectDevice; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["deviceIdSearch"] = $deviceIdSearch; |
|||
$param["deviceNameSearch"] = $deviceNameSearch; |
|||
$param["imeiSearch"] = $imeiSearch; |
|||
$param["deviceGroupIdSearch"] = $deviceGroupIdSearch; |
|||
|
|||
$version = "20200529233027"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function QuerySoftwareUpgradeDetail($appKey, $appSecret, $id, $productId, $MasterKey) |
|||
{ |
|||
$path = "/aep_software_upgrade_management/detail"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20200529233010"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数,默认1 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页显示数,默认20 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:MasterKey,产品概况中查看 |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询条件,支持主任务名称模糊查询 |
|||
public static function QuerySoftwareUpgradeTaskList($appKey, $appSecret, $productId, $MasterKey, $pageNow = "", $pageSize = "", $searchValue = "") |
|||
{ |
|||
$path = "/aep_software_upgrade_management/tasks"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["searchValue"] = $searchValue; |
|||
|
|||
$version = "20200529232940"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_standard_management |
|||
{ |
|||
//参数standardVersion: 类型String, 参数可以为空 |
|||
// 描述:标准物模型版本号 |
|||
//参数thirdType: 类型long, 参数不可以为空 |
|||
// 描述:三级分类Id |
|||
public static function QueryStandardModel($appKey, $appSecret, $thirdType, $standardVersion = "") |
|||
{ |
|||
$path = "/aep_standard_management/standardModel"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["standardVersion"] = $standardVersion; |
|||
$param["thirdType"] = $thirdType; |
|||
|
|||
$version = "20190713033424"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,160 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_subscribe_north |
|||
{ |
|||
//参数subId: 类型long, 参数不可以为空 |
|||
// 描述:订阅记录id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id,分组级为-1 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:产品MasterKey |
|||
public static function GetSubscription($appKey, $appSecret, $subId, $productId, $MasterKey) |
|||
{ |
|||
$path = "/aep_subscribe_north/subscription"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["subId"] = $subId; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20220624171733"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品ID |
|||
//参数pageNow: 类型long, 参数不可以为空 |
|||
// 描述:当前页 |
|||
//参数pageSize: 类型long, 参数不可以为空 |
|||
// 描述:每页条数 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数subType: 类型long, 参数可以为空 |
|||
// 描述:订阅类型 |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:检索deviceId,模糊匹配 |
|||
//参数deviceGroupId: 类型String, 参数可以为空 |
|||
// 描述: |
|||
public static function GetSubscriptionsList($appKey, $appSecret, $productId, $pageNow, $pageSize, $MasterKey, $subType = "", $searchValue = "", $deviceGroupId = "") |
|||
{ |
|||
$path = "/aep_subscribe_north/subscribes"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["subType"] = $subType; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["deviceGroupId"] = $deviceGroupId; |
|||
|
|||
$version = "20220624163719"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数subId: 类型String, 参数不可以为空 |
|||
// 描述:订阅记录id |
|||
//参数deviceId: 类型String, 参数可以为空 |
|||
// 描述:设备id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数subLevel: 类型long, 参数不可以为空 |
|||
// 描述:订阅级别 |
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述:产品MasterKey |
|||
public static function DeleteSubscription($appKey, $appSecret, $subId, $productId, $subLevel, $MasterKey, $deviceId = "") |
|||
{ |
|||
$path = "/aep_subscribe_north/subscription"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["subId"] = $subId; |
|||
$param["deviceId"] = $deviceId; |
|||
$param["productId"] = $productId; |
|||
$param["subLevel"] = $subLevel; |
|||
|
|||
$version = "20181031202023"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateSubscription($appKey, $appSecret, $MasterKey, $body) |
|||
{ |
|||
$path = "/aep_subscribe_north/subscription"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20181031202018"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateDestHttpUrl($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_subscribe_north/createUrl"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20231109105327"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,327 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Aep_upgrade_management |
|||
{ |
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function QueryRemoteUpgradeDetail($appKey, $appSecret, $id, $productId, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/detail"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20190615001517"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function QueryRemoteUpgradeTask($appKey, $appSecret, $id, $productId, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
|
|||
$version = "20190615001509"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ControlRemoteUpgradeTask($appKey, $appSecret, $id, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/control"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20190615001456"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型String, 参数可以为空 |
|||
// 描述:主任务id,isSelectDevice为1时必填,为2不必填 |
|||
//参数productId: 类型String, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数isSelectDevice: 类型String, 参数不可以为空 |
|||
// 描述:查询类型(1.查询加入升级设备,2.查询可加入升级设备) |
|||
//参数pageNow: 类型String, 参数可以为空 |
|||
// 描述:当前页,默认1 |
|||
//参数pageSize: 类型String, 参数可以为空 |
|||
// 描述:每页显示数,默认20 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数deviceIdSearch: 类型String, 参数可以为空 |
|||
// 描述:根据设备id精确查询 |
|||
//参数deviceNameSearch: 类型String, 参数可以为空 |
|||
// 描述:根据设备名称精确查询 |
|||
//参数imeiSearch: 类型String, 参数可以为空 |
|||
// 描述:根据imei号精确查询,仅支持LWM2M协议 |
|||
//参数deviceNoSearch: 类型String, 参数可以为空 |
|||
// 描述:根据设备编号精确查询,仅支持T_Link协议 |
|||
//参数deviceGroupIdSearch: 类型String, 参数可以为空 |
|||
// 描述:根据群组id精确查询 |
|||
public static function QueryRemoteUpradeDeviceList($appKey, $appSecret, $productId, $isSelectDevice, $id = "", $pageNow = "", $pageSize = "", $MasterKey = "", $deviceIdSearch = "", $deviceNameSearch = "", $imeiSearch = "", $deviceNoSearch = "", $deviceGroupIdSearch = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/devices"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["isSelectDevice"] = $isSelectDevice; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["deviceIdSearch"] = $deviceIdSearch; |
|||
$param["deviceNameSearch"] = $deviceNameSearch; |
|||
$param["imeiSearch"] = $imeiSearch; |
|||
$param["deviceNoSearch"] = $deviceNoSearch; |
|||
$param["deviceGroupIdSearch"] = $deviceGroupIdSearch; |
|||
|
|||
$version = "20190615001451"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数updateBy: 类型String, 参数可以为空 |
|||
// 描述:修改人 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function DeleteRemoteUpgradeTask($appKey, $appSecret, $id, $productId, $updateBy = "", $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["updateBy"] = $updateBy; |
|||
|
|||
$version = "20190615001444"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "DELETE"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页数,默认1 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页显示数,默认20 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询条件,支持主任务名称模糊查询 |
|||
public static function QueryRemoteUpgradeTaskList($appKey, $appSecret, $productId, $pageNow = "", $pageSize = "", $MasterKey = "", $searchValue = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/tasks"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
$param["searchValue"] = $searchValue; |
|||
|
|||
$version = "20190615001440"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述: |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function ModifyRemoteUpgradeTask($appKey, $appSecret, $id, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
|
|||
$version = "20190615001433"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "PUT"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function CreateRemoteUpgradeTask($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/task"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615001416"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function OperationalRemoteUpgradeTask($appKey, $appSecret, $body, $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/operational"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = null; |
|||
$version = "20190615001412"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数id: 类型long, 参数不可以为空 |
|||
// 描述:主任务id |
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述:产品id |
|||
//参数taskStatus: 类型long, 参数可以为空 |
|||
// 描述:子任务状态 |
|||
// T-Link协议必填(1.待升级,2.升级中,3.升级成功,4.升级失败) |
|||
// LWM2M协议选填(0:未启动,1:等待升级,2:升级执行中,3:升级成功,4:升级失败,5:取消升级) |
|||
//参数searchValue: 类型String, 参数可以为空 |
|||
// 描述:查询值,设备ID或设备编号(IMEI)或设备名称模糊查询 |
|||
//参数pageNow: 类型long, 参数可以为空 |
|||
// 描述:当前页码 |
|||
//参数pageSize: 类型long, 参数可以为空 |
|||
// 描述:每页显示数 |
|||
//参数MasterKey: 类型String, 参数可以为空 |
|||
// 描述:MasterKey |
|||
public static function QueryRemoteUpgradeSubtasks($appKey, $appSecret, $id, $productId, $taskStatus = "", $searchValue = "", $pageNow = "", $pageSize = "", $MasterKey = "") |
|||
{ |
|||
$path = "/aep_upgrade_management/details"; |
|||
$headers = array(); |
|||
$headers["MasterKey"] = $MasterKey; |
|||
|
|||
$param = array(); |
|||
$param["id"] = $id; |
|||
$param["productId"] = $productId; |
|||
$param["taskStatus"] = $taskStatus; |
|||
$param["searchValue"] = $searchValue; |
|||
$param["pageNow"] = $pageNow; |
|||
$param["pageSize"] = $pageSize; |
|||
|
|||
$version = "20190615001406"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,228 @@ |
|||
<?php |
|||
|
|||
|
|||
namespace app\common\AepSdk\Apis\Core; |
|||
|
|||
use AepSdk\Apis\Core\API版本号:; |
|||
use AepSdk\Apis\Core\api配置参数表; |
|||
use AepSdk\Apis\Core\appKey; |
|||
use AepSdk\Apis\Core\UNIX格式时间戳; |
|||
use AepSdk\Apis\Core\密钥; |
|||
use AepSdk\Apis\Core\密钥,例如:; |
|||
use AepSdk\Apis\Core\应用的AppKey,如果需要进行签名认证则需要填写,例如:; |
|||
use AepSdk\Apis\Core\签名数据; |
|||
use AepSdk\Apis\Core\请求body数据; |
|||
use AepSdk\Apis\Core\请求BODY:null; |
|||
use AepSdk\Apis\Core\请求参数:array; |
|||
use AepSdk\Apis\Core\请求地址,例如:; |
|||
use AepSdk\Apis\Core\请求头部公共参数:array; |
|||
use AepSdk\Apis\Core\请求方法:; |
|||
use AepSdk\Apis\Core\返回响应:bool; |
|||
use Exception; |
|||
|
|||
class AepSdkCore |
|||
{ |
|||
public static $baseUrl="https://2000423559.api.ctwing.cn"; |
|||
public static $timeUrl ="https://2000423559.api.ctwing.cn/echo"; |
|||
static $offset=0; |
|||
static $lastGetOffsetTime=0; |
|||
|
|||
/*** |
|||
* @param $path 请求地址,例如:'/aep_product_management/product' |
|||
* @param $head 请求头部公共参数:array or null |
|||
* @param $param 请求参数:array("productId"=>"9392") or null |
|||
* @param $body 请求BODY:null or string |
|||
* @param $version API版本号:'20181031202055' |
|||
* @param $application 应用的AppKey,如果需要进行签名认证则需要填写,例如:'91Ebv1S0HBb' |
|||
* @param $secret 密钥,例如:"FJDq8agNp5" |
|||
* @param $method 请求方法:"GET" "PUT" "POST" "DELETE" |
|||
* @return 返回响应:bool or string |
|||
*/ |
|||
public static function sendSDkRequest($path, $head, $param, $body, $version, $application, $secret, $method="GET"){ |
|||
|
|||
$ch = curl_init(); |
|||
//获取请求地址 |
|||
$url=self::$baseUrl.$path; |
|||
$urlparams=array(); |
|||
if(is_array($param)) { |
|||
foreach ($param as $key => $value) { |
|||
array_push($urlparams, $key . '=' . $value); |
|||
} |
|||
} |
|||
if(count($urlparams)>0) { |
|||
$url = $url . '?' . implode('&', $urlparams); |
|||
} |
|||
#print_r("url: ".$url."\n"); |
|||
|
|||
if(strlen($url) > 5 && strtolower(substr($url,0,5)) == "https" ){ |
|||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 |
|||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在 |
|||
} |
|||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
|||
curl_setopt($ch, CURLOPT_URL, $url); |
|||
if($method=="POST"){ |
|||
curl_setopt($ch, CURLOPT_POST, true); |
|||
} |
|||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); |
|||
//连接主机时的最长等待时间:60second |
|||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); |
|||
//整个cURL函数执行过程的最长等待时间:80second |
|||
curl_setopt($ch, CURLOPT_TIMEOUT, 80); |
|||
|
|||
//获取api配置参数 |
|||
$paramTmp=array(); |
|||
if($head!=null){ |
|||
$paramTmp=array_merge($head,$paramTmp); |
|||
} |
|||
if($param!=null){ |
|||
$paramTmp=array_merge($paramTmp,$param); |
|||
} |
|||
//获取时间戳 |
|||
$curentTime=self::getMillisecond(); |
|||
//300秒调用一次 |
|||
if($curentTime-self::$lastGetOffsetTime>300*1000) { |
|||
self::$offset=self::getTimeOffset(); |
|||
self::$lastGetOffsetTime=$curentTime; |
|||
} |
|||
|
|||
$timestamp=self::getMillisecond()+self::$offset; |
|||
//将签名数据填入请求头部 |
|||
$header=array("application"=>$application,"timestamp"=>"".$timestamp,"version"=>$version,"signature"=>self::sign($paramTmp,$timestamp,$application,$secret,self::getBytes($body))); |
|||
if($head!=null){ |
|||
$header=array_merge($header,$head); |
|||
} |
|||
if (is_array($header) && 0 < count($header)) { |
|||
$httpHeaders = self::getHttpHearders($header); |
|||
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeaders); |
|||
} |
|||
curl_setopt($ch, CURLOPT_POSTFIELDS, $body); |
|||
$response= curl_exec($ch); |
|||
if (curl_errno($ch)) { |
|||
die('Curl error: Errno: '. curl_errno($ch)." ".curl_error($ch)); |
|||
} |
|||
curl_close($ch); |
|||
|
|||
return $response; |
|||
} |
|||
|
|||
static function getHttpHearders($headers) |
|||
{ |
|||
$httpHeader = array(); |
|||
foreach ($headers as $key => $value) |
|||
{ |
|||
$httpHeader[]=$key.":".$value; |
|||
} |
|||
return $httpHeader; |
|||
} |
|||
|
|||
/*** |
|||
* 获取时间偏移量 |
|||
* @return false|float|int |
|||
*/ |
|||
static function getTimeOffset(){ |
|||
$offsettime=0; |
|||
$url=self::$timeUrl; |
|||
try{ |
|||
$start=self::getMillisecond(); |
|||
//校验能否获取响应状态 |
|||
stream_context_set_default(array( |
|||
'ssl' => array( |
|||
'verify_host' => false, |
|||
'verify_peer' => false, |
|||
'verify_peer_name' => false, |
|||
), |
|||
)); |
|||
$response=get_headers($url,1); |
|||
$end=self::getMillisecond(); |
|||
$head=$response["x-ag-timestamp"]; |
|||
if ($head!=null){ |
|||
$offsettime =round( ($head - ($start + $end) / 2)); |
|||
} |
|||
else { |
|||
throw new Exception("Error:cannot get timestamp."); |
|||
} |
|||
} |
|||
catch (Exception $exception) { |
|||
print_r($exception->getMessage() . "\n"); |
|||
} |
|||
return $offsettime; |
|||
} |
|||
|
|||
/*** |
|||
* 获取系统当前时间 |
|||
* @return float |
|||
*/ |
|||
static function getMillisecond() |
|||
{ |
|||
list($s1, $s2) = explode(' ', microtime()); |
|||
return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); |
|||
} |
|||
|
|||
static function getBytes($str) |
|||
{ |
|||
$bytes = array(); |
|||
for ($pos = 0; $pos < strlen($str); $pos++) { |
|||
$byte = substr($str, $pos); |
|||
$bytes[] = ord($byte); |
|||
} |
|||
return $bytes; |
|||
} |
|||
|
|||
static function toStr($bytes) |
|||
{ |
|||
$str = ''; |
|||
foreach ($bytes as $ch) { |
|||
$str .= chr($ch); |
|||
} |
|||
return $str; |
|||
} |
|||
|
|||
/*** |
|||
* 计算签名 |
|||
* 将业务数据连同timestamp、application一起签名后的数据,如果需要进行签名认证则需要填写 |
|||
* @param $param api配置参数表 |
|||
* @param $timestamp UNIX格式时间戳 |
|||
* @param $application appKey,到应用管理打开应用可以找到此值 |
|||
* @param $secret 密钥,到应用管理打开应用可以找到此值 |
|||
* @param $body 请求body数据,如果是GET请求,此值写null |
|||
* @return 签名数据 |
|||
*/ |
|||
static function sign($param,$timestamp,$application,$secret,$body) |
|||
{ |
|||
//将业务数据排序 |
|||
ksort($param); |
|||
|
|||
//写入timestamp、application数据 |
|||
$temp = array("application" => $application, "timestamp" => $timestamp); |
|||
$temp = $temp + $param; |
|||
$s = ""; |
|||
foreach ($temp as $key => $value) { |
|||
$string = ($key . ":" . "$value\n"); |
|||
$s = $s . $string; |
|||
} |
|||
|
|||
$text = self::getBytes($s); |
|||
// 将body数据写入需要签名的字符流中 |
|||
if ($body != null && count($body) > 0) { |
|||
$text = array_merge($text, $body, self::getBytes("\n")); |
|||
} |
|||
// 得到需要签名的字符串 |
|||
$encryptText = self::toStr($text); |
|||
#print_r("Sign string: " . $encryptText); |
|||
//hmac-sha1编码 |
|||
$result = self::HmacSHA1Encrypt($encryptText, $secret); |
|||
|
|||
return ($result); |
|||
} |
|||
|
|||
/*** |
|||
* hmac-sha1编码 |
|||
*/ |
|||
static function HmacSHA1Encrypt($encryptText, $encryptKey) |
|||
{ |
|||
$hash_hmac = hash_hmac("sha1", $encryptText, $encryptKey, true); |
|||
$signature = base64_encode($hash_hmac); |
|||
|
|||
return $signature; |
|||
} |
|||
} |
|||
@ -0,0 +1,93 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Device_archives |
|||
{ |
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function DeleteArchivesInfo($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/device_archives/deleteArchivesInfo"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20231117042743"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function GetArchivesAttribute($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/device_archives/getArchivesAttr"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20231117042748"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数body: 类型json, 参数不可以为空 |
|||
// 描述:body,具体参考平台api说明 |
|||
public static function UpdateArchivesInfo($appKey, $appSecret, $body) |
|||
{ |
|||
$path = "/device_archives/updateArchivesInfo"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20231117042738"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, $body, $version, $application, $secret, "POST"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数productId: 类型long, 参数不可以为空 |
|||
// 描述: |
|||
//参数deviceId: 类型String, 参数不可以为空 |
|||
// 描述: |
|||
public static function GetArchivesInfoDetailById($appKey, $appSecret, $productId, $deviceId) |
|||
{ |
|||
$path = "/device_archives/getArchivesInfoDetailById"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["productId"] = $productId; |
|||
$param["deviceId"] = $deviceId; |
|||
|
|||
$version = "20231117042731"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Tenant_app_statistics |
|||
{ |
|||
public static function QueryTenantApiMonthlyCount($appKey, $appSecret) |
|||
{ |
|||
$path = "/tenant_app_statistics/queryTenantApiMonthlyCount"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201225122609"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static function QueryTenantAppCount($appKey, $appSecret) |
|||
{ |
|||
$path = "/tenant_app_statistics/queryTenantAppCount"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201225122611"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数dateType: 类型String, 参数不可以为空 |
|||
// 描述:日期格式 m:月 d:日 |
|||
//参数dataType: 类型String, 参数不可以为空 |
|||
// 描述:数据格式 1:api调用量分析 |
|||
public static function QueryTenantApiTrend($appKey, $appSecret, $dateType, $dataType) |
|||
{ |
|||
$path = "/tenant_app_statistics/queryTenantApiTrend"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["dateType"] = $dateType; |
|||
$param["dataType"] = $dataType; |
|||
|
|||
$version = "20201225122606"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,70 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Tenant_device_statistics |
|||
{ |
|||
public static function QueryTenantDeviceCount($appKey, $appSecret) |
|||
{ |
|||
$path = "/tenant_device_statistics/queryTenantDeviceCount"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201225122555"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
//参数dateType: 类型String, 参数不可以为空 |
|||
// 描述:时间类型:d:天;m:月 |
|||
//参数type: 类型String, 参数不可以为空 |
|||
// 描述:数据类型:1:设备总数量,激活数,活跃数;3:设备活跃数,活跃率 |
|||
public static function QueryTenantDeviceTrend($appKey, $appSecret, $dateType, $type) |
|||
{ |
|||
$path = "/tenant_device_statistics/queryTenantDeviceTrend"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["dateType"] = $dateType; |
|||
$param["type"] = $type; |
|||
|
|||
$version = "20201225122550"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
public static function QueryTenantDeviceActiveCount($appKey, $appSecret) |
|||
{ |
|||
$path = "/tenant_device_statistics/queryTenantDeviceActiveCount"; |
|||
$headers = null; |
|||
$param = null; |
|||
$version = "20201225122558"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
namespace app\common\AepSdk\Apis; |
|||
|
|||
use app\common\AepSdk\Apis\Core\AepSdkCore; |
|||
|
|||
require_once dirname(__DIR__) . '\Apis\Core\AepSdkCore.php'; |
|||
|
|||
class Usr |
|||
{ |
|||
//参数sdk_type: 类型String, 参数可以为空 |
|||
// 描述:SDK语言类型,默认为Java(字典项: sdk_type) |
|||
//参数file_name: 类型String, 参数不可以为空 |
|||
// 描述:SDK描述,用以标识其中的biz包 |
|||
//参数application_id: 类型String, 参数不可以为空 |
|||
// 描述:应用编码,下载的SDK会根据该编码收集所有有权限的API打包 |
|||
//参数api_version: 类型String, 参数可以为空 |
|||
// 描述:API版本信息 TODO |
|||
public static function SdkDownload($appKey, $appSecret, $file_name, $application_id, $sdk_type = "", $api_version = "") |
|||
{ |
|||
$path = "/usr/sdk/download"; |
|||
$headers = null; |
|||
$param = array(); |
|||
$param["sdk_type"] = $sdk_type; |
|||
$param["file_name"] = $file_name; |
|||
$param["application_id"] = $application_id; |
|||
$param["api_version"] = $api_version; |
|||
|
|||
$version = "20180000000000"; |
|||
|
|||
$application = $appKey; |
|||
$secret = $appSecret; |
|||
|
|||
$response = AepSdkCore::sendSDkRequest($path, $headers, $param, null, $version, $application, $secret, "GET"); |
|||
if ($response != null) { |
|||
return $response; |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
|
|||
} |
|||
Loading…
Reference in new issue