feat(ios): IOS-M0-06 + IOS-M0-07

- LearningSessionService 新增 list() 分页查询
- FileUploadService 新增 deleteFile() 调用 DELETE /files/:id

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-28 20:17:52 +08:00
parent 0a8d873157
commit bd635f4af1
2 changed files with 12 additions and 0 deletions

View File

@ -210,6 +210,13 @@ class LearningSessionService {
func end(id: String) async throws -> LearningSession {
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

View File

@ -74,6 +74,11 @@ class FileUploadService {
return confirmResp.id
}
/// COS +
func deleteFile(fileId: String) async throws {
let _: GenericSuccessResponse = try await client.request("/files/\(fileId)", method: "DELETE")
}
/// URL
func getDownloadUrl(fileId: String) async throws -> String {
let detail: FileDetailResponse = try await client.request("/files/\(fileId)")