Skip to content

Commit 0c87486

Browse files
authored
[Merge] #195 - 마이페이지 완료
2 parents 2b05d19 + 0d14e24 commit 0c87486

52 files changed

Lines changed: 2498 additions & 154 deletions

File tree

Some content is hidden

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

CERTI-iOS/Application/DIContainer/AppDIContainer.swift

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ final class AppDIContainer {
1212
static let shared = AppDIContainer()
1313

1414
private init() { }
15-
15+
16+
/// TODO: - 매번 API 연결할 때마다 service랑 repository에 case 만들고 usecase 만들고 DIContainer에서 생성해서 일일이 의존성 주입해주려니 너무 귀찮음;;
17+
/// 여유될 때 방법을 좀 모색해보자
1618

1719
// MARK: - Services
1820

@@ -162,6 +164,42 @@ extension AppDIContainer {
162164
func makeCheckNickNameUseCase() -> CheckNickNameUseCase {
163165
return DefaultCheckNickNameUseCase(repository: userRepository)
164166
}
167+
168+
func makeFetchMyPageInfoUseCase() -> FetchMyPageInfoUseCase {
169+
return DefaultFetchMyPageInfoUseCase(repository: userRepository)
170+
}
171+
172+
func makeFetchEditProfileInfoUseCase() -> FetchEditProfileInfoUseCase {
173+
return DefaultFetchEditProfileInfoUseCase(repository: userRepository)
174+
}
175+
176+
func makeUpdateEditProfileInfoUseCase() -> UpdateEditProfileInfoUseCase {
177+
return DefaultUpdateEditProfileInfoUseCase(repository: userRepository)
178+
}
179+
180+
func makeFetchMyPageUnivListUseCase() -> FetchMyPageUnivListUseCase {
181+
return DefaultFetchMyPageUnivListUseCase(repository: userRepository)
182+
}
183+
184+
func makeFetchMyPageMajorListUseCase() -> FetchMyPageMajorListUseCase {
185+
return DefaultFetchMyPageMajorListUseCase(repository: userRepository)
186+
}
187+
188+
func makeEditMajorUseCase() -> DefaultEditMajorUseCase {
189+
return DefaultEditMajorUseCase(repository: userRepository)
190+
}
191+
192+
func makeEditUnivUseCase() -> DefaultEditUnivUseCase {
193+
return DefaultEditUnivUseCase(repository: userRepository)
194+
}
195+
196+
func makeToggleNotificationSettingUseCase() -> DefaultToggleNotificationSettingUseCase {
197+
return DefaultToggleNotificationSettingUseCase(repository: userRepository)
198+
}
199+
200+
func makeGetNotificationSettingUseCase() -> DefaultGetNotificationSettingUseCase {
201+
return DefaultGetNotificationSettingUseCase(repository: userRepository)
202+
}
165203
}
166204

167205

@@ -231,7 +269,24 @@ extension AppDIContainer {
231269
}
232270

233271
func makeMyPageFactory() -> MyPageFactory {
234-
return DefaultMyPageFactory()
272+
return DefaultMyPageFactory(
273+
fetchMyPageInfoUseCase: makeFetchMyPageInfoUseCase(),
274+
fetchEditProfileInfoUseCase: makeFetchEditProfileInfoUseCase(),
275+
checkNickNameUseCase: makeCheckNickNameUseCase(),
276+
updateEditProfileInfoUseCase: makeUpdateEditProfileInfoUseCase(),
277+
editJobUseCase: makeEditJobUseCase(),
278+
fetchMajorListUseCase: makeFetchMyPageMajorListUseCase(),
279+
fetchUnivListUseCase: makeFetchMyPageUnivListUseCase(),
280+
editMajorUseCase: makeEditMajorUseCase(),
281+
editUnivUseCase: makeEditUnivUseCase(),
282+
getPreCertificationUseCase: makeGetPreCertificationUseCase(),
283+
getFavoriteCertificationUseCase: makeGetFavoritePreCertificationUseCase(),
284+
withDrawUseCase: makeWithDrawUseCase(),
285+
getNotificationSettingUseCase: makeGetNotificationSettingUseCase(),
286+
toggleNotificationSettingUseCase: makeToggleNotificationSettingUseCase(),
287+
switchFavoriteUseCase: makeSwitchFavoriteUseCase(),
288+
fetchAcquisitionListUseCase: makeFetchAcquisitionListUseCase()
289+
)
235290
}
236291

237292
func makeLoginFactory() -> LoginFactory {

CERTI-iOS/Data/Network/Acquisition/DTO/Response/AcquisitionListResponseDTO.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ struct AcquisitionListInfo: Decodable {
3535

3636
func toAcquisitionListEntityData() -> AcquisitionListEntityData {
3737
return AcquisitionListEntityData(
38-
acquisitionId: acquisitionId,
39-
cardFrontImageUrl: cardFrontImageUrl,
38+
acquisitionID: acquisitionId,
39+
cardFrontImageURL: cardFrontImageUrl,
40+
certificationType: "",
4041
index: index,
4142
name: name,
4243
tags: tags,
4344
description: description,
44-
createdAt: createdAt
45+
acquisitionDate: createdAt,
46+
grade: ""
4547
)
4648
}
4749
}

CERTI-iOS/Data/Network/Certification/DTO/Response/CertificationInfoResponseDTO.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ struct CertificationInfoResponseDTO: Decodable {
1919
extension CertificationInfoResponseDTO {
2020
func toPreCertificationEntityData() -> PreCertificationEntityData {
2121
return PreCertificationEntityData(
22-
id: certificationId,
23-
name: certificationName,
22+
certificationID: certificationId,
23+
certificationName: certificationName,
24+
certificationType: "",
25+
description: "",
2426
averagePeriod: averagePeriod,
2527
nearestTestDate: nearestTestDate,
2628
agencyName: agencyName,
27-
iconIndex: iconIndex
29+
iconIndex: iconIndex,
30+
city: "",
31+
state: "",
32+
testDate: ""
2833
)
2934
}
3035
}

CERTI-iOS/Data/Network/Home/DTO/Response/PreCertificationInfoResponseDTO.swift

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
typealias PreCertificationInfoResponseDTO = BaseResponseDTO<PreCertificationData>
1111

1212
struct PreCertificationData: Decodable {
13-
let data: [CertificationInfoResponseDTO]
13+
let data: [PreCertificationDataInfo]
1414
}
1515

1616
extension PreCertificationData {
@@ -20,3 +20,32 @@ extension PreCertificationData {
2020
)
2121
}
2222
}
23+
24+
struct PreCertificationDataInfo: Codable {
25+
let certificationID: Int
26+
let certificationName, certificationType, description, averagePeriod: String
27+
let nearestTestDate, agencyName: String
28+
let iconIndex: Int
29+
let city, state, testDate: String
30+
31+
enum CodingKeys: String, CodingKey {
32+
case certificationID = "certificationId"
33+
case certificationName, certificationType, description, averagePeriod, nearestTestDate, agencyName, iconIndex, city, state, testDate
34+
}
35+
36+
func toPreCertificationEntityData() -> PreCertificationEntityData {
37+
return PreCertificationEntityData(
38+
certificationID: certificationID,
39+
certificationName: certificationName,
40+
certificationType: certificationType,
41+
description: description,
42+
averagePeriod: averagePeriod,
43+
nearestTestDate: nearestTestDate,
44+
agencyName: agencyName,
45+
iconIndex: iconIndex,
46+
city: city,
47+
state: state,
48+
testDate: testDate
49+
)
50+
}
51+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// EditMajorRequestDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/26/26.
6+
//
7+
8+
import Foundation
9+
10+
struct EditMajorRequestDTO: Codable {
11+
let majorName: String
12+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// EditProfileRequestDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/13/26.
6+
//
7+
8+
import Foundation
9+
10+
struct EditProfileRequestDTO: Codable {
11+
let name, email, nickName: String
12+
let birthDate: String?
13+
let publicURL: String
14+
15+
init(entity: EditProfileEntity) {
16+
self.name = entity.name
17+
self.email = entity.email
18+
self.nickName = entity.nickName
19+
self.birthDate = entity.birthDate
20+
self.publicURL = entity.profileImageURL
21+
}
22+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// EditUnivRequestDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/26/26.
6+
//
7+
8+
import Foundation
9+
10+
struct EditUnivRequestDTO: Codable {
11+
let universityName: String
12+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// EditProfileResponseDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/13/26.
6+
//
7+
8+
import Foundation
9+
10+
typealias EditProfileResponseDTO = BaseResponseDTO<EditProfileResponseData>
11+
12+
struct EditProfileResponseData: Codable {
13+
let nickName, name, email: String
14+
let birthDate: String?
15+
let profileImageURL: String
16+
17+
func toEditProfileEntity() -> EditProfileEntity {
18+
return EditProfileEntity(
19+
nickName: nickName,
20+
name: name,
21+
email: email,
22+
birthDate: birthDate,
23+
profileImageURL: profileImageURL
24+
)
25+
}
26+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// MyPageResponseDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/12/26.
6+
//
7+
8+
import Foundation
9+
10+
typealias MyPageResponseDTO = BaseResponseDTO<MyPageResponseData>
11+
12+
struct MyPageResponseData: Codable {
13+
let nickname, profileImageURL, email: String
14+
let jobResponse: JobResponseData
15+
let upCount, acCount, fCount: Int
16+
17+
func toMyPageEntity() -> MyPageEntity {
18+
return MyPageEntity(
19+
nickname: nickname,
20+
profileImageURL: profileImageURL,
21+
email: email,
22+
jobResponse: jobResponse.toJobEntity(),
23+
upCount: upCount,
24+
acCount: acCount,
25+
fCount: fCount
26+
)
27+
}
28+
}
29+
30+
struct JobResponseData: Codable {
31+
let jobList: [String]
32+
33+
func toJobEntity() -> JobEntity {
34+
return JobEntity(jobs: jobList)
35+
}
36+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// NotificationSettingResponseDTO.swift
3+
// CERTI-iOS
4+
//
5+
// Created by OneTen on 1/27/26.
6+
//
7+
8+
import Foundation
9+
10+
typealias NotificationSettingResponseDTO = BaseResponseDTO<NotificationSettingData>
11+
12+
struct NotificationSettingData: Codable {
13+
let isAdAgreed: Bool
14+
}
15+

0 commit comments

Comments
 (0)