-
Notifications
You must be signed in to change notification settings - Fork 1
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
[DDING-55] Feed 삭제 API 구현 #200
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a26f1de
feat : 피드 삭제 API 구현
KoSeonJe f845b05
test : 피드 삭제 API 테스트 작성
KoSeonJe f893e77
feat : @Transactional 어노테이션 추가
KoSeonJe 3846a83
test : 테스트 에러 수정
KoSeonJe 34ef7ed
test : video일 경우 테스트 추가
KoSeonJe c982749
refactor : fileMetaData의 FileStatus Delete 변환 로직 수정
KoSeonJe 639d68a
fix : @Transactional 추가
KoSeonJe eb38e0a
refactor : FeedType에 따른 FileMetaData 삭제로직 수정
KoSeonJe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ public interface FacadeClubFeedService { | |
|
||
void update(UpdateFeedCommand command); | ||
|
||
void delete(Long feedId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ public void create(CreateFeedCommand command) { | |
|
||
if (feed.isImage()) { | ||
fileMetaDataService.updateStatusToCoupled(command.mediaId(), DomainType.FEED_IMAGE, createdId); | ||
return; | ||
} | ||
|
||
if (feed.isVideo()) { | ||
|
@@ -43,4 +44,19 @@ public void update(UpdateFeedCommand command) { | |
Feed updateFeed = command.toEntity(); | ||
originFeed.update(updateFeed); | ||
} | ||
|
||
@Override | ||
@Transactional | ||
public void delete(Long feedId) { | ||
Feed feed = feedService.getById(feedId); | ||
feedService.delete(feed); | ||
if (feed.isImage()) { | ||
fileMetaDataService.updateStatusToDelete(DomainType.FEED_IMAGE, feedId); | ||
return; | ||
} | ||
|
||
if (feed.isVideo()) { | ||
fileMetaDataService.updateStatusToDelete(DomainType.FEED_VIDEO, feedId); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3) |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ public interface FeedService { | |
Feed getById(Long feedId); | ||
|
||
Long create(Feed feed); | ||
|
||
void delete(Feed feed); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
보안 검증이 누락된 것이 확인되었습니다.
ClubFeedApi 인터페이스에 정의된 보안 요구사항(@securityrequirement)에 맞게 구현되어야 하나, updateFeed와 deleteFeed 메서드 모두에서 인증 파라미터(PrincipalDetails)가 누락되어 있습니다. 다음과 같이 수정이 필요합니다:
🔗 Analysis chain
보안 검증이 필요합니다.
다른 엔드포인트들과 달리 deleteFeed 메서드에는 인증 검사(PrincipalDetails)가 누락되어 있습니다. 피드 삭제 권한이 있는 사용자만 접근할 수 있도록 보안 검증이 필요합니다.
다음과 같이 수정을 제안합니다:
🏁 Scripts executed
The following scripts were executed for the analysis:
Error: No shell scripts found
Script:
Length of output: 20533
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.