feat: 更新素材管理和举报风险地图
This commit is contained in:
@ -10,6 +10,8 @@ import Foundation
|
||||
protocol WildPhotographerReportServing {
|
||||
/// 拉取提交举报可选类型。
|
||||
func reportTypes() async throws -> WildReportTypeListResponse
|
||||
/// 拉取举报首页须知与规则文案。
|
||||
func reportCopy() async throws -> WildReportCopyResponse
|
||||
/// 提交摄影师举报。
|
||||
func submitReport(_ request: WildReportSubmitRequest) async throws
|
||||
/// 为已有举报补充证据。
|
||||
@ -41,6 +43,13 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
|
||||
)
|
||||
}
|
||||
|
||||
/// 拉取举报首页须知与规则文案。
|
||||
func reportCopy() async throws -> WildReportCopyResponse {
|
||||
try await client.send(
|
||||
APIRequest(method: .get, path: "/api/yf-handset-app/photog/report/copy")
|
||||
)
|
||||
}
|
||||
|
||||
/// 提交摄影师举报。
|
||||
func submitReport(_ request: WildReportSubmitRequest) async throws {
|
||||
let _: EmptyPayload = try await client.send(
|
||||
@ -67,9 +76,9 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
|
||||
func riskMap(_ request: WildReportRiskMapRequest) async throws -> WildReportRiskMapResponse {
|
||||
try await client.send(
|
||||
APIRequest(
|
||||
method: .post,
|
||||
method: .get,
|
||||
path: "/api/yf-handset-app/photog/report/risk-map",
|
||||
body: request
|
||||
queryItems: request.queryItems
|
||||
)
|
||||
)
|
||||
}
|
||||
@ -115,12 +124,23 @@ struct WildReportSupplementRequest: Encodable, Equatable {
|
||||
let evidences: [WildReportEvidenceRequest]?
|
||||
}
|
||||
|
||||
/// 附近风险地图接口请求体。
|
||||
/// 附近风险地图接口请求参数。
|
||||
struct WildReportRiskMapRequest: Encodable, Equatable {
|
||||
let scenicId: Int
|
||||
let latitude: Double?
|
||||
let longitude: Double?
|
||||
|
||||
var queryItems: [URLQueryItem] {
|
||||
var items = [URLQueryItem(name: "scenic_id", value: String(scenicId))]
|
||||
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 latitude
|
||||
|
||||
Reference in New Issue
Block a user