Skip to content

Conversation

her0807
Copy link
Contributor

@her0807 her0807 commented Aug 15, 2022

구현 요구사항

  • 레벨로그 내용 작성 (content)
    • 레벨로그 질문 + 답변 작성 (Q&A 두 개)
    • 내용, 질문 , 답변 수정
    • 레벨로그 조회
      • 목록 단건 조회
      • 목록 전체 조회

스크린샷 2022-08-08 오후 4 04 53

@verus-j verus-j requested a review from wishoon August 16, 2022 07:32
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
6.5% 6.5% Duplication

@kwannee kwannee changed the base branch from main to develop August 16, 2022 13:03
Copy link
Contributor

@wishoon wishoon left a comment

Choose a reason for hiding this comment

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

베루스, 수달!! 새로운 기능인 레벨로그 구현 고생하셨습니다 🥳 제 생각에는 코드가 깔끔하게 작성된 것 같아요!! 작성된 코멘트 내용만 한번 확인해주세요~! 수고하셨습니다 🙂

추가적으로 documentTest가 현재 작성되어 있지 않은 것 같은데 한번 확인해주세요!!

Comment on lines +27 to +29
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Objects.nonNull같은 경우는 stream과 같은 경우에 메서드참조 형식으로 사용하기 위한 메서드에요.
저도 예전에는 이런식으로 많이 사용했었는데 요즘에는 != null 형태로 많이 작성합니다. (Objects.isNull 과같은 형태도 마찬가지 입니다)
api note를 읽어보세요!
image


@Entity
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EqualsAndHashCode
Copy link
Contributor

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가 만들어지도록 바꿔주세요~

Comment on lines 27 to 31
validateNull(title);
validateEmpty(title);
validateOnlyBlank(title);
validateMaxLength(title);
this.title = trim(title);
Copy link
Contributor

Choose a reason for hiding this comment

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

trim을 하고 validation을 진행하는게 더 정확하지 않을까요??

verus-j and others added 21 commits August 21, 2022 13:59
* 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]>
@her0807 her0807 merged commit 745c444 into develop Sep 4, 2022
@gracefulBrown gracefulBrown deleted the feat/levellog branch September 6, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants