Skip to content

[FEAT] 6주차 미션_링크#20

Open
Cheesebee wants to merge 9 commits intolinkfrom
week6-link
Open

[FEAT] 6주차 미션_링크#20
Cheesebee wants to merge 9 commits intolinkfrom
week6-link

Conversation

@Cheesebee
Copy link
Copy Markdown
Contributor

@Cheesebee Cheesebee commented May 4, 2026

📂 관련 이슈

  • closes #[이슈 번호]
  • JPA 하고 나니까 swagger가 안 열리는데 이거 다른사람들은 yml 편집한거야?? 함부로 건드리면 안될 것 같아서 일단 보류..... 스터디때 물어봐야겟다

🛠️ 작업 사항

01 Entity 및 연관관계 매핑 구현
• ERD 기반 Member, Mission, Store, Review 등 엔티티 생성
• MemberMission, MemberFood, MemberTerm 중간 매핑 엔티티 구현
@manytoone, @onetomany 연관관계 설정
• BaseEntity 적용 및 공통 필드 관리

2 API Controller, Service, Repository 구현
• 홈 화면 조회 API 구현 (GET /api/users/{userId}/home)
- 사용자 정보 및 포인트 반환
• 마이페이지 조회 API 구현 (GET /api/users/{userId}/mypage)
- 회원 정보 조회 및 DTO 반환
• 리뷰 작성 API 구현 (POST /api/users/{userId}/reviews)
- Review 엔티티 저장 및 Service 계층 연결
• 미션 목록 조회 API 구현 (GET /api/users/{userId}/missions)
- 진행중/완료 상태 반환
- 페이징 구조 적용
• 홈 화면 미션 조회 API 구현
- 지역 기반 미션 목록 조회
- @query 활용 페이징 처리

3 Service 계층 구조 분리
• Controller와 비즈니스 로직 분리
• Service 계층을 통한 DTO 변환 처리
• Repository를 통한 엔티티 조회 및 저장 구현

📸 관련 이미지 (스크린샷 또는 동영상)

image image

💬 기타 설명

MySQL 작업을 안 해서 swagger에서 확인을 못 했는데 맞게 했을지 궁금하다

💡 추가적으로 공유할 내용이나 리뷰어에게 전달할 사항이 있다면 작성해 주세요.

@Cheesebee Cheesebee changed the base branch from main to link May 4, 2026 10:59
@Cheesebee Cheesebee requested a review from gyeonseo May 4, 2026 10:59
@Cheesebee Cheesebee self-assigned this May 4, 2026
@Cheesebee Cheesebee requested review from hoondongseo and wnsgh7368 and removed request for wnsgh7368 May 5, 2026 06:05
public ApiResponse<HomeResponseDTO> home(
@PathVariable Long userId
) {
HomeResponseDTO response = new HomeResponseDTO(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

가짜 임시 데이터가 반환되어서 회원가입 메서드가 실행되는데, 실제로 구현되게 MemberService에 따로 join 로직을 만들어야 할 것 같아

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

오케이 추가할게 고마워!!

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@column(name = "point")와 같이 이름을 정해줘도 되고, 생략해도 되지만, phoneNumber 같은 건 phone_number 처럼 스네이크 케이스로 변환한다고 하니까, 주의해서 써야할 듯.
그리고 null 값 허용 여부 (nullable = false) 를 추가해줬으면 더 좋았을 듯

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

널러블 신경 써야겟다... 자꾸 까먹네 고마워

private Boolean isComplete;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "member_id")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

난 여기도 널 값 허용 여부 적어주긴 했어!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

이것두 널러블 추가할게!

private final MissionService missionService;

// 미션 목록 조회 (페이징)
@GetMapping
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 뒤에 경로를 적어줘

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

컨트롤러가 아직 어색하네... 다시 공부해보면서 적어볼게 땡큐


@RestController
@RequiredArgsConstructor
@RequestMapping("/api/users/{userId}/missions")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MissionController 내부의 모든 경로에 공통적으로 있는 경로만 적어줘

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

부모 경로만 적으라는거지? 땡쿠!!


// 미션 목록 조회 (페이징)
@GetMapping
public ApiResponse<MissionListResDTO> getMissions(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@RequestParam(name = "status") Status status
난 이런식으로 진행중 / 완료 인지 구분했는데 구분짓는 것도 구현해줭

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

그렇네 진행 상태 확인하는 부분도 확실히 잡고 가야겠다


return ApiResponse.onSuccess(GeneralSuccessCode.OK, response);
}
} No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

미션 도전하기, 미션 성공 인증, 내 미션 목록 조회에 대한 매핑도 만들어줘

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

오케이... 추가할게 많지 ㅜㅜ 고마워


private String content;

@OneToOne
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One2One으로 하면 한 댓글에 답글을 하나밖에 못다니까 ManyToOne으로 하는게 좋아

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

매핑관계 신경쓸게 고마워!!

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.

3 participants