Skip to content

Commit

Permalink
#2 - Feat: Add Common Detail Information Search rest docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eun61n00 committed Jun 20, 2023
1 parent e0e3cec commit 3065d5d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
package org.routemaster.api.total.domain.attraction.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.routemaster.api.total.domain.attraction.service.AttractionInformationSearchService;
Expand All @@ -19,9 +25,29 @@ public class CommonDetailInformationSearchRestController {

private final AttractionInformationSearchService service;

@Operation(
summary = "공통 상세 정보 조회",
description = "contentID에 해당하는 attraction의 공통 상세 정보(제목, 연락처, 주소, 좌표, 개요 정보 등) 조회",
tags = {"attraction-detail"}
)
@ApiResponses({
@ApiResponse(
responseCode = "200",
description= "Success Response",
content = @Content(
mediaType = "application/json",
schema = @Schema(implementation = AttractionSearchVO.class)
)
)
})
@GetMapping("/common")
public ResponseEntity<Mono<AttractionSearchVO>> detailCommon(
@RequestParam Integer contentId
@Parameter(
name = "contentId",
description = "조회할 관광지의 contentId",
required = true,
example = "126508"
) @RequestParam Integer contentId
) {
Mono<AttractionSearchVO> result = service.searchAttractionDetail(
contentId
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
package org.routemaster.api.total.infra.tourapi.vo;

import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;

import java.text.ParseException;
import java.util.Objects;

@Schema(
name = "CommonDetailVO",
description = "공통 상세 정보(제목, 연락처, 주소 좌표, 개요 정보 등)"
)
@Getter
public class CommonDetailVO extends AttractionVO {

private @Getter String homepage;
private @Getter String zipcode;
private @Getter String overview;
@Schema(
description = "홈페이지",
example = "경복궁 <a href=\"http://www.royalpalace.go.kr/\" target=\"_blank\" title=\"새창 : 경복궁 홈페이지로 이동\">http://www.royalpalace.go.kr</a><br />궁궐길라잡이 <a href=\"http://www.palaceguide.or.kr/\" target=\"_blank\" title=\"새창 : 궁궐길라잡이 홈페이지로 이동\">http://www.palaceguide.or.kr</a><br />한국의재발견 <a href=\"http://www.rekor.or.kr/\" target=\"_blank\" title=\"새창 : 한국의재발견 홈페이지로 이동\">http://www.rekor.or.kr</a><br />야간관람 예매<a href=\"https://ticket.11st.co.kr/Product/Detail?id=266194&prdNo=4239172482\"title=\"새창: 경복궁 야간관람 예매\"target=\"_blank\">https://ticket.11st.co.kr/</a>",
nullable = true
) private @Getter String homepage;
@Schema(
description = "우편번호",
example = "03045"
) private @Getter String zipcode;
@Schema(
description = "개요",
example = "경복궁은 1395년 태조 이성계에 의해서 새로운 조선왕조의 법궁으로 지어졌다. 경복궁은 동궐(창덕궁)이나 서궐(경희궁)에 비해 위치가 북쪽에 있어 '북궐'이라 불리기도 했다."
) private @Getter String overview;

public CommonDetailVO(JsonNode item) throws ParseException {
super(item);
Expand Down

0 comments on commit 3065d5d

Please sign in to comment.