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
@@ -1,11 +1,11 @@
package com.comma.soomteum.domain.place.controller;
package com.comma.soomteum.domain.external.tourapi;

import com.comma.soomteum.domain.place.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.place.dto.KorService2Response;
import com.comma.soomteum.domain.place.service.KorAreaService;
import com.comma.soomteum.domain.place.service.KorDetailService;
import com.comma.soomteum.domain.place.service.KorLocationService;
import com.comma.soomteum.domain.external.tourapi.dto.KorService2Response;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.external.tourapi.service.KorAreaService;
import com.comma.soomteum.domain.external.tourapi.service.KorDetailService;
import com.comma.soomteum.domain.external.tourapi.service.KorLocationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -21,21 +21,21 @@
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@Tag(name = "디버그- KorService2", description = "한국관광공사 데이터 확인용 API (개발환경에서만 사용)")
@Tag(name = "Debug - TourAPI", description = "한국관광공사 TourAPI 응답 구조 확인·디버그용 (개발 환경 전용)")
@RestController
@RequestMapping(path = "/api/debug", produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(path = "/api/debug/tour", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
@Validated
public class KorService2Controller {
public class TourApiDebugController {

private final KorAreaService areaService;
private final KorLocationService locationService;
private final KorDetailService detailService;

@Operation(
summary = "위치기반 관광정보 조회 (/locationBasedList2)",
description = "경도(mapX)·위도(mapY)와 반경(radius) 기준으로 관광정보를 조회합니다. "
+ "옵션: cat1/cat2(분류), pageNo/numOfRows(페이징), arrange(정렬; 기본값 서비스 내부 적용).",
summary = "위치 기반 관광정보 원본 확인",
description = "공공데이터 TourAPI(locationBasedList2)를 호출해 경도·위도와 반경 기준 원본 응답을 반환합니다. "
+ "디버그 용도로 cat1/cat2, pageNo/numOfRows, arrange 옵션을 그대로 전달합니다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공",
content = @Content(schema = @Schema(implementation = KorService2Response.class))),
Expand All @@ -45,15 +45,13 @@ public class KorService2Controller {
public Mono<KorService2Response> locationBasedList(
@Valid @ParameterObject TourApiRequestDto.LocationBasedList2 req
) {
// DTO 내부의 pageNoOrDefault, rowsOrDefault, arrangeOrDefault 등을
// 서비스에서 사용 가능 (컨트롤러에서는 그대로 전달)
return locationService.locationBasedList(req);
}

@Operation(
summary = "지역기반 관광정보 조회 (/areaBasedList2)",
description = "지역과 테마를 기반으로 관광지를 조회합니다. "
+ " 옵션: cat1/cat2(분류), pageNo/numOfRows(페이징), arrange(정렬; 기본값 서비스 내부 적용)",
summary = "지역 기반 관광정보 원본 확인",
description = "지역·테마 기반으로 TourAPI(areaBasedList2)를 호출한 원본 응답을 반환합니다. "
+ "cat1/cat2, pageNo/numOfRows, arrange 옵션을 그대로 전달해 디버그에 활용합니다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공",
content = @Content(schema = @Schema(implementation = KorService2Response.class))),
Expand All @@ -67,12 +65,11 @@ public Mono<KorService2Response> areaBasedList(
}

@Operation(
summary = "여행지 공통정보 조회 (/detailCommon2)",
description = "contentId로 공통정보를 조회하고, 이름/대표이미지/위치/주소/소개만 추려 반환합니다."
summary = "여행지 공통정보 원본 확인",
description = "contentId로 TourAPI(detailCommon2)를 호출한 원본 데이터에서 기본 필드만 추려 반환합니다."
)
@ApiResponse(responseCode = "200", description = "성공",
content = @Content(schema = @Schema(implementation = PlaceDetailResponseDto.class)))

@GetMapping("/detail")
public Mono<PlaceDetailResponseDto> detail(
@Valid @ParameterObject TourApiRequestDto.DetailCommon2 req
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.config;
package com.comma.soomteum.domain.external.tourapi.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.config;
package com.comma.soomteum.domain.external.tourapi.config;


import lombok.*;
Expand Down Expand Up @@ -65,4 +65,4 @@ public static class Client {
private String baseUrl;
private String serviceKey;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.dto;
package com.comma.soomteum.domain.external.tourapi.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonRootName;
Expand Down Expand Up @@ -55,4 +55,4 @@ public static class Item {
private String name;
private String rnum;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.dto;
package com.comma.soomteum.domain.external.tourapi.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.dto;
package com.comma.soomteum.domain.external.tourapi.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.dto;
package com.comma.soomteum.domain.external.tourapi.dto;

import lombok.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.comma.soomteum.domain.place.dto.response;
package com.comma.soomteum.domain.external.tourapi.dto.response;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.comma.soomteum.domain.place.service;
package com.comma.soomteum.domain.external.tourapi.service;

import com.comma.soomteum.domain.place.config.TourApiProperties;
import com.comma.soomteum.domain.place.dto.TourApiErrorResponse;
import com.comma.soomteum.domain.external.tourapi.config.TourApiProperties;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiErrorResponse;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
Expand Down Expand Up @@ -177,4 +177,4 @@ public static class Upstream5xxException extends RuntimeException {
public final String body;
public Upstream5xxException(String msg, String body) { super(msg); this.body = body; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.comma.soomteum.domain.place.service;
package com.comma.soomteum.domain.external.tourapi.service;

import com.comma.soomteum.domain.place.dto.KorService2Response;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.KorService2Response;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

import static com.comma.soomteum.domain.place.service.KorApiCaller.qpIfPresent;
import static com.comma.soomteum.domain.external.tourapi.service.KorApiCaller.qpIfPresent;

@Service
@RequiredArgsConstructor
Expand All @@ -30,4 +30,4 @@ public Mono<KorService2Response> areaBasedList(TourApiRequestDto.AreaBasedList2
qpIfPresent(b, "cat2", req.getCat2());
}, KorService2Response.class);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.comma.soomteum.domain.place.service;
package com.comma.soomteum.domain.external.tourapi.service;

import com.comma.soomteum.domain.place.dto.CategoryCodeResponse;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.CategoryCodeResponse;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

import static com.comma.soomteum.domain.place.service.KorApiCaller.qpIfPresent;
import static com.comma.soomteum.domain.external.tourapi.service.KorApiCaller.qpIfPresent;

@Service
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.comma.soomteum.domain.place.service;
package com.comma.soomteum.domain.external.tourapi.service;

import com.comma.soomteum.domain.place.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.comma.soomteum.domain.place.service;
package com.comma.soomteum.domain.external.tourapi.service;

import com.comma.soomteum.domain.place.dto.KorService2Response;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.KorService2Response;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono;

import static com.comma.soomteum.domain.place.service.KorApiCaller.qpIfPresent;
import static com.comma.soomteum.domain.external.tourapi.service.KorApiCaller.qpIfPresent;

@Service
@RequiredArgsConstructor
Expand All @@ -27,4 +27,4 @@ public Mono<KorService2Response> locationBasedList(TourApiRequestDto.LocationBas
qpIfPresent(b, "cat2", req.getCat2());
}, KorService2Response.class);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@Tag(name = "여행지", description = "여행지와 관련된 로직")
@Tag(name = "여행지 상세", description = "여행지 통합 상세 조회 전용 API")
@RestController
@RequestMapping(path = "/api/places", produces = MediaType.APPLICATION_JSON_VALUE)
@RequiredArgsConstructor
Expand All @@ -26,42 +26,30 @@ public class PlaceController {
private final PlaceDetailIntegratedService placeDetailIntegratedService;

@Operation(
summary = "여행지 상세 통합 정보 조회",
description = """
여행지 상세 조회 시 필요한 모든 정보를 통합하여 제공합니다.

**제공 정보:**
- 여행지 이름, 사진, 주소, 지역, 테마, 소개
- 한적함 등급 (1-5단계, -1: 데이터 없음)
- 좋아요 수
- AI 꿀팁 요약 (강릉시만 제공)
- 근처 공영주차장 정보 (강릉시만 제공)

**강릉시 전용 기능:**
- AI가 생성한 여행 꿀팁 요약
- 주변 5km 이내 공영주차장 최대 5개 정보
"""
summary = "여행지 통합 상세 조회",
description = "여행지 상세 화면에서 필요한 정보를 한 번에 제공합니다. "
+ "기본 프로필(이름, 사진, 주소, 지역, 테마, 소개), 한적함 등급, 좋아요 수, AI 꿀팁(강릉시), 근처 공영주차장(강릉시)까지 통합 조회합니다."
)
@ApiResponses({
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "200",
responseCode = "200",
description = "통합 정보 조회 성공",
content = @Content(schema = @Schema(implementation = PlaceDetailIntegratedResponseDto.class))
),
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "404",
responseCode = "404",
description = "여행지를 찾을 수 없음"
),
@io.swagger.v3.oas.annotations.responses.ApiResponse(
responseCode = "500",
responseCode = "500",
description = "서버 내부 오류"
)
})
@GetMapping("/integrated/{contentId}")
public Mono<ApiResponse<PlaceDetailIntegratedResponseDto>> getIntegratedPlaceDetail(
@Parameter(description = "공공데이터 API의 컨텐츠 ID", required = true, example = "128758")
@PathVariable String contentId) {

return placeDetailIntegratedService.getIntegratedPlaceDetail(contentId)
.map(ApiResponse::ok)
.onErrorReturn(new ApiResponse<>(null, false, null, null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
import com.comma.soomteum.domain.ai.dto.AiReviewResponse;
import com.comma.soomteum.domain.ai.service.AiRecommendationService;
import com.comma.soomteum.domain.ai.service.AiReviewService;
import com.comma.soomteum.domain.external.tourapi.service.KorCategoryService;
import com.comma.soomteum.domain.external.tourapi.service.KorDetailService;
import com.comma.soomteum.domain.parking.dto.PublicParkingResponseDto;
import com.comma.soomteum.domain.parking.service.PublicParkingService;
import com.comma.soomteum.domain.place.dto.CategoryCodeResponse;
import com.comma.soomteum.domain.place.dto.KorService2Response;
import com.comma.soomteum.domain.place.dto.TourApiRequestDto;
import com.comma.soomteum.domain.external.tourapi.dto.CategoryCodeResponse;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiRequestDto;
import com.comma.soomteum.domain.place.dto.response.PlaceDetailIntegratedResponseDto;
import com.comma.soomteum.domain.place.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.external.tourapi.dto.response.PlaceDetailResponseDto;
import com.comma.soomteum.domain.theme.entity.Theme;
import com.comma.soomteum.domain.theme.repository.ThemeRepository;
import com.comma.soomteum.domain.tour.service.TourService;
import com.comma.soomteum.domain.recommendation.service.TourService;
import com.comma.soomteum.domain.userPlace.enums.UserActionType;
import com.comma.soomteum.domain.userPlace.service.UserPlaceService;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -624,4 +625,4 @@ public String getThemeName() {
return themeName;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.comma.soomteum.domain.place.service;

import com.comma.soomteum.domain.place.config.TourApiProperties;
import com.comma.soomteum.domain.place.dto.TourApiErrorResponse;
import com.comma.soomteum.domain.external.tourapi.config.TourApiProperties;
import com.comma.soomteum.domain.external.tourapi.dto.TourApiErrorResponse;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.cfg.CoercionAction;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.comma.soomteum.domain.place.service;

import com.comma.soomteum.domain.place.dto.KorService2Response;
import com.comma.soomteum.domain.external.tourapi.dto.KorService2Response;
import com.comma.soomteum.domain.place.dto.TatsCnctrResponse;
import com.comma.soomteum.domain.region.entity.Region;
import com.comma.soomteum.domain.region.entity.RegionCnctr;
Expand Down
Loading
Loading