feat: add live module and optimize report list
This commit is contained in:
@ -109,6 +109,41 @@ final class OSSUploadService {
|
||||
)
|
||||
}
|
||||
|
||||
/// 上传直播封面,对齐 Android `moduleType = live_covers`。
|
||||
func uploadLiveCover(
|
||||
data: Data,
|
||||
fileName: String,
|
||||
scenicId: Int,
|
||||
onProgress: @escaping (Int) -> Void
|
||||
) async throws -> String {
|
||||
try await uploadFile(
|
||||
data: data,
|
||||
fileName: fileName,
|
||||
fileType: 2,
|
||||
scenicId: scenicId,
|
||||
moduleType: "live_covers",
|
||||
onProgress: onProgress
|
||||
)
|
||||
}
|
||||
|
||||
/// 上传直播相册素材,对齐 Android `moduleType = alive_album`。
|
||||
func uploadLiveAlbumFile(
|
||||
data: Data,
|
||||
fileName: String,
|
||||
fileType: Int,
|
||||
scenicId: Int,
|
||||
onProgress: @escaping (Int) -> Void
|
||||
) async throws -> String {
|
||||
try await uploadFile(
|
||||
data: data,
|
||||
fileName: fileName,
|
||||
fileType: fileType,
|
||||
scenicId: scenicId,
|
||||
moduleType: "alive_album",
|
||||
onProgress: onProgress
|
||||
)
|
||||
}
|
||||
|
||||
private func uploadFile(
|
||||
data: Data,
|
||||
fileName: String,
|
||||
@ -205,6 +240,10 @@ enum OSSUploadPolicy {
|
||||
return "sample/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
|
||||
case "scenic_apply":
|
||||
return "scenic_apply/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
|
||||
case "live_covers":
|
||||
return "live_covers/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
|
||||
case "alive_album":
|
||||
return "alive_album/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
|
||||
default:
|
||||
return "task/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user