Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions RF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
3B03E1EF2AE8FDA1006CC482 /* ScheduleService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B03E1EE2AE8FDA1006CC482 /* ScheduleService.swift */; };
3B03E1F12AE8FDD7006CC482 /* ScheduleList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B03E1F02AE8FDD7006CC482 /* ScheduleList.swift */; };
3B0B35292A7A5A31003B2D8C /* SecretKey.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B0B35282A7A5A31003B2D8C /* SecretKey.plist */; };
3B0BA20A2A8DEEAA00F7E818 /* GradientView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B0BA2092A8DEEAA00F7E818 /* GradientView.swift */; };
3B0E2EB92A80FE9200797782 /* MeetingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B0E2EB82A80FE9200797782 /* MeetingService.swift */; };
Expand All @@ -25,6 +27,8 @@
3B267B8F2A861E3200F3949A /* GroupJoinRequestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B267B8E2A861E3200F3949A /* GroupJoinRequestViewController.swift */; };
3B267B922A86281100F3949A /* GroupJoinRequestViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B267B912A86281100F3949A /* GroupJoinRequestViewModel.swift */; };
3B267B942A862AB100F3949A /* GroupJoinRequestTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B267B932A862AB100F3949A /* GroupJoinRequestTableViewCell.swift */; };
3B3698862B0457EE00BEB126 /* ChoiceMajorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3698852B0457EE00BEB126 /* ChoiceMajorView.swift */; };
3B3698882B048DB000BEB126 /* ChoiceMajorViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3698872B048DB000BEB126 /* ChoiceMajorViewModel.swift */; };
3B5402BD2A6E76C100D0AD21 /* ListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5402BC2A6E76C100D0AD21 /* ListViewController.swift */; };
3B5402C02A6E7E0900D0AD21 /* ListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5402BF2A6E7E0900D0AD21 /* ListTableViewCell.swift */; };
3B5402C32A6EA61700D0AD21 /* ListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B5402C22A6EA61700D0AD21 /* ListViewModel.swift */; };
Expand Down Expand Up @@ -126,7 +130,6 @@
440B53CA2AC9421600D6607F /* SearchPWResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 440B53C92AC9421600D6607F /* SearchPWResultViewController.swift */; };
443044BD2A67B434008A4087 /* UserInfoSelfViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 443044BC2A67B434008A4087 /* UserInfoSelfViewController.swift */; };
44BBA9B12AB8B4B200EC43BB /* SearchIDViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44BBA9B02AB8B4B200EC43BB /* SearchIDViewController.swift */; };
44CC47732A8DE9A70025EAEC /* ProfileSettingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44CC47722A8DE9A70025EAEC /* ProfileSettingTableViewCell.swift */; };
44F82A112A56D5D4006B17F8 /* UIColor+Ext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44F82A102A56D5D4006B17F8 /* UIColor+Ext.swift */; };
44F82A172A5C05A7006B17F8 /* UserInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44F82A162A5C05A7006B17F8 /* UserInfoViewController.swift */; };
570063602A63D5120051F42A /* PersonnelStepper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5700635F2A63D5120051F42A /* PersonnelStepper.swift */; };
Expand Down Expand Up @@ -212,6 +215,8 @@
1993FCFD8483C342C337F096 /* Pods_RF.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RF.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2505DAF5F18952160CB2275D /* Pods-RF.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RF.debug.xcconfig"; path = "Target Support Files/Pods-RF/Pods-RF.debug.xcconfig"; sourceTree = "<group>"; };
2B0C13344295BF3D18F7D032 /* Pods-RF.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RF.release.xcconfig"; path = "Target Support Files/Pods-RF/Pods-RF.release.xcconfig"; sourceTree = "<group>"; };
3B03E1EE2AE8FDA1006CC482 /* ScheduleService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScheduleService.swift; sourceTree = "<group>"; };
3B03E1F02AE8FDD7006CC482 /* ScheduleList.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScheduleList.swift; sourceTree = "<group>"; };
3B0B35282A7A5A31003B2D8C /* SecretKey.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = SecretKey.plist; sourceTree = "<group>"; };
3B0BA2092A8DEEAA00F7E818 /* GradientView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientView.swift; sourceTree = "<group>"; };
3B0E2EB82A80FE9200797782 /* MeetingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeetingService.swift; sourceTree = "<group>"; };
Expand All @@ -230,6 +235,8 @@
3B267B8E2A861E3200F3949A /* GroupJoinRequestViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupJoinRequestViewController.swift; sourceTree = "<group>"; };
3B267B912A86281100F3949A /* GroupJoinRequestViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupJoinRequestViewModel.swift; sourceTree = "<group>"; };
3B267B932A862AB100F3949A /* GroupJoinRequestTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupJoinRequestTableViewCell.swift; sourceTree = "<group>"; };
3B3698852B0457EE00BEB126 /* ChoiceMajorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChoiceMajorView.swift; sourceTree = "<group>"; };
3B3698872B048DB000BEB126 /* ChoiceMajorViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChoiceMajorViewModel.swift; sourceTree = "<group>"; };
3B5402BC2A6E76C100D0AD21 /* ListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListViewController.swift; sourceTree = "<group>"; };
3B5402BF2A6E7E0900D0AD21 /* ListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListTableViewCell.swift; sourceTree = "<group>"; };
3B5402C22A6EA61700D0AD21 /* ListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -443,9 +450,18 @@
path = Pods;
sourceTree = "<group>";
};
3B03E1ED2AE8FD97006CC482 /* Schedule */ = {
isa = PBXGroup;
children = (
3B03E1EE2AE8FDA1006CC482 /* ScheduleService.swift */,
);
path = Schedule;
sourceTree = "<group>";
};
3B0E2EB72A80FE8400797782 /* Meeting */ = {
isa = PBXGroup;
children = (
3B03E1ED2AE8FD97006CC482 /* Schedule */,
3B6E6F152A94D2930002C6F3 /* Search */,
3B0E2EB82A80FE9200797782 /* MeetingService.swift */,
3BF2E7712A8CB32300FD09F7 /* DetailMeetingJoinService.swift */,
Expand Down Expand Up @@ -742,6 +758,7 @@
3BD700C42A793565005C7D7E /* ChoiceBornCountryView.swift */,
3BD700CE2A7962F0005C7D7E /* ChoiceInterestingCountryView.swift */,
3BD700D22A7963DD005C7D7E /* ChoiceInterestingLanguageView.swift */,
3B3698852B0457EE00BEB126 /* ChoiceMajorView.swift */,
);
path = ChooseUserInfo;
sourceTree = "<group>";
Expand All @@ -767,6 +784,7 @@
isa = PBXGroup;
children = (
3BD700C72A79364B005C7D7E /* ChoiceCountryViewModel.swift */,
3B3698872B048DB000BEB126 /* ChoiceMajorViewModel.swift */,
3BD700D02A796312005C7D7E /* ChoiceInterestingCountryViewModel.swift */,
3BD700D42A796403005C7D7E /* ChoiceInterestingLanguageViewModel.swift */,
);
Expand Down Expand Up @@ -849,6 +867,7 @@
57DD3E6B2A810F60009F7139 /* Response.swift */,
3BF2E7652A8B50CC00FD09F7 /* Judge.swift */,
57AF3D572A85FE8800C09715 /* Papago.swift */,
3B03E1F02AE8FDD7006CC482 /* ScheduleList.swift */,
570063D32A7A57110051F42A /* Meeting.swift */,
3B69EE3F2A81F522002DB6DF /* Enums.swift */,
3BD68EF62A779741003A57A7 /* SignIn.swift */,
Expand Down Expand Up @@ -1281,6 +1300,7 @@
files = (
570063E82A7D13480051F42A /* OtherMessageTableViewCell.swift in Sources */,
3B6C31252A7E17DC008FADA1 /* UserInfoSelfViewModel.swift in Sources */,
3B03E1F12AE8FDD7006CC482 /* ScheduleList.swift in Sources */,
570063932A67B23A0051F42A /* RuleListViewController.swift in Sources */,
3B6BA9982A7FEC7F00A11FE4 /* EmailCustomTextField.swift in Sources */,
3BEEA2722AD578F200F6D5B7 /* MyPageReportApplyViewController.swift in Sources */,
Expand Down Expand Up @@ -1339,7 +1359,6 @@
3BC35CEF2A5C6C1B00D73163 /* UILabel+Ext.swift in Sources */,
572A9A322A5CB445004D2809 /* SetInterestViewController.swift in Sources */,
570063602A63D5120051F42A /* PersonnelStepper.swift in Sources */,
572A9A3A2A5E80D1004D2809 /* Member.swift in Sources */,
440B53C62AC1725300D6607F /* SearchIDResultViewController.swift in Sources */,
57673EE42A58360B00A13D07 /* TagCollectionViewCell.swift in Sources */,
3B62877C2A84BF7200E00B09 /* CreateViewModel.swift in Sources */,
Expand All @@ -1352,6 +1371,7 @@
57BB1B412AD5799B00516897 /* PapagoService.swift in Sources */,
3BD68EF72A779741003A57A7 /* SignIn.swift in Sources */,
3B6E6F172A94D29D0002C6F3 /* SearchService.swift in Sources */,
3B03E1EF2AE8FDA1006CC482 /* ScheduleService.swift in Sources */,
572DC2562A51C9BD00C0D6E1 /* SetNicknameViewController.swift in Sources */,
3B938C902A93847A00CBF734 /* MeetingManageUIButton.swift in Sources */,
57AF3D5C2A94957300C09715 /* ChatMenuOption.swift in Sources */,
Expand Down Expand Up @@ -1407,12 +1427,14 @@
3B15CD5A2A63ECB80096871F /* FilteringViewController.swift in Sources */,
5700639D2A6AC60C0051F42A /* NotiListTableViewCell.swift in Sources */,
3BEEA2702AD558EF00F6D5B7 /* MyPageReportViewController.swift in Sources */,
3B3698882B048DB000BEB126 /* ChoiceMajorViewModel.swift in Sources */,
572A9A242A5AAE24004D2809 /* CALayer+Ext.swift in Sources */,
440B53C82AC29E2700D6607F /* SearchPWViewController.swift in Sources */,
3BF2E7662A8B50CC00FD09F7 /* Judge.swift in Sources */,
3B5402C72A6EA99E00D0AD21 /* ListCellViewModel.swift in Sources */,
3B935D582A56F00200FECE3A /* SignUpViewController.swift in Sources */,
572DC2312A51BF2400C0D6E1 /* SceneDelegate.swift in Sources */,
3B3698862B0457EE00BEB126 /* ChoiceMajorView.swift in Sources */,
3B9BA8F12A724CB30043DDE6 /* MyPageViewController.swift in Sources */,
3BD68EFB2A779885003A57A7 /* SignInService.swift in Sources */,
57DD3E682A8106E7009F7139 /* Message.swift in Sources */,
Expand Down Expand Up @@ -1607,7 +1629,6 @@
CODE_SIGN_ENTITLEMENTS = RF/RF.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = SN5J3DYFX4;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = RF/Info.plist;
Expand Down
5 changes: 5 additions & 0 deletions RF/Constants/API/EndPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ struct ReportPath {
struct SearchPath {
static let search = "/party/search"
}

/// Schedule
struct SchedulePath {
static let myList = "/schedule/user/:userId"
}
2 changes: 2 additions & 0 deletions RF/Constants/ViewConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ struct UserInfo {
static let bornCountryPlaceHolder = "출생 국가를 선택해주세요"
static let college = "대학교 선택"
static let collegePlaceHolder = "대학교를 선택해주세요"
static let major = "전공 선택"
static let majorPlaceHolder = "전공을 선택해주세요"
}

// MARK: - DetailMeetingJoinPopUp
Expand Down
5 changes: 3 additions & 2 deletions RF/Models/Codable/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ final class EnumFile {
service.getEnumList()
.subscribe(
onNext: { [weak self] data in
print(data)
self?.enumList.accept(data)
},onError: { error in
print("EnumFile getEnumList error!")
})
.disposed(by: disposeBag)

}

}

struct Enums: Codable {
var country, interest, language, lifeStyle: [KVO]?
var mbti, preferAges, rule, university: [KVO]?
var mbti, preferAges, rule, university, major: [KVO]?

enum CodingKeys: String, CodingKey {
case country = "Country"
Expand All @@ -46,6 +46,7 @@ struct Enums: Codable {
case preferAges = "PreferAges"
case rule = "Rule"
case university = "University"
case major = "Major"
}
}

Expand Down
18 changes: 18 additions & 0 deletions RF/Models/Codable/ScheduleList.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Schedule.swift
// RF
//
// Created by 정호진 on 10/25/23.
//

import Foundation

struct ScheduleList: Codable {
let id: Int?
let partyId: Int?
let partyName: String?
let scheduleName: String?
let localDateTime: String?
let location: String?
let participantCount: Int?
}
2 changes: 2 additions & 0 deletions RF/Models/Codable/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct User: Codable {
let mbti: String?
let profileImageUrl: String?
let userId: Int?
let major: String?

enum CodingKeys: String, CodingKey {
case loginId
Expand All @@ -28,6 +29,7 @@ struct User: Codable {
case interest = "interests"
case profileImageUrl = "imageFilePath"
case mbti, userId
case major
}
}

43 changes: 43 additions & 0 deletions RF/Services/Meeting/Schedule/ScheduleService.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// ScheduleService.swift
// RF
//
// Created by 정호진 on 10/25/23.
//

import Foundation
import Alamofire
import RxSwift

final class ScheduleService {

func getMySchdule(year: Int, month: Int) -> Observable<[ScheduleList]> {
var url = Domain.restApi + SchedulePath.myList
let userId = UserDefaults.standard.string(forKey: "UserId") ?? ""
url = url.replacingOccurrences(of: ":userId", with: userId)
print(url)
print(year)
print(month)

return Observable.create { observer in
AF.request(url,
method: .get,
parameters:["year": year,
"month": month])
.validate(statusCode: 200..<201)
.responseDecodable(of: Response<[ScheduleList]>.self) { response in
print(response)
switch response.result {
case .success(let data):
observer.onNext(data.result ?? [])
case .failure(let error):
print("\(#function) error! \(error)")
}
}

return Disposables.create()
}

}

}
3 changes: 2 additions & 1 deletion RF/Services/SignUp/SignUpService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ final class SignUpService {
interest: SignUpDataViewModel.viewModel.interestingRelay.value,
mbti: SignUpDataViewModel.viewModel.mbtiRelay.value,
profileImageUrl: nil,
userId: nil)
userId: nil,
major: SignUpDataViewModel.viewModel.major.value)
print(body)
return Observable.create { observer in

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import RxSwift

final class ScheduleFSCalendarCellViewModel {
/// 특정 날짜에 대한 일정 리스트
var specificEventList : BehaviorRelay<[ScheduleEvent]> = BehaviorRelay(value: [])
var specificEventList : BehaviorRelay<[ScheduleList]> = BehaviorRelay(value: [])

/// 테이블 뷰가 생성 되었는지
var isTableView: BehaviorRelay<Bool> = BehaviorRelay(value: false)

/// MARK: 특정 날짜에 대한 리스트에 데이터 넣기
func inputData(events: [ScheduleEvent]){
func inputData(events: [ScheduleList]){
specificEventList.accept(events)
}

Expand Down
36 changes: 24 additions & 12 deletions RF/ViewModels/Meeting/Schedule/ScheduleViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import RxRelay

final class ScheduleViewModel {
private let disposeBag = DisposeBag()
private let service = ScheduleService()

/// 일정 리스트
var eventList : BehaviorRelay<[ScheduleEvent]> = BehaviorRelay(value: [])
var eventList : BehaviorRelay<[ScheduleList]> = BehaviorRelay(value: [])

/// MARK: Change Date -> String
func formattingDate(date: Date) -> String{
Expand All @@ -34,25 +35,36 @@ final class ScheduleViewModel {
}

/// 테스트 데이터 넣어 놓은 함수
func getData() {
var list: [ScheduleEvent] = []
func getData(year: String, month: String) {
let year = Int(year)
let month = Int(month)

list.append(ScheduleEvent(date: "2023-08-23", description: "데모 데이",color: "00f44d"))
list.append(ScheduleEvent(date: "2023-08-24", description: "데모 데이",color: "00f44d"))
list.append(ScheduleEvent(date: "2023-08-15", description: "광복절",color: "FE4700"))
list.append(ScheduleEvent(date: "2023-08-11", description: "알프 모임",color: "00daf7"))
list.append(ScheduleEvent(date: "2023-07-25", description: "마라탕 먹방",color: "f1f900"))
list.append(ScheduleEvent(date: "2023-09-01", description: "개강 파티",color: "1dfc00"))
guard let year = year, let month = month else { return }
service.getMySchdule(year: year, month: month)
.subscribe(onNext: { [weak self] list in
guard let self = self else {return}
eventList.accept(list)
})
.disposed(by: disposeBag)

self.eventList.accept(list)
// var list: [ScheduleList] = []

// list.append(ScheduleEvent(date: "2023-08-23", description: "데모 데이",color: "00f44d"))
// list.append(ScheduleEvent(date: "2023-08-24", description: "데모 데이",color: "00f44d"))
// list.append(ScheduleEvent(date: "2023-08-15", description: "광복절",color: "FE4700"))
// list.append(ScheduleEvent(date: "2023-08-11", description: "알프 모임",color: "00daf7"))
// list.append(ScheduleEvent(date: "2023-07-25", description: "마라탕 먹방",color: "f1f900"))
// list.append(ScheduleEvent(date: "2023-09-01", description: "개강 파티",color: "1dfc00"))

// self.eventList.accept(list)
}

/// MARK: 날짜 변환 후 일정 리스트에 해당 날짜가 있는지 필터링
func dateFiltering(date: Date) -> Observable<[ScheduleEvent]?>{
func dateFiltering(date: Date) -> Observable<[ScheduleList]?>{
let list = eventList.value

let date = String(formattingDate(date: date).split(separator: " ")[0])
let event = list.filter({ date == $0.date ?? "" })
let event = list.filter({ date == $0.localDateTime ?? "" })

return Observable.create { observer in
if event.isEmpty{
Expand Down
Loading