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 @@ -29,7 +29,7 @@ public Response<List<MegaCodeResponse>> getMegaCodes(){
List<MegaCode> megaCodes = areaCodeUseCase.getMegaCodeList();
return Response.success(
megaCodes.stream().map(list ->
new MegaCodeResponse(list.ctprvnCd(), list.ctprvnNm())
new MegaCodeResponse(list.getCtprvnCd(), list.getCtprvnNm())
).toList()
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ public class ClutrFatvlController implements ClutrFatvlControllerSwagger {
private final ClutrFatvlUseCase clutrFatvlUseCase;
private final AreaCodeCacheService areaCodeCacheService;


@Override
@GetMapping("/clutr/fatvl")
public Response<PageResponse<ClutrFatvListResponse>> getClureFatvlList(
@RequestParam() String megaCode,
@RequestParam() String cityCode,
@RequestParam() Integer megaCode,
@RequestParam() Integer cityCode,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size
) {
Expand All @@ -45,8 +44,8 @@ public Response<PageResponse<ClutrFatvListResponse>> getClureFatvlList(
List<ClutrFatvListResponse> content = clutrFatvls.getContent().stream().map(list ->
ClutrFatvListResponse.create(
list,
areaCodeCacheService.getMegaName(Long.valueOf(list.address().megaCodeId())),
areaCodeCacheService.getCityName(Long.valueOf(list.address().ctprvnCodeId()), Long.valueOf(list.address().megaCodeId())))
areaCodeCacheService.getMegaName(Long.valueOf(list.getAddress().megaCodeId())),
areaCodeCacheService.getCityName(Long.valueOf(list.getAddress().ctprvnCodeId()), Long.valueOf(list.getAddress().megaCodeId())))
).toList();
return Response.success(
new PageResponse<>(
Expand All @@ -64,6 +63,6 @@ public Response<PageResponse<ClutrFatvListResponse>> getClureFatvlList(
public Response<ClutrFatvInfoResponse> getClutrFatvlInfo(
@RequestParam Long clutrFatvlId) {
ClutrFatvl clutrFatvlInfo = clutrFatvlUseCase.getClutrFatvlInfo(clutrFatvlId);
return Response.success(ClutrFatvInfoResponse.create(clutrFatvlInfo));
return Response.success(ClutrFatvInfoResponse.create(clutrFatvlInfo, null));
}
}
Original file line number Diff line number Diff line change
@@ -1,73 +1,52 @@
package backend.airo.api.clutr_fatvl.dto;

import backend.airo.domain.clure_fatvl.ClutrFatvl;
import backend.airo.domain.clure_fatvl.ClutrFatvlInfo;
import backend.airo.domain.clure_fatvl.vo.Address;
import backend.airo.domain.clure_fatvl.vo.FestivalPeriod;
import lombok.Builder;

@Builder
public record ClutrFatvInfoResponse(
String id,

// 축제/행사 이름
String fstvlNm,

// 행사 장소
String opar,

// 행사 상세 내용
String fstvlCo,

// 행사 기간 [시작일, 종료일]
FestivalPeriod period,

// 행사 주소 [지번, 도로명]
Address address,

// 주관 기관명(Organizer / 실제 운영)
String mnnstNm,

// 주최 기관명(Host)
String auspcInsttNm,

// 후원 기관명(Sponsor)
String suprtInsttNm,

// 행사 담당 전화번호
Long contentId,
String title,
String firstImage1,
String firstImage2,
String homepage,
String addr1,
String addr2,
String cat1,
String usetimefestival,
String playTime,
String start,
String end,
String phoneNumber,

// 행사 홈페이지 URL
String homepageUrl,

// 관련 정보(비고/추가 안내/링크 등)
String relateInfo

// // 이 데이터(레코드)의 기준/갱신 일자
// LocalDate referenceDate

// // 공공데이터포털 제공 기관 코드
// String insttCode,
//
// // 공공데이터포털 제공 기관명
// String insttNm
String agelimit,
String clutrFatvlIntro,
String mainProgramInfo,
String guestProgramInfo
) {

public static ClutrFatvInfoResponse create(ClutrFatvl clutrFatvlInfo) {
public static ClutrFatvInfoResponse create(ClutrFatvl clutrFatvl, ClutrFatvlInfo clutrFatvlInfo) {
return ClutrFatvInfoResponse.builder()
.id(clutrFatvlInfo.id())
.fstvlNm(clutrFatvlInfo.fstvlNm())
.opar(clutrFatvlInfo.opar())
.fstvlCo(clutrFatvlInfo.fstvlCo())
.period(clutrFatvlInfo.period())
.address(clutrFatvlInfo.address())
.mnnstNm(clutrFatvlInfo.mnnstNm())
.auspcInsttNm(clutrFatvlInfo.auspcInsttNm())
.suprtInsttNm(clutrFatvlInfo.suprtInsttNm())
.phoneNumber(clutrFatvlInfo.phoneNumber())
.homepageUrl(clutrFatvlInfo.homepageUrl())
.relateInfo(clutrFatvlInfo.relateInfo())
.contentId(clutrFatvl.getContentId())
.title(clutrFatvl.getTitle())
.firstImage1(clutrFatvl.getFirstImage())
.firstImage2(clutrFatvl.getFirstImage2())
.homepage(clutrFatvlInfo.getEventHomePage())
.addr1(clutrFatvl.getAddress().addr1())
.addr2(clutrFatvl.getAddress().addr2())
.cat1(clutrFatvl.getCat1())
.usetimefestival(clutrFatvlInfo.getUsetimefestival())
.playTime(clutrFatvlInfo.getPlayTime())
.start(clutrFatvlInfo.getStart())
.end(clutrFatvlInfo.getEnd())
.phoneNumber(clutrFatvlInfo.getPhoneNumber())
.agelimit(clutrFatvlInfo.getAgelimit())
.clutrFatvlIntro(clutrFatvlInfo.getClutrFatvlIntro())
.mainProgramInfo(clutrFatvlInfo.getMainProgramInfo())
.guestProgramInfo(clutrFatvlInfo.getGuestProgramInfo())
.build();
}

private static String nz(String s) { return s == null ? "" : s; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,20 @@
@Builder
public record ClutrFatvListResponse(

String id,
String name,
LocalDate startDate,
LocalDate endDate,
String region,
String place,
String shortDesc,
boolean progressCheck,
boolean periodCheck,
boolean ended
Long contentId,
String title,
String firstImage1,
String firstImage2

) {

public static ClutrFatvListResponse create(ClutrFatvl clutrFatvl, String megaName, String cityName) {
return ClutrFatvListResponse.builder()
.id(clutrFatvl.id())
.name(clutrFatvl.fstvlNm())
.startDate(clutrFatvl.period().start())
.endDate(clutrFatvl.period().end())
.region(addMegaNameCityName(megaName, cityName))
.place(clutrFatvl.opar())
.progressCheck(clutrFatvl.period().progressCheck())
.periodCheck(clutrFatvl.period().periodCheck())
.ended(clutrFatvl.period().ended())
.contentId(clutrFatvl.getContentId())
.title(clutrFatvl.getTitle())
.firstImage1(clutrFatvl.getFirstImage())
.firstImage2(clutrFatvl.getFirstImage2())
.build();
}

private static String addMegaNameCityName(String megaName, String cityName) {
return megaName + " " + cityName;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public interface ClutrFatvlControllerSwagger {
)
@GetMapping("/clutr/fatvl")
Response<PageResponse<ClutrFatvListResponse>> getClureFatvlList(
@RequestParam() String megaCode,
@RequestParam() String cityCode,
@RequestParam() Integer megaCode,
@RequestParam() Integer cityCode,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size
);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/backend/airo/api/shop/ShopController.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public class ShopController implements ShopControllerSwagger {
@Override
@GetMapping("/shop")
public Response<PageResponse<ShopListResponse>> getShoplList(
@RequestParam() String megaCode,
@RequestParam() String cityCode,
@RequestParam() String largeCategoryCode,
@RequestParam(defaultValue = "") String middleCategoryCode,
@RequestParam(defaultValue = "") String smallCategoryCode,
@RequestParam() String megaCode,
@RequestParam() String cityCode,
@RequestParam() String largeCategoryCode,
@RequestParam(defaultValue = "") String middleCategoryCode,
@RequestParam(defaultValue = "") String smallCategoryCode,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "20") int size
) {
Expand Down
29 changes: 15 additions & 14 deletions src/main/java/backend/airo/api/shop/dto/ShopInfoResponse.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
package backend.airo.api.shop.dto;

import backend.airo.domain.shop.Shop;
import backend.airo.domain.shop.vo.ShopType;
import backend.airo.api.shop.vo.ShopType;
import lombok.Builder;

@Builder
public record ShopInfoResponse(
Long id,
String shopName,
String roadAddr,
String lotAddr,
String flrNo,
String hoNo,
ShopType shopType
Long contentId,
Integer contentTypeId,
String name,
String addr,
String representativeImageURL,
String thumbnailImageURl,
String shopTypeName
) {

public static ShopInfoResponse create(Shop shop) {
return ShopInfoResponse.builder()
.id(shop.id())
.shopName(shop.shopName())
.roadAddr(shop.address().road())
.lotAddr(shop.address().lot())
.flrNo(shop.floorInfo().flrNo())
.hoNo(shop.floorInfo().hoNo())
.contentId(shop.contentId())
.contentTypeId(shop.contentTypeId())
.name(shop.shopName())
.addr(shop.address().addr())
.representativeImageURL(shop.representativeImageURL())
.thumbnailImageURl(shop.thumbnailImageURl())
.shopTypeName(ShopType.valueOf(shop.industry().indsSclsCd()).getName())
.build();
}

Expand Down
21 changes: 13 additions & 8 deletions src/main/java/backend/airo/api/shop/dto/ShopListResponse.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
package backend.airo.api.shop.dto;

import backend.airo.domain.shop.Shop;
import backend.airo.api.shop.vo.ShopType;
import lombok.Builder;

@Builder
public record ShopListResponse(

Long id,
Long contentId,
Integer contentTypeId,
String name,
String lotAddr,
String roadAddr,
String indeScleName
String addr,
String representativeImageURL,
String thumbnailImageURl,
String shopTypeName
) {

public static ShopListResponse create(Shop shop) {
return new ShopListResponse(
shop.id(),
shop.contentId(),
shop.contentTypeId(),
shop.shopName(),
shop.address().lot(),
shop.address().road(),
shop.shopType().getTypeName()
shop.address().addr(),
shop.representativeImageURL(),
shop.thumbnailImageURl(),
ShopType.valueOf(shop.industry().indsSclsCd()).getName()
);
}

Expand Down
46 changes: 46 additions & 0 deletions src/main/java/backend/airo/api/shop/vo/ShopType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package backend.airo.api.shop.vo;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum ShopType {
// ---- 음식 ----
A05("A05", "음식"),
A0502("A0502", "음식점"),

// 소분류(음식점)
A05020100("A05020100", "한식"),
A05020200("A05020200", "서양식"),
A05020300("A05020300", "일식"),
A05020400("A05020400", "중식"),
A05020700("A05020700", "이색음식점"),
A05020900("A05020900", "카페/전통찻집"),
A05021000("A05021000", "클럽"),


// ---- 숙박 ----
B02("B02", "숙박"),
B0201("B0201", "숙박업"),

// 소분류(숙박업)
B02010100("B02010100", "관광호텔"),
B02010500("B02010500", "콘도미니엄"),
B02010600("B02010600", "유스호스텔"),
B02010700("B02010700", "펜션"),
B02010900("B02010900", "모텔"),
B02011000("B02011000", "민박"),
B02011100("B02011100", "게스트하우스"),
B02011200("B02011200", "홈스테이"),
B02011300("B02011300", "서비스드레지던스"),
B02011600("B02011600", "한옥"),

;

public enum Level { MAJOR, MID, SUB }

private final String code;
private final String name;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package backend.airo.application.clure_fatvl.dto;


import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDate;

public record OpenApiClutrFatvl(
Long contentId,
Integer contenttypeId,
String title,
Double lat,
Double lon,
String addr1,
String addr2,
Integer megaCodeId,
Integer ctprvnCodeId,
String phoneNumber,
String cat1,
String firstImage,
String firstImage2,
@JsonFormat(pattern = "yyyyMMddHHmmss")
LocalDate modifiedDate
) {
}
Loading