Skip to content

Conversation

@jpark0506
Copy link
Contributor

@jpark0506 jpark0506 commented Feb 2, 2025

#️⃣ 요약 설명

프런트가 요청사항으로 부탁하신 플래너 생성 API를 다시 생성했습니다.
초기 데이터 타입도 요청해주셔서 맞게 수정했습니다.

📝 작업 내용

    public static Planner toInitialPlanner(Member member){
        return Planner
                .builder()
                .activityName("")
                .startTime(null)
                .endTime(null)
                .specifics("")
                .measurable("")
                .achievable("")
                .relevant("")
                .timeBound("")
                .otherPlans("")
                .member(member)
                .build();
    }

    public static List<Planner> toInitialPlannerList(Member member){
        return List.of(
                PlannerConverter.toInitialPlanner(member),
                PlannerConverter.toInitialPlanner(member)
        );
    }

Converter로 새로 생성하도록 했고 아래처럼 서비스 코드를 간소화했습니다.

public void initPlanner(Member member){

        if(member == null){
            throw new GeneralException(CommonErrorCode.NOT_FOUND_BY_MEMBER_ID);
        }

        if(plannerRepository.existsByMember(member)){
            throw new GeneralException(CommonErrorCode.PLANNER_EXISTS);
        }

        plannerRepository.saveAll(PlannerConverter.toInitialPlannerList(member));
    }

member가 null인 상태로 서비스 단으로 넘어오는 경우도 있어서 우선 예외 처리했고, 안정화되면 수정하겠습니다.

동작 확인

로컬호스트에서 로그인이 불가능하고, 프런트가 빨리 필요한 것 같아 우선 올렸습니다.

💬 리뷰 요구사항(선택)

코드의 논리적 오류를 살펴봐주시면 감사하겠습니다.

Summary by CodeRabbit

  • New Features
    • 인증된 사용자를 위한 플래너 초기화 기능이 추가되어, 기본 설정이 적용된 플래너를 손쉽게 생성할 수 있습니다.
  • Refactor
    • 플래너 생성 및 초기화 로직이 개선되어, 보다 일관된 초기 상태 제공과 강화된 오류 처리가 반영되었습니다.
  • Bug Fixes
    • 플래너가 존재하지 않을 경우의 예외 처리가 추가되어, 안정성이 향상되었습니다.
  • Chores
    • 불필요한 메서드가 제거되고, 새로운 메서드가 추가되어 코드 구조가 간소화되었습니다.

@jpark0506 jpark0506 added the feat 기능 추가 label Feb 2, 2025
@jpark0506 jpark0506 self-assigned this Feb 2, 2025
@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2025

Walkthrough

이 PR은 회원 프로필 생성 시 플래너 초기화 로직으로 변경하는 내용을 포함합니다.
MemberService의 makeProfile 메소드에서 기존의 savePlanner 호출을 initPlanner로 대체하였고, PlannerController에 플래너 초기화를 위한 새로운 POST 엔드포인트가 추가되었습니다.
또한, PlannerConverter에서는 기존의 DTO 리스트 변환 메소드를 제거하고 기본값을 갖는 플래너 인스턴스를 생성하는 두 개의 메소드를 추가하였으며, PlannerCommandService에서는 메소드명을 변경하고 멤버 유효성 검사를 추가하였습니다.

Changes

File(s) Change Summary
src/main/java/UMC/.../domain/member/service/MemberService.java makeProfile 메소드에서 savePlanner 호출을 initPlanner로 대체하여 플래너 초기화 로직 변경.
src/main/java/UMC/.../domain/planner/controller/PlannerController.java 플래너 초기화를 위한 새로운 POST 엔드포인트 initPlanner 추가.
src/main/java/UMC/.../domain/planner/converter/PlannerConverter.java 기존 toPlannerList 메소드 제거, 기본값으로 초기 플래너 생성하는 toInitialPlannertoInitialPlannerList 메소드 추가.
src/main/java/UMC/.../domain/planner/service/PlannerCommandService.java savePlanner 메소드를 initPlanner로 이름 변경, 멤버 null 체크 및 해당 시 예외 발생 로직 추가하고 초기 플래너 리스트 저장 구현.
src/main/java/UMC/.../domain/planner/repository/PlannerRepository.java findPlannerByMember 메소드 제거, 단일 플래너 조회 기능 삭제.
src/main/java/UMC/.../domain/planner/service/PlannerQueryService.java getPlannerByMember 메소드 수정, 플래너가 없을 경우 예외 처리 추가.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller as PlannerController
    participant Service as PlannerCommandService
    participant Converter as PlannerConverter
    participant Repo as PlannerRepository

    Client->>Controller: POST /initPlanner (인증된 회원 전달)
    Controller->>Service: initPlanner(member)
    Service->>Converter: toInitialPlannerList(member)
    Converter-->>Service: 초기 플래너 리스트 반환
    Service->>Repo: saveAll(초기 플래너 리스트)
    Repo-->>Service: 저장 결과 반환
    Service-->>Controller: 성공 응답 전송
    Controller-->>Client: ApiResponse 전송
Loading

Possibly related PRs

  • [CMAT-45] feat: Planner 2개로 수정 #28: MemberService의 makeProfile 메소드 내 플래너 처리 방식 변경과 DTO를 사용하지 않는 새로운 초기화 로직이 적용되어 직접적인 코드 연결성을 가짐.

Suggested reviewers

  • KSLEE19
  • veronees
  • jjeongdong
  • kyoooooong

Poem

나는 작은 토끼, 깡총깡총 뛰네,
코드 속 변화가 내 발자국 남기네.
플래너 초기화, 새롭게 피어나네,
변경된 로직, 깔끔히 다듬어졌네.
함께 축하하며, 코드를 사랑하네 🐇💻.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/main/java/UMC/career_mate/domain/planner/converter/PlannerConverter.java (1)

31-45: 초기 플래너 생성 로직 개선이 필요합니다.

다음 사항들을 고려해 주시기 바랍니다:

  1. 빈 문자열("") 대신 의미 있는 기본값을 사용하는 것이 좋습니다.
  2. startTimeendTime이 null인 경우 프론트엔드에서 처리가 필요할 수 있습니다.
  3. member 파라미터에 대한 null 체크가 없습니다.

다음과 같이 개선하는 것을 제안드립니다:

 public static Planner toInitialPlanner(Member member){
+    if (member == null) {
+        throw new IllegalArgumentException("멤버 정보가 없습니다.");
+    }
     return Planner
             .builder()
-            .activityName("")
+            .activityName("새로운 활동")
             .startTime(null)
             .endTime(null)
-            .specifics("")
-            .measurable("")
-            .achievable("")
-            .relevant("")
-            .timeBound("")
-            .otherPlans("")
+            .specifics("구체적인 계획을 입력해주세요")
+            .measurable("측정 가능한 목표를 입력해주세요")
+            .achievable("달성 가능한 목표를 입력해주세요")
+            .relevant("관련성 있는 목표를 입력해주세요")
+            .timeBound("목표 기한을 입력해주세요")
+            .otherPlans("추가 계획을 입력해주세요")
             .member(member)
             .build();
 }
src/main/java/UMC/career_mate/domain/planner/controller/PlannerController.java (1)

23-30: API 문서화가 명확합니다만, 테스트용 API 표시를 개선할 수 있습니다.

테스트용 API임을 더 명확하게 표시하고, 프로덕션 환경에서의 사용을 제한하는 것이 좋을 것 같습니다.

 @Operation(
-            summary = "플래너 생성(TEST용)",
+            summary = "[개발 테스트 전용] 플래너 생성",
             description = """
+                    ⚠️ 주의: 이 API는 개발 테스트 목적으로만 사용되어야 합니다.
+                    
                     [프로필 작성 완료시 플래너가 자동 생성되기 때문에, PATCH API를 사용해주시면 되겠습니다]
                     요청한 멤버에 해당하는 빈 플래너를 생성합니다.
                     ```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe8fa31 and ac96848.

📒 Files selected for processing (4)
  • src/main/java/UMC/career_mate/domain/member/service/MemberService.java (1 hunks)
  • src/main/java/UMC/career_mate/domain/planner/controller/PlannerController.java (1 hunks)
  • src/main/java/UMC/career_mate/domain/planner/converter/PlannerConverter.java (1 hunks)
  • src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (1 hunks)
🔇 Additional comments (4)
src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (2)

27-31: 멤버 유효성 검사 로직이 적절합니다.

null 체크를 통한 방어적 프로그래밍이 잘 구현되어 있습니다.


37-37: PlannerConverter 사용 검증이 필요합니다.

toInitialPlannerList 메서드의 구현을 확인하여 초기 플래너가 올바르게 생성되는지 검증이 필요합니다.

✅ Verification successful

다음과 같이 추가 검증을 진행하겠습니다.


PlannerConverter의 toInitialPlannerList 검증 결과

  • toInitialPlannerList 메서드는 입력된 Member 객체를 기반으로 두 개의 초기 Planner 인스턴스를 생성하여 리스트로 반환합니다.
  • 각 Planner 인스턴스는 내부에서 toInitialPlanner(member)를 통해 동일한 초기값(예, 빈 문자열로 설정된 'relevant', 'timeBound', 'otherPlans' 등과 member 필드 할당)을 갖도록 생성됩니다.
  • 현재 코드 구현 상으로는 Builder 패턴을 활용하여 올바르게 초기화된 Planner 객체들이 반환되고 있으므로, 초기 Planner가 의도한 대로 구성되는 것으로 보입니다.
  • 단, 두 개의 동일한 Planner 객체를 생성하는 것이 실제 요구사항에 부합하는지 최종적으로 팀 내부에서 한번 더 확인해 주시기 바랍니다.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# PlannerConverter의 toInitialPlannerList 구현 확인
ast-grep --pattern 'class PlannerConverter {
  $$$
  static List<Planner> toInitialPlannerList($_) {
    $$$
  }
  $$$
}'

Length of output: 123


Script:

#!/bin/bash
# PlannerConverter 클래스 정의를 포함하는 파일 찾기
rg -n "class PlannerConverter" --type java

# toInitialPlannerList 메서드의 구현을 포함하는 코드를 검색
rg -n "static List<Planner> toInitialPlannerList" --type java

Length of output: 369


Script:

#!/bin/bash
# PlannerConverter.java 파일에서 toInitialPlannerList 메서드의 구현 세부 내용을 확인합니다.
sed -n '40,120p' src/main/java/UMC/career_mate/domain/planner/converter/PlannerConverter.java

Length of output: 1579

src/main/java/UMC/career_mate/domain/member/service/MemberService.java (1)

39-39: 메서드 호출 변경이 적절합니다.

PlannerCommandService의 변경된 메서드명을 반영하여 올바르게 수정되었습니다.

src/main/java/UMC/career_mate/domain/planner/controller/PlannerController.java (1)

31-34: 보안 검증이 적절합니다.

@LoginMember 어노테이션을 통해 인증된 사용자만 접근할 수 있도록 보안이 적절히 구현되어 있습니다.

Comment on lines +47 to 52
public static List<Planner> toInitialPlannerList(Member member){
return List.of(
PlannerConverter.toInitialPlanner(member),
PlannerConverter.toInitialPlanner(member)
);
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

초기 플래너 리스트 생성 로직 개선이 필요합니다.

현재 구현의 잠재적인 문제점들:

  1. 플래너 개수가 하드코딩되어 있습니다.
  2. 두 개의 플래너가 동일한 내용으로 생성됩니다.
  3. List.of()는 불변 리스트를 반환하여 추후 수정이 필요한 경우 문제가 될 수 있습니다.

다음과 같이 개선하는 것을 제안드립니다:

 public static List<Planner> toInitialPlannerList(Member member){
-    return List.of(
-            PlannerConverter.toInitialPlanner(member),
-            PlannerConverter.toInitialPlanner(member)
-    );
+    List<Planner> planners = new ArrayList<>();
+    
+    Planner firstPlanner = PlannerConverter.toInitialPlanner(member);
+    firstPlanner.setActivityName("첫 번째 활동");
+    planners.add(firstPlanner);
+    
+    Planner secondPlanner = PlannerConverter.toInitialPlanner(member);
+    secondPlanner.setActivityName("두 번째 활동");
+    planners.add(secondPlanner);
+    
+    return planners;
 }

또한, 초기 플래너의 개수를 설정 파일이나 상수로 관리하는 것을 고려해보세요.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static List<Planner> toInitialPlannerList(Member member){
return List.of(
PlannerConverter.toInitialPlanner(member),
PlannerConverter.toInitialPlanner(member)
);
}
public static List<Planner> toInitialPlannerList(Member member){
- return List.of(
- PlannerConverter.toInitialPlanner(member),
- PlannerConverter.toInitialPlanner(member)
- );
+ List<Planner> planners = new ArrayList<>();
+
+ Planner firstPlanner = PlannerConverter.toInitialPlanner(member);
+ firstPlanner.setActivityName("첫 번째 활동");
+ planners.add(firstPlanner);
+
+ Planner secondPlanner = PlannerConverter.toInitialPlanner(member);
+ secondPlanner.setActivityName("두 번째 활동");
+ planners.add(secondPlanner);
+
+ return planners;
}

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (1)

40-52: 리스트 크기 불일치에 대한 방어 로직이 필요합니다.

현재 구현에서는 plannersplannerDTOs의 크기가 다를 경우 NoSuchElementException 또는 일부 데이터가 무시되는 문제가 발생할 수 있습니다.

다음과 같은 방어 로직 추가를 제안합니다:

 public void editPlanner(Member member, CreatePlannerListDTO createPlannerListDTO){
     if(!plannerRepository.existsByMember(member)){
         throw new GeneralException(CommonErrorCode.PLANNER_NOT_EXISTS);
     }

     List<Planner> planners = plannerRepository.findByMember(member);
     List<CreatePlannerDTO> plannerDTOs = createPlannerListDTO.planners();

+    if (planners.size() != plannerDTOs.size()) {
+        throw new GeneralException(CommonErrorCode.INVALID_REQUEST);
+    }
+
     Iterator<CreatePlannerDTO> dtoIterator = plannerDTOs.iterator();
     planners.forEach(planner -> planner.update(dtoIterator.next()));
 }
🧹 Nitpick comments (1)
src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (1)

27-38: 구현이 잘 되어있습니다만, 작은 개선사항이 있습니다.

메서드의 유효성 검사 순서를 최적화하면 좋을 것 같습니다. null 체크와 존재 여부 체크의 순서를 바꾸면, 불필요한 데이터베이스 조회를 방지할 수 있습니다.

다음과 같이 수정하는 것을 제안합니다:

 public void initPlanner(Member member){
+    if(member == null){
+        throw new GeneralException(CommonErrorCode.NOT_FOUND_BY_MEMBER_ID);
+    }
+
     if(plannerRepository.existsByMember(member)){
         throw new GeneralException(CommonErrorCode.PLANNER_EXISTS);
     }
-    if(member == null){
-        throw new GeneralException(CommonErrorCode.NOT_FOUND_BY_MEMBER_ID);
-    }

     plannerRepository.saveAll(PlannerConverter.toInitialPlannerList(member));
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac96848 and 7d1939a.

📒 Files selected for processing (2)
  • src/main/java/UMC/career_mate/domain/planner/repository/PlannerRepository.java (0 hunks)
  • src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (2 hunks)
💤 Files with no reviewable changes (1)
  • src/main/java/UMC/career_mate/domain/planner/repository/PlannerRepository.java
🔇 Additional comments (1)
src/main/java/UMC/career_mate/domain/planner/service/PlannerCommandService.java (1)

54-63: 구현이 깔끔하고 효율적입니다.

존재 여부 확인 후 일괄 삭제하는 방식으로 잘 구현되어 있습니다. deleteAll을 사용하여 배치 처리를 하는 것이 성능상 좋은 선택입니다.

Copy link
Member

@jjeongdong jjeongdong left a comment

Choose a reason for hiding this comment

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

LGTM~ 고생하셨습니다!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/main/java/UMC/career_mate/domain/planner/converter/PlannerConverter.java (1)

45-50: 🛠️ Refactor suggestion

초기 플래너 리스트 생성 로직 개선이 필요합니다.

이전 리뷰에서 지적된 문제점들이 여전히 존재합니다:

  1. 플래너 개수가 하드코딩되어 있습니다
  2. 두 플래너가 동일한 내용으로 생성됩니다
  3. List.of()는 불변 리스트를 반환합니다

추가로 다음과 같은 개선사항을 제안드립니다:

public static final int DEFAULT_INITIAL_PLANNER_COUNT = 2;  // 설정 값으로 관리

public static List<Planner> toInitialPlannerList(Member member) {
    List<Planner> planners = new ArrayList<>();
    for (int i = 0; i < DEFAULT_INITIAL_PLANNER_COUNT; i++) {
        Planner planner = toInitialPlanner(member);
        planner.setActivityName(String.format("%d번째 활동", i + 1));
        planners.add(planner);
    }
    return planners;
}
🧹 Nitpick comments (1)
src/main/java/UMC/career_mate/domain/planner/service/PlannerQueryService.java (1)

29-31: 로깅 추가를 고려해보세요.

예외가 발생하는 상황에서 디버깅을 용이하게 하기 위해 로그를 추가하는 것이 좋을 것 같습니다.

다음과 같이 로그를 추가하는 것을 제안합니다:

 if (planners.isEmpty()) {
+    log.error("플래너를 찾을 수 없습니다. memberId: {}", member.getId());
     throw new GeneralException(CommonErrorCode.PLANNER_NOT_EXISTS);
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7d1939a and a3d0683.

📒 Files selected for processing (2)
  • src/main/java/UMC/career_mate/domain/planner/converter/PlannerConverter.java (1 hunks)
  • src/main/java/UMC/career_mate/domain/planner/service/PlannerQueryService.java (1 hunks)
🔇 Additional comments (1)
src/main/java/UMC/career_mate/domain/planner/service/PlannerQueryService.java (1)

28-32: 예외 처리 로직이 적절히 추가되었습니다.

플래너 목록이 비어있는 경우에 대한 예외 처리가 명확하게 구현되었습니다. 프론트엔드 팀에서 더 나은 에러 핸들링이 가능할 것 같습니다.

Comment on lines +29 to +43
public static Planner toInitialPlanner(Member member){
return Planner
.builder()
.activityName("")
.startTime(null)
.endTime(null)
.specifics("")
.measurable("")
.achievable("")
.relevant("")
.timeBound("")
.otherPlans("")
.member(member)
.build();
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

초기 플래너 생성 메소드의 개선이 필요합니다.

다음과 같은 개선사항을 제안드립니다:

  1. 빈 문자열 대신 의미 있는 기본값 설정이 필요합니다.
  2. member 파라미터에 대한 null 체크가 필요합니다.
  3. JavaDoc을 추가하여 초기 상태의 목적과 사용법을 문서화해주세요.
+    /**
+     * 회원의 초기 플래너를 생성합니다.
+     * @param member 플래너를 생성할 회원 (null이 아니어야 함)
+     * @return 기본값으로 초기화된 플래너
+     * @throws IllegalArgumentException member가 null인 경우
+     */
     public static Planner toInitialPlanner(Member member){
+        if (member == null) {
+            throw new IllegalArgumentException("회원 정보는 필수입니다.");
+        }
         return Planner
                 .builder()
-                .activityName("")
+                .activityName("새로운 활동")
                 .startTime(null)
                 .endTime(null)
-                .specifics("")
-                .measurable("")
-                .achievable("")
-                .relevant("")
-                .timeBound("")
-                .otherPlans("")
+                .specifics("구체적인 계획을 입력해주세요")
+                .measurable("측정 가능한 목표를 설정해주세요")
+                .achievable("달성 가능한 목표를 설정해주세요")
+                .relevant("관련성 있는 목표를 설정해주세요")
+                .timeBound("기한이 있는 목표를 설정해주세요")
+                .otherPlans("추가 계획을 입력해주세요")
                 .member(member)
                 .build();
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public static Planner toInitialPlanner(Member member){
return Planner
.builder()
.activityName("")
.startTime(null)
.endTime(null)
.specifics("")
.measurable("")
.achievable("")
.relevant("")
.timeBound("")
.otherPlans("")
.member(member)
.build();
}
/**
* 회원의 초기 플래너를 생성합니다.
* @param member 플래너를 생성할 회원 (null이 아니어야 )
* @return 기본값으로 초기화된 플래너
* @throws IllegalArgumentException member가 null인 경우
*/
public static Planner toInitialPlanner(Member member){
if (member == null) {
throw new IllegalArgumentException("회원 정보는 필수입니다.");
}
return Planner
.builder()
.activityName("새로운 활동")
.startTime(null)
.endTime(null)
.specifics("구체적인 계획을 입력해주세요")
.measurable("측정 가능한 목표를 설정해주세요")
.achievable("달성 가능한 목표를 설정해주세요")
.relevant("관련성 있는 목표를 설정해주세요")
.timeBound("기한이 있는 목표를 설정해주세요")
.otherPlans("추가 계획을 입력해주세요")
.member(member)
.build();
}

Copy link
Member

@momuzzi momuzzi left a comment

Choose a reason for hiding this comment

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

LGTM입니다~~

@jpark0506 jpark0506 merged commit c618f30 into develop Feb 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants