Implement report supplement evidence flow

This commit is contained in:
2026-07-08 17:23:28 +08:00
parent 290a01e699
commit fd5dc2bbe6
9 changed files with 1906 additions and 421 deletions

View File

@ -12,8 +12,12 @@ protocol WildPhotographerReportServing {
func reportTypes() async throws -> WildReportTypeListResponse
///
func submitReport(_ request: WildReportSubmitRequest) async throws
///
func supplementReport(_ request: WildReportSupplementRequest) async throws
///
func reportList(_ request: WildReportListRequest) async throws -> WildReportListResponse
///
func reportDetail(id: Int) async throws -> WildReportDetailData
}
/// API `photog/report`
@ -44,6 +48,17 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
)
}
///
func supplementReport(_ request: WildReportSupplementRequest) async throws {
let _: EmptyPayload = try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/report/supplement",
body: request
)
)
}
///
func reportList(_ request: WildReportListRequest) async throws -> WildReportListResponse {
try await client.send(
@ -54,6 +69,24 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
)
)
}
///
func reportDetail(id: Int) async throws -> WildReportDetailData {
try await client.send(
APIRequest(
method: .get,
path: "/api/yf-handset-app/photog/report/detail",
queryItems: [URLQueryItem(name: "id", value: String(id))]
)
)
}
}
///
struct WildReportSupplementRequest: Encodable, Equatable {
let id: Int
let desc: String?
let evidences: [WildReportEvidenceRequest]?
}
///