Skip to content

Conversation

@ggamnunq
Copy link
Contributor

@ggamnunq ggamnunq commented Sep 5, 2025

명소 위경도

  • 소수점 5자리까지 저장하도록 로직 수정
  • 테이블 정의 수정

축제 정보

  • 축제 시작일/종료일 정보 중 시간 제거
  • 축제 시작일/종료일 뒤바뀌는 문제 해결
  • 축제 정규식 개선 -> 최대한 많은 축제 추가할 수 있도록 수정

이미지

  • 이미지 반환값 "" -> null. nullIfBlank() 메서드 작성
  • 장소 이미지 검증 로직 작성 ( url http 요청 보내 검증, 아직 적용 x )
  • 검색 API 응답값 img_url 추가
  • TourAPI의 이미지정보조회API 조회하여 더 많은 이미지 저장할 수 있도록 추가 로직 작성

Summary by CodeRabbit

  • New Features

    • Search results and festival/place lists now show image thumbnails when available.
    • Admin data import for festivals and places supports pagination.
    • Clearer error shown when festival duration information is invalid.
  • Bug Fixes

    • Blank image URLs are filtered out; image fields return null instead of empty strings.
    • More accurate festival status and date handling for ongoing/upcoming/complete views.
    • Improved location accuracy with higher-precision coordinates.
  • Refactor

    • Standardized festival date parsing and display (yyyy.MM.dd) using modern date handling.

@ggamnunq ggamnunq self-assigned this Sep 5, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 5, 2025

Walkthrough

Refactors festival dates to LocalDate, removes status usage, and centralizes date formatting via FestivalDateUtil. Adds image URL utilities and propagates imgUrl into search and home/place responses. Introduces Tour API pagination and image-fetching for places, adjusts controllers/services accordingly, and adds new DTOs and error status. Minor repository and logging changes.

Changes

Cohort / File(s) Summary
Domain models & enums
src/main/kotlin/busanVibe/busan/domain/festival/domain/Festival.kt, .../festival/enums/FestivalStatus.kt, .../place/domain/Place.kt, .../global/apiPayload/code/status/ErrorStatus.kt
Festival start/end switched from Date to LocalDate?, columns now nullable; status field removed. FestivalStatus drops UNKNOWN. Place latitude/longitude columns now decimal(38,5). New error code FESTIVAL_DURATION_INVALID added.
Date utilities & converters
.../festival/util/FestivalDateUtil.kt, .../festival/converter/FestivalConverter.kt, .../tourApi/util/TourFestivalConverter.kt
FestivalDateUtil.removeTime now LocalDate? -> String with formatter and null-safe empty string. FestivalConverter uses FestivalDateUtil and removes internal Date formatter. TourFestivalConverter reworks parsing to LocalDate, normalizes ranges, removes status derivation, expands parsing helpers.
Festival repository & service
.../festival/repository/FestivalRepository.kt, .../festival/service/FestivalQueryService.kt
Removed repository method getFestivalList(status). Service now fetches all and filters in-memory by status using LocalDate.now(). Details use FestivalDateUtil.
Search DTOs and mapping
.../search/dto/SearchResultDTO.kt, .../search/util/SearchUtil.kt
Search InfoDto adds imgUrl: String?. Mapping updated: festival/places include imgUrl; dates use FestivalDateUtil; end check uses LocalDate; place imgUrl nullIfBlank.
Place image utilities and services
.../place/util/PlaceImageUtil.kt, .../place/service/PlaceQueryService.kt, .../place/service/PlaceCongestionQueryService.kt, .../home/service/HomeQueryService.kt
New utilities: String?.nullIfBlank(), checkImageUrl(url). Place/query/home map image URLs through nullIfBlank; congestion default filters out blank image URLs; removed some logs.
Tour API controller & services
.../tourApi/controller/TourAPIController.kt, .../tourApi/service/TourCommandService.kt
Controller methods now accept pageColumns/page and pass to service; place save mapping annotation removed/commented. Services: syncFestivalsFromApi(pageSize,pageNum); getPlace(placeType,pageSize,pageNum). Places: fetch extra images, round coords, aggregate images, batch save per item.
Tour API utilities & DTOs
.../tourApi/util/TourFestivalUtil.kt, .../tourApi/util/TourPlaceUtil.kt, .../tourApi/dto/TourPlaceImagesDTO.kt
getFestivals now takes pageSize/pageNum. TourPlaceUtil.getPlace takes pagination; new getImages(contentId) calling detailImage2. New DTOs for place image API responses.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant FestSvc as FestivalQueryService
  participant Repo as FestivalRepository

  Client->>FestSvc: getFestivalList(status)
  FestSvc->>Repo: findAll()
  Repo-->>FestSvc: List<Festival>
  Note over FestSvc: today = LocalDate.now()
  alt status == ALL
    FestSvc-->>Client: all festivals
  else status == UPCOMING
    FestSvc-->>Client: start != null && today < start
  else status == IN_PROGRESS
    FestSvc-->>Client: start/end != null && start <= today <= end
  else status == COMPLETE
    FestSvc-->>Client: end != null && today > end
  end
Loading
sequenceDiagram
  participant Client as TourAPIController
  participant Cmd as TourCommandService
  participant PlaceAPI as TourPlaceUtil
  participant Repo as PlaceRepository

  Client->>Cmd: getPlace(placeType, pageSize, pageNum)
  Cmd->>PlaceAPI: getPlace(placeType, pageSize, pageNum)
  PlaceAPI-->>Cmd: PlaceApiResponseWrapper(items)
  loop for each item
    Cmd->>PlaceAPI: getImages(contentId)
    PlaceAPI-->>Cmd: PlaceImageResponseWrapper(imageItems)
    Note over Cmd: Build Place\n- round lat/lng\n- collect firstImage + fetched originImgUrls
  end
  Cmd->>Repo: saveAllPlaces(placeList) (per-item transactions)
  Repo-->>Cmd: persisted
  Cmd-->>Client: done
Loading
sequenceDiagram
  participant Client as TourAPIController
  participant Cmd as TourCommandService
  participant FestAPI as TourFestivalUtil
  participant Repo as FestivalRepository

  Client->>Cmd: syncFestivalsFromApi(pageSize, pageNum)
  Cmd->>FestAPI: getFestivals(pageSize, pageNum)
  FestAPI-->>Cmd: List<FestivalItem>
  Note over Cmd: Convert to entities\n- parse LocalDate\n- ensure start/end not null\n- swap if start > end
  Cmd->>Repo: saveAll(...)
  Repo-->>Cmd: persisted
  Cmd-->>Client: done
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I hop through dates, from Date to LocalDate lands,
Polishing dots on calendars with tiny paws and plans.
I nudge blank pics to null, fetch images on the fly,
Paginate the journeys, let repositories sigh.
With whiskers twitching, I stitch the flows—
A carrot for each API that grows. 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Free

💡 Knowledge Base configuration:

  • Jira integration is disabled
  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3771819 and 236e558.

📒 Files selected for processing (20)
  • src/main/kotlin/busanVibe/busan/domain/festival/converter/FestivalConverter.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/festival/domain/Festival.kt (3 hunks)
  • src/main/kotlin/busanVibe/busan/domain/festival/enums/FestivalStatus.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/festival/repository/FestivalRepository.kt (0 hunks)
  • src/main/kotlin/busanVibe/busan/domain/festival/service/FestivalQueryService.kt (4 hunks)
  • src/main/kotlin/busanVibe/busan/domain/festival/util/FestivalDateUtil.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/home/service/HomeQueryService.kt (3 hunks)
  • src/main/kotlin/busanVibe/busan/domain/place/domain/Place.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/place/service/PlaceCongestionQueryService.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/place/service/PlaceQueryService.kt (4 hunks)
  • src/main/kotlin/busanVibe/busan/domain/place/util/PlaceImageUtil.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/search/dto/SearchResultDTO.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/search/util/SearchUtil.kt (3 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/controller/TourAPIController.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/dto/TourPlaceImagesDTO.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/service/TourCommandService.kt (4 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/util/TourFestivalConverter.kt (2 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/util/TourFestivalUtil.kt (1 hunks)
  • src/main/kotlin/busanVibe/busan/domain/tourApi/util/TourPlaceUtil.kt (3 hunks)
  • src/main/kotlin/busanVibe/busan/global/apiPayload/code/status/ErrorStatus.kt (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/kotlin/busanVibe/busan/domain/festival/repository/FestivalRepository.kt

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ggamnunq ggamnunq merged commit 948725a into main Sep 5, 2025
2 checks 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.

2 participants