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>
This commit is contained in:
2026-06-25 18:15:59 +08:00
parent fdf4659048
commit 41dda3cc9b
33 changed files with 3455 additions and 37 deletions

View File

@ -0,0 +1,58 @@
//
// PilotCertificationAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/25.
//
import Foundation
import Observation
///
@MainActor
protocol PilotCertificationServing {
func flyerDetail() async throws -> FlyerDetailResponse
func flyerSendCode(phone: String) async throws
func flyerApply(_ request: FlyerApplyRequest) async throws
func flyerEdit(_ request: FlyerEditRequest) async throws
}
@MainActor
@Observable
/// API `/api/app/flyer`
final class PilotCertificationAPI {
@ObservationIgnored private let client: APIClient
/// API
init(client: APIClient) {
self.client = client
}
///
func flyerDetail() async throws -> FlyerDetailResponse {
try await client.send(APIRequest(method: .get, path: "/api/app/flyer/detail"))
}
///
func flyerSendCode(phone: String) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(method: .post, path: "/api/app/flyer/send-code", body: FlyerSendCodeRequest(phone: phone))
)
}
///
func flyerApply(_ request: FlyerApplyRequest) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(method: .post, path: "/api/app/flyer/apply", body: request)
)
}
///
func flyerEdit(_ request: FlyerEditRequest) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(method: .post, path: "/api/app/flyer/edit", body: request)
)
}
}
extension PilotCertificationAPI: PilotCertificationServing {}