fix(ios): 修复重复 list 方法 + FocusItem update Any 类型 + FocusItemUpdateRequest
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
7535865492
commit
8e37223b7f
@ -234,12 +234,6 @@ class LearningSessionService {
|
|||||||
return try await client.request("/learning-sessions/\(id)/end", method: "POST")
|
return try await client.request("/learning-sessions/\(id)/end", method: "POST")
|
||||||
}
|
}
|
||||||
|
|
||||||
func list(page: Int = 1, limit: Int = 20) async throws -> [LearningSession] {
|
|
||||||
return try await client.request("/learning-sessions", queryItems: [
|
|
||||||
URLQueryItem(name: "page", value: String(page)),
|
|
||||||
URLQueryItem(name: "limit", value: String(limit)),
|
|
||||||
])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Review
|
// MARK: - Review
|
||||||
@ -278,9 +272,7 @@ class FocusItemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func update(id: String, masteryScore: Int? = nil, title: String? = nil) async throws -> FocusItem {
|
func update(id: String, masteryScore: Int? = nil, title: String? = nil) async throws -> FocusItem {
|
||||||
var body: [String: Any] = [:]
|
let body = FocusItemUpdateRequest(masteryScore: masteryScore, title: title)
|
||||||
if let s = masteryScore { body["masteryScore"] = s }
|
|
||||||
if let t = title { body["title"] = t }
|
|
||||||
return try await client.request("/focus-items/\(id)", method: "PATCH", body: body)
|
return try await client.request("/focus-items/\(id)", method: "PATCH", body: body)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -483,6 +475,11 @@ struct NotificationPreferences: Codable {
|
|||||||
var systemNotice: Bool?
|
var systemNotice: Bool?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct FocusItemUpdateRequest: Codable {
|
||||||
|
let masteryScore: Int?
|
||||||
|
let title: String?
|
||||||
|
}
|
||||||
|
|
||||||
struct FocusItemCompleteRequest: Codable {
|
struct FocusItemCompleteRequest: Codable {
|
||||||
let id: String
|
let id: String
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user