From 8e37223b7f4f1f75d5b33995bfadfb3d2b219f8d Mon Sep 17 00:00:00 2001 From: wangdl Date: Thu, 28 May 2026 21:00:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(ios):=20=E4=BF=AE=E5=A4=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=20list=20=E6=96=B9=E6=B3=95=20+=20FocusItem=20update?= =?UTF-8?q?=20Any=20=E7=B1=BB=E5=9E=8B=20+=20FocusItemUpdateRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- .../AIStudyApp/Core/Services/APIService.swift | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/AIStudyApp/AIStudyApp/Core/Services/APIService.swift b/AIStudyApp/AIStudyApp/Core/Services/APIService.swift index 1c8d0b9..59a53a6 100644 --- a/AIStudyApp/AIStudyApp/Core/Services/APIService.swift +++ b/AIStudyApp/AIStudyApp/Core/Services/APIService.swift @@ -234,12 +234,6 @@ class LearningSessionService { 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 @@ -278,9 +272,7 @@ class FocusItemService { } func update(id: String, masteryScore: Int? = nil, title: String? = nil) async throws -> FocusItem { - var body: [String: Any] = [:] - if let s = masteryScore { body["masteryScore"] = s } - if let t = title { body["title"] = t } + let body = FocusItemUpdateRequest(masteryScore: masteryScore, title: title) return try await client.request("/focus-items/\(id)", method: "PATCH", body: body) } @@ -483,6 +475,11 @@ struct NotificationPreferences: Codable { var systemNotice: Bool? } +struct FocusItemUpdateRequest: Codable { + let masteryScore: Int? + let title: String? +} + struct FocusItemCompleteRequest: Codable { let id: String }