Add Projects, Schedule, and Invite modules with home routing.

Migrate project management, schedule management, and photographer invitation flows from placeholders, including project image OSS upload and shared business models.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-24 15:57:15 +08:00
parent 0d4b63d273
commit fb8430889b
40 changed files with 4496 additions and 108 deletions

View File

@ -0,0 +1,93 @@
//
// ScheduleAPI.swift
// suixinkan
//
// Created by Codex on 2026/6/24.
//
import Foundation
import Observation
///
@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
@Observable
final class ScheduleAPI: ScheduleServing {
@ObservationIgnored 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)")]
)
)
}
}