$manufactureNo,
'device_id' => $device_id,
'project' => $projectNo,
'model' => $modelNo,
'production' => $productionNo,
'timestamp' => $timestamp,
'sign' => $sign,
];
$params = json_encode($params);
//$params = '{"manufacture":"0002","device_id":"6705BF36C37F","project":"0002","model":"0003","production":"0002","timestamp":"1500000000","sign":"2b67361ba972020496f1a1b3df388499"}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
public function actionUpgrade()
{
$url = 'http://kingb:8012/app-api/web/reportDeviceVersion';
$params = [
'barcode' => '00001',
'device_id' => 'DEVICE001',
'software_version' => 'V1.0.1',
'hardware_version' => 'V1.0.2',
'timestamp' => 1500000000
];
$postResult = Http::POST($url, $params);
echo $postResult;
}
public function actionAec()
{
$aes = new Aes('12345678');
$encrypted = $aes->encrypt('this is en AES testing');
echo '要加密的字符串:this is en AES testing
加密后的字符串:'. $encrypted. '
';
$decrypted = $aes->decrypt($encrypted);
echo '要解密的字符串:'. $encrypted, '
解密后的字符串:'. $decrypted;
}
public function actionDeviceSt()
{
$url = 'http://kingb:8012/app-api/web/reportDeviceVersion';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DEVICE003',
'software_version' => 'V1.0.1',
'hardware_version' => 'V1.0.2',
'timestamp' => 1500000000
];
$postResult = Http::POST($url, json_encode($params));
echo $postResult;
}
public function actionCheckAppUpdate()
{
//actionCheckAppVersion
$url = 'http://47.107.95.101/app-api/web/checkAppVersion';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DEVICE000001',
'current_version' => 'V1.0.1',
'package_name' => 'V1.0.2安装包',
];
//$params = json_decode($params);
$params = '{"barcode":"0001000100010001","device_id":"DGDEVBICEID00001","package_name":"com.kingboard.settings","current_version":"1"}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
public function actionCheckOtaUpdate()
{
//actionCheckAppVersion
//$url = 'http://47.107.95.101/app-api/web/checkOtaVersion';
$url = 'http://kingb:8012/app-api/web/checkOtaVersion';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DGDEVBICEID00001',
'software_version' => 'V1.0.1',
'hardware_version' => 'V1.0.1',
];
$params = json_encode($params);
//$params = '{"barcode":"0001000100010001","device_id":"DEVICEID00001","software_version":"V1.00.1A.20191002","hardware_version":""}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
//{"barcode":"0001000100010001","device_id":"DEVICEID00001","current_version":"V1.00.1A.20191022","target_version":"V1.00.1A.20191022","status":5,"timestamp":"1572759793"}
public function actionReportOtaEvent()
{
//actionCheckAppVersion
$url = 'http://47.107.95.101/app-api/web/reportOtaUpgradeEvent';
//$url = 'http://kingb:8012/app-api/web/reportOtaUpgradeEvent';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DGDEVBICEID00001',
'software_version' => 'V1.0.1',
'hardware_version' => 'V1.0.1',
];
$params = json_encode($params);
$params = '{"barcode":"0001000100010001","device_id":"DEVICEID00001","current_version":"V1.00.1A.20191022","target_version":"V1.00.1A.20191022","status":5,"timestamp":"1572759793"}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
public function actionReportAppEvent()
{
//actionCheckAppVersion
$url = 'http://47.107.95.101/app-api/web/reportAppUpgradeEvent';
//$url = 'http://kingb:8012/app-api/web/reportAppUpgradeEvent';
$params = [
'barcode' => '0001000100010001',
'device_id' => 'DGDEVBICEID00001',
'software_version' => 'V1.0.1',
'hardware_version' => 'V1.0.1',
];
$params = json_encode($params);
$params = '{"barcode":"0001000100010001","device_id":"DGDEVBICEID00001","current_version":"1","target_version":"2","status":"5","error_code":"0","timestamp":"1572767677"}';
$postResult = Http::POST($url, $params);
echo $postResult;
}
}