LNProfileResponse.swift 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. //
  2. // LNProfileResponse.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/11/12.
  6. //
  7. import Foundation
  8. import AutoCodable
  9. enum LNUserGender: Int, Decodable {
  10. case unknow = 0
  11. case male = 1
  12. case female = 2
  13. var desc: String {
  14. switch self {
  15. case .unknow: .init(key: "A00016")
  16. case .male: .init(key: "A00014")
  17. case .female: .init(key: "A00015")
  18. }
  19. }
  20. }
  21. @AutoCodable
  22. class LNUserInterestVO: Decodable {
  23. var code: String = ""
  24. var name: String = ""
  25. init(code: String, name: String) {
  26. self.code = code
  27. self.name = name
  28. }
  29. }
  30. @AutoCodable
  31. class LNUserProfileVO: Decodable, Copyable {
  32. var avatar: String = ""
  33. var nickname: String = ""
  34. var age: Int = 0
  35. var gender: LNUserGender = .unknow
  36. var star: Double = 0.0
  37. var area: String = ""
  38. var cover: String = ""
  39. var userNo: String = ""
  40. var languageNames: [String] = []
  41. var photos: [String] = []
  42. var intro: String = ""
  43. var playmate: Bool = false
  44. var skills: [LNGameMateSkillVO] = []
  45. var follow: Bool = false
  46. var fansCount: Int = 0
  47. var voiceBar: String = ""
  48. var birthday: Int = 0
  49. var rated: Bool = false
  50. var interests: [LNUserInterestVO] = []
  51. var distance: Double = 0
  52. var isAvailable: Bool {
  53. !avatar.isEmpty
  54. && !nickname.isEmpty
  55. }
  56. init() { }
  57. }
  58. @AutoCodable
  59. class LNUserRelationStatVO: Decodable {
  60. var fansCount: Int = 0
  61. var followCount: Int = 0
  62. var visitCount: Int = 0
  63. init() { }
  64. }
  65. enum LNUserVoiceBarState: Int, Decodable {
  66. case none = 0
  67. case review = 1
  68. case done = 2
  69. }
  70. @AutoCodable
  71. class LNUserVoiceStateVO: Decodable {
  72. var status: LNUserVoiceBarState = .none
  73. var voiceBar: String = ""
  74. var voiceBarDuration: Int = 0
  75. init() { }
  76. }
  77. @AutoCodable
  78. class LNMyProfileResponseVO: Decodable {
  79. var userProfile: LNUserProfileVO?
  80. var userFollowStat: LNUserRelationStatVO?
  81. var userVoice: LNUserVoiceStateVO?
  82. }
  83. @AutoCodable
  84. class LNUsersProfileResponse: Decodable {
  85. var list: [LNUserProfileVO] = []
  86. }
  87. @AutoCodable
  88. class LNProfileRandomInfoVO: Decodable {
  89. var nicknames: [String] = []
  90. var avatars: [String] = []
  91. init() { }
  92. }
  93. @AutoCodable
  94. class LNRandomProfileResponse: Decodable {
  95. var male: LNProfileRandomInfoVO = LNProfileRandomInfoVO()
  96. var female: LNProfileRandomInfoVO = LNProfileRandomInfoVO()
  97. }
  98. @AutoCodable
  99. class LNUserOnlineStateVO: Decodable {
  100. var userNo: String = ""
  101. var online: Bool = false
  102. }
  103. @AutoCodable
  104. class LNUserOnlineStateResponse: Decodable {
  105. var list: [LNUserOnlineStateVO] = []
  106. }