12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace App\HttpController;
- use EasySwoole\Http\AbstractInterface\Controller;
- class Index extends Controller
- {
- public function index()
- {
- $file = EASYSWOOLE_ROOT.'/vendor/easyswoole/easyswoole/src/Resource/Http/welcome.html';
- if(!is_file($file)){
- $file = EASYSWOOLE_ROOT.'/src/Resource/Http/welcome.html';
- }
- $this->response()->write(file_get_contents($file));
- }
-
- public function skuState()
- {
-
- $data = $this->request()->getRequestParam();
-
-
- $skuArr = $data['skuArr'];
-
- $this->JdSdk = new JdSdk();
- $response = $this->JdSdk->api_product_sku_state($skuArr);
- print_r($response);
- $this->response()->write($response . PHP_EOL);
-
-
- }
- function test()
- {
- $this->response()->write('this is test');
- }
- protected function actionNotFound(?string $action)
- {
- $this->response()->withStatus(404);
- $file = EASYSWOOLE_ROOT.'/vendor/easyswoole/easyswoole/src/Resource/Http/404.html';
- if(!is_file($file)){
- $file = EASYSWOOLE_ROOT.'/src/Resource/Http/404.html';
- }
- $this->response()->write(file_get_contents($file));
- }
- }
|