【发布时间】:2020-08-31 13:16:16
【问题描述】:
用户结构:
struct User: Codable, Identifiable {
let id = UUID()
let userId: Int?
let userName: String?
let userDocument: [UserDocument]?
}
用户文档结构:
struct UserDocument: Codable, Identifiable {
let id = UUID()
let userDocumentId: Int?
let userId: Int?
let documentId: Int?
let document: Document?
}
文档结构:
struct Document: Codable {
let documentId: Int
let ownerId: Int?
let secureName: String?
let title: String?
let description: String?
let fileExtension: String?
let fileSize: Int64?
let url: String?
}
这是请求正文(我被困在这里):
let body: [String: Any?] = ["userId": 0, "userName": "name", "userDcuments": ?....]
【问题讨论】:
标签: swift httprequest codable