Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ public MagazineResDTO.GetMagazinePhotos getMagazinePhotos(
return magazineService.getMagazinePhotos(magazineId);
}

@Operation(summary = "λ§€κ±°μ§„ μž₯μ†Œ μ €μž₯")
@Operation(
summary = "λ§€κ±°μ§„ μž₯μ†Œ μ €μž₯",
description = "λ§€κ±°μ§„ 상세 쑰회 μ‘λ‹΅μ˜ magazineId 값을 contentId 둜 κ·ΈλŒ€λ‘œ μ „λ‹¬ν•œλ‹€. "
+ "(contentId = κ΄€κ΄‘ KorService2 μ½˜ν…μΈ  ID, λ‚΄λΆ€ Place PK μ•„λ‹˜)"
)
@PostMapping("/bookmarks")
public PlaceResDTO.CreateBookmark createBookmark(
@AuthenticationPrincipal Long userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,28 @@ private static PlaceResDTO.GetBookmarkList.BookmarkItem toBookmarkItem(BookmarkP

return PlaceResDTO.GetBookmarkList.BookmarkItem.builder()
.bookmarkId(bookmarkPlace.getId())
.magazineId(null) // λ§€κ±°μ§„ 도메인 연동 μ „κΉŒμ§€ null
// κ΄€κ΄‘(KorService2) 좜처 μž₯μ†ŒλŠ” tour_content_id κ°€ κ³§ magazineId(=contentId).
// 넀이버 좜처 μž₯μ†ŒλŠ” 값이 μ—†μ–΄ null (ν•΄λ‹Ή ν•­λͺ©μ€ λ§€κ±°μ§„ μƒμ„Έλ‘œ 이동 λΆˆκ°€).
.magazineId(parseContentId(place.getTourContentId()))
.thumbnailUrl(place.getImageUrl())
.placeName(place.getPlaceName())
.regionName(toRegionName(place.getRegion()))
.category(place.getCategory())
.build();
}

// tour_content_id(숫자 λ¬Έμžμ—΄) -> Long. 값이 μ—†κ±°λ‚˜ μˆ«μžκ°€ μ•„λ‹ˆλ©΄ null 둜 흑수.
private static Long parseContentId(String tourContentId) {
if (tourContentId == null || tourContentId.isBlank()) {
return null;
}
try {
return Long.parseLong(tourContentId.trim());
} catch (NumberFormatException e) {
return null;
}
}

// "μ‹œ ꡬ" ν˜•νƒœλ‘œ μ‘°λ¦½ν•œλ‹€. μ‹œ/도 λ‹¨μœ„ 지역이면 μƒμœ„ 지역이 μ—†μœΌλ―€λ‘œ μ§€μ—­λͺ…λ§Œ λ°˜ν™˜
private static String toRegionName(Region region) {
if (region == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static MagazineResDTO.GetMagazineDetail toDetail(
List<TourApiResponse.ImageItem> images
) {
return MagazineResDTO.GetMagazineDetail.builder()
.placeId(parseLong(common.contentid()))
.magazineId(parseLong(common.contentid()))
.thumbnailUrl(firstNonBlank(common.firstimage(), common.firstimage2()))
.category(categoryName(common.contenttypeid()))
.placeName(removeHtmlTags(common.title()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public record GetBookmarkList(
// μΆ©λŒν•˜λ―€λ‘œ, μš”μ²­ μŠ€ν‚€λ§ˆ 이름을 λͺ…μ‹œμ μœΌλ‘œ κ΅¬λΆ„ν•œλ‹€.
@Schema(name = "CreateBookmarkRequest")
public record CreateBookmark(
@Schema(description = "κ΄€κ΄‘(KorService2) μ½˜ν…μΈ  ID. λ§€κ±°μ§„ 상세 쑰회 μ‘λ‹΅μ˜ magazineId 값을 κ·ΈλŒ€λ‘œ μ „λ‹¬ν•œλ‹€. (λ‚΄λΆ€ Place PK μ•„λ‹˜)")
@NotNull(message = "contentIdκ°€ ν•„μš”ν•©λ‹ˆλ‹€.") Long contentId
){}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public record MagazineItem(
// λ§€κ±°μ§„ 상세
@Builder
public record GetMagazineDetail(
Long placeId, // 관광곡사 contentId (μ €μž₯ μ‹œ contentId 둜 μ‚¬μš©)
Long magazineId, // λ§€κ±°μ§„ PK = 관광곡사 contentId (μ €μž₯ μ‹œ 이 값을 contentId 둜 전달)
String thumbnailUrl,
String category,
String placeName,
Expand Down
Loading