You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
874 B

  1. <?php
  2. namespace App\JsonRpc;
  3. use App\Constants\ErrorCode;
  4. use App\Service\SeparateAccountsServiceInterface;
  5. use Hyperf\RpcServer\Annotation\RpcService;
  6. use Hyperf\Di\Annotation\Inject;
  7. /**
  8. * @RpcService(name="OrderService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="")
  9. */
  10. class OrderService implements OrderServiceInterface
  11. {
  12. /**
  13. * @Inject
  14. * @var SeparateAccountsServiceInterface
  15. */
  16. protected $separateAccService;
  17. public function onlineComplete($global_order_id)
  18. {
  19. $data = $this->separateAccService->orderOnlineCompleted($global_order_id);
  20. return [
  21. "status" => 200,
  22. "code" => $data ? 0 : ErrorCode::SEPARATE_ACCOUNTS_ERROR,
  23. "result" => [],
  24. "message" => $data ? '调用成功' : ErrorCode::getMessage(ErrorCode::SEPARATE_ACCOUNTS_ERROR)
  25. ];
  26. }
  27. }