feat: connect wild report risk map

This commit is contained in:
2026-07-08 17:52:29 +08:00
parent fd5dc2bbe6
commit 939295d74a
6 changed files with 1829 additions and 135 deletions

View File

@ -14,6 +14,10 @@ protocol WildPhotographerReportServing {
func submitReport(_ request: WildReportSubmitRequest) async throws
///
func supplementReport(_ request: WildReportSupplementRequest) async throws
///
func riskMap(_ request: WildReportRiskMapRequest) async throws -> WildReportRiskMapResponse
///
func markerDetail(_ request: WildReportMarkerDetailRequest) async throws -> WildReportMarkerDetailResponse
///
func reportList(_ request: WildReportListRequest) async throws -> WildReportListResponse
///
@ -59,6 +63,28 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
)
}
///
func riskMap(_ request: WildReportRiskMapRequest) async throws -> WildReportRiskMapResponse {
try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/report/risk-map",
body: request
)
)
}
///
func markerDetail(_ request: WildReportMarkerDetailRequest) async throws -> WildReportMarkerDetailResponse {
try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/report/marker-detail",
body: request
)
)
}
///
func reportList(_ request: WildReportListRequest) async throws -> WildReportListResponse {
try await client.send(
@ -89,6 +115,36 @@ struct WildReportSupplementRequest: Encodable, Equatable {
let evidences: [WildReportEvidenceRequest]?
}
///
struct WildReportRiskMapRequest: Encodable, Equatable {
let scenicId: Int
let latitude: Double?
let longitude: Double?
enum CodingKeys: String, CodingKey {
case scenicId = "scenic_id"
case latitude
case longitude
}
}
///
struct WildReportMarkerDetailRequest: Encodable, Equatable {
let scenicId: Int
let markerType: String
let id: Int
let latitude: Double?
let longitude: Double?
enum CodingKeys: String, CodingKey {
case scenicId = "scenic_id"
case markerType = "marker_type"
case id
case latitude
case longitude
}
}
///
struct WildReportSubmitRequest: Encodable, Equatable {
let scenicId: Int