Conversation
Feat : 예약 상태 방문 완료 추가 및 예약 상태 변경 api 구현, 내 빈자리 알림 조회 매장 id 추가
Feat : 알림 api 구현(알림 생성, 알림 조회, 알림 읽기)
# Conflicts: # src/main/java/com/catchtable/global/common/SuccessCode.java # src/main/java/com/catchtable/global/exception/ErrorCode.java # src/main/java/com/catchtable/vacancy/repository/VacancyRepository.java # src/main/java/com/catchtable/vacancy/service/VacancyService.java
Feat/coupon read
Feat/#44 google login
Feat/#48 pg test api
Feat: github actions 설정
There was a problem hiding this comment.
Code Review
This pull request introduces a robust authentication system using JWT and Google OAuth2, implements a payment verification flow with PortOne, and adds an event-driven in-app notification system. It also enhances store discovery with PostGIS-based nearby searches and popularity-based sorting, while updating the deployment infrastructure with Nginx and Certbot. The review feedback highlights critical performance and configuration improvements, specifically addressing N+1 query issues in notification services, the need to externalize hardcoded environment variables in file handling, ensuring nickname uniqueness through retry logic, and correcting potential CORS policy violations in the security configuration.
| @Transactional(readOnly = true) | ||
| public Page<NotificationListResponse> getMyNotifications(Long userId, Pageable pageable) { | ||
| return notificationRepository.findByUserIdAndIsDeletedFalse(userId, pageable) | ||
| .map(notification -> new NotificationListResponse(notification, resolveStoreName(notification))); |
| public class FileService { | ||
|
|
||
| private static final String UPLOAD_DIR = "uploads"; | ||
| private static final String BASE_URL = "http://localhost:8080"; |
|
|
||
| private String generateUniqueNickname(String baseName) { | ||
| String nickname = baseName != null ? baseName : "user"; | ||
| if (!userRepository.existsByNickname(nickname)) { | ||
| return nickname; | ||
| } | ||
| return nickname + "_" + UUID.randomUUID().toString().substring(0, 6); |
There was a problem hiding this comment.
중복 닉네임 처리 시 랜덤 문자열을 한 번만 추가하고 있어, 드문 확률로 다시 중복이 발생할 경우 유일성이 보장되지 않습니다. 중복되지 않는 닉네임이 생성될 때까지 반복 확인하는 로직을 도입하여 안정성을 확보하는 것이 좋습니다.
| private String generateUniqueNickname(String baseName) { | |
| String nickname = baseName != null ? baseName : "user"; | |
| if (!userRepository.existsByNickname(nickname)) { | |
| return nickname; | |
| } | |
| return nickname + "_" + UUID.randomUUID().toString().substring(0, 6); | |
| private String generateUniqueNickname(String baseName) { | |
| String nickname = baseName != null ? baseName : "user"; | |
| String uniqueNickname = nickname; | |
| while (userRepository.existsByNickname(uniqueNickname)) { | |
| uniqueNickname = nickname + "_" + UUID.randomUUID().toString().substring(0, 6); | |
| } | |
| return uniqueNickname; | |
| } |
| config.setAllowedOrigins(List.of(allowedOrigins.split(","))); | ||
| config.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")); | ||
| config.setAllowedHeaders(List.of("*")); | ||
| config.setAllowCredentials(true); |
📢 기능 설명