-
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
[#34] 카드 게시글 CRUD 기능 추가 #41
base: develop
Are you sure you want to change the base?
Conversation
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.
일단 머지하고 자세한 내용은 메토링떄 얘기해봐요. 몇가지 빠진 것들이 있어요.
// 게시글 수정 | ||
@Transactional | ||
public void updatePost(Long id, PostRequestDto requestDto) { | ||
Post post = postRepository.findById(id) |
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.
권한 체크가 다 빠져있어요. 예를 들면 여기서 유저 정보를 파라미터로 받아서 해당 유저가 이 포스트의 주인이 맞는지 확인하는 부분들이 추가 되어야해요.
// 게시글 삭제 | ||
@Transactional | ||
public void deletePost(Long id) { | ||
if (!postRepository.existsById(id)) { |
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.
여기도 마찬가지로 권한체크 필요해요. 권한 관련은 멘토링때 같이보죠
@AllArgsConstructor | ||
@Builder | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class Image { |
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.
여기에 created_at, updated_at같은 auditing요 컬럼들을 부모클래스로 구현하는 부분 필요해요. 멘토링떄 얘기해보죠
@PostMapping | ||
@Operation(summary = "게시글 등록 API", description = "새로운 게시글을 등록합니다.") | ||
public CommonResponse<Long> createPost(@RequestBody PostRequestDto requestDto) { | ||
return CommonResponse.success(postService.createPost(requestDto)); |
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.
여기에 validation check 필요
Closes 카드 게시글 CRUD API #34