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 ) } }