Files
suixinkan_ios_new/suixinkan/Features/OperatingArea/API/OperatingAreaAPI.swift
汉秋 41dda3cc9b Add OperatingArea and PilotCertification modules with live push readiness.
Migrate operating area and pilot certification from home placeholders, extend Live with playback and push readiness flows, and add pilot certificate OSS upload.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 18:15:59 +08:00

53 lines
1.6 KiB
Swift
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// OperatingAreaAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/25.
//
import Foundation
import Observation
///
@MainActor
protocol OperatingAreaServing {
func storeBusinessArea(storeId: Int) async throws -> ListPayload<OperatingAreaItem>
func scenicAdminBusinessArea(scenicId: Int) async throws -> ListPayload<OperatingAreaItem>
}
@MainActor
@Observable
/// API
final class OperatingAreaAPI {
@ObservationIgnored private let client: APIClient
/// API
init(client: APIClient) {
self.client = client
}
///
func storeBusinessArea(storeId: Int) async throws -> ListPayload<OperatingAreaItem> {
try await client.send(
APIRequest(
method: .get,
path: "/api/app/store/business-area",
queryItems: [URLQueryItem(name: "store_id", value: String(storeId))]
)
)
}
///
func scenicAdminBusinessArea(scenicId: Int) async throws -> ListPayload<OperatingAreaItem> {
try await client.send(
APIRequest(
method: .get,
path: "/api/app/scenic-admin/business-area",
queryItems: [URLQueryItem(name: "scenic_id", value: String(scenicId))]
)
)
}
}
extension OperatingAreaAPI: OperatingAreaServing {}