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

🔀 :: (#121) 게시글 수정 API #122

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

🔀 :: (#121) 게시글 수정 API #122

wants to merge 7 commits into from

Conversation

lyutvs
Copy link
Collaborator

@lyutvs lyutvs commented Jun 22, 2022

close #121

@lyutvs lyutvs added the 기능 추가 새로운 기능 요청을 나타냅니다. label Jun 22, 2022
@lyutvs lyutvs self-assigned this Jun 22, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@@ -49,4 +50,10 @@ public PublicFeed(String title, String content, Integer likeCount, Feed feed) {
this.likeCount = likeCount;
this.feed = feed;
}

public void updateFeedContent(UpdateFeedRequest request) {
Copy link
Member

Choose a reason for hiding this comment

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

request 넘기는 것보다 title하고 content 나눠서 넘기는 게 좋을 것 같아여


@ResponseStatus(HttpStatus.NO_CONTENT)
@DeleteMapping("/{feed-id}")
public void deleteFeed(@PathVariable("feed-id") Integer feedId) {
deleteFeedService.execute(feedId);
}

@ResponseStatus(HttpStatus.NO_CONTENT)
@PatchMapping("/{feed-id}")
public void updateFeed(@Valid @RequestBody UpdateFeedRequest request, @PathVariable("feed-id") Integer feedId) {
Copy link
Member

Choose a reason for hiding this comment

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

이거 @Valid 순서가..

@NotBlank(message = "title은 Null, 공백, 띄어쓰기를 허용하지 않습니다.")
private String title;

@NotNull(message = "content은 Null일 수 없습니다.")
Copy link
Member

Choose a reason for hiding this comment

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

는 아닌가..?

PublicFeed publicFeed = feedFacade.getPublicFeedByFeedId(feed);
FeedAttachmentFile feedAttachmentFile = feedFacade.getFeedAttachmentFileByFeedId(feed);

if (!user.equals(feed.getUser())) {
Copy link
Member

@ericlee05 ericlee05 Jul 6, 2022

Choose a reason for hiding this comment

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

이 if문을 publicFeed를 조회하기 이전에(라인 26과 27 사이) 넣으면 불필요한 조회(publicFeed, feedAttachmentFile)를 막을 수 있지 않을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
기능 추가 새로운 기능 요청을 나타냅니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

게시글 수정
3 participants