Skip to content

Conversation

@yongjun0511
Copy link
Collaborator

No description provided.

JjungminLee and others added 9 commits November 22, 2025 20:25
* fix: 리뷰 리스트 속 아이템의 별점이 평점이 아닌 그 리뷰의 별점을 반환하도록 수정

* fix: 리뷰 리스트가 메뉴에 대한 리뷰 + 밀에 대한 리뷰를 합쳐서 반환하도록 수정

* fix: menu reviewlist에서 rating이 없을시 mainrating을 내보내도록 수정

* fix: meal list에서도 rating, 없을시 mainrating을 내보내도록 수정
* fix: [POST] /reviews/write/{menuID} List<String>으로 변경

* fix: List String으로 바꾸는 것 불요하여 원상 복귀
* feat: 기능 구현

* chore: enum 대문자화

* fix: 오타 정정

---------

Co-authored-by: 나용준 <[email protected]>
@yongjun0511 yongjun0511 self-assigned this Dec 21, 2025
@yongjun0511 yongjun0511 merged commit d96b2ef into main Dec 21, 2025
1 check passed
@gemini-code-assist
Copy link

Summary of Changes

Hello @yongjun0511, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 카카오 및 애플 로그인 시스템의 V2 버전을 도입하여 기기 유형 정보를 통합하고 사용자 관리를 개선합니다. 또한, 식사 관련 리뷰 표시 로직에 대한 중요한 리팩토링 및 개선 사항을 포함하여 더 정확한 평점 계산 및 데이터 검색을 보장합니다. 추가적으로, 슬랙 채널 이름이 업데이트되었고 기존 문의 시스템은 사용 중단되었습니다.

Highlights

  • 로그인 V2 구현: 카카오 및 애플 로그인에 대한 V2 엔드포인트와 DTO(AppleLoginRequestV2, KakaoLoginRequestV2)가 추가되었습니다. 이 V2 요청에는 DeviceType 정보가 포함되며, SecurityConfigJwtAuthenticationFilter에서 새로운 엔드포인트가 화이트리스트에 추가되었습니다. OAuthServiceDeviceType을 활용하여 사용자를 가입시키거나 기존 사용자를 업데이트하는 kakaoLoginV2appleLoginV2 메서드를 포함하도록 업데이트되었습니다.
  • 기기 유형(DeviceType) 통합: 새로운 DeviceType 열거형이 추가되었으며, User 엔티티에 deviceType 필드가 포함되도록 업데이트되었습니다. CustomUserDetailsUserPrincipalDto도 이 정보를 전달하도록 수정되었고, ControllerLogAspect는 요청 로깅에 deviceType을 포함하도록 업데이트되었습니다.
  • 리뷰 시스템 개선: MealReviewResponseReviewDetail DTO에서 평점(rating)의 타입이 Double에서 Integer로 변경되었고, Review 엔티티에서 평점을 더 정확하게 해석하도록 로직이 개선되었습니다. ReviewServiceV2는 식사와 관련된 리뷰(식사 내 개별 메뉴 리뷰 포함)를 가져오기 위해 새로운 reviewRepository 메서드(findAllMealAndMenuReviews, findMealAndMenuReviews)를 사용하도록 리팩토링되었습니다.
  • 슬랙 채널 및 문의 시스템 업데이트: SlackChannel 열거형에서 #신고 채널명이 #01-신고로 변경되었고, #메뉴_추가#장애 채널이 제거되었습니다. 또한, InquiryController는 문의 시스템이 카카오톡으로 이전됨에 따라 @Deprecated 처리되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


새로운 로그인, 기기 유형도 함께 오네, 리뷰는 더 정확히.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이번 PR은 로그인 v2를 도입하여 사용자의 디바이스 타입(IOS/ANDROID)을 수집하고, 이를 인증 및 로깅 과정에 통합하는 변경 사항을 포함하고 있습니다. 또한, 리뷰 관련 로직을 리팩토링하고 Slack 채널명을 변경하는 등 여러 개선 사항이 있습니다. 전반적으로 기능 확장을 위한 좋은 시도이지만, 몇 가지 코드 중복, 스타일 가이드 위반, 잠재적 버그 등이 발견되었습니다. 아래 리뷰 코멘트를 확인하고 수정하여 코드 품질을 더욱 향상시키는 것을 권장합니다.

Comment on lines 61 to +63
public static MealReviewResponse from(Review review,
Long userId,
List<ValidMenuForViewResponse.MenuDto> validMenus,Double rating) {
List<ValidMenuForViewResponse.MenuDto> validMenus, Integer rating) {

Choose a reason for hiding this comment

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

high

from 메소드의 rating 파라미터가 사용되지 않고 있습니다. 메소드 내부에서 resolvedRating이라는 변수를 새로 계산하여 사용하고 있어, rating 파라미터는 혼란을 야기할 수 있습니다. 이 파라미터를 메소드 시그니처에서 제거하고, 호출하는 부분(ReviewServiceV2:216)도 함께 수정하는 것을 권장합니다.

Suggested change
public static MealReviewResponse from(Review review,
Long userId,
List<ValidMenuForViewResponse.MenuDto> validMenus,Double rating) {
List<ValidMenuForViewResponse.MenuDto> validMenus, Integer rating) {
public static MealReviewResponse from(Review review,
Long userId,
List<ValidMenuForViewResponse.MenuDto> validMenus) {

}

Integer likeCount = Optional.ofNullable(menus)
Integer likeCount = Optional.of(menus)

Choose a reason for hiding this comment

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

high

Optional.ofNullableOptional.of로 변경하면 menus가 null일 경우 NullPointerException이 발생할 수 있습니다. ofNullable이 더 안전한 선택입니다. 더 좋은 방법은 mealMenuRepository가 null을 반환하지 않는다고 가정하고 Optional 래퍼를 완전히 제거하는 것입니다. 하지만 현재 변경 사항만 고려했을 때는 ofNullable로 되돌리는 것이 좋습니다.

Suggested change
Integer likeCount = Optional.of(menus)
Integer likeCount = Optional.ofNullable(menus)

import ssu.eatssu.domain.auth.dto.AppleLoginRequest;
import ssu.eatssu.domain.auth.dto.KakaoLoginRequest;
import ssu.eatssu.domain.auth.dto.ValidRequest;
import ssu.eatssu.domain.auth.dto.*;

Choose a reason for hiding this comment

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

medium

리포지토리 스타일 가이드 3번 규칙에 따라 와일드카드(*)를 사용한 임포트는 지양해야 합니다. 필요한 클래스를 명시적으로 임포트하여 코드의 가독성과 명확성을 높이는 것이 좋습니다.

Suggested change
import ssu.eatssu.domain.auth.dto.*;
import ssu.eatssu.domain.auth.dto.AppleLoginRequest;
import ssu.eatssu.domain.auth.dto.AppleLoginRequestV2;
import ssu.eatssu.domain.auth.dto.KakaoLoginRequest;
import ssu.eatssu.domain.auth.dto.KakaoLoginRequestV2;
import ssu.eatssu.domain.auth.dto.ValidRequest;
References
  1. Do not use wildcard when importing libraries (link)


private final OAuthService oauthService;

// TODO : 로그인 & 회원 가입 마이그레이션 이후에 지울 것.

Choose a reason for hiding this comment

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

medium

리포지토리 스타일 가이드 7, 8, 9번 규칙에 따라 TODO 주석을 작성해야 합니다. 주석은 한 줄로 작성하고, 작성자 이름과 날짜를 포함하며, FIX ME 형식을 사용하는 것을 권장합니다. 예를 들어, // FIXME(author, yyyy-MM-dd): 로그인 & 회원 가입 마이그레이션 이후에 지울 것.과 같이 수정할 수 있습니다. 69번 라인의 TODO 주석도 동일하게 수정이 필요합니다.

References
  1. Comments should be written in a single line whenever possible. (link)
  2. Each comment must include the author's name and the date. (link)
  3. Use IntelliJ's default FIX ME comment format. (link)

Comment on lines +60 to +64
long startTime = System.currentTimeMillis();
Tokens tokens = oauthService.kakaoLoginV2(request);
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
log.info("OAuthWarmupRunner 완료 - 소요 시간: {} ms", duration);

Choose a reason for hiding this comment

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

medium

System.currentTimeMillis()를 사용한 성능 측정 코드가 포함되어 있습니다. 이러한 코드는 보통 개발 및 디버깅 단계에서 임시로 사용되며, 프로덕션 코드에 포함되는 것은 바람직하지 않습니다. 만약 성능 측정이 필요하다면 AOP 등을 활용하여 공통 로직으로 분리하는 것을 고려해볼 수 있습니다. appleLoginV2 메소드에는 해당 코드가 없는 것으로 보아 일관성도 부족해 보입니다. 이 코드를 제거하는 것을 제안합니다.

Suggested change
long startTime = System.currentTimeMillis();
Tokens tokens = oauthService.kakaoLoginV2(request);
long endTime = System.currentTimeMillis();
long duration = endTime - startTime;
log.info("OAuthWarmupRunner 완료 - 소요 시간: {} ms", duration);
Tokens tokens = oauthService.kakaoLoginV2(request);

Comment on lines +49 to +51
if (user.getDeviceType() == null) {
user.updateDeviceType(request.deviceType());
}

Choose a reason for hiding this comment

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

medium

kakaoLoginV2appleLoginV2 메소드에 deviceType을 업데이트하는 로직이 중복됩니다. 중복을 제거하고 코드 재사용성을 높이기 위해 이 로직을 별도의 private 메소드로 추출하는 것을 고려해 보세요. 예를 들어, updateDeviceTypeIfNull(User user, DeviceType deviceType)와 같은 메소드를 만들어 사용할 수 있습니다. 79-81 라인에도 동일한 코드가 있습니다.

Comment on lines +82 to +84
// TODO : 회원 가입 V2 마이그레이션 이후 삭제.
// 기본 생성자 : DeviceType을 Null로 받고 있는데 마이그레이션 이후 기본 생성자도 NotNull 붙이기.
// admin 정적 펙토리 : 여기도 null 넣는 부분 바꿔주기.

Choose a reason for hiding this comment

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

medium

리포지토리 스타일 가이드 7, 8, 9번 규칙에 따라 TODO 주석을 작성해야 합니다. 주석은 한 줄로 작성하고, 작성자 이름과 날짜를 포함하며, FIX ME 형식을 사용하는 것을 권장합니다. 여러 줄에 걸쳐 작성된 TODO를 규칙에 맞게 수정해주세요.

References
  1. Comments should be written in a single line whenever possible. (link)
  2. Each comment must include the author's name and the date. (link)
  3. Use IntelliJ's default FIX ME comment format. (link)

Comment on lines +309 to +310
// .filter(menu -> !MenuFilterUtil.isExcludedFromReview(
// menu.getName()))

Choose a reason for hiding this comment

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

medium

주석 처리된 코드가 남아있습니다. 사용하지 않는 코드는 혼란을 줄 수 있으므로 제거하는 것이 좋습니다.

ADDMENU_CHANNEL("#메뉴_추가"),
ERROR_CHANNEL("#장애"),
REPORT_CHANNEL("#01-신고"),
// TODO: 회의에서 제안 후 삭제한다

Choose a reason for hiding this comment

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

medium

리포지토리 스타일 가이드 8, 9번 규칙에 따라 TODO 주석을 작성해야 합니다. 주석에 작성자 이름과 날짜를 포함하고, FIX ME 형식을 사용하는 것을 권장합니다. 예를 들어, // FIXME(author, yyyy-MM-dd): 회의에서 제안 후 삭제한다와 같이 수정할 수 있습니다.

References
  1. Each comment must include the author's name and the date. (link)
  2. Use IntelliJ's default FIX ME comment format. (link)

Comment on lines 120 to +139
private String getUserIdFromSecurityContext() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated() && authentication.getPrincipal() instanceof CustomUserDetails) {
CustomUserDetails userDetails = (CustomUserDetails) authentication.getPrincipal();
if (authentication != null && authentication.isAuthenticated() &&
authentication.getPrincipal() instanceof CustomUserDetails userDetails) {
return String.valueOf(userDetails.getId());
}
return "anonymous";
}

private String getDeviceTypeFromSecurityContext() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null && authentication.isAuthenticated() &&
authentication.getPrincipal() instanceof CustomUserDetails userDetails) {

return userDetails.getDeviceType() != null
? userDetails.getDeviceType().name()
: "null";
}
return "unknown";
}

Choose a reason for hiding this comment

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

medium

getUserIdFromSecurityContext 메소드와 getDeviceTypeFromSecurityContext 메소드에서 SecurityContextHolder로부터 Authentication 객체를 가져오고 CustomUserDetails로 캐스팅하는 로직이 중복됩니다. 이 중복을 제거하기 위해 CustomUserDetails를 반환하는 private 헬퍼 메소드를 만드는 것을 고려해 보세요. 예를 들어, private Optional<CustomUserDetails> getCustomUserDetails()와 같은 메소드를 만들어 사용할 수 있습니다.

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.

4 participants