Files
shaguabijia-app-ios/App/Networking/DTO/MeituanDTO.swift
T
marco 98b7600797 初始化傻瓜比价正式版 iOS 客户端
对标安卓正式版、对接 app-server(8770)的 SwiftUI 客户端。iOS 无障碍受限、无比价核心,做自成一体:美团 CPS 导购 + 福利(签到/任务/金币)+ 查看(比价记录/省钱战绩)。
功能完整 M0-M5:脚手架、短信登录(JWT+Keychain+401 自动刷新)、首页券 feed 导购、比价记录+省钱战绩、福利、我的(资料/反馈/设置/注销)。
单 target、0 三方依赖、XcodeGen 生成工程;Debug/Release 双 plist 分流 ATS。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 00:54:11 +08:00

67 lines
1.7 KiB
Swift

import Foundation
// CPS (),
struct FeedRequest: Codable {
let longitude: Double
let latitude: Double
var page: Int = 1
var pageSize: Int = 20
}
struct FeedResponse: Codable {
let items: [CouponCard]
let hasNext: Bool
let page: Int
}
struct CouponCard: Codable, Identifiable, Hashable {
var id: String { productViewSign }
let productViewSign: String
let platform: Int
let bizLine: Int?
let name: String
let headImageUrl: String
let brandName: String?
let brandLogoUrl: String?
let sellPrice: String
let originalPrice: String
let discountAmount: String
let commissionRate: String
let commissionAmount: String?
let saleVolume: String?
let poiName: String?
let distanceText: String?
let distanceMeters: Double?
let availablePoiNum: Int?
let couponNum: Int?
let validDays: Int?
let priceLabel: String?
let rankLabel: String?
let ratingLabel: String?
}
struct ReferralLinkRequest: Codable {
let productViewSign: String
var platform: Int = 1
var bizLine: Int?
var linkTypeList: [Int]?
}
struct ReferralLinkResponse: Codable {
let link: String
var linkMap: [String: String] = [:]
enum CodingKeys: String, CodingKey {
case link
case linkMap // convertFromSnakeCase link_map linkMap
}
init(from decoder: Decoder) throws {
let c = try decoder.container(keyedBy: CodingKeys.self)
link = try c.decode(String.self, forKey: .link)
linkMap = (try? c.decode([String: String].self, forKey: .linkMap)) ?? [:]
}
}