added ios module

This commit is contained in:
2026-08-17 20:13:28 +08:00
parent a8031e2e3b
commit 7c81976b2b
27 changed files with 2767 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import Foundation
struct VideoCatalogResponse: Decodable {
let videos: [TrainingVideoSummary]
}
enum VideoCatalogAPI {
static func fetch() async throws -> (videos: [TrainingVideoSummary], baseURL: String) {
let result = try await HTTPClient.getJSON(
VideoCatalogResponse.self,
baseURL: AppConfig.serverBaseURL,
path: "api/v1/videos",
timeout: AppConfig.readTimeout
)
let ready = result.value.videos.filter { $0.status == "ready" }
return (ready, result.effectiveBaseURL)
}
}