新增直播模块,包含推流管理与相册流程
将直播推流管理与直播相册从首页占位页迁移为完整实现,包含 alive album OSS 上传、首页路由与单元测试。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -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 {
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user