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

Feature 11/240408회의 api 개발 및 엔티티 수정 #13

Merged

Conversation

Ryeolee
Copy link
Contributor

@Ryeolee Ryeolee commented May 1, 2024

#️⃣연관된 이슈

ex) #11

📝작업 내용

Api 개발

메인페이지 내 채소 루틴 조회
내 채소 정보 수정
내 채소 루틴 조회
내 채소별 성장 일기 개수 조회
내 채소별 성장일기 내용 조회

스크린샷 (선택)

💬리뷰 요구사항(선택)

오늘 말한 processData 함수에 static을 붙였는데

     public static List<MyVeggieRoutine> processData(List<Routine> routineList){
        return routineList.stream()
                .map(routine -> {
                    boolean check;

                    check = signRoutineCheck(routine.getDate());
                    return MyVeggieRoutine.of(routine, check);
                })
                .toList();
    }


    private static Boolean signRoutineCheck(Date date){
        boolean check = true;
        if (date.equals(LocalDate.now())) {
           check = false;
        }
        return check;
    }

processData() 함수 안에 있는 signRoutineCheck() 함수도 static 으로 바꾸게 됐는데 이 dto 속에 있는 static 함수 폭탄 괜찮을까요?

.map(diary -> AllDairy.of(diary, formatDate(diary.getCreatedDate())))
.toList();
}
public static String formatDate(LocalDateTime date) {
Copy link
Contributor

Choose a reason for hiding this comment

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

이 메서드는 AllDairy 클래스가 온전히 책임을 질 기능으로 보이지 않아요. 다른 도메인, 파일에서 쓰일 여지가 충분한 것 같으니 Common과 같은 곳에 Util(예시) 클래스를 만들어서 관리하면 좋을 듯 합니다 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

해당 도메인 util 패키지로 함수를 옮겼습닌다.

@AllArgsConstructor
@Getter
@Component
Copy link
Contributor

Choose a reason for hiding this comment

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

컴포넌트를 붙인 이유가 있을까요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

엇 이 dto를 의존성 주입하여 service에서 사용하려고 했습니다만 해당 클래스 proccessData()함수에 static을 붙여 수정했습니다.~!

Copy link
Contributor

@MinchoGreenT MinchoGreenT left a comment

Choose a reason for hiding this comment

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

코드에 코멘트 달았습니다~

Copy link
Contributor

@MinchoGreenT MinchoGreenT left a comment

Choose a reason for hiding this comment

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

굿 수고하셨습니다~

@MinchoGreenT MinchoGreenT merged commit d8b1e67 into dev May 4, 2024
1 check passed
@Ryeolee Ryeolee deleted the feature_11/240408회의-api-개발-및-엔티티-수정 branch May 4, 2024 11:06
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.

2 participants