From a9bbdd106d6098f29df3c9a5e0ceceb389df61b0 Mon Sep 17 00:00:00 2001 From: Woohyun Jo Date: Sun, 3 Nov 2024 14:58:31 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FIX/#178]=20PlaylistView=20=EC=82=AC?= =?UTF-8?q?=EC=A7=84=20=EC=9E=98=EB=A6=BC=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0=20/=20=EA=B8=B0=EB=B3=B8=EC=9D=B4=EB=AF=B8=EC=A7=80?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Junu-Pak Co-authored-by: WooFeather --- PLAT/PLAT.xcodeproj/project.pbxproj | 8 ++++---- PLAT/PLAT/Presentaion/Playlist/PlaylistView.swift | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/PLAT/PLAT.xcodeproj/project.pbxproj b/PLAT/PLAT.xcodeproj/project.pbxproj index 5f1a6085..96ce8a38 100644 --- a/PLAT/PLAT.xcodeproj/project.pbxproj +++ b/PLAT/PLAT.xcodeproj/project.pbxproj @@ -1317,7 +1317,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"PLAT/Preview Content\""; - DEVELOPMENT_TEAM = 9XG4S4XZWN; + DEVELOPMENT_TEAM = MXGCKXDXUM; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = PLAT/App/Info.plist; @@ -1337,7 +1337,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = com.letsplat.thinkyside; + PRODUCT_BUNDLE_IDENTIFIER = com.letsplat; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -1359,7 +1359,7 @@ CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"PLAT/Preview Content\""; - DEVELOPMENT_TEAM = 9XG4S4XZWN; + DEVELOPMENT_TEAM = MXGCKXDXUM; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = PLAT/App/Info.plist; @@ -1379,7 +1379,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0.0; - PRODUCT_BUNDLE_IDENTIFIER = com.letsplat.thinkyside; + PRODUCT_BUNDLE_IDENTIFIER = com.letsplat; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; diff --git a/PLAT/PLAT/Presentaion/Playlist/PlaylistView.swift b/PLAT/PLAT/Presentaion/Playlist/PlaylistView.swift index 20f28dc1..a56dab6d 100644 --- a/PLAT/PLAT/Presentaion/Playlist/PlaylistView.swift +++ b/PLAT/PLAT/Presentaion/Playlist/PlaylistView.swift @@ -166,8 +166,16 @@ private struct PlaylistImageView: View { .placeholder { RoundedRectangle(cornerRadius: 12) .frame(width: 68, height: 68) + .foregroundStyle( + LinearGradient( + colors: [.orange, .indigo], + startPoint: .top, + endPoint: .bottom + ) + ) } .resizable() + .scaledToFill() .frame(width: 68, height: 68) .clipShape(RoundedRectangle(cornerRadius: 12)) } From e61c666d1366ed02bedd5811d2f470e5a25e728b Mon Sep 17 00:00:00 2001 From: Woohyun Jo Date: Sun, 3 Nov 2024 15:55:36 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[Fix/#178]=20=ED=94=8C=EB=A6=AC=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EC=9E=88=EB=8A=94=20=EC=83=81=ED=83=9C?= =?UTF-8?q?=EC=97=90=EC=84=9C=EC=9D=98=20=ED=8E=B8=EC=A7=91=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Junu-Pak Co-authored-by: WooFeather --- .../PlaylistService/PlaylistServiceImpl.swift | 13 +++++++++++++ .../Interface/PlaylistServiceInterface.swift | 1 + PLAT/PLAT/Domain/UseCase/PlaylistUseCase.swift | 14 ++++++++++++++ .../Playlist/PlaylistDetailsEditView.swift | 14 +++++++++----- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/PLAT/PLAT/Data/PlatService/Service/PlaylistService/PlaylistServiceImpl.swift b/PLAT/PLAT/Data/PlatService/Service/PlaylistService/PlaylistServiceImpl.swift index ab22420c..55b28093 100644 --- a/PLAT/PLAT/Data/PlatService/Service/PlaylistService/PlaylistServiceImpl.swift +++ b/PLAT/PLAT/Data/PlatService/Service/PlaylistService/PlaylistServiceImpl.swift @@ -188,6 +188,19 @@ final class PlaylistServiceImpl: PlaylistServiceInterface { } } + /// 플레이리스트를 업데이트합니다. 이미지URL을 받습니다. + func updatePlaylist(playlistId: Int, title: String, imageUrl: String?) async -> Result { + + let request = UpdatePlaylistRequest(title: title, playlistImageUrl: imageUrl ?? "") + let response = await playlistRepository.updatePlaylist(request: request, playlistId: Int64(playlistId)) + switch response { + case .success: + return .success(()) + case .failure(let error): + return .failure(error) + } + } + /// 플레이리스트의 트랙 순서를 변경합니다. func updateTrackOrder(playlistId: Int, tracks: [Track]) async -> Result { diff --git a/PLAT/PLAT/Domain/Interface/PlaylistServiceInterface.swift b/PLAT/PLAT/Domain/Interface/PlaylistServiceInterface.swift index e3320179..c9c65731 100644 --- a/PLAT/PLAT/Domain/Interface/PlaylistServiceInterface.swift +++ b/PLAT/PLAT/Domain/Interface/PlaylistServiceInterface.swift @@ -14,6 +14,7 @@ protocol PlaylistServiceInterface { func uploadPlaylist(title: String, image: UIImage?, tracks: [Track]) async -> Result func appendTrackToPlaylist(playlistId: Int, trackId: Int) async -> Result func updatePlaylist(playlistId: Int, title: String, image: UIImage?) async -> Result + func updatePlaylist(playlistId: Int, title: String, imageUrl: String?) async -> Result func updateTrackOrder(playlistId: Int, tracks: [Track]) async -> Result func deleteTrackFromPlaylist(playlistId: Int, trackId: Int) async -> Result func deletePlaylist(playlistId: Int) async -> Result diff --git a/PLAT/PLAT/Domain/UseCase/PlaylistUseCase.swift b/PLAT/PLAT/Domain/UseCase/PlaylistUseCase.swift index 2d83a85a..1a90ff49 100644 --- a/PLAT/PLAT/Domain/UseCase/PlaylistUseCase.swift +++ b/PLAT/PLAT/Domain/UseCase/PlaylistUseCase.swift @@ -137,6 +137,20 @@ extension PlaylistUseCase { } } + /// 플레이리스트를 업데이트합니다. ImageUrl을 받습니다. + func updatePlaylist(playlistId: Int, title: String, imageUrl: String?) async { + let result = await playlistService.updatePlaylist( + playlistId: playlistId, + title: title, + imageUrl: imageUrl + ) + + switch result { + case .success: break + case .failure(let error): print(error) // TODO: 에러 처리 + } + } + /// 플레이리스트의 트랙 순서를 변경합니다. func updateTrackOrder(playlistId: Int, tracks: [Track]) { Task { diff --git a/PLAT/PLAT/Presentaion/Playlist/PlaylistDetailsEditView.swift b/PLAT/PLAT/Presentaion/Playlist/PlaylistDetailsEditView.swift index b977e3e2..947f1475 100644 --- a/PLAT/PLAT/Presentaion/Playlist/PlaylistDetailsEditView.swift +++ b/PLAT/PLAT/Presentaion/Playlist/PlaylistDetailsEditView.swift @@ -60,11 +60,15 @@ struct PlaylistDetailsEditView: View { ToolbarItem(placement: .primaryAction) { Button { Task { - await playlistUseCase.updatePlaylist( - playlistId: Int(selectedPlaylist.id), - title: selectedPlaylist.title, - image: selectedImage - ) + if let selectedImg = selectedImage { + await playlistUseCase.updatePlaylist( + playlistId: Int(selectedPlaylist.id), + title: selectedPlaylist.title, + image: selectedImage + ) + } else { + await playlistUseCase.updatePlaylist(playlistId: Int(selectedPlaylist.id), title: selectedPlaylist.title, imageUrl: selectedPlaylist.imageUrl) + } playlistUseCase.fetchPlaylistDetail(playlistId: Int(selectedPlaylist.id)) pathModel.pop()