-
Notifications
You must be signed in to change notification settings - Fork 0
[Release] V2.0.0 제휴지도 배포 #209
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
Conversation
* feat: 리뷰 좋아요, 싫어요 API 삭제 * feat: 리뷰v2 uri 직관적으로 네이밍 수정 * feat: dev, prod에서만 서버에러 슬랙 알림가게 수정 * feat: menu에 대한 리뷰리스트 조회 추가 * feat: likeCount, alias 제거 * feat: menu에 대한 리뷰 추가 * chore: 내가 쓴 리뷰 조회 user -> review로 위치 이동 * feat: /statistics/menu api 조회시 npe 나는 문제 해결 * feat: ReviewMenuRepository 원복 * feat: meal, menu 정보 조회 시 menuName / menuNames null로 나오는 문제 해결 * feat: 좋아요, 싫어요 산정 기준에 맞춰서 로직 변경 * feat: /users/reviews NPE 문제 나는 부분 예외처리 * feat: 마이페이지 좋아한 메뉴 칩 추가되게 dto, 로직 일괄 변경 * feat: 특정 메뉴 리스트 조회 로직 변경
hotfix: 배포 파이프라인 문제 발생
feat: .gitignore 및 코드컨벤션에 맞는 AI Rules 작성
* feat: 테스트 코드 구조 개선 및 OAuthService 테스트 케이스 추가 - 기존 `OauthServiceTest` 및 Apple 관련 Mock 클래스 제거 - `OAuthServiceUnitTest` 작성으로 단위 테스트 강화 - 테스트 프로필 활성화를 위한 설정 및 application.yml 정리 - 테스트 환경(application-test.yml) 개선 - 빌드 환경 관련 build.gradle 의존성 간소화 및 필요한 테스트 의존성 추가 * feat: Tokens 클래스 리팩토링 및 OAuthService 테스트 추가 - Tokens 클래스를 record로 변경하여 간결하게 리팩토링 - OAuthService에 대한 통합 테스트 추가 - 기존 OAuthServiceUnitTest 파일 삭제 및 테스트 구조 개선 - GitHub Actions에서 테스트 환경 설정 강화 * fix: 변수를 거치지 않고 리턴하게 코드 수정 Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
* feat: Gemini 설정 및 스타일 가이드 문서 추가 * fix: 영어 문법 수정 * feat: Copilot 지침 및 주석, 테스트 코드 규칙 추가
* feat: 리뷰 리스트 조회시 싫어요 제거 * feat: 싫어요 관련 필드 일괄 삭제 * feat: menu에 대한 리뷰에도 좋아요 기능 추가 * feat: 전체 메뉴 칩 필드 추가 * feat: my페이지 menu name 조회되게 추가 * feat: 마이페이지 전체 메뉴칩 npe 예외처리 * feat: mypage review dto 코드 포멧팅 * feat: 리뷰에 제외되는 메뉴 조회 api 개발 * feat: 단일메뉴 작성 transactional 어노테이션 추가 * feat: gemini pr 리뷰에 맞춰 수정
* feat: 전체조회 API에 좋아요 수 필드 추가 * feat: 음식점 좋아요 했는지 필드 추가: * feat: PartnershipRestaurant 엔티티 추가 * feat: 식당<->단과대 n:m 매핑테이블을 Partnership으로 변경 * feat: 식당별 제휴 조회로 수정 * feat: gemini 리뷰 바탕으로 수정 * feat: 제휴 등록 로직 일괄 수정 * feat: likes 리스트 초기화
* feat: whitelist uri는 토큰 유효성 검사 제외하게끔 변경 * feat: partnership url whitelist에서 제거 및 filter jwt 예외처리 추가
* chore: reformat code * feat: jwt 토큰 만료 로직 개선 및 화이트 리스트 필터 로직 일괄 수정 * feat: SlackErrorNotifier로 슬랙에러 알림 클래스 통합 * feat: 슬랙알림 메시지 null 나오는 문제 수정 * chore: local 알림 메시지 삭제
* feat: 개별제휴 조회 API 삭제 * feat: slack 알림 local에서도 나가는 문제 수정 * feat: 학과기입여부 API 삭제 * feat: 유저 학과조회 API에 학과가 없으면 빈문자열 return하게끔 수정 * feat: [gemini] - 슬랙 알림 에러 메시지 생성 로직 개선 * feat: [gemini] - 학과 조회 삼항연산자로 로직 개선
* fix: Java Toolchain 설정 추가 (Java 17) * fix: Java 17 소스 호환성 설정 제거
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @JjungminLee, 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!
This pull request introduces a major overhaul of the partnership map feature and a new version of the review system, aligning with a V2.0.0 release. It also includes significant enhancements to security, error handling, and development practices through new AI guidelines and refined build configurations.
Highlights
- Partnership Map System Rearchitecture: The core
PartnershipandPartnershipRestaurantentities have been redesigned for improved data modeling and flexibility. Partnership details (store info, location) are now centralized inPartnershipRestaurant, with individualPartnershipentries linking to these restaurants. Liking functionality has also been shifted to thePartnershipRestaurantlevel. - Introduction of Review System V2: A new version of the review system is implemented, featuring separate API endpoints and service logic for managing reviews of
Meal(variable menus) andMenu(fixed menus). This includes new DTOs for review creation and detailed responses, as well as refined calculations for review statistics. - Enhanced Security and Error Handling: The JWT authentication filter is improved to directly handle unauthorized token access, providing more specific error responses and integrating Slack notifications for invalid tokens. Global exception handling is also refined with Slack error notification.
- Standardized AI Assistant Guidelines: New Markdown files are introduced to provide consistent instructions and conventions for AI code assistants (Copilot, Claude, Gemini), aiming to improve code quality and review processes.
- Configuration and Build System Updates: The project's build configuration is updated to explicitly use Java 17. Development environment JWT token validity periods are significantly shortened for faster iteration, and
.gitignoreis adjusted to properly track new guideline files.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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 or fill out our survey to provide feedback.
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.
A map of partnerships, new and grand, Reviews now flow, across the land. With code refactored, clean and bright, Version two takes its joyful flight.
Footnotes
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
V2.0.0 제휴지도 배포를 위한 대규모 업데이트로 보입니다. 전반적으로 제휴 관련 도메인의 구조가 크게 변경되었고, 리뷰 시스템도 V2로 개편되었습니다. 또한 코드 포맷팅과 의존성 관리 방식이 개선되었습니다. 몇 가지 중요한 변경사항과 잠재적인 이슈에 대해 리뷰를 남겼으니 확인 부탁드립니다. 특히 JwtAuthenticationFilter의 변경 사항은 보안 및 유지보수 측면에서 중요하므로 반드시 검토가 필요합니다.
| @Override | ||
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | ||
| throws IOException, ServletException { | ||
| HttpServletRequest httpRequest = (HttpServletRequest) request; | ||
| HttpServletResponse httpResponse = (HttpServletResponse) response; | ||
| String requestURI = httpRequest.getRequestURI(); | ||
|
|
||
| if (isWhiteListed(requestURI)) { | ||
| chain.doFilter(request, response); | ||
| return; | ||
| } | ||
|
|
||
| String token = resolveToken(httpRequest); | ||
|
|
||
| if (token == null) { | ||
| httpResponse.setStatus(HttpStatus.UNAUTHORIZED.value()); | ||
| httpResponse.setContentType("application/json;charset=UTF-8"); | ||
| httpResponse.setCharacterEncoding("UTF-8"); | ||
| httpResponse.getWriter().write("{\"success\":false,\"code\":401,\"message\":\"유효하지 않은 토큰입니다.\"}"); | ||
| return; | ||
| } | ||
|
|
||
| if (!jwtTokenProvider.validateToken(token)) { | ||
| log.warn("토큰 유효하지 않음: {}", requestURI); | ||
| httpResponse.setStatus(HttpStatus.UNAUTHORIZED.value()); | ||
| httpResponse.setContentType("application/json;charset=UTF-8"); | ||
| httpResponse.setCharacterEncoding("UTF-8"); | ||
| httpResponse.getWriter().write("{\"success\":false,\"code\":401,\"message\":\"유효하지 않은 토큰입니다.\"}"); | ||
| slackErrorNotifier.notify(new BaseException(BaseResponseStatus.INVALID_TOKEN)); | ||
| return; | ||
| } | ||
|
|
||
| Authentication authentication = jwtTokenProvider.getAuthentication(token); | ||
| SecurityContextHolder.getContext().setAuthentication(authentication); | ||
|
|
||
| chain.doFilter(request, response); | ||
| } | ||
|
|
||
| private boolean isWhiteListed(String requestURI) { | ||
| return AUTH_WHITELIST.stream().anyMatch(pattern -> pathMatcher.match(pattern, requestURI)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JwtAuthenticationFilter 내부에 AUTH_WHITELIST를 정의하고 요청 URI를 직접 확인하여 토큰 검증을 건너뛰는 로직이 추가되었습니다. 이는 Spring Security의 SecurityConfig에 설정된 인가 규칙과 중복되며, 필터 체인의 동작 방식을 우회하는 위험한 구현입니다. 모든 인증/인가 규칙은 SecurityConfig에서 중앙 관리하는 것이 바람직합니다. 이 필터는 토큰을 추출하고 유효성을 검증하는 책임만 가져야 합니다. 현재 구조는 유지보수를 어렵게 하고 예상치 못한 보안 문제를 야기할 수 있습니다.
| private Integer likeCount = 0; | ||
|
|
||
| @Column(name = "unlike_count") | ||
| private final Integer unlikeCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // FIXME: 같은 이메일로 카카오, 애플 등 여러 회원가입을 한 회원 처리 필요. | ||
| // 사용자는 같은 이메일로 로그인을 진행했을 시 같은 계정에 접근하기를 원함. | ||
| // iPhone을 사용하는 사용자들에서만 한함. | ||
| // 하지만 private relay를 사용하는 경우도 있는데, 이럴 때는 사용자의 계정을 묶기 다소 복잡하다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FIXME 주석으로 중요한 비즈니스 로직(여러 소셜 로그인 계정 통합)에 대한 고민을 남겨주신 점이 좋습니다. 스타일 가이드에 따라 // FIXME (author, yyyy-MM-dd): content 형식의 한 줄 주석으로 수정하는 것을 권장합니다.12
Style Guide References
| // FIXME: 같은 이메일로 카카오, 애플 등 여러 회원가입을 한 회원 처리 필요. | |
| // 사용자는 같은 이메일로 로그인을 진행했을 시 같은 계정에 접근하기를 원함. | |
| // iPhone을 사용하는 사용자들에서만 한함. | |
| // 하지만 private relay를 사용하는 경우도 있는데, 이럴 때는 사용자의 계정을 묶기 다소 복잡하다. | |
| // FIXME (author, 2024-05-24): 같은 이메일로 여러 소셜 로그인을 사용하는 경우 계정 통합 정책 필요 |
Footnotes
| @Transactional | ||
| public void createPartnership(CreatePartnershipRequest request) { | ||
| PartnershipRestaurant partnershipRestaurant = partnerShipRestaurantRepository.findById(request.getStoreId()) | ||
| .orElseThrow(() -> new BaseException( | ||
| NOT_FOUND_PARTNERSHIP_RESTAURANT)); | ||
| Partnership partnership = request.toPartnershipEntity(partnershipRestaurant); | ||
|
|
||
| College college = collegeRepository.findByName(request.getCollege()) | ||
| .orElseThrow(() -> new BaseException(NOT_FOUND_COLLEGE)); | ||
| partnership.setPartnershipCollege(college); | ||
| Department department = departmentRepository.findByName(request.getDepartment()) | ||
| .orElseThrow(() -> new BaseException(NOT_FOUND_DEPARTMENT)); | ||
| partnership.setPartnershipDepartment(department); | ||
| partnershipRepository.save(partnership); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제휴(Partnership) 관련 도메인 모델이 크게 변경되었습니다. 기존에는 하나의 제휴가 여러 단과대/학과에 연결될 수 있었지만, 변경된 모델에서는 하나의 제휴가 하나의 단과대와 하나의 학과에만 연결되는 것으로 보입니다. 또한, 사용자가 '찜'하는 대상이 개별 제휴(Partnership)에서 제휴 업체(PartnershipRestaurant)로 변경되었습니다. 이러한 구조 변경이 모든 비즈니스 요구사항을 충족하는지 다시 한번 확인하는 것이 좋겠습니다. 예를 들어, "IT대 또는 컴퓨터학부 학생 대상 10% 할인"과 같은 복합적인 제휴 조건을 표현할 수 있는지 검토가 필요합니다.
| @@ -1,35 +1,34 @@ | |||
| package ssu.eatssu.domain.admin.service; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,12 @@ | |||
| package ssu.eatssu.domain.admin.controller; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,12 +1,12 @@ | |||
| package ssu.eatssu.domain.admin.dto; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,9 +1,9 @@ | |||
| package ssu.eatssu.domain.admin.dto; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,14 +1,14 @@ | |||
| package ssu.eatssu.domain.admin.dto; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| package ssu.eatssu.domain.admin.dto; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.