001project_wildgrowth/ios/WildGrowth/WildGrowth/UserModels.swift

35 lines
847 B
Swift

import Foundation
// (GET /api/user/profile)
struct UserProfileResponse: Codable {
let id: String
let phone: String?
let nickname: String
let avatar: String?
let digitalId: String? // ID (Wild ID)
let total_study_time: Int
let completed_lessons: Int
enum CodingKeys: String, CodingKey {
case id, phone, nickname, avatar
case digitalId = "digital_id" // snake_case -> camelCase
case total_study_time, completed_lessons
}
}
// (PUT /api/user/profile)
struct UpdateProfileResponse: Codable {
let id: String
let nickname: String
let avatar: String? // URL
}
// (GET/PUT /api/user/settings)
struct UserSettingsResponse: Codable {
let push_notification: Bool
}