Sfoglia il codice sorgente

feat: 房间列表进入房间失败时,需要上报后端进行房间状态检测

陈文艺 2 giorni fa
parent
commit
7b7279d3f5

+ 5 - 0
Lanu/Manager/Room/LNRoomManager.swift

@@ -100,6 +100,7 @@ extension LNRoomManager {
                 case .failure(let errorInfo):
                     handler(nil)
                     showTencentError(errorInfo)
+                    self.reportRoomUnavailable(id: roomId, code: errorInfo.code, reason: errorInfo.message)
                 }
             }
         }
@@ -183,6 +184,10 @@ extension LNRoomManager {
             }
         }
     }
+    
+    func reportRoomUnavailable(id: String, code: Int, reason: String) {
+        LNHttpManager.shared.reportRoomUnavailable(id: id, code: "\(code)", reason: reason) { _ in }
+    }
 }
 
 // MARK: 用户

+ 11 - 0
Lanu/Manager/Room/Network/LNHttpManager+Room.swift

@@ -31,6 +31,8 @@ private let kNetPath_Room_Cur = "/live/view/watching"
 private let kNetPath_Room_Search = "/live/room/search"
 private let kNetPath_Room_List = "/live/room/list"
 
+private let kNetPath_Room_Unavailable = "/live/room/unavailable"
+
 
 // MARK: 房间管理
 extension LNHttpManager {
@@ -195,4 +197,13 @@ extension LNHttpManager {
             ]
         ], completion: completion)
     }
+    
+    func reportRoomUnavailable(id: String, code: String, reason: String, completion: @escaping (LNHttpError?) -> Void) {
+        post(path: kNetPath_Room_Unavailable, params: [
+            "id": id,
+            "supplier": 1,
+            "errorCode": code,
+            "errorReson": reason
+        ], completion: completion)
+    }
 }