xiaogang 4 년 전
부모
커밋
537fbc4e46
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      app/Http/Controllers/Api/ChatController.php

+ 8 - 2
app/Http/Controllers/Api/ChatController.php

xqd xqd
@@ -4,6 +4,7 @@
 namespace App\Http\Controllers\Api;
 
 
+use App\Services\TencentImAccountService;
 use App\Services\TencentImFriendService;
 use Illuminate\Http\Request;
 use PHPUnit\Util\Exception;
@@ -24,9 +25,14 @@ class ChatController extends Controller
                 throw new Exception("参数错误");
             }
 
+            $tencent_account =new TencentImAccountService();
+            $tencent_friend =new TencentImFriendService();
 
-            $tencent_im =new TencentImFriendService();
-            $res = $tencent_im->friendAddItem($user->tencent_im_user_id,$request->tencent_im_user_id);
+            //检测是否已经导入IM账号
+            $tencent_account->accountCheck($request->tencent_im_user_id);
+            dd($tencent_account);
+
+            $res = $tencent_friend->friendAddItem($user->tencent_im_user_id,$request->tencent_im_user_id);
         }catch (\Exception $exception){
             return $this->response->errorForbidden($exception->getMessage());
         }