OrderController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Controllers\api\thirdPart\syrius\producer;
  3. use App\Http\Controllers\api\thirdPart\syrius\beans\Task;
  4. use Illuminate\Support\Facades\Log;
  5. class OrderController extends Controller
  6. {
  7. public function createOrder(Task $order)
  8. {
  9. $this->method = "post";
  10. $this->data = [(array)$order];
  11. $this->url = config("api.syrius.request.create_order");
  12. $response = $this->response();
  13. if (!$response){
  14. Log::warning("炬星-创建订单",["msg"=>"服务器通信异常,检查错误日志","data"=>json_encode($order,JSON_UNESCAPED_UNICODE)]);
  15. return null;
  16. }
  17. Log::warning("炬星-创建订单",["msg"=>"成功","data"=>json_encode($order,JSON_UNESCAPED_UNICODE)]);
  18. return $response;
  19. }
  20. public function getOrder(string $id)
  21. {
  22. $this->method = "get";
  23. $this->url = config("api.syrius.request.find_order").$id;
  24. $response = $this->response();
  25. if (!$response)dd("服务器通信异常,检查错误日志");
  26. dd($response->body());
  27. }
  28. }