Skip to content

Commit

Permalink
Revert "[#132] 푸쉬알림 뷰 api 연결"
Browse files Browse the repository at this point in the history
This reverts commit 298947e.
  • Loading branch information
ubeeni committed Feb 18, 2024
1 parent 298947e commit df2bb80
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 108 deletions.
21 changes: 1 addition & 20 deletions Spon-us.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@
8042C38F2B809BA5003DE096 /* AsyncImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8042C38E2B809BA5003DE096 /* AsyncImageView.swift */; };
8042C3912B80B9A5003DE096 /* SearchAnnouncementModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8042C3902B80B9A5003DE096 /* SearchAnnouncementModel.swift */; };
8042C3932B80BDFC003DE096 /* SearchAnnouncementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8042C3922B80BDFC003DE096 /* SearchAnnouncementViewModel.swift */; };
8042C39D2B82075A003DE096 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 8042C39C2B82075A003DE096 /* GoogleService-Info.plist */; };
8042C3A02B820A50003DE096 /* NotificationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8042C39F2B820A50003DE096 /* NotificationModel.swift */; };
8042C3A22B820A5B003DE096 /* NotificationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8042C3A12B820A5B003DE096 /* NotificationViewModel.swift */; };
806AF86A2B79DBD0008F7F62 /* CategoryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 806AF8692B79DBD0008F7F62 /* CategoryModel.swift */; };
806AF86C2B79EB3F008F7F62 /* CategoryModelData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 806AF86B2B79EB3F008F7F62 /* CategoryModelData.swift */; };
806AF8732B7B8504008F7F62 /* AnnouncementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 806AF8722B7B8504008F7F62 /* AnnouncementViewModel.swift */; };
Expand Down Expand Up @@ -208,9 +205,6 @@
8042C38E2B809BA5003DE096 /* AsyncImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncImageView.swift; sourceTree = "<group>"; };
8042C3902B80B9A5003DE096 /* SearchAnnouncementModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchAnnouncementModel.swift; sourceTree = "<group>"; };
8042C3922B80BDFC003DE096 /* SearchAnnouncementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchAnnouncementViewModel.swift; sourceTree = "<group>"; };
8042C39C2B82075A003DE096 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../GoogleService-Info.plist"; sourceTree = "<group>"; };
8042C39F2B820A50003DE096 /* NotificationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationModel.swift; sourceTree = "<group>"; };
8042C3A12B820A5B003DE096 /* NotificationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationViewModel.swift; sourceTree = "<group>"; };
806AF8692B79DBD0008F7F62 /* CategoryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryModel.swift; sourceTree = "<group>"; };
806AF86B2B79EB3F008F7F62 /* CategoryModelData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryModelData.swift; sourceTree = "<group>"; };
806AF8722B7B8504008F7F62 /* AnnouncementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnouncementViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -323,7 +317,6 @@
100A1E352B7348DB00AAC1E8 /* Model */ = {
isa = PBXGroup;
children = (
8042C39E2B820A18003DE096 /* Notification */,
8042C3882B80784E003DE096 /* Search */,
100A1E362B734DA500AAC1E8 /* Onboarding */,
DF498F282B7CDD8200ADE078 /* Portfolio */,
Expand Down Expand Up @@ -371,7 +364,7 @@
100D387F2B44826500498977 /* Spon-us */ = {
isa = PBXGroup;
children = (
8042C39C2B82075A003DE096 /* GoogleService-Info.plist */,
10584CBF2B81EE84007F7A3F /* GoogleService-Info.plist */,
80B41FFF2B77F0DF0021DD90 /* Spon-us.entitlements */,
100D389F2B44833F00498977 /* Info.plist */,
3B36F09F2B6FEBCB0000ACFB /* PortOne */,
Expand Down Expand Up @@ -582,15 +575,6 @@
path = Search;
sourceTree = "<group>";
};
8042C39E2B820A18003DE096 /* Notification */ = {
isa = PBXGroup;
children = (
8042C39F2B820A50003DE096 /* NotificationModel.swift */,
8042C3A12B820A5B003DE096 /* NotificationViewModel.swift */,
);
path = Notification;
sourceTree = "<group>";
};
806AF8682B79D985008F7F62 /* Category */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -758,7 +742,6 @@
100D389C2B44833500498977 /* SUIT-Medium.otf in Resources */,
3B81BCBE2B62312C0067E9CB /* Product.storekit in Resources */,
100D38A32B44834700498977 /* Preview Assets.xcassets in Resources */,
8042C39D2B82075A003DE096 /* GoogleService-Info.plist in Resources */,
100D389E2B44833500498977 /* Pretendard-SemiBold.otf in Resources */,
100D38AD2B44844F00498977 /* Assets.xcassets in Resources */,
10584CC02B81EE84007F7A3F /* GoogleService-Info.plist in Resources */,
Expand All @@ -775,7 +758,6 @@
buildActionMask = 2147483647;
files = (
107D6E6B2B7A83AB005B6261 /* MyOrganizationViewModel.swift in Sources */,
8042C3A22B820A5B003DE096 /* NotificationViewModel.swift in Sources */,
100D38BA2B4EF54C00498977 /* MyView.swift in Sources */,
3B81BCB42B622ED00067E9CB /* StoreKitTestView.swift in Sources */,
DF90A5B22B664EBF00BC54D0 /* TermsAndConditionsView.swift in Sources */,
Expand All @@ -790,7 +772,6 @@
100D389A2B44833500498977 /* FontManager.swift in Sources */,
10025B392B7B804400DCCC5A /* SentViewModel.swift in Sources */,
100D38B62B4EF51E00498977 /* SavedView.swift in Sources */,
8042C3A02B820A50003DE096 /* NotificationModel.swift in Sources */,
80FA31692B5EB9490076453B /* NewPostView.swift in Sources */,
100D38B82B4EF54100498977 /* CategoryView.swift in Sources */,
3BD26D062B62342C0035FE80 /* ChargerInfoView.swift in Sources */,
Expand Down
24 changes: 0 additions & 24 deletions Spon-us/Model/Notification/NotificationModel.swift

This file was deleted.

34 changes: 0 additions & 34 deletions Spon-us/Model/Notification/NotificationViewModel.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Spon-us/SponusAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ enum SponusAPI {
case searchAnnouncement(keyword: String)
case getMyOffer
case patchPullUp(announcementID: Int)
//MARK: 알림
case getNotification
}

extension SponusAPI: TargetType {
Expand Down Expand Up @@ -93,8 +91,6 @@ extension SponusAPI: TargetType {
return "/api/v1/proposes/received"
case .patchPullUp(let announcementID):
return "/api/v1/announcements/\(announcementID)/pullUp"
case .getNotification:
return "/api/v1/organizations/notifications"
}
}

Expand Down Expand Up @@ -147,8 +143,6 @@ extension SponusAPI: TargetType {
return .get
case .patchPullUp:
return .patch
case .getNotification:
return .get
}
}

Expand Down Expand Up @@ -231,8 +225,6 @@ extension SponusAPI: TargetType {
return Data()
case .patchPullUp:
return Data()
case .getNotification:
return Data()
}
}

Expand Down Expand Up @@ -354,8 +346,6 @@ extension SponusAPI: TargetType {
return .requestPlain
case .patchPullUp:
return .requestPlain
case .getNotification:
return .requestPlain
}
}

Expand Down Expand Up @@ -412,8 +402,6 @@ extension SponusAPI: TargetType {
return ["Authorization": "Bearer \(loadAccessToken(userID: UserDefaults.standard.string(forKey: "loginAccount") ?? "loadAccessToken Error"))"]
case .patchPullUp:
return ["Authorization": "Bearer \(loadAccessToken(userID: UserDefaults.standard.string(forKey: "loginAccount") ?? "loadAccessToken Error"))"]
case .getNotification:
return ["Authorization": "Bearer \(loadAccessToken(userID: UserDefaults.standard.string(forKey: "loginAccount") ?? "loadAccessToken Error"))"]
}
}
}
Expand Down
33 changes: 15 additions & 18 deletions Spon-us/View/Notification/NotificationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,12 @@
import SwiftUI

struct NotificationView: View {
@ObservedObject var viewModel = NotificationViewModel()
var body: some View {
ScrollView(){
VStack(spacing: 16){
// NotificationCell(isRead: false)
// NotificationCell(isRead: true)
// NotificationCell(isRead: true)
ForEach(viewModel.notificationContents) { notificationContent in
NotificationCell(notificationContent: notificationContent).frame(height: 95)
}
Spacer()
}
}
.onAppear(){
viewModel.getNotifications()
VStack(spacing: 16){
NotificationCell(isRead: false)
NotificationCell(isRead: true)
NotificationCell(isRead: true)
Spacer()
}
.padding(.horizontal, 20).padding(.vertical, 16)
.navigationTitle("알림").font(.Body01)
Expand All @@ -33,18 +24,24 @@ struct NotificationView: View {
}

struct NotificationCell: View {
var notificationContent: NotificationContent
let isRead: Bool
var body: some View {
VStack(spacing: 20){
NavigationLink(destination: Text("df"), label : {
HStack(alignment: .top){
Image("company_dummy").frame(width: 46, height: 46)
.padding(.trailing, 12)
VStack(alignment: .leading, spacing: 4){
Text("\(notificationContent.title)").font(.Body06).foregroundColor(notificationContent.isRead == true ? .sponusGrey700 : .sponusPrimary)
Text("\(notificationContent.body)").multilineTextAlignment(.leading).font(.Body06).foregroundColor(notificationContent.isRead == true ? .sponusGrey700 : .sponusBlack)
Text("제안서 도착").font(.Body06).foregroundColor(isRead == true ? .sponusGrey700 : .sponusPrimary)
Text("무신사 담당자님이\n제안서를 보냈습니다.").multilineTextAlignment(.leading).font(.Body06).foregroundColor(isRead == true ? .sponusGrey700 : .sponusBlack)
HStack(spacing: 0){
Image("ic_alert").frame(width: 8, height: 8)
.padding(.trailing, 6)
Text("27분 전").font(.English16).foregroundColor(.sponusGrey700)
Spacer()
}
Spacer()
}
}.frame(width: 237, height: 95)
Spacer()
Image("ic_move").rotationEffect(Angle(degrees: 180))
}
Expand Down

0 comments on commit df2bb80

Please sign in to comment.