Files
suixinkan_ios_new/suixinkan/Features/PilotCertification/API/PilotCertificationAPI.swift
汉秋 a04168cf30 新增运营区域与飞手认证模块,并完善直播推流就绪流程
将运营区域与飞手认证从首页占位页迁移为完整模块,扩展 Live 播放与推流就绪流程,并新增飞手证书 OSS 上传。

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

59 lines
1.8 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.

//
// 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 {}