-
Notifications
You must be signed in to change notification settings - Fork 29
레벨로그 기능 구현 #982
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
레벨로그 기능 구현 #982
Conversation
SonarCloud Quality Gate failed. |
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.
베루스, 수달!! 새로운 기능인 레벨로그 구현 고생하셨습니다 🥳 제 생각에는 코드가 깔끔하게 작성된 것 같아요!! 작성된 코멘트 내용만 한번 확인해주세요~! 수고하셨습니다 🙂
추가적으로 documentTest
가 현재 작성되어 있지 않은 것 같은데 한번 확인해주세요!!
backend/src/main/java/wooteco/prolog/levellogs/application/LevelLogService.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/wooteco/prolog/levellogs/application/LevelLogServiceTest.java
Show resolved
Hide resolved
backend/src/main/java/wooteco/prolog/levellogs/domain/SelfDiscussion.java
Show resolved
Hide resolved
backend/src/acceptanceTest/java/wooteco/prolog/steps/LevellogsStepDefinitions.java
Show resolved
Hide resolved
backend/src/main/java/wooteco/prolog/levellogs/application/LevelLogService.java
Show resolved
Hide resolved
backend/src/main/java/wooteco/prolog/common/exception/BadRequestCode.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/wooteco/prolog/levellogs/domain/SelfDiscussion.java
Show resolved
Hide resolved
private LocalDateTime createdAt; | ||
private LocalDateTime updatedAt; |
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.
auditor 로 생성되는 데이터는 영어 단어 그대로, 데이터를 위한 메타데이터로 취급되는편이 좋아요. (auditor는 사용자 interaction이 아닌, 다른 이유로도 변경될 수 있거든요)
따라서, 비즈니스에서 생성, 수정일자를 보여줘야 한다면 따로 필드를 생성해 주는편이 더 좋습니다 :)
|
||
@AllArgsConstructor | ||
@Getter | ||
@EqualsAndHashCode |
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.
response는 dto의 성질을 담고 있습니다. EqualsAndHashCode를 만들어주는것이 객체지향적으로 어떤 의미를 가지는지, 왜 dto에는 equalsAndHashcode를 지양하는지 한번 생각해 봐도 좋을 것 같아요
- 다른 response들도 마찬가지 입니다~
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@AllArgsConstructor |
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.
response는 보동 serialize만 진행하기 때문에 크게 상관 없지만, 추 후에 다른 serializer가 사용되거나 할 경우 기본생성자가 필요해질 수 있습니다.
저는 그런 걱정을 조금이라도 덜기 위해서 기본생성자 넣어주는 편 입니다.(양심상, public으로 여는건 싫고, 타협봐서 protected로 열어줍니다)
@Getter | ||
@EqualsAndHashCode | ||
@ToString | ||
@NoArgsConstructor |
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.
protected로 열어도 바인딩 될꺼에요 :)
기본생성자로 인해 비어있는 데이터를 생성하는걸 최대한 방지하는 방향으로 가도 좋아보입니다
} | ||
|
||
private int length(String title) { | ||
if (Objects.nonNull(title)) { |
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.
|
||
@Entity | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@EqualsAndHashCode |
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.
LevelLog는 entity에요, eualsAndHashCode 어노테이션을 이렇게 붙히면, vo처럼 모든 필드에 대한 equals검사를 진행합니다.
엔티티의 정의에 맞도록, 식별자에 대한 equals and hashcode가 만들어지도록 바꿔주세요~
validateNull(title); | ||
validateEmpty(title); | ||
validateOnlyBlank(title); | ||
validateMaxLength(title); | ||
this.title = trim(title); |
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.
trim을 하고 validation을 진행하는게 더 정확하지 않을까요??
* feat: 댓글(Comment) Entity 구현 * feat: 댓글 등록 Service 기능 구현 * feat: 댓글 등록 Controller 기능 구현 * test: 댓글 등록 인수 테스트 작성 * test: 댓글 등록 문서 테스트 작성 * feat: 단일 스터디로그에 대한 댓글 리스트 조회 Repository 기능 구현 * feat: 단일 스터디로그에 대한 댓글 리스트 조회 Service 기능 구현 * feat: 단일 스터디로그에 대한 댓글 리스트 조회 Controller 기능 구현 * feat: 단일 스터디로그에 대한 댓글 리스트 조회 인수 테스트 작성 * feat: 단일 스터디로그에 대한 댓글 리스트 조회 문서 테스트 작성 * feat: CommentMemberResponse 인자 값 추가 * feat: 댓글 수정하기 기능 추가 * feat: 댓글 삭제하기 기능 추가 * feat: setComment를 updateComment로 메서드명 변경 - final 제거 - commentUpdateRequest 변수 제거 - 기본 생성자(protected)로 추가 * feat: delete() 메서드를 boolean 반환에서 void로 변경 * test: 잘못 입력된 테스트 메서드명 수정 * style: PrologStyle 적용 * test: 댓글 Rest Docs에 대한 내용이 일치하도록 수정 * feat: member를 author로 수정 * fix: delete() 메서드를 호출하도록 수정 * refactor: 디미터 법칙을 위반하지 않도록 체이닝 제거 * refactor: exists를 이용해서 ID 존재여부를 검증하도록 변경 * refactor: layer별 dto의 생성 메서드 이름 변경 * fix: 테스트 픽스처 오류 수정 Co-authored-by: youngwooyoo <[email protected]>
구현 요구사항
내용 작성
(content)질문 + 답변 작성
(Q&A 두 개)내용, 질문 , 답변
수정