Integrate高德 SDK with simulator-safe build flags, add map views for operating area and punch points, refactor main tabs and key feature screens to UIKit with Diffable lists, and document Swift concurrency defaults in AGENTS.md. Co-authored-by: Cursor <cursoragent@cursor.com>
61 lines
1.9 KiB
Swift
61 lines
1.9 KiB
Swift
//
|
||
// PilotCertificationAPI.swift
|
||
// suixinkan
|
||
//
|
||
// Created by Codex on 2026/6/25.
|
||
//
|
||
|
||
import Foundation
|
||
|
||
/// 飞手认证服务协议,定义认证详情、短信、提交和编辑接口。
|
||
@MainActor
|
||
protocol PilotCertificationServing {
|
||
/// 飞手详情相关逻辑。
|
||
func flyerDetail() async throws -> FlyerDetailResponse
|
||
/// 飞手Send验证码相关逻辑。
|
||
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 {}
|