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:
parent
0a8d873157
commit
bd635f4af1
@ -210,6 +210,13 @@ class LearningSessionService {
|
|||||||
func end(id: String) async throws -> LearningSession {
|
func end(id: String) async throws -> LearningSession {
|
||||||
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
|
||||||
|
|||||||
@ -74,6 +74,11 @@ class FileUploadService {
|
|||||||
return confirmResp.id
|
return confirmResp.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 删除文件(COS + 数据库)
|
||||||
|
func deleteFile(fileId: String) async throws {
|
||||||
|
let _: GenericSuccessResponse = try await client.request("/files/\(fileId)", method: "DELETE")
|
||||||
|
}
|
||||||
|
|
||||||
/// 获取文件下载 URL
|
/// 获取文件下载 URL
|
||||||
func getDownloadUrl(fileId: String) async throws -> String {
|
func getDownloadUrl(fileId: String) async throws -> String {
|
||||||
let detail: FileDetailResponse = try await client.request("/files/\(fileId)")
|
let detail: FileDetailResponse = try await client.request("/files/\(fileId)")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user