Ver Fonte

增加测试推送消息接口

林琦海 há 5 anos atrás
pai
commit
6fa5d449e0
1 ficheiros alterados com 7 adições e 0 exclusões
  1. 7 0
      app/ghs/controllers/WsController.php

+ 7 - 0
app/ghs/controllers/WsController.php

@@ -3,6 +3,7 @@
 // websocket相关
 // websocket相关
 namespace ghs\controllers;
 namespace ghs\controllers;
 
 
+use bizGhs\ws\services\WsService;
 use Yii;
 use Yii;
 use GatewayClient\Gateway;
 use GatewayClient\Gateway;
 class WsController extends BaseController
 class WsController extends BaseController
@@ -24,4 +25,10 @@ class WsController extends BaseController
         $clientId = isset($post['clientId']) ? $post['clientId'] : '';
         $clientId = isset($post['clientId']) ? $post['clientId'] : '';
         Gateway::closeClient($clientId);
         Gateway::closeClient($clientId);
     }
     }
+
+    //模拟推送ws (仅供测试联调用)
+    public function actionSend()
+    {
+        WsService::arrivalNotice($this->adminId,1.2);
+    }
 }
 }