Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 모임 상세 화면 약속 분기 처리 #343

Merged
merged 9 commits into from
Aug 27, 2024
24 changes: 14 additions & 10 deletions KkuMulKum.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
784824F72C6E1C9900FE07A0 /* AuthServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784824F62C6E1C9900FE07A0 /* AuthServiceProtocol.swift */; };
784824FC2C75BF7900FE07A0 /* MyPageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784824FB2C75BF7900FE07A0 /* MyPageViewModel.swift */; };
784824FE2C75F25900FE07A0 /* MyPageEditViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784824FD2C75F25900FE07A0 /* MyPageEditViewController.swift */; };
784825092C77623C00FE07A0 /* MypageTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825082C77623C00FE07A0 /* MypageTargetType.swift */; };
7848250B2C77627200FE07A0 /* UserService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7848250A2C77627200FE07A0 /* UserService.swift */; };
784825112C77666500FE07A0 /* MyPageUserServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825102C77666500FE07A0 /* MyPageUserServiceType.swift */; };
784825012C77016400FE07A0 /* MyPageEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825002C77016400FE07A0 /* MyPageEditView.swift */; };
784825032C77016F00FE07A0 /* MyPageEditViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825022C77016F00FE07A0 /* MyPageEditViewModel.swift */; };
784825052C7716E900FE07A0 /* MyPageAskViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825042C7716E900FE07A0 /* MyPageAskViewController.swift */; };
784825072C77215B00FE07A0 /* MyPageTermsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825062C77215B00FE07A0 /* MyPageTermsViewController.swift */; };
784825092C77623C00FE07A0 /* MypageTargetType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825082C77623C00FE07A0 /* MypageTargetType.swift */; };
7848250B2C77627200FE07A0 /* UserService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7848250A2C77627200FE07A0 /* UserService.swift */; };
784825112C77666500FE07A0 /* MyPageUserServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 784825102C77666500FE07A0 /* MyPageUserServiceType.swift */; };
784E4D942C3B1C7F00BC943C /* KakaoSDK in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D932C3B1C7F00BC943C /* KakaoSDK */; };
784E4D962C3B1C7F00BC943C /* KakaoSDKAuth in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D952C3B1C7F00BC943C /* KakaoSDKAuth */; };
784E4D992C3B95A900BC943C /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 784E4D982C3B95A900BC943C /* KeychainAccess */; };
Expand Down Expand Up @@ -246,6 +246,7 @@
DED5DBF02C345317006ECE7E /* BaseCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED5DBEF2C345317006ECE7E /* BaseCollectionViewCell.swift */; };
DED5DBF22C34534A006ECE7E /* BaseCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED5DBF12C34534A006ECE7E /* BaseCollectionReusableView.swift */; };
DED5DBF42C34539A006ECE7E /* BaseTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED5DBF32C34539A006ECE7E /* BaseTableViewCell.swift */; };
DEE4B1412C7C73630063B92A /* UnderlineSegmentedControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEE4B1402C7C73630063B92A /* UnderlineSegmentedControl.swift */; };
DEF725DB2C3F3BBF008C87C7 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEF725DA2C3F3BBF008C87C7 /* Toast.swift */; };
DEFBEBCB2C466E9500437188 /* SelectMemberCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEFBEBCA2C466E9500437188 /* SelectMemberCell.swift */; };
DEFBEBCD2C46AE0700437188 /* SelectPenaltyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEFBEBCC2C46AE0700437188 /* SelectPenaltyViewController.swift */; };
Expand All @@ -267,13 +268,13 @@
784824F62C6E1C9900FE07A0 /* AuthServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthServiceProtocol.swift; sourceTree = "<group>"; };
784824FB2C75BF7900FE07A0 /* MyPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageViewModel.swift; sourceTree = "<group>"; };
784824FD2C75F25900FE07A0 /* MyPageEditViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageEditViewController.swift; sourceTree = "<group>"; };
784825082C77623C00FE07A0 /* MypageTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MypageTargetType.swift; sourceTree = "<group>"; };
7848250A2C77627200FE07A0 /* UserService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserService.swift; sourceTree = "<group>"; };
784825102C77666500FE07A0 /* MyPageUserServiceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageUserServiceType.swift; sourceTree = "<group>"; };
784825002C77016400FE07A0 /* MyPageEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageEditView.swift; sourceTree = "<group>"; };
784825022C77016F00FE07A0 /* MyPageEditViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageEditViewModel.swift; sourceTree = "<group>"; };
784825042C7716E900FE07A0 /* MyPageAskViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageAskViewController.swift; sourceTree = "<group>"; };
784825062C77215B00FE07A0 /* MyPageTermsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageTermsViewController.swift; sourceTree = "<group>"; };
784825082C77623C00FE07A0 /* MypageTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MypageTargetType.swift; sourceTree = "<group>"; };
7848250A2C77627200FE07A0 /* UserService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserService.swift; sourceTree = "<group>"; };
784825102C77666500FE07A0 /* MyPageUserServiceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageUserServiceType.swift; sourceTree = "<group>"; };
789196332C486F6B00FF8CDF /* KeychainAccessible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainAccessible.swift; sourceTree = "<group>"; };
789196352C492F8600FF8CDF /* AuthTargetType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthTargetType.swift; sourceTree = "<group>"; };
789196372C49697B00FF8CDF /* AuthError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthError.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -445,6 +446,7 @@
DED5DBEF2C345317006ECE7E /* BaseCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCollectionViewCell.swift; sourceTree = "<group>"; };
DED5DBF12C34534A006ECE7E /* BaseCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseCollectionReusableView.swift; sourceTree = "<group>"; };
DED5DBF32C34539A006ECE7E /* BaseTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTableViewCell.swift; sourceTree = "<group>"; };
DEE4B1402C7C73630063B92A /* UnderlineSegmentedControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnderlineSegmentedControl.swift; sourceTree = "<group>"; };
DEF725DA2C3F3BBF008C87C7 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
DEFBEBCA2C466E9500437188 /* SelectMemberCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectMemberCell.swift; sourceTree = "<group>"; };
DEFBEBCC2C46AE0700437188 /* SelectPenaltyViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectPenaltyViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1379,6 +1381,7 @@
DE6D4D032C3F14D80005584B /* InvitationCodePopUpView.swift */,
DE6D4D042C3F14D80005584B /* MeetingInfoBannerView.swift */,
DE6D4D052C3F14D80005584B /* MeetingInfoView.swift */,
DEE4B1402C7C73630063B92A /* UnderlineSegmentedControl.swift */,
);
path = View;
sourceTree = "<group>";
Expand All @@ -1404,12 +1407,12 @@
DE6D4D0E2C3F14D80005584B /* MeetingInfo */ = {
isa = PBXGroup;
children = (
DEFBEBC92C466C6500437188 /* Cell */,
DE6D4D022C3F14D80005584B /* Service */,
DE6D4D082C3F14D80005584B /* View */,
DE6D4D0B2C3F14D80005584B /* ViewController */,
DE6D4D0D2C3F14D80005584B /* ViewModel */,
DEBB8DED2C771FFD00C5A528 /* Model */,
DE6D4D0D2C3F14D80005584B /* ViewModel */,
DE6D4D0B2C3F14D80005584B /* ViewController */,
DE6D4D082C3F14D80005584B /* View */,
DEFBEBC92C466C6500437188 /* Cell */,
);
path = MeetingInfo;
sourceTree = "<group>";
Expand Down Expand Up @@ -1801,6 +1804,7 @@
buildActionMask = 2147483647;
files = (
784824FC2C75BF7900FE07A0 /* MyPageViewModel.swift in Sources */,
DEE4B1412C7C73630063B92A /* UnderlineSegmentedControl.swift in Sources */,
DDD62FFC2C5FA54100174B57 /* CreateMeetingServiceProtocol.swift in Sources */,
DDE7D2CC2C47F073005A921F /* PlaceModel.swift in Sources */,
DEFBEBD12C46B33000437188 /* SelectCapsuleButton.swift in Sources */,
Expand Down
138 changes: 30 additions & 108 deletions KkuMulKum/Network/Service/MeetingService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ final class MeetingService {
}
}


// MARK: - MeetingInfoServiceProtocol

extension MeetingService: MeetingInfoServiceProtocol {
func fetchMeetingInfo(with meetingID: Int) async throws -> ResponseBodyDTO<MeetingInfoModel>? {
return try await request(with: .fetchMeetingInfo(meetingID: meetingID))
Expand All @@ -51,8 +54,14 @@ extension MeetingService: MeetingInfoServiceProtocol {
return try await request(with: .fetchMeetingMember(meetingID: meetingID))
}

func fetchMeetingPromiseList(with meetingID: Int) async throws -> ResponseBodyDTO<MeetingPromisesModel>? {
return try await request(with: .fetchMeetingPromiseList(meetingID: meetingID))
func fetchMeetingPromiseList(
with meetingID: Int,
isParticipant: Bool?
) async throws -> ResponseBodyDTO<MeetingPromisesModel>? {
guard let isParticipant else {
return try await request(with: .fetchMeetingPromiseList(meetingID: meetingID))
}
return try await request(with: .fetchParticipatedPromiseList(meetingID: meetingID, isParticipant: isParticipant))
Comment on lines +61 to +64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿!

}

func exitMeeting(with meetingID: Int) -> Single<ResponseBodyDTO<EmptyModel>> {
Expand Down Expand Up @@ -175,114 +184,27 @@ final class MockMeetingInfoService: MeetingInfoServiceProtocol {
return ResponseBodyDTO(success: true, data: mockData, error: nil)
}

func fetchMeetingPromiseList(with meetingID: Int) -> ResponseBodyDTO<MeetingPromisesModel>? {
func fetchMeetingPromiseList(
with meetingID: Int,
isParticipant: Bool?
) async throws -> ResponseBodyDTO<MeetingPromisesModel>? {
let mockData = MeetingPromisesModel(
promises: [
MeetingPromise(
promiseID: 1,
name: "꾸물 리프레시 데이",
dDay: 0,
time: "PM 2:00",
placeName: "DMC역"
),
MeetingPromise(
promiseID: 2,
name: "꾸물 잼얘 나이트",
dDay: 10,
time: "PM 6:00",
placeName: "홍대입구"
),
MeetingPromise(
promiseID: 3,
name: "친구 생일 파티",
dDay: 5,
time: "PM 7:00",
placeName: "강남역"
),
MeetingPromise(
promiseID: 4,
name: "주말 산책",
dDay: 3,
time: "AM 10:00",
placeName: "서울숲"
),
MeetingPromise(
promiseID: 5,
name: "프로젝트 미팅",
dDay: 1,
time: "AM 9:00",
placeName: "삼성역"
),
MeetingPromise(
promiseID: 6,
name: "독서 모임",
dDay: 7,
time: "PM 3:00",
placeName: "합정역"
),
MeetingPromise(
promiseID: 7,
name: "헬스클럽 모임",
dDay: 2,
time: "AM 8:00",
placeName: "신촌역"
),
MeetingPromise(
promiseID: 8,
name: "영화 관람",
dDay: 4,
time: "PM 8:00",
placeName: "잠실역"
),
MeetingPromise(
promiseID: 9,
name: "저녁 식사",
dDay: 6,
time: "PM 7:30",
placeName: "이태원역"
),
MeetingPromise(
promiseID: 10,
name: "아침 조깅",
dDay: 14,
time: "AM 6:00",
placeName: "한강공원"
),
MeetingPromise(
promiseID: 11,
name: "커피 브레이크",
dDay: 8,
time: "PM 4:00",
placeName: "을지로입구"
),
MeetingPromise(
promiseID: 12,
name: "스터디 그룹",
dDay: 12,
time: "PM 5:00",
placeName: "강남역"
),
MeetingPromise(
promiseID: 13,
name: "뮤직 페스티벌",
dDay: 9,
time: "PM 2:00",
placeName: "난지공원"
),
MeetingPromise(
promiseID: 14,
name: "낚시 여행",
dDay: 11,
time: "AM 5:00",
placeName: "속초항"
),
MeetingPromise(
promiseID: 15,
name: "가족 모임",
dDay: 13,
time: "PM 1:00",
placeName: "광화문역"
)
MeetingPromise(promiseID: 1,name: "꾸물 리프레시 데이",dDay: 0,time: "PM 2:00",placeName: "DMC역"),
MeetingPromise(promiseID: 2,name: "꾸물 잼얘 나이트",dDay: 10,time: "PM 6:00",placeName: "홍대입구"),
MeetingPromise(promiseID: 3,name: "친구 생일 파티",dDay: 5,time: "PM 7:00",placeName: "강남역"),
MeetingPromise(promiseID: 4,name: "주말 산책",dDay: 3,time: "AM 10:00",placeName: "서울숲"),
MeetingPromise(promiseID: 5,name: "프로젝트 미팅",dDay: 1,time: "AM 9:00",placeName: "삼성역"),
MeetingPromise(promiseID: 6,name: "독서 모임",dDay: 7,time: "PM 3:00",placeName: "합정역"),
MeetingPromise(promiseID: 7,name: "헬스클럽 모임",dDay: 2,time: "AM 8:00",placeName: "신촌역"),
MeetingPromise(promiseID: 8,name: "영화 관람",dDay: 4,time: "PM 8:00",placeName: "잠실역"),
MeetingPromise(promiseID: 9,name: "저녁 식사",dDay: 6,time: "PM 7:30",placeName: "이태원역"),
MeetingPromise(promiseID: 10,name: "아침 조깅",dDay: 14,time: "AM 6:00",placeName: "한강공원"),
MeetingPromise(promiseID: 11,name: "커피 브레이크",dDay: 8,time: "PM 4:00",placeName: "을지로입구"),
MeetingPromise(promiseID: 12,name: "스터디 그룹",dDay: 12,time: "PM 5:00",placeName: "강남역"),
MeetingPromise(promiseID: 13,name: "뮤직 페스티벌",dDay: 9,time: "PM 2:00",placeName: "난지공원"),
MeetingPromise(promiseID: 14, name: "낚시 여행", dDay: 11, time: "AM 5:00", placeName: "속초항"),
MeetingPromise(promiseID: 15, name: "가족 모임", dDay: 13, time: "PM 1:00", placeName: "광화문역")
Comment on lines +193 to +207
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 혹시 한번에 개행 없애는 방법 아시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

나중에 직접 알려드릴게요~

]
)

Expand Down
19 changes: 13 additions & 6 deletions KkuMulKum/Network/TargetType/MeetingTargetType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum MeetingTargetType {
case fetchMeetingInfo(meetingID: Int)
case fetchMeetingMember(meetingID: Int)
case fetchMeetingPromiseList(meetingID: Int)
case fetchParticipatedPromiseList(meetingID: Int, isParticipant: Bool)
case exitMeeting(meetingID: Int)
}

Expand All @@ -41,7 +42,7 @@ extension MeetingTargetType: TargetType {
return "/api/v1/meetings/\(meetingID)"
case .fetchMeetingMember(let meetingID):
return "/api/v1/meetings/\(meetingID)/members"
case .fetchMeetingPromiseList(let meetingID):
case .fetchMeetingPromiseList(let meetingID), .fetchParticipatedPromiseList(let meetingID, _):
return "/api/v1/meetings/\(meetingID)/promises"
case .exitMeeting(let meetingID):
return "/api/v1/meetings/\(meetingID)"
Expand All @@ -52,7 +53,7 @@ extension MeetingTargetType: TargetType {
switch self {
case .createMeeting, .joinMeeting:
return .post
case .fetchMeetingList, .fetchMeetingInfo, .fetchMeetingMember, .fetchMeetingPromiseList:
case .fetchMeetingList, .fetchMeetingInfo, .fetchMeetingMember, .fetchMeetingPromiseList, .fetchParticipatedPromiseList:
return .get
case .exitMeeting:
return .delete
Expand All @@ -68,10 +69,16 @@ extension MeetingTargetType: TargetType {
case .fetchMeetingList, .fetchMeetingInfo, .fetchMeetingMember, .exitMeeting:
return .requestPlain
case .fetchMeetingPromiseList:
return .requestParameters(
parameters: ["done": "false"],
encoding: URLEncoding.queryString
)
let parameters: [String: Any] = [
"done": "false"
]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
case .fetchParticipatedPromiseList(_, let isParticipant):
let parameters: [String: Any] = [
"done": "false",
"isParticipant": isParticipant
]
return .requestParameters(parameters: parameters, encoding: URLEncoding.queryString)
}
}

Expand Down
2 changes: 1 addition & 1 deletion KkuMulKum/Source/MeetingInfo/Cell/MeetingPromiseCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extension MeetingPromiseCell {
fileprivate var dDayTextColor: UIColor {
switch self {
case .past: .gray3
case .today: .orange
case .today: .mainorange
case .future: .gray5
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ import RxSwift
protocol MeetingInfoServiceProtocol {
func fetchMeetingInfo(with meetingID: Int) async throws -> ResponseBodyDTO<MeetingInfoModel>?
func fetchMeetingMemberList(with meetingID: Int) async throws -> ResponseBodyDTO<MeetingMembersModel>?
func fetchMeetingPromiseList(with meetingID: Int) async throws -> ResponseBodyDTO<MeetingPromisesModel>?
func fetchMeetingPromiseList(with meetingID: Int, isParticipant: Bool?) async throws -> ResponseBodyDTO<MeetingPromisesModel>?
func exitMeeting(with meetingID: Int) -> Single<ResponseBodyDTO<EmptyModel>>
}
Loading