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,91 @@
//
// ScheduleAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/24.
//
import Foundation
///
@MainActor
protocol ScheduleServing {
///
func monthScheduleDays(scenicId: Int, yearMonth: String) async throws -> [String]
///
func dayScheduleList(scenicId: Int, date: String) async throws -> [ScheduleItem]
///
func addSchedule(_ request: AddScheduleRequest) async throws
///
func deleteSchedule(id: Int) async throws
///
func availableOrderList(scenicId: Int) async throws -> [AvailableOrderResponse]
}
/// API
@MainActor
final class ScheduleAPI: ScheduleServing {
private let client: APIClient
/// API
init(client: APIClient) {
self.client = client
}
///
func monthScheduleDays(scenicId: Int, yearMonth: String) async throws -> [String] {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/schedule/list-date",
queryItems: [
URLQueryItem(name: "scenic_id", value: "\(scenicId)"),
URLQueryItem(name: "date", value: yearMonth)
]
)
)
}
///
func dayScheduleList(scenicId: Int, date: String) async throws -> [ScheduleItem] {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/schedule/list",
queryItems: [
URLQueryItem(name: "scenic_id", value: "\(scenicId)"),
URLQueryItem(name: "date", value: date)
]
)
)
}
///
func addSchedule(_ request: AddScheduleRequest) async throws {
_ = try await client.send(
APIRequest(method: .post, path: "/api/yf-handset-app/photog/schedule/add", body: request)
) as EmptyPayload
}
///
func deleteSchedule(id: Int) async throws {
_ = try await client.send(
APIRequest(method: .post, path: "/api/yf-handset-app/photog/schedule/delete", body: ScheduleDeleteRequest(id: id))
) as EmptyPayload
}
///
func availableOrderList(scenicId: Int) async throws -> [AvailableOrderResponse] {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/task/available-order",
queryItems: [URLQueryItem(name: "scenic_id", value: "\(scenicId)")]
)
)
}
}