LNHttpManager+Relation.swift 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // LNHttpManager+Relation.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/14.
  6. //
  7. import Foundation
  8. private let kNetPath_Relation_Follow = "/user/follow"
  9. private let kNetPath_Relation_FollowList = "/user/relateion/myFollows"
  10. private let kNetPath_Relation_FansList = "/user/relateion/fans"
  11. private let kNetPath_Relation_Relation = "/user/followRelateions/get"
  12. private let kNetPath_Relation_BlackList_Add = "/im/pullInBlacklist"
  13. private let kNetPath_Relation_BlackList = "/im/myBlacklist"
  14. extension LNHttpManager {
  15. func operateFollow(uid: String, follow: Bool, completion: @escaping (LNHttpError?) -> Void) {
  16. post(path: kNetPath_Relation_Follow, params: [
  17. "userNo": uid,
  18. "follow": follow
  19. ], completion: completion)
  20. }
  21. func blackListUser(uid: String, black: Bool, completion: @escaping (LNHttpError?) -> Void) {
  22. post(path: kNetPath_Relation_BlackList_Add, params: [
  23. "userNo": uid,
  24. "black": black
  25. ], completion: completion)
  26. }
  27. func getBlackList(size: Int, next: String, completion: @escaping (LNUserBlackListResponse?, LNHttpError?) -> Void) {
  28. post(path: kNetPath_Relation_BlackList, params: [
  29. "size": size,
  30. "next": next
  31. ], completion: completion)
  32. }
  33. }
  34. extension LNHttpManager {
  35. func getUserFollowList(size: Int, next: String,
  36. completion: @escaping (LNUserFollowListResponse?, LNHttpError?) -> Void) {
  37. post(path: kNetPath_Relation_FollowList, params: [
  38. "size": size,
  39. "next": next
  40. ], completion: completion)
  41. }
  42. func getUserFansList(size: Int, next: String,
  43. completion: @escaping (LNUserFansListResponse?, LNHttpError?) -> Void) {
  44. post(path: kNetPath_Relation_FansList, params: [
  45. "size": size,
  46. "next": next
  47. ], completion: completion)
  48. }
  49. func getRelationWithUser(uid: String, completion: @escaping (LNUserRelationRespones?, LNHttpError?) -> Void) {
  50. post(path: kNetPath_Relation_Relation, params: [
  51. "userNos": [uid]
  52. ], completion: completion)
  53. }
  54. }