Skip to content
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

Merged
merged 9 commits into from
Jan 20, 2024
Merged

[Feat] showcase_delete,update #648

merged 9 commits into from
Jan 20, 2024

Conversation

weejihye
Copy link
Contributor

@weejihye weejihye commented Jan 19, 2024

변경 사항

showcase의 delete, update api 구현
답글 api는 post 답글 api 활용




테스트 결과

@weejihye weejihye self-assigned this Jan 19, 2024
@sinryuji
Copy link
Collaborator

🎉 @sinryuji 님 랜덤 리뷰어로 당첨되셨습니다! 리뷰를 부탁드립니다. 🙏

@sinryuji sinryuji self-requested a review January 19, 2024 15:25
Copy link
Collaborator

@sinryuji sinryuji left a 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){
Copy link
Collaborator

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을 파라미터로 받는다 함은 무조건 컨트롤러에 종속되는 함수가 될 수 밖에 없고 재사용성이 너무 떨어지는 것 같아요.

Copy link
Contributor Author

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){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마찬가지로 Authentication을 미리 유저로 변환후 넘기는게 재사용성 측면에서 좋을 것 같아요. 같은 맥락으로 저는 Dto를 통째로 넘기는 것도 선호하지 않는 편인데 이 정도까지는 개취의 영역이라 생각합니다.

Copy link

sonarcloud bot commented Jan 20, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

@weejihye weejihye merged commit 21e0d2b into dev Jan 20, 2024
6 checks passed
@weejihye weejihye deleted the 598-showcase branch January 23, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants