接入举报摄影师正式接口

This commit is contained in:
2026-07-08 16:38:15 +08:00
parent 4a78a0c21a
commit 290a01e699
12 changed files with 2586 additions and 218 deletions

View File

@ -83,6 +83,48 @@ final class ProfileSpaceSettingsViewModelTests: XCTestCase {
XCTAssertEqual(response.schedule["2026-07-08"]?.first?.userPhone, "13800000000")
}
func testProfileInfoEnvelopeDecodeSupportsEmptyScheduleArray() throws {
let json = """
{
"code": 100000,
"data": {
"accept_order_status": 1,
"attr_label": [],
"avatar": "https://vipsky.oss-cn-shanghai.aliyuncs.com/avatar/20260707/128/E7036CC996884E8A963A3962A9E72850_avatar_1783416288.jpg",
"business_end_time": "",
"business_start_time": "",
"camera_device": [],
"description": "",
"holiday_end_time": "",
"holiday_start_time": "",
"id": 732,
"nickname": "陆久银12",
"real_name": "陆久银",
"scenic_certification": [
"伊犁那拉提景区-5A"
],
"schedule": [],
"shoot_label": []
},
"msg": "success",
"time": "2026-07-08 16:16:18"
}
""".data(using: .utf8)!
let envelope = try JSONDecoder().decode(APIEnvelope<PhotographerProfileInfoResponse>.self, from: json)
let response = try XCTUnwrap(envelope.data)
XCTAssertEqual(response.id, 732)
XCTAssertEqual(response.scenicId, 0)
XCTAssertEqual(response.photogUid, 0)
XCTAssertEqual(response.realName, "")
XCTAssertEqual(response.nickname, "12")
XCTAssertEqual(response.scenicCertification, ["-5A"])
XCTAssertEqual(response.acceptOrderStatus, 1)
XCTAssertEqual(response.schedule, [:])
XCTAssertEqual(response.virtualPhone, "")
}
func testLabelValidationCoversEmptyTooLongDuplicateAndLimit() {
let viewModel = makeViewModel()
var messages: [String] = []