Skip to content

Develop - #55

Merged
jaebeom79 merged 37 commits into
mainfrom
develop
May 10, 2026
Merged

Develop#55
jaebeom79 merged 37 commits into
mainfrom
develop

Conversation

@jaebeom79

Copy link
Copy Markdown
Contributor

📢 기능 설명

  • 매장 CRUD
  • 메뉴 CRUD
  • 예약 CRUD
  • 쿠폰 생성 및 발급
  • 매장 즐겨찾기
  • AI 챗봇
  • 소셜 로그인(google)
  • CI/CD

silkair and others added 30 commits April 27, 2026 13:14
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/#44 google login

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

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.

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)));

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.

high

getMyNotifications 메서드에서 resolveStoreName을 호출할 때 N+1 문제가 발생합니다. 페이지네이션으로 가져온 각 알림마다 Store 또는 Reservation을 조회하는 쿼리가 추가로 실행되어 성능 저하를 유발합니다. 알림 생성 시점에 상점 이름을 엔티티에 포함하여 저장하거나, 조회 시점에 필요한 정보를 조인 또는 벌크 조회를 통해 가져오도록 개선이 필요합니다.

public class FileService {

private static final String UPLOAD_DIR = "uploads";
private static final String BASE_URL = "http://localhost:8080";

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.

medium

BASE_URLhttp://localhost:8080으로 하드코딩되어 있습니다. 이는 로컬 환경에서만 유효하며, 실제 배포 환경(운영, 스테이징 등)에서는 클라이언트가 파일에 접근할 수 없는 문제를 야기합니다. @Value를 사용하여 설정 파일에서 환경별로 다른 URL을 주입받도록 수정해야 합니다.

Comment on lines +114 to +120

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);

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.

medium

중복 닉네임 처리 시 랜덤 문자열을 한 번만 추가하고 있어, 드문 확률로 다시 중복이 발생할 경우 유일성이 보장되지 않습니다. 중복되지 않는 닉네임이 생성될 때까지 반복 확인하는 로직을 도입하여 안정성을 확보하는 것이 좋습니다.

Suggested change
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);

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.

medium

setAllowCredentials(true)를 설정한 상태에서 allowedOrigins*(와일드카드)가 포함되면 브라우저의 CORS 정책 위반으로 에러가 발생합니다. 설정 파일(spring.cors.allowed-origins)에 와일드카드가 들어가지 않도록 주의하거나, setAllowedOriginPatterns를 사용하여 안전하게 와일드카드를 허용하는 방식을 권장합니다.

@jaebeom79
jaebeom79 merged commit f7431bd into main May 10, 2026
1 check passed
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