LNHttpManager+IM.swift 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // LNHttpManager+IM.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/26.
  6. //
  7. import Foundation
  8. private let kNetPath_IM_Sign = "/im/userSign"
  9. private let kNetPath_IM_Remark = "/im/set/usernameNote"
  10. private let kNetPath_IM_Remark_Query = "/im/get/usernameNotes"
  11. private let kNetPath_IM_Call_Check = "/im/callCheck"
  12. extension LNHttpManager {
  13. func getIMSign(completion: @escaping (String?, LNHttpError?) -> Void) {
  14. post(path: kNetPath_IM_Sign, completion: completion)
  15. }
  16. func checkIfCanCall(uid: String, completion: @escaping (LNHttpError?) -> Void) {
  17. post(path: kNetPath_IM_Call_Check, params: [
  18. "id": uid
  19. ], completion: completion)
  20. }
  21. }
  22. extension LNHttpManager {
  23. func setUserRemark(uid: String, remark: String, completion: @escaping (LNHttpError?) -> Void) {
  24. post(path: kNetPath_IM_Remark, params: [
  25. "userNo": uid,
  26. "note": remark
  27. ], completion: completion)
  28. }
  29. func getUsersRemark(uids: [String], completion: @escaping (LNIMUsersRemarkResponse?, LNHttpError?) -> Void) {
  30. post(path: kNetPath_IM_Remark_Query, params: [
  31. "list": uids
  32. ], completion: completion)
  33. }
  34. }