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
@@ -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]?
}
/// 提交举报接口请求体。