feat: update wallet punch point and report success

This commit is contained in:
2026-07-09 14:27:18 +08:00
parent 2970f1514b
commit 43e6133c21
34 changed files with 6671 additions and 71 deletions

View File

@ -13,7 +13,7 @@ protocol WildPhotographerReportServing {
///
func reportCopy() async throws -> WildReportCopyResponse
///
func submitReport(_ request: WildReportSubmitRequest) async throws
func submitReport(_ request: WildReportSubmitRequest) async throws -> WildReportSubmitResponse
///
func supplementReport(_ request: WildReportSupplementRequest) async throws
///
@ -51,8 +51,8 @@ final class WildPhotographerReportAPI: WildPhotographerReportServing {
}
///
func submitReport(_ request: WildReportSubmitRequest) async throws {
let _: EmptyPayload = try await client.send(
func submitReport(_ request: WildReportSubmitRequest) async throws -> WildReportSubmitResponse {
try await client.send(
APIRequest(
method: .post,
path: "/api/yf-handset-app/photog/report/submit",
@ -209,6 +209,28 @@ struct WildReportSubmitRequest: Encodable, Equatable {
}
}
/// ID
struct WildReportSubmitResponse: Decodable, Equatable {
let id: Int
let complaintNo: String
enum CodingKeys: String, CodingKey {
case id
case complaintNo = "complaint_no"
}
init(id: Int = 0, complaintNo: String = "") {
self.id = id
self.complaintNo = complaintNo
}
init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(Int.self, forKey: .id) ?? 0
complaintNo = try container.decodeIfPresent(String.self, forKey: .complaintNo) ?? ""
}
}
///
struct WildReportEvidenceRequest: Encodable, Equatable {
let fileURL: String