Add test capi endpoint. #704
This commit is contained in:
parent
138c60a61b
commit
6314b4097d
4 changed files with 27 additions and 1 deletions
|
|
@ -43,6 +43,10 @@ security:
|
||||||
pattern: ^\/rapi\/
|
pattern: ^\/rapi\/
|
||||||
security: false
|
security: false
|
||||||
|
|
||||||
|
test_capi:
|
||||||
|
pattern: ^\/test_capi\/
|
||||||
|
security: false
|
||||||
|
|
||||||
warranty_api:
|
warranty_api:
|
||||||
pattern: ^\/capi\/
|
pattern: ^\/capi\/
|
||||||
stateless: true
|
stateless: true
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@ capi_test:
|
||||||
path: /capi/test
|
path: /capi/test
|
||||||
controller: App\Controller\CAPI\TestController::test
|
controller: App\Controller\CAPI\TestController::test
|
||||||
|
|
||||||
|
capi_test_warranty_serial:
|
||||||
|
path: /test_capi/test/warranty_serial
|
||||||
|
controller: App\Controller\CAPI\TestController::warrantySerial
|
||||||
|
|
||||||
|
|
||||||
# battery api
|
# battery api
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class LoadWarrantySerialCommand extends Command
|
||||||
}
|
}
|
||||||
|
|
||||||
// send results back to third party
|
// send results back to third party
|
||||||
// $this->sendResults($output_info);
|
$this->sendResults($output_info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -402,6 +402,9 @@ class LoadWarrantySerialCommand extends Command
|
||||||
$res = curl_exec($curl);
|
$res = curl_exec($curl);
|
||||||
|
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
|
|
||||||
|
// check result
|
||||||
|
error_log('Result ' . $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,19 @@ class TestController extends APIController
|
||||||
];
|
];
|
||||||
return new APIResponse(true, 'Test successful.', $data);
|
return new APIResponse(true, 'Test successful.', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function warrantySerial(Request $req)
|
||||||
|
{
|
||||||
|
error_log('Got request');
|
||||||
|
|
||||||
|
$res = json_decode($req->getContent(), true);
|
||||||
|
|
||||||
|
// return $res;
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'status' => 'Test successful.',
|
||||||
|
];
|
||||||
|
return new APIResponse(true, 'Test successful.', $data);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue