|
@@ -0,0 +1,55 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+declare(strict_types=1);
|
|
|
+
|
|
|
+namespace App\Controller;
|
|
|
+
|
|
|
+use App\JsonRpc\ChatServiceInterface;
|
|
|
+use App\JsonRpc\UserServiceInterface;
|
|
|
+use App\JsonRpc\ClientServiceInterface;
|
|
|
+
|
|
|
+use App\Tools\PublicData;
|
|
|
+use App\Tools\Result;
|
|
|
+use function Hyperf\Support\env;
|
|
|
+use Hyperf\Context\Context;
|
|
|
+use Hyperf\Di\Annotation\Inject;
|
|
|
+use Hyperf\Validation\Contract\ValidatorFactoryInterface;
|
|
|
+// use App\Controller\WebSocketController as WebSocket;
|
|
|
+use Hyperf\Context\ApplicationContext as ApplicationContext;
|
|
|
+use App\Controller\WebSocketController;
|
|
|
+use Swoole\WebSocket\Frame;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * Class ClientController
|
|
|
+ * @package App\Controller
|
|
|
+ */
|
|
|
+//#[AutoController]
|
|
|
+class ClientController extends AbstractController
|
|
|
+{
|
|
|
+ #[Inject]
|
|
|
+ protected ValidatorFactoryInterface $validationFactory;
|
|
|
+ #[Inject]
|
|
|
+ private ChatServiceInterface $chatServiceClient;
|
|
|
+ #[Inject]
|
|
|
+ private UserServiceInterface $userServiceClient;
|
|
|
+ #[Inject]
|
|
|
+ private ClientServiceInterface $clientServiceClient;
|
|
|
+ public function __construct(
|
|
|
+ ClientServiceInterface $clientServiceClient,
|
|
|
+ ValidatorFactoryInterface $validationFactory,
|
|
|
+ ChatServiceInterface $chatServiceClient,
|
|
|
+ UserServiceInterface $userServiceClient
|
|
|
+ ) {
|
|
|
+ $this->clientServiceClient = $clientServiceClient;
|
|
|
+ $this->validationFactory = $validationFactory;
|
|
|
+ $this->chatServiceClient = $chatServiceClient;
|
|
|
+ $this->userServiceClient = $userServiceClient;
|
|
|
+ }
|
|
|
+ public function test()
|
|
|
+ {
|
|
|
+ // var_dump($this->validationFactory, '----------2-------');
|
|
|
+ $test = $this->clientServiceClient->test(['name' => 'test']);
|
|
|
+ return Result::success($test);
|
|
|
+ }
|
|
|
+}
|