初始化傻瓜比价正式版 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>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import Foundation
|
||||
|
||||
/// 美团 CPS 导购接口,对齐后端 app/api/v1/meituan.py。未登录可用(后端不鉴权)。
|
||||
struct MeituanService {
|
||||
private var api: APIClient { .shared }
|
||||
|
||||
/// 首页推荐流(2 外卖 + 1 到店交叉,后端写死 3 页)。
|
||||
func feed(longitude: Double, latitude: Double, page: Int) async throws -> FeedResponse {
|
||||
try await api.post(
|
||||
"api/v1/meituan/feed",
|
||||
body: FeedRequest(longitude: longitude, latitude: latitude, page: page),
|
||||
auth: false
|
||||
)
|
||||
}
|
||||
|
||||
/// 换推广链接(带 CPS sid 分佣)。linkTypeList=[1,3]:1=H5 长链、3=deeplink。
|
||||
func referralLink(productViewSign: String, platform: Int, bizLine: Int?) async throws -> ReferralLinkResponse {
|
||||
try await api.post(
|
||||
"api/v1/meituan/referral-link",
|
||||
body: ReferralLinkRequest(
|
||||
productViewSign: productViewSign,
|
||||
platform: platform,
|
||||
bizLine: bizLine,
|
||||
linkTypeList: [1, 3]
|
||||
),
|
||||
auth: false
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user