diff --git a/KkuMulKum/Resource/Service/HomeService.swift b/KkuMulKum/Resource/Service/HomeService.swift index ce2b9f45..2ccbb036 100644 --- a/KkuMulKum/Resource/Service/HomeService.swift +++ b/KkuMulKum/Resource/Service/HomeService.swift @@ -8,82 +8,94 @@ import Foundation protocol HomeServiceType { - func fetchLoginUser() -> LoginUserModel? - func fetchNearestPromise() -> NearestPromiseModel? - func fetchUpcomingPromise() -> UpcomingPromiseListModel? + func fetchLoginUser() -> ResponseBodyDTO + func fetchNearestPromise() -> ResponseBodyDTO + func fetchUpcomingPromise() -> ResponseBodyDTO } final class MockHomeService: HomeServiceType { - func fetchLoginUser() -> LoginUserModel? { - let mockData = LoginUserModel( - name: "꾸물리안", - level: 4, - promiseCount: 8, - tardyCount: 2, - tardySum: 72, - profileImageURL: "" + func fetchLoginUser() -> ResponseBodyDTO { + let mockData = ResponseBodyDTO( + success: true, + data: LoginUserModel( + name: "꾸물리안", + level: 4, + promiseCount: 8, + tardyCount: 2, + tardySum: 72, + profileImageURL: "" + ), + error: nil ) return mockData } - func fetchNearestPromise() -> NearestPromiseModel? { - let mockData = NearestPromiseModel( - id: 1, - dDay: 0, - name: "꾸물이들 대환장 파티", - meetingName: "꾸물이들", - dressUpLevel: "냐미", - date: "2024.07.16", - time: "PM 8:00", - placeName: "DMC역" + func fetchNearestPromise() -> ResponseBodyDTO { + let mockData = ResponseBodyDTO( + success: true, + data: NearestPromiseModel( + id: 1, + dDay: 0, + name: "꾸물이들 대환장 파티", + meetingName: "꾸물이들", + dressUpLevel: "냐미", + date: "2024.07.16", + time: "PM 8:00", + placeName: "DMC역" + ), + error: nil ) return mockData } - func fetchUpcomingPromise() -> UpcomingPromiseListModel? { - let mockData = UpcomingPromiseListModel( - promises: [ - UpcomingPromise( - id: 1, - dDay: 1, - name: "누가 코코볼 다 먹었어?", - meetingName: "우마우스", - dressUpLevel: "", - date: "2024.07.17", - time: "PM 2:00", - placeName: "가자하우스" - ), - UpcomingPromise( - id: 2, - dDay: 1, - name: "누가 코코볼 다 먹었어?", - meetingName: "우마우스", - dressUpLevel: "", - date: "2024.07.17", - time: "PM 2:00", - placeName: "가자하우스" - ), - UpcomingPromise( - id: 3, - dDay: 1, - name: "누가 코코볼 다 먹었어?", - meetingName: "우마우스", - dressUpLevel: "", - date: "2024.07.17", - time: "PM 2:00", - placeName: "가자하우스" - ), - UpcomingPromise( - id: 4, - dDay: 1, - name: "누가 코코볼 다 먹었어?", - meetingName: "우마우스", - dressUpLevel: "", - date: "2024.07.17", - time: "PM 2:00", - placeName: "가자하우스" - ) - ] + func fetchUpcomingPromise() -> ResponseBodyDTO { + let mockData = ResponseBodyDTO( + success: true, + data: UpcomingPromiseListModel( + promises: [ + UpcomingPromise( + id: 1, + dDay: 1, + name: "누가 코코볼 다 먹었어?", + meetingName: "우마우스", + dressUpLevel: "", + date: "2024.07.17", + time: "PM 2:00", + placeName: "가자하우스" + ), + UpcomingPromise( + id: 2, + dDay: 1, + name: "누가 코코볼 다 먹었어?", + meetingName: "우마우스", + dressUpLevel: "", + date: "2024.07.17", + time: "PM 2:00", + placeName: "가자하우스" + ), + UpcomingPromise( + id: 3, + dDay: 1, + name: "누가 코코볼 다 먹었어?", + meetingName: "우마우스", + dressUpLevel: "", + date: "2024.07.17", + time: "PM 2:00", + placeName: "가자하우스" + ), + UpcomingPromise( + id: 4, + dDay: 1, + name: "누가 코코볼 다 먹었어?", + meetingName: "우마우스", + dressUpLevel: "", + date: "2024.07.17", + time: "PM 2:00", + placeName: "가자하우스" + ) + ] + ), + error: nil ) return mockData } diff --git a/KkuMulKum/Resource/Service/MeetingListService.swift b/KkuMulKum/Resource/Service/MeetingListService.swift index 65326662..2b480080 100644 --- a/KkuMulKum/Resource/Service/MeetingListService.swift +++ b/KkuMulKum/Resource/Service/MeetingListService.swift @@ -8,21 +8,25 @@ import Foundation protocol MeetingListServiceType { - func fetchMeetingList() -> MeetingListModel? + func fetchMeetingList() -> ResponseBodyDTO } final class MockMeetingListService: MeetingListServiceType { - func fetchMeetingList() -> MeetingListModel? { - let mockData = MeetingListModel( - count: 6, - meetings: [ - Meeting(id: 1, name: "꾸물이들", memberCount: 14), - Meeting(id: 2, name: "아요레디", memberCount: 28), - Meeting(id: 3, name: "안드가자", memberCount: 26), - Meeting(id: 4, name: "난이서버", memberCount: 30), - Meeting(id: 5, name: "캔디팟", memberCount: 24), - Meeting(id: 6, name: "열기팟", memberCount: 24) - ] + func fetchMeetingList() -> ResponseBodyDTO { + let mockData = ResponseBodyDTO( + success: true, + data: MeetingListModel( + count: 6, + meetings: [ + Meeting(id: 1, name: "꾸물이들", memberCount: 14), + Meeting(id: 2, name: "아요레디", memberCount: 28), + Meeting(id: 3, name: "안드가자", memberCount: 26), + Meeting(id: 4, name: "난이서버", memberCount: 30), + Meeting(id: 5, name: "캔디팟", memberCount: 24), + Meeting(id: 6, name: "열기팟", memberCount: 24) + ] + ), + error: nil ) return mockData }