LNPurchaseResponse.swift 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // LNPurchaseResponse.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/22.
  6. //
  7. import Foundation
  8. import AutoCodable
  9. enum LNCurrencyType: Int, Decodable {
  10. case coin = 0
  11. case diamond = 1
  12. case bean = 2
  13. func name(lowcase: Bool = false) -> String {
  14. switch self {
  15. case .coin: lowcase ? .init(key: "B00136") : .init(key: "A00216")
  16. case .diamond: lowcase ? .init(key: "B00135") : .init(key: "A00217")
  17. case .bean: lowcase ? .init(key: "B00137") : .init(key: "A00277")
  18. }
  19. }
  20. var icon: UIImage {
  21. switch self {
  22. case .coin: .icCoin42
  23. case .diamond: .icDiamond42
  24. case .bean: .icBean
  25. }
  26. }
  27. var currentValue: Double {
  28. switch self {
  29. case .coin: myWalletInfo.coin
  30. case .diamond: myWalletInfo.diamond
  31. case .bean: myWalletInfo.bean
  32. }
  33. }
  34. }
  35. enum LNPurchasePlatform: Int, Decodable {
  36. case official = 0
  37. case android = 1
  38. case web = 2
  39. case iOS = 3
  40. }
  41. enum LNPurchasePayType: Int, Decodable {
  42. case apple = 1
  43. case google = 2
  44. }
  45. @AutoCodable
  46. class LNUserWalletInfoResponse: Decodable {
  47. var diamond: Double = 0
  48. var goldCoin: Double = 0
  49. var beanTotal: Double = 0
  50. var unsettledBean: Double = 0
  51. var availableBean: Double = 0
  52. }
  53. @AutoCodable
  54. class LNPurchaseGoodsVO: Decodable {
  55. var id: String = ""
  56. var coinRechargeAmount: Double = 0
  57. var amount: Double = 0
  58. var currency: String = ""
  59. var code: String = ""
  60. }
  61. @AutoCodable
  62. class LNPurchaseGoodsListResponse: Decodable {
  63. var items: [LNPurchaseGoodsVO] = []
  64. }
  65. @AutoCodable
  66. class LNPurchaseCreateOrderResponse: Decodable {
  67. var result: String = ""
  68. }
  69. @AutoCodable
  70. class LNExchangeExpectResponse: Decodable {
  71. var amount: Double = 0.0
  72. }