feat: 更新素材管理和举报风险地图
This commit is contained in:
@ -8,7 +8,7 @@ import Foundation
|
||||
import MapKit
|
||||
import UIKit
|
||||
|
||||
/// 举报摄影师页面状态,用于演示加载、空态和异常态。
|
||||
/// 举报摄影师页面状态,用于加载、空态和异常态展示。
|
||||
enum WildReportPageState: String, CaseIterable, Hashable {
|
||||
case normal
|
||||
case loading
|
||||
@ -36,15 +36,6 @@ enum WildReportAttachmentKind: Hashable {
|
||||
struct WildReportType: Decodable, Hashable {
|
||||
let value: Int
|
||||
let label: String
|
||||
|
||||
static let defaultSelected = WildReportType(value: 2, label: "疑似打野")
|
||||
|
||||
static let fallbackOptions = [
|
||||
WildReportType(value: 1, label: "私下收款"),
|
||||
WildReportType(value: 2, label: "疑似打野"),
|
||||
WildReportType(value: 3, label: "未戴工牌"),
|
||||
WildReportType(value: 4, label: "其他")
|
||||
]
|
||||
}
|
||||
|
||||
/// 举报类型接口返回的列表包裹。
|
||||
@ -56,7 +47,51 @@ struct WildReportTypeListResponse: Decodable, Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
/// 举报附件实体,表示一条本地待上传或演示用的上传项。
|
||||
/// 举报首页须知与规则接口响应体。
|
||||
struct WildReportCopyResponse: Decodable, Equatable, Hashable {
|
||||
let notice: [String]
|
||||
let ruleGroups: [WildReportRuleGroup]
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case notice
|
||||
case ruleGroups = "rule_groups"
|
||||
}
|
||||
|
||||
init(notice: [String] = [], ruleGroups: [WildReportRuleGroup] = []) {
|
||||
self.notice = notice
|
||||
self.ruleGroups = ruleGroups
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
notice = try container.decodeIfPresent([String].self, forKey: .notice) ?? []
|
||||
ruleGroups = try container.decodeIfPresent([WildReportRuleGroup].self, forKey: .ruleGroups) ?? []
|
||||
}
|
||||
}
|
||||
|
||||
/// 举报规则分组,用于首页规则入口与举报规则页展示。
|
||||
struct WildReportRuleGroup: Decodable, Equatable, Hashable {
|
||||
let title: String
|
||||
let items: [String]
|
||||
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case title
|
||||
case items
|
||||
}
|
||||
|
||||
init(title: String = "", items: [String] = []) {
|
||||
self.title = title
|
||||
self.items = items
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
title = try container.decodeIfPresent(String.self, forKey: .title) ?? ""
|
||||
items = try container.decodeIfPresent([String].self, forKey: .items) ?? []
|
||||
}
|
||||
}
|
||||
|
||||
/// 举报附件实体,表示一条本地待上传的附件。
|
||||
struct WildReportAttachment: Hashable {
|
||||
let id: UUID
|
||||
let kind: WildReportAttachmentKind
|
||||
|
||||
Reference in New Issue
Block a user