-
Notifications
You must be signed in to change notification settings - Fork 4
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] showcase_delete,update #648
Conversation
🎉 @sinryuji 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏 |
…to 598-showcase
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.
쇼케이스 delete, update api 구현 확인하였습니다.
@@ -218,4 +218,17 @@ public ResponseEntity<Object> updateShowcase(Long showcaseId, ShowcaseUpdateDto | |||
objectService.deleteObject(temp); | |||
return new ResponseEntity<>(HttpStatus.OK); | |||
} | |||
|
|||
@Transactional | |||
public ResponseEntity<Object> deleteShowcase(Long showcaseId, Authentication auth){ |
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.
Service단 함수에서 Authentication을 받아 User로 변환하는 것보다 컨트롤러에서 변환 후 User를 건네주는게 더 좋을 것 같습니다. Authentication을 파라미터로 받는다 함은 무조건 컨트롤러에 종속되는 함수가 될 수 밖에 없고 재사용성이 너무 떨어지는 것 같아요.
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.
넵! 이해했습니다^^ 반영해서 수정하겠습니다~
@@ -201,4 +203,32 @@ public Long createShowcase(ShowcaseCreateDto request, Authentication auth){ | |||
post.addFile(objectService.uploadObject(filePath, request.getImage(), "image")); | |||
return post.getId(); | |||
} | |||
|
|||
@Transactional | |||
public ResponseEntity<Object> updateShowcase(Long showcaseId, ShowcaseUpdateDto request, Authentication auth){ |
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.
마찬가지로 Authentication을 미리 유저로 변환후 넘기는게 재사용성 측면에서 좋을 것 같아요. 같은 맥락으로 저는 Dto를 통째로 넘기는 것도 선호하지 않는 편인데 이 정도까지는 개취의 영역이라 생각합니다.
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 1 New issue |
변경 사항
showcase의 delete, update api 구현
답글 api는 post 답글 api 활용
테스트 결과