98b7600797
对标安卓正式版、对接 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>
67 lines
1.2 KiB
Swift
67 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
// ===== 请求 =====
|
|
|
|
struct SmsSendRequest: Codable {
|
|
let phone: String
|
|
}
|
|
|
|
struct SmsLoginRequest: Codable {
|
|
let phone: String
|
|
let code: String
|
|
}
|
|
|
|
struct RefreshRequest: Codable {
|
|
let refreshToken: String // → refresh_token
|
|
}
|
|
|
|
struct ProfileUpdateRequest: Codable {
|
|
let nickname: String
|
|
}
|
|
|
|
// ===== 响应 =====
|
|
|
|
struct UserDTO: Codable, Identifiable, Hashable {
|
|
let id: Int
|
|
let phone: String
|
|
var nickname: String?
|
|
var avatarUrl: String?
|
|
let registerChannel: String
|
|
let status: String
|
|
let createdAt: String
|
|
let lastLoginAt: String
|
|
}
|
|
|
|
struct TokenPairDTO: Codable {
|
|
let accessToken: String
|
|
let refreshToken: String
|
|
let tokenType: String
|
|
let expiresIn: Int
|
|
let refreshExpiresIn: Int
|
|
}
|
|
|
|
struct TokenWithUserDTO: Codable {
|
|
let accessToken: String
|
|
let refreshToken: String
|
|
let tokenType: String
|
|
let expiresIn: Int
|
|
let refreshExpiresIn: Int
|
|
let user: UserDTO
|
|
}
|
|
|
|
struct SmsSendResponse: Codable {
|
|
let sent: Bool
|
|
let mock: Bool
|
|
let cooldownSec: Int
|
|
}
|
|
|
|
struct LogoutResponse: Codable {
|
|
let ok: Bool
|
|
}
|
|
|
|
struct FeedbackResultDTO: Codable {
|
|
let id: Int
|
|
let status: String
|
|
let createdAt: String?
|
|
}
|