Add TravelAlbum, ProfileSpace, and wired camera transfer modules.

Introduce travel album entry with Sony PTP tethering pipeline, profile space settings page, home routing updates, Launch Screen storyboard, and related tests/docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-30 09:41:05 +08:00
parent 5692134efc
commit d2fe5d71e4
48 changed files with 6477 additions and 11 deletions

View File

@ -0,0 +1,63 @@
//
// TravelAlbumMaterialUploader.swift
// suixinkan
//
// Created by Codex on 2026/6/29.
//
import Foundation
/// OSS + upload-material
@MainActor
final class TravelAlbumMaterialUploader: CameraAssetUploadSink {
private let api: any TravelAlbumServing
private let ossService: any OSSUploadServing
private let albumID: Int
private let scenicID: Int
/// APIOSS
init(api: any TravelAlbumServing, ossService: any OSSUploadServing, albumID: Int, scenicID: Int) {
self.api = api
self.ossService = ossService
self.albumID = albumID
self.scenicID = scenicID
}
/// OSS
func upload(
localURL: URL,
fileName: String,
fileType: Int,
progress: @escaping @Sendable (Int) -> Void
) async throws -> String {
guard albumID > 0 else {
throw APIError.serverCode(0, "请先选择有效的相册")
}
guard FileManager.default.fileExists(atPath: localURL.path) else {
throw APIError.serverCode(0, "相机文件读取失败")
}
let data = try Data(contentsOf: localURL)
guard !data.isEmpty else {
throw APIError.serverCode(0, "相机文件读取失败")
}
let remoteURL = try await ossService.uploadAlbumFile(
data: data,
fileName: fileName,
fileType: fileType,
scenicId: scenicID,
onProgress: progress
)
_ = try await api.uploadMaterial(
TravelAlbumUploadMaterialRequest(
userEquityTravelId: albumID,
fileName: fileName,
fileURL: remoteURL
)
)
return remoteURL
}
}