Skip to content

Commit 5300a33

Browse files
authored
Merge branch 'YAPP-Github:develop' into develop
2 parents 46d27db + 3ffa4b5 commit 5300a33

File tree

303 files changed

+8484
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+8484
-595
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Set Xcode version
17-
run: sudo xcode-select -s /Applications/Xcode_16.2.app
17+
run: sudo xcode-select -s /Applications/Xcode_16.4.app
1818

1919
- name: Install Mise and Tuist
2020
run: |

Projects/DataSource/Sources/Common/DataSourceDependencyAssembler.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,17 @@ public struct DataSourceDependencyAssembler: DependencyAssemblerProtocol {
4040
DIContainer.shared.register(type: AppConfigRepositoryProtocol.self) { _ in
4141
return AppConfigRepository()
4242
}
43+
44+
DIContainer.shared.register(type: LocationRepositoryProtocol.self) { _ in
45+
return LocationRepository()
46+
}
47+
48+
DIContainer.shared.register(type: ReportRepositoryProtocol.self) { _ in
49+
return ReportRepository()
50+
}
51+
52+
DIContainer.shared.register(type: FileRepositoryProtocol.self) { _ in
53+
return FileRepository()
54+
}
4355
}
4456
}

Projects/DataSource/Sources/Common/Enum/AppProperties.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ public enum AppProperties {
1515
public static var kakaoNativeKey: String {
1616
Bundle.main.object(forInfoDictionaryKey: "KakaoNativeKey") as? String ?? ""
1717
}
18+
19+
public static var kakaoApiKey: String {
20+
Bundle.main.object(forInfoDictionaryKey: "KakaoAPIKey") as? String ?? ""
21+
}
1822
}

Projects/DataSource/Sources/Common/Enum/Endpoint.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// Created by 최정인 on 6/21/25.
66
//
77

8+
import Foundation
9+
810
public protocol Endpoint {
911
var baseURL: String { get }
1012
var path: String { get }
@@ -13,4 +15,11 @@ public protocol Endpoint {
1315
var queryParameters: [String: String] { get }
1416
var bodyParameters: [String: Any] { get }
1517
var isAuthorized: Bool { get }
18+
var bodyType: EndpointBodyType { get }
19+
var bodyData: Data? { get }
20+
}
21+
22+
extension Endpoint {
23+
var bodyType: EndpointBodyType { return .json }
24+
var bodyData: Data? { return nil }
1625
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// EndpointBodyType.swift
3+
// DataSource
4+
//
5+
// Created by 이동현 on 11/22/25.
6+
//
7+
8+
public enum EndpointBodyType {
9+
case json
10+
case rawData
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// FilePresignedConditionDTO.swift
3+
// DataSource
4+
//
5+
// Created by 이동현 on 11/22/25.
6+
//
7+
8+
struct FilePresignedConditionDTO: Codable {
9+
let prefix: String?
10+
let fileName: String
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// FilePresignedDTO.swift
3+
// DataSource
4+
//
5+
// Created by 이동현 on 11/22/25.
6+
//
7+
8+
struct FilePresignedDTO: Decodable {
9+
let file1: String?
10+
let file2: String?
11+
let file3: String?
12+
13+
enum CodingKeys: String, CodingKey {
14+
case file1 = "additionalProp1"
15+
case file2 = "additionalProp2"
16+
case file3 = "additionalProp3"
17+
}
18+
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
//
2+
// KakaoLocationResponseDTO.swift
3+
// DataSource
4+
//
5+
// Created by 이동현 on 11/10/25.
6+
//
7+
8+
import Domain
9+
import Foundation
10+
11+
struct KakaoLocationResponseDTO: Codable {
12+
let meta: Meta
13+
let documents: [Document]
14+
15+
struct Meta: Codable {
16+
let totalCount: Int
17+
let pageableCount: Int?
18+
let isEnd: Bool?
19+
20+
enum CodingKeys: String, CodingKey {
21+
case totalCount = "total_count"
22+
case pageableCount = "pageable_count"
23+
case isEnd = "is_end"
24+
}
25+
}
26+
}
27+
28+
// MARK: - Document
29+
struct Document: Codable {
30+
let roadAddress: KakaoRoadAddress?
31+
let address: KakaoAddress?
32+
33+
let addressName: String?
34+
let y: String? // 위도 (latitude)
35+
let x: String? // 경도 (longitude)
36+
let addressType: String?
37+
38+
enum CodingKeys: String, CodingKey {
39+
case addressName = "address_name"
40+
case y, x
41+
case addressType = "address_type"
42+
case address
43+
case roadAddress = "road_address"
44+
}
45+
46+
var latitude: Double? {
47+
if let y, let v = Double(y) { return v }
48+
if let v = address?.latitude { return v }
49+
if let v = roadAddress?.latitude { return v }
50+
return nil
51+
}
52+
53+
var longitude: Double? {
54+
if let x, let v = Double(x) { return v }
55+
if let v = address?.longitude { return v }
56+
if let v = roadAddress?.longitude { return v }
57+
return nil
58+
}
59+
}
60+
61+
// MARK: - KakaoRoadAddress (도로명 주소)
62+
struct KakaoRoadAddress: Codable {
63+
let addressName: String
64+
let region1depthName: String
65+
let region2depthName: String
66+
let region3depthName: String
67+
let roadName: String
68+
let undergroundYn: String?
69+
let mainBuildingNo: String?
70+
let subBuildingNo: String?
71+
let buildingName: String?
72+
let zoneNo: String?
73+
let y: String?
74+
let x: String?
75+
76+
enum CodingKeys: String, CodingKey {
77+
case addressName = "address_name"
78+
case region1depthName = "region_1depth_name"
79+
case region2depthName = "region_2depth_name"
80+
case region3depthName = "region_3depth_name"
81+
case roadName = "road_name"
82+
case undergroundYn = "underground_yn"
83+
case mainBuildingNo = "main_building_no"
84+
case subBuildingNo = "sub_building_no"
85+
case buildingName = "building_name"
86+
case zoneNo = "zone_no"
87+
case y, x
88+
}
89+
90+
var latitude: Double? { y.flatMap(Double.init) }
91+
var longitude: Double? { x.flatMap(Double.init) }
92+
}
93+
94+
// MARK: - Address (지번 주소)
95+
struct KakaoAddress: Codable {
96+
let addressName: String
97+
let region1depthName: String
98+
let region2depthName: String
99+
let region3depthName: String
100+
let region3depthHName: String?
101+
let hCode: String?
102+
let bCode: String?
103+
let mountainYn: String?
104+
let mainAddressNo: String?
105+
let subAddressNo: String?
106+
let x: String?
107+
let y: String?
108+
let zipCode: String?
109+
110+
enum CodingKeys: String, CodingKey {
111+
case addressName = "address_name"
112+
case region1depthName = "region_1depth_name"
113+
case region2depthName = "region_2depth_name"
114+
case region3depthName = "region_3depth_name"
115+
case region3depthHName = "region_3depth_h_name"
116+
case hCode = "h_code"
117+
case bCode = "b_code"
118+
case mountainYn = "mountain_yn"
119+
case mainAddressNo = "main_address_no"
120+
case subAddressNo = "sub_address_no"
121+
case x, y
122+
case zipCode = "zip_code"
123+
}
124+
125+
var latitude: Double? { y.flatMap(Double.init) }
126+
var longitude: Double? { x.flatMap(Double.init) }
127+
}
128+
129+
// MARK: - Mapping
130+
extension KakaoLocationResponseDTO {
131+
func toLocationEntity(fallbackLongitude: Double? = nil, fallbackLatitude: Double? = nil) -> LocationEntity? {
132+
guard let doc = documents.first else { return nil }
133+
let longitude = doc.longitude ?? fallbackLongitude
134+
let latitude = doc.latitude ?? fallbackLatitude
135+
let address = doc.roadAddress?.addressName ?? doc.address?.addressName
136+
137+
return LocationEntity(longitude: longitude ?? 0, latitude: latitude ?? 0, address: address)
138+
}
139+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// OnboardingDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 8/27/25.
6+
//
7+
8+
import Domain
9+
10+
struct OnboardingDTO: Encodable {
11+
let timeSlot: String
12+
let emotionType: [String]
13+
let realOutingFrequency: String?
14+
let targetOutingFrequency: String
15+
16+
func toOnboardingEntity() -> OnboardingEntity {
17+
return OnboardingEntity(
18+
time: timeSlot,
19+
feeling: emotionType,
20+
frequency: realOutingFrequency,
21+
outdoor: targetOutingFrequency)
22+
}
23+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// OnboardingResponseDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 9/1/25.
6+
//
7+
8+
import Domain
9+
10+
struct OnboardingResponseDTO: Decodable {
11+
let timeSlot: String
12+
let emotionTypes: [String]
13+
let targetOutingFrequency: String
14+
15+
func toOnboardingEntity() -> OnboardingEntity {
16+
return OnboardingEntity(
17+
time: timeSlot,
18+
feeling: emotionTypes,
19+
outdoor: targetOutingFrequency)
20+
}
21+
}

0 commit comments

Comments
 (0)