新增景区权限模块,集成 AMap CocoaPods 并支持模拟器

将景区选择与权限申请流程接入首页路由,集成高德 SDK 用于真机构建,并通过 Podfile post_install 钩子保证 arm64 模拟器可编译。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-23 10:15:26 +08:00
parent 5d4613f317
commit b61bf0d070
416 changed files with 18641 additions and 38 deletions

View File

@ -0,0 +1,121 @@
//
// ScenicPermissionAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/23.
//
import Foundation
import Observation
///
@MainActor
protocol ScenicPermissionServing {
///
func scenicListAll() async throws -> ScenicListAllResponse
///
func areas() async throws -> [ScenicAreaNode]
///
func scenicApplicationPendingAll() async throws -> ScenicApplicationPendingsResponse
///
func scenicSubmit(_ request: ScenicApplicationSubmitRequest) async throws
///
func scenicApplicationUploadPlaceholder(_ items: [ScenicApplicationUploadPlaceholder]) async throws
///
func roleApplyAll() async throws -> [RoleApplyPendingResponse]
///
func roleApplySubmit(roleId: Int, scenicIds: [Int]) async throws
}
@MainActor
@Observable
/// API
final class ScenicPermissionAPI {
@ObservationIgnored private let client: APIClient
/// API
init(client: APIClient) {
self.client = client
}
///
func scenicListAll() async throws -> ScenicListAllResponse {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/scenic/list-all"
)
)
}
///
func areas() async throws -> [ScenicAreaNode] {
try await client.send(
APIRequest(
method: .get,
path: "/api/app/config/areas"
)
)
}
///
func scenicApplicationPendingAll() async throws -> ScenicApplicationPendingsResponse {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/scenic-apply/all"
)
)
}
///
func scenicSubmit(_ request: ScenicApplicationSubmitRequest) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/scenic-apply/submit",
body: request
)
)
}
///
func scenicApplicationUploadPlaceholder(_ items: [ScenicApplicationUploadPlaceholder]) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/scenic-apply/upload-placeholder",
body: ["files": items]
)
)
}
///
func roleApplyAll() async throws -> [RoleApplyPendingResponse] {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/role-apply/all"
)
)
}
///
func roleApplySubmit(roleId: Int, scenicIds: [Int]) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/role-apply/submit",
body: RoleApplySubmitRequest(scenicId: scenicIds, roleId: roleId)
)
)
}
}
extension ScenicPermissionAPI: ScenicPermissionServing {}