新增ai修图
This commit is contained in:
@ -116,6 +116,8 @@ struct TravelAlbumAvailableOrder: Decodable, Sendable, Equatable, Hashable {
|
||||
|
||||
/// 旅拍相册素材实体,对齐 Android `TravelAlbumMaterialEntity`。
|
||||
struct TravelAlbumMaterial: Decodable, Sendable, Equatable, Hashable, Identifiable {
|
||||
private static let bundledImageURLPrefix = "asset://"
|
||||
|
||||
let id: Int
|
||||
let userEquityTravelId: Int
|
||||
let status: Int
|
||||
@ -175,6 +177,18 @@ struct TravelAlbumMaterial: Decodable, Sendable, Equatable, Hashable, Identifiab
|
||||
self.createdAt = createdAt
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// 将工程内图片资源转换为素材可识别的本地地址,仅供无接口数据的演示素材使用。
|
||||
static func bundledImageURL(assetName: String) -> String {
|
||||
bundledImageURLPrefix + assetName
|
||||
}
|
||||
|
||||
/// 返回本地演示素材对应的图片资源名;真实网络素材返回 `nil`。
|
||||
var bundledImageAssetName: String? {
|
||||
guard fileUrl.hasPrefix(Self.bundledImageURLPrefix) else { return nil }
|
||||
let assetName = String(fileUrl.dropFirst(Self.bundledImageURLPrefix.count))
|
||||
return assetName.isEmpty ? nil : assetName
|
||||
}
|
||||
}
|
||||
|
||||
/// 旅拍相册创建请求体,对齐 Android `TravelAlbumCreateRequest`。
|
||||
|
||||
Reference in New Issue
Block a user