Initial commit: suixinkan_ios UIKit rewrite project.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 14:33:31 +08:00
commit 9edf993432
297 changed files with 47151 additions and 0 deletions

View File

@ -0,0 +1,56 @@
//
// PilotCertificationAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/25.
//
import Foundation
///
@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
/// API `/api/app/flyer`
final class PilotCertificationAPI {
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 {}