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

[Feat] 마이페이지 구현 #32

Merged
merged 11 commits into from
Mar 21, 2024
Merged

[Feat] 마이페이지 구현 #32

merged 11 commits into from
Mar 21, 2024

Conversation

Ahyun0326
Copy link
Collaborator

@Ahyun0326 Ahyun0326 commented Mar 21, 2024

closes #17

@Ahyun0326 Ahyun0326 added the feature New feature label Mar 21, 2024
@Ahyun0326 Ahyun0326 self-assigned this Mar 21, 2024
Copy link
Member

Choose a reason for hiding this comment

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

오 로우 쿼리로 mySQL에서 넣으려 했는데, 코드로 넣어버리니까 훨씬 간편해졌네요~! 감사합니다

Comment on lines +47 to +58
try {
if (userRepo.findByKakaoId(kakao_uid) == null) return MyInterestResponseDto.notExistedUser();
List<Interests> findInterests = interestsRepo.findAllByUserId(kakao_uid);
if ((interests.size() > 3) || (findInterests.size() > 0)) return MyInterestResponseDto.inputFailed();

for (Long categoryId : interests) {
// 사용자의 관심사 3개를 interestsRepo에 저장한다.
// 1. CategoryRepo에서 사용자가 선택한 interests에 해당되는 관심사 조회
Optional<Category> category = categoryRepo.findById(categoryId);
if (!category.isPresent()) { // 존재하지 않는 카테고리일 경우
return MyInterestResponseDto.databaseError();
}
Copy link
Member

Choose a reason for hiding this comment

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

꼼꼼한 예외처리 아주 좋아요👍

@Ahyun0326 Ahyun0326 merged commit c51573d into develop Mar 21, 2024
@chaeeun-Han chaeeun-Han deleted the feature/17 branch April 4, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants