-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! |
@@ -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) { |
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.
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) { |
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.
이거 @Valid 순서가..
@NotBlank(message = "title은 Null, 공백, 띄어쓰기를 허용하지 않습니다.") | ||
private String title; | ||
|
||
@NotNull(message = "content은 Null일 수 없습니다.") |
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.
는 아닌가..?
PublicFeed publicFeed = feedFacade.getPublicFeedByFeedId(feed); | ||
FeedAttachmentFile feedAttachmentFile = feedFacade.getFeedAttachmentFileByFeedId(feed); | ||
|
||
if (!user.equals(feed.getUser())) { |
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.
이 if문을 publicFeed
를 조회하기 이전에(라인 26과 27 사이) 넣으면 불필요한 조회(publicFeed
, feedAttachmentFile
)를 막을 수 있지 않을까요?
close #121