完善风险地图定位与标记详情
This commit is contained in:
@ -87,9 +87,9 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
|
||||
func markerDetail(_ request: WildReportMarkerDetailRequest) async throws -> WildReportMarkerDetailResponse {
|
||||
try await client.send(
|
||||
APIRequest(
|
||||
method: .post,
|
||||
method: .get,
|
||||
path: "/api/yf-handset-app/photog/report/marker-detail",
|
||||
body: request
|
||||
queryItems: request.queryItems
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -148,7 +148,7 @@ struct WildReportRiskMapRequest: Encodable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
/// 风险地图标记详情接口请求体。
|
||||
/// 风险地图标记详情接口请求参数。
|
||||
struct WildReportMarkerDetailRequest: Encodable, Equatable {
|
||||
let scenicId: Int
|
||||
let markerType: String
|
||||
@ -156,6 +156,21 @@ struct WildReportMarkerDetailRequest: Encodable, Equatable {
|
||||
let latitude: Double?
|
||||
let longitude: Double?
|
||||
|
||||
var queryItems: [URLQueryItem] {
|
||||
var items = [
|
||||
URLQueryItem(name: "scenic_id", value: String(scenicId)),
|
||||
URLQueryItem(name: "marker_type", value: markerType),
|
||||
URLQueryItem(name: "id", value: String(id))
|
||||
]
|
||||
if let latitude {
|
||||
items.append(URLQueryItem(name: "latitude", value: String(latitude)))
|
||||
}
|
||||
if let longitude {
|
||||
items.append(URLQueryItem(name: "longitude", value: String(longitude)))
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case scenicId = "scenic_id"
|
||||
case markerType = "marker_type"
|
||||
|
||||
Reference in New Issue
Block a user