Skip to content

Commit 5587dc2

Browse files
authored
Feat: 홈 API 연동 (1) - 루틴 조회, 루틴 상세 보기 (#T3-130)
* Feat: 유저 닉네임 가져오는 API 연동 (#T3-130) - HomeView, MypageView에서 사용 * Chore: 이용 약관 및 공지사항 등 서비스 URL 교체 * Feat: HomeView에 FloatingButton 추가 (#T3-130) * Feat: 루틴 목록 조회 API 연동 (#T3-130) * Feat: 감정 구슬 관련 TooltipView 추가 (#T3-130) * Feat: RoutineDetailView UI 구현 (#T3-130) * Refactor: KakaoSDK에서 닉네임, 프로필 가져오는 로직 제거 * Refactor: 오타 수정 및 분기 처리 * Refactor: RoutineView, SubRoutineButton Layout 조정 * Refactor: LoginView, IntroView 그래픽 추가 * Chore: AppIcon 추가 * Feat: Home 화면에서 감정 구슬 보여주기 (#T3-130) * Fix: IntroView Layout 수정 * Fix: handleTap 좌표 계산 수정
1 parent 6934e6f commit 5587dc2

74 files changed

Lines changed: 1389 additions & 243 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.
23 KB
Loading

Projects/App/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 3 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,9 @@
11
{
22
"images" : [
33
{
4-
"idiom" : "iphone",
5-
"scale" : "2x",
6-
"size" : "20x20"
7-
},
8-
{
9-
"idiom" : "iphone",
10-
"scale" : "3x",
11-
"size" : "20x20"
12-
},
13-
{
14-
"idiom" : "iphone",
15-
"scale" : "2x",
16-
"size" : "29x29"
17-
},
18-
{
19-
"idiom" : "iphone",
20-
"scale" : "3x",
21-
"size" : "29x29"
22-
},
23-
{
24-
"idiom" : "iphone",
25-
"scale" : "2x",
26-
"size" : "40x40"
27-
},
28-
{
29-
"idiom" : "iphone",
30-
"scale" : "3x",
31-
"size" : "40x40"
32-
},
33-
{
34-
"idiom" : "iphone",
35-
"scale" : "2x",
36-
"size" : "60x60"
37-
},
38-
{
39-
"idiom" : "iphone",
40-
"scale" : "3x",
41-
"size" : "60x60"
42-
},
43-
{
44-
"idiom" : "ipad",
45-
"scale" : "1x",
46-
"size" : "20x20"
47-
},
48-
{
49-
"idiom" : "ipad",
50-
"scale" : "2x",
51-
"size" : "20x20"
52-
},
53-
{
54-
"idiom" : "ipad",
55-
"scale" : "1x",
56-
"size" : "29x29"
57-
},
58-
{
59-
"idiom" : "ipad",
60-
"scale" : "2x",
61-
"size" : "29x29"
62-
},
63-
{
64-
"idiom" : "ipad",
65-
"scale" : "1x",
66-
"size" : "40x40"
67-
},
68-
{
69-
"idiom" : "ipad",
70-
"scale" : "2x",
71-
"size" : "40x40"
72-
},
73-
{
74-
"idiom" : "ipad",
75-
"scale" : "1x",
76-
"size" : "76x76"
77-
},
78-
{
79-
"idiom" : "ipad",
80-
"scale" : "2x",
81-
"size" : "76x76"
82-
},
83-
{
84-
"idiom" : "ipad",
85-
"scale" : "2x",
86-
"size" : "83.5x83.5"
87-
},
88-
{
89-
"idiom" : "ios-marketing",
90-
"scale" : "1x",
4+
"filename" : "AppIcon.png",
5+
"idiom" : "universal",
6+
"platform" : "ios",
917
"size" : "1024x1024"
928
}
939
],

Projects/DataSource/Sources/Common/DataSourceDependencyAssembler.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,9 @@ public struct DataSourceDependencyAssembler: DependencyAssemblerProtocol {
3232
DIContainer.shared.register(type: EmotionRepositoryProtocol.self) { _ in
3333
return EmotionRepository()
3434
}
35+
36+
DIContainer.shared.register(type: RoutineRepositoryProtocol.self) { _ in
37+
return RoutineRepository()
38+
}
3539
}
3640
}

Projects/DataSource/Sources/DTO/EmotionResponseDTO.swift

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import Domain
99
import Foundation
1010

1111
struct EmotionResponseDTO: Decodable {
12-
let type: String
13-
let name: String
14-
let imageUrl: String
12+
let type: String?
13+
let name: String?
14+
let imageUrl: String?
1515

1616
enum CodingKeys: String, CodingKey {
1717
case type = "emotionMarbleType"
@@ -21,7 +21,13 @@ struct EmotionResponseDTO: Decodable {
2121
}
2222

2323
extension EmotionResponseDTO {
24-
func toEmotionEntity() -> EmotionEntity {
24+
func toEmotionEntity() -> EmotionEntity? {
25+
guard
26+
let type,
27+
let name,
28+
let imageUrl
29+
else { return nil }
30+
2531
return EmotionEntity(
2632
emotionType: type,
2733
emotionName: name,

Projects/DataSource/Sources/DTO/RecommendedRoutineDTO.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ struct RecommendedRoutineDTO: Decodable {
1212
let routineName: String
1313
let routineDescription: String
1414
let routineLevel: String?
15-
let subRoutines: [SubRoutineDTO]
15+
let subRoutines: [RecommendedSubRoutineDTO]
1616

1717
enum CodingKeys: String, CodingKey {
1818
case id = "recommendedRoutineId"
@@ -21,7 +21,9 @@ struct RecommendedRoutineDTO: Decodable {
2121
case routineLevel = "recommendedRoutineLevel"
2222
case subRoutines = "recommendedSubRoutineSearchResult"
2323
}
24+
}
2425

26+
extension RecommendedRoutineDTO {
2527
func toRecommendedRoutineEntity(category: String? = nil) -> RecommendedRoutineEntity {
2628
var routineCategory: RoutineCategoryType?
2729
if let category {
@@ -38,20 +40,6 @@ struct RecommendedRoutineDTO: Decodable {
3840
description: routineDescription,
3941
category: routineCategory,
4042
level: level,
41-
subRoutines: subRoutines.compactMap({ $0.toSubRoutineEntity() }))
42-
}
43-
}
44-
45-
struct SubRoutineDTO: Decodable {
46-
let id: Int
47-
let routineName: String
48-
49-
enum CodingKeys: String, CodingKey {
50-
case id = "recommendedSubRoutineId"
51-
case routineName = "recommendedSubRoutineName"
52-
}
53-
54-
func toSubRoutineEntity() -> SubRoutineEntity {
55-
return SubRoutineEntity(id: id, title: routineName)
43+
subRoutines: subRoutines.compactMap({ $0.toRecommendedSubRoutineEntity() }))
5644
}
5745
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// RecommendedSubRoutineDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 7/30/25.
6+
//
7+
8+
import Domain
9+
10+
struct RecommendedSubRoutineDTO: Decodable {
11+
let id: Int
12+
let routineName: String
13+
14+
enum CodingKeys: String, CodingKey {
15+
case id = "recommendedSubRoutineId"
16+
case routineName = "recommendedSubRoutineName"
17+
}
18+
}
19+
20+
extension RecommendedSubRoutineDTO {
21+
func toRecommendedSubRoutineEntity() -> RecommendedSubRoutineEntity {
22+
return RecommendedSubRoutineEntity(id: id, title: routineName)
23+
}
24+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
//
2+
// RoutineResponseDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 7/30/25.
6+
//
7+
8+
import Domain
9+
10+
struct RoutineDictionaryDTO: Decodable {
11+
let routines: [String: [RoutineResponseDTO]]
12+
}
13+
14+
struct RoutineResponseDTO: Decodable {
15+
let routineId: String
16+
let historySeq: Int
17+
let routineName: String
18+
let repeatDay: [String]?
19+
let executionTime: String
20+
let subRoutineSearchResultDto: [SubRoutineResponseDTO]
21+
let modifiedYn: Bool
22+
let routineCompletionId: Int?
23+
let completeYn: Bool
24+
let routineType: String
25+
}
26+
27+
extension RoutineResponseDTO {
28+
func toRoutineEntity() -> RoutineEntity {
29+
return RoutineEntity(
30+
routineId: routineId,
31+
historySeq: historySeq,
32+
routineName: routineName,
33+
repeatDay: repeatDay,
34+
executionTime: executionTime,
35+
subRoutineSearchResultDto: subRoutineSearchResultDto.map({ $0.toSubRoutineEntity() }),
36+
modifiedYn: modifiedYn,
37+
routineCompletionId: routineCompletionId,
38+
completeYn: completeYn,
39+
routineType: routineType)
40+
}
41+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// SubRoutineResponseDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 7/30/25.
6+
//
7+
8+
import Domain
9+
10+
struct SubRoutineResponseDTO: Decodable {
11+
let subRoutineId: String
12+
let historySeq: Int
13+
let subRoutineName: String
14+
let modifiedYn: Bool
15+
let sortOrder: Int
16+
let routineCompletionId: Int?
17+
let completeYn: Bool
18+
let routineType: String
19+
}
20+
21+
extension SubRoutineResponseDTO {
22+
func toSubRoutineEntity() -> SubRoutineEntity {
23+
return SubRoutineEntity(
24+
subRoutineId: subRoutineId,
25+
historySeq: historySeq,
26+
subRoutineName: subRoutineName,
27+
modifiedYn: modifiedYn,
28+
sortOrder: sortOrder,
29+
routineCompletionId: routineCompletionId,
30+
completeYn: completeYn,
31+
routineType: routineType)
32+
}
33+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//
2+
// UserDataResponseDTO.swift
3+
// DataSource
4+
//
5+
// Created by 최정인 on 7/30/25.
6+
//
7+
8+
struct UserDataResponseDTO: Decodable {
9+
let nickname: String
10+
}

Projects/DataSource/Sources/Endpoint/EmotionEndpoint.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
enum EmotionEndpoint {
99
case fetchEmotions
10+
case fetchEmotion(date: String)
1011
case registerEmotion(emotion: String)
1112
}
1213

@@ -16,12 +17,20 @@ extension EmotionEndpoint: Endpoint {
1617
}
1718

1819
var path: String {
19-
return baseURL
20+
switch self {
21+
case .fetchEmotions:
22+
return baseURL
23+
case .fetchEmotion(let date):
24+
return baseURL + "/\(date)"
25+
case .registerEmotion(let emotion):
26+
return baseURL
27+
}
2028
}
2129

2230
var method: HTTPMethod {
2331
switch self {
2432
case .fetchEmotions: .get
33+
case .fetchEmotion: .get
2534
case .registerEmotion: .post
2635
}
2736
}
@@ -42,6 +51,8 @@ extension EmotionEndpoint: Endpoint {
4251
switch self {
4352
case .fetchEmotions:
4453
return [:]
54+
case .fetchEmotion:
55+
return [:]
4556
case .registerEmotion(let emotion):
4657
return ["emotionMarbleType": emotion]
4758
}

0 commit comments

Comments
 (0)