feat(travel-album): 按当前景区创建相册及筛选订单
This commit is contained in:
@@ -8,8 +8,8 @@ import Foundation
|
||||
@MainActor
|
||||
/// 旅拍相册服务协议,抽象相册列表、创建、详情与素材接口。
|
||||
protocol TravelAlbumServing {
|
||||
/// 拉取可绑定订单。
|
||||
func availableOrders() async throws -> [TravelAlbumAvailableOrder]
|
||||
/// 拉取指定景区的可绑定订单。
|
||||
func availableOrders(scenicId: Int) async throws -> [TravelAlbumAvailableOrder]
|
||||
|
||||
/// 创建旅拍相册。
|
||||
func create(_ request: TravelAlbumCreateRequest) async throws -> TravelAlbumCreateResponse
|
||||
@@ -83,14 +83,24 @@ final class TravelAlbumAPI: TravelAlbumServing {
|
||||
self.client = client
|
||||
}
|
||||
|
||||
/// 拉取可绑定订单。
|
||||
func availableOrders() async throws -> [TravelAlbumAvailableOrder] {
|
||||
try await client.send(APIRequest(method: .get, path: "\(basePath)/available-order"))
|
||||
/// 拉取指定景区的可绑定订单。
|
||||
func availableOrders(scenicId: Int) async throws -> [TravelAlbumAvailableOrder] {
|
||||
try await client.send(
|
||||
APIRequest(
|
||||
method: .get,
|
||||
path: "\(basePath)/available-order",
|
||||
queryItems: [URLQueryItem(name: "scenic_id", value: String(scenicId))]
|
||||
),
|
||||
preservingBusinessErrorCodes: [100099]
|
||||
)
|
||||
}
|
||||
|
||||
/// 创建旅拍相册。
|
||||
func create(_ request: TravelAlbumCreateRequest) async throws -> TravelAlbumCreateResponse {
|
||||
try await client.send(APIRequest(method: .post, path: "\(basePath)/create", body: request))
|
||||
try await client.send(
|
||||
APIRequest(method: .post, path: "\(basePath)/create", body: request),
|
||||
preservingBusinessErrorCodes: [100001, 100099]
|
||||
)
|
||||
}
|
||||
|
||||
/// 拉取旅拍相册列表。
|
||||
|
||||
Reference in New Issue
Block a user