新增直播模块,包含推流管理与相册流程

将直播推流管理与直播相册从首页占位页迁移为完整实现,包含 alive album OSS 上传、首页路由与单元测试。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-25 14:38:52 +08:00
parent c39c3d3c75
commit fcb692b56a
23 changed files with 2811 additions and 11 deletions

View File

@ -12,11 +12,21 @@ import Foundation
enum TestFixture {
/// JSON fixture
static func data(named name: String, filePath: String = #filePath) throws -> Data {
let url = URL(fileURLWithPath: filePath)
var directory = URL(fileURLWithPath: filePath).deletingLastPathComponent()
while directory.path != "/" {
let url = directory
.appendingPathComponent("Fixtures")
.appendingPathComponent("\(name).json")
if FileManager.default.fileExists(atPath: url.path) {
return try Data(contentsOf: url)
}
directory.deleteLastPathComponent()
}
let fallback = URL(fileURLWithPath: filePath)
.deletingLastPathComponent()
.appendingPathComponent("Fixtures")
.appendingPathComponent("\(name).json")
return try Data(contentsOf: url)
return try Data(contentsOf: fallback)
}
/// Envelope
@ -33,3 +43,16 @@ enum TestFixture {
enum FixtureError: Error {
case emptyPayload
}
extension OSSUploadServing {
/// Live
func uploadAliveAlbumFile(
data: Data,
fileName: String,
fileType: Int,
scenicId: Int,
onProgress: @escaping (Int) -> Void
) async throws -> String {
""
}
}