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

#447 [feat] 글 상세 뷰 에러 코드 세분화 #449

Merged
merged 10 commits into from
Aug 6, 2024
Merged

Conversation

sohyundoh
Copy link
Member

✒️ 관련 이슈번호

Key Changes 🔑

(중요도 상)

  1. 에러 코드 세분화 -> 글 상세 뷰에서 발생하는 예외 케이스들의 코드를 세분화 하였습니다.
  2. 글 모임 뷰에서 글쓴이가 모두 글쓴이로 보이지 않던 현상을 해결했습니다. equals를 오버라이드 해서 재정의하면서 해결했습니다.
  • 제가 파악하기에는, 같은 영속성 컨텍스트에 존재하지 않는 이유로 equals가 제대로 작동하지 않은 것 같습니다 링크
  1. 글 상세 뷰에서 방장에 대해 글 삭제, 댓글 대댓글 삭제 권한이 존재한다는 점을 발견하였습니다. 그래서 이 요구사항에 적합하게 수정하였습니다.

(중요도 하)
4. 이전에 반영되어 있지 않던, 댓글 대댓글 길이 관련한 DB 제약사항 변경했습니다.
5. WriterName테이블의 Constraints와 이름 명명이 카멜케이스가 아닌 다른 방법으로 적용되어 있어서 수정했습니다.

To Reviewers 📢

  • 변경사항이 큽니다! 이번 주까지 반영해야하니 리뷰 부탁드려요!

@sohyundoh sohyundoh requested a review from parkheeddong August 5, 2024 08:47
@sohyundoh sohyundoh self-assigned this Aug 5, 2024
Copy link
Contributor

@parkheeddong parkheeddong left a comment

Choose a reason for hiding this comment

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

작업 내용이 많았네요.. 고생 많으셨습니다!!

MOIM_OWNER_AUTHENTICATION_ERROR(HttpStatus.FORBIDDEN.value(), "사용자는 해당 모임의 모임장이 아닙니다."),
WRITER_NAME_INFO_FORBIDDEN(HttpStatus.FORBIDDEN.value(), "해당 사용자는 필명에 접근 권한이 없습니다."),
COMMENT_ACCESS_ERROR(HttpStatus.FORBIDDEN.value(), "해당 사용자는 댓글에 접근 권한이 없습니다."),
COMMENT_ACCESS_ERROR(40306, "해당 사용자는 댓글에 접근 권한이 없습니다."),
Copy link
Contributor

Choose a reason for hiding this comment

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

P5) 사소하지만.. 40305 인것 같숩니다!

writerNameRetriever.findWriterNameByMoimIdAndUserId(moimId, userId));
Long moimId = post.getTopic().getMoim().getId();
WriterName writerName = writerNameRetriever.findByMoimAndUser(moimId, userId);
if(!postRetriever.isWriterOfPost(post, writerName) && !moimRetriever.isMoimOwnerEqualsUser(post.getTopic().getMoim(), userId)){
Copy link
Contributor

Choose a reason for hiding this comment

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

P5) and 가 아니라 or 이 들어가야 하는 조건문 아닌가요?!

Copy link
Member Author

Choose a reason for hiding this comment

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

모임장을 체크하는 조건, 글쓴이를 체크하는 조건 이 두 조건이 모두 false이면 예외인 점이어서 ! 연산자를 통해 예외를 던지게 했습니다! 제가 잘못 작성한 것 일까요!

@sohyundoh sohyundoh merged commit d6d53ed into develop Aug 6, 2024
1 check passed
@sohyundoh sohyundoh deleted the feat/#447 branch August 6, 2024 04:28
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.

[feat] 글 상세 뷰 에러코드 수정
2 participants