feat: 添加云盘与消息中心功能

This commit is contained in:
2026-07-09 22:37:43 +08:00
parent 8e356973bd
commit f20ec7f06c
91 changed files with 5437 additions and 89 deletions

View File

@ -179,6 +179,24 @@ final class OSSUploadService {
)
}
/// Android `cloud_driver` / `cloud_driver_test`
func uploadCloudDriveFile(
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: "cloud_driver",
onProgress: onProgress
)
}
///
func uploadWildReportAttachment(
data: Data,
@ -280,7 +298,7 @@ enum OSSUploadPolicy {
formatter.timeZone = timeZone
formatter.dateFormat = "yyyyMMdd"
let currentDate = formatter.string(from: date)
let uploadId = uuid.uuidString.replacingOccurrences(of: "-", with: "")
let uploadId = uuid.uuidString.replacingOccurrences(of: "-", with: "").lowercased()
let safeName = sanitizedFileName(fileName)
switch moduleType {
case "user_avatar":
@ -307,6 +325,16 @@ enum OSSUploadPolicy {
return "live_covers/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
case "alive_album":
return "alive_album/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
case "cloud_driver":
let userId = AppStore.shared.userId.trimmingCharacters(in: .whitespacesAndNewlines)
let ownerId = userId.isEmpty ? String(scenicId) : userId
let month = String(currentDate.dropFirst(4).prefix(2))
#if DEBUG
let root = "cloud_driver_test"
#else
let root = "cloud_driver"
#endif
return "\(root)/\(ownerId)/\(String(currentDate.prefix(4)))/\(month)/\(safeName)"
case "photog_report":
return "photog_report/\(currentDate)/\(scenicId)/\(uploadId)_\(safeName)"
default: