Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] 스마트 서울맵 콘텐츠 데이터 DB 저장 #112

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions src/main/java/com/ecolink/core/CoreApplication.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.ecolink.core;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@EnableFeignClients
@SpringBootApplication
public class CoreApplication {

Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/ecolink/core/common/constant/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,11 @@ public class Address {
@Schema(description = "지번 주소", example = "흑석동 54-149 1층")
private String lotNumber;

public Address(String province, String city, String roadName, String lotNumber) {
this.province = province;
this.city = city;
this.roadName = roadName;
this.lotNumber = lotNumber;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.ecolink.core.map.controller;

import com.ecolink.core.map.util.ContentDetailFetcher;
import com.ecolink.core.map.util.ContentListFetcher;
import com.ecolink.core.map.util.StoreDetailFetcher;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@RestController
public class StoreMapController {

private final ContentListFetcher contentListFetcher;
private final ContentDetailFetcher contentDetailFetcher;
private final StoreDetailFetcher storeDetailFetcher;

public StoreMapController(ContentListFetcher contentListFetcher, ContentDetailFetcher contentDetailFetcher,
StoreDetailFetcher storeDetailFetcher) {
this.contentListFetcher = contentListFetcher;
this.contentDetailFetcher = contentDetailFetcher;
this.storeDetailFetcher = storeDetailFetcher;
}

@Tag(name = "${swagger.map-data}")
@Operation(summary = "스마트서울맵 데이터 조회 API", description = "테마 내 모든 콘텐츠 리스트 API")
@GetMapping("/list")
public void getContentsListAll() {
contentListFetcher.fetchDataAndStore();

}

@Tag(name = "${swagger.map-data}")
@Operation(summary = "스마트서울맵 데이터 조회 API", description = "테마 내 모든 콘텐츠 상세 정보 API")
@GetMapping("/data")
public void getContentsDetailAll() {
contentDetailFetcher.fetchAndStoreContentDetail();
}

@Tag(name = "${swagger.map-data}")
@Operation(summary = "상점 데이터 등록 API", description = "상점 상세 데이터 조회 및 등록 API")
@GetMapping("/store")
public void getStoreDetailAll() {
storeDetailFetcher.fetchAndStoreInfoDetail();
}

}
35 changes: 35 additions & 0 deletions src/main/java/com/ecolink/core/map/domain/Map.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.ecolink.core.map.domain;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import jakarta.persistence.*;

import java.time.LocalDateTime;

@Getter
@Setter
@NoArgsConstructor
@Entity
public class Map {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String mapThemeId;
private String mapContentId;
private String mapSubCategoryId;
private String mapContentStatus;
private LocalDateTime updateDate;
private LocalDateTime registrationDate;

public Map(String mapThemeId, String mapContentId, String mapSubCategoryId, String mapContentStatus, LocalDateTime updateDate, LocalDateTime registrationDate) {
this.mapThemeId = mapThemeId;
this.mapContentId = mapContentId;
this.mapSubCategoryId = mapSubCategoryId;
this.mapContentStatus = mapContentStatus;
this.updateDate = updateDate;
this.registrationDate = registrationDate;
}
}
121 changes: 121 additions & 0 deletions src/main/java/com/ecolink/core/map/domain/MapContent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
package com.ecolink.core.map.domain;

import org.locationtech.jts.geom.Point;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@ToString
@Getter
@Setter
@NoArgsConstructor
@Entity
public class MapContent {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String cotContsName;
private String cotValue03;
private String cotValue04;
private String cotValue05;
private String cotValue06;
private String cotValue07;
private String cotAddrFullNew;
private String cotAddrFullOld;
private String cotTelNo;
private String cotRegDate;
private String cotUpdateDate;
private String cotThemeId;
private String cotContsId;
private String cotGuName;
private String cotDongName;
private String cotSanName;
private String cotMasterNo;
private String cotSlaveNo;
private String cotExtraName;
private String cotNationBaseArea;
private String cotNationPointNumber;
private Point cotCoordData;
private String cotCoordType;
private String cotCoordX;
private String cotCoordY;
private String cotContsStat;
private String cotWriter;
private String cotThemeSubId;
private String cotExtraData01;
private String cotExtraData02;
private String cotMovieUrl;
private String cotVoiceUrl;
private String cotContsDetail;
private String cotImgMainUrl;
private String cotImgMainUrl2;
private String cotImgMainUrl3;
private String cotImgMainUrl4;
private String cotImgMainUrl5;
private String cotCoordStyle;
private String cotLinePattern;
private String cotLineWeight;
private String cotLineColor;

public MapContent(String cotContsName, String cotValue03, String cotValue04, String cotValue05, String cotValue06, String cotValue07,
String cotAddrFullNew, String cotAddrFullOld, String cotTelNo, String cotRegDate, String cotUpdateDate,
String cotThemeId, String cotContsId, String cotGuName, String cotDongName, String cotSanName,
String cotMasterNo, String cotSlaveNo, String cotExtraName, String cotNationBaseArea,
String cotNationPointNumber, String cotCoordType, String cotCoordX,
String cotCoordY, String cotContsStat, String cotWriter, String cotThemeSubId, String cotExtraData01,
String cotExtraData02, String cotMovieUrl, String cotVoiceUrl, String cotContsDetail,
String cotImgMainUrl, String cotImgMainUrl2, String cotImgMainUrl3, String cotImgMainUrl4,
String cotImgMainUrl5, String cotCoordStyle, String cotLinePattern, String cotLineWeight,
String cotLineColor) {
this.cotContsName = cotContsName;
this.cotValue03 = cotValue03;
this.cotValue04 = cotValue04;
this.cotValue05 = cotValue05;
this.cotValue06 = cotValue06;
this.cotValue07 = cotValue07;
this.cotAddrFullNew = cotAddrFullNew;
this.cotAddrFullOld = cotAddrFullOld;
this.cotTelNo = cotTelNo;
this.cotRegDate = cotRegDate;
this.cotUpdateDate = cotUpdateDate;
this.cotThemeId = cotThemeId;
this.cotContsId = cotContsId;
this.cotGuName = cotGuName;
this.cotDongName = cotDongName;
this.cotSanName = cotSanName;
this.cotMasterNo = cotMasterNo;
this.cotSlaveNo = cotSlaveNo;
this.cotExtraName = cotExtraName;
this.cotNationBaseArea = cotNationBaseArea;
this.cotNationPointNumber = cotNationPointNumber;
this.cotCoordType = cotCoordType;
this.cotCoordX = cotCoordX;
this.cotCoordY = cotCoordY;
this.cotContsStat = cotContsStat;
this.cotWriter = cotWriter;
this.cotThemeSubId = cotThemeSubId;
this.cotExtraData01 = cotExtraData01;
this.cotExtraData02 = cotExtraData02;
this.cotMovieUrl = cotMovieUrl;
this.cotVoiceUrl = cotVoiceUrl;
this.cotContsDetail = cotContsDetail;
this.cotImgMainUrl = cotImgMainUrl;
this.cotImgMainUrl2 = cotImgMainUrl2;
this.cotImgMainUrl3 = cotImgMainUrl3;
this.cotImgMainUrl4 = cotImgMainUrl4;
this.cotImgMainUrl5 = cotImgMainUrl5;
this.cotCoordStyle = cotCoordStyle;
this.cotLinePattern = cotLinePattern;
this.cotLineWeight = cotLineWeight;
this.cotLineColor = cotLineColor;
}

}
145 changes: 145 additions & 0 deletions src/main/java/com/ecolink/core/map/dto/ContentDetailDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
package com.ecolink.core.map.dto;

import java.math.BigDecimal;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@ToString
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true)
public class ContentDetailDto {

@Schema(description = "상점이름", example = "호랑이상점")
private String cotContsName;

@Schema(description = "운영시간", example = "매일 11:00-21:30/ 비건 베이커리만 화 휴무")
private String cotValue_03;

@Schema(description = "취급품목(메뉴)", example = "제로웨이스트 제품, 비건 식품, 리필 세제류, 비건베이커리")
private String cotValue_04;

@Schema(description = "인스타그램", example = "http://www.instagram.com/zerowaste_jigu")
private String cotValue_05;

@Schema(description = "제로페이", example = "가능")
private String cotValue_06;

@Schema(description = "인터넷 쇼핑몰", example = "https://smartstore.naver.com/peaceontable")
private String cotValue_07;

@Schema(description = "매장 주소 (새 주소)", example = "서울특별시 마포구 성미산로 155")
private String cotAddrFullNew;

@Schema(description = "매장 주소 (구 주소)", example = "서울특별시 마포구 연남동 240-23")
private String cotAddrFullOld;

@Schema(description = "전화번호", example = "070-7721-5748")
private String cotTelNo;

@Schema(description = "등록일", example = "2023-10-31 10:04:59")
private String cotRegDate;

@Schema(description = "업데이트 일", example = "2023-10-31 13:02:54")
private String cotUpdateDate;

@Schema(description = "테마 ID", example = "11103395")
private String cotThemeId;

@Schema(description = "콘텐츠 ID", example = "zerowaste_0004")
private String cotContsId;

@Schema(description = "구명", example = "마포구")
private String cotGuName;

@Schema(description = "동명", example = "")
private String cotDongName;

@Schema(description = "산지 명", example = "")
private String cotSanName;

@Schema(description = "주 번지", example = "")
private String cotMasterNo;

@Schema(description = "부 번지", example = "")
private String cotSlaveNo;

@Schema(description = "나머지 주소", example = "")
private String cotExtraName;

@Schema(description = "국가 기초 구역", example = "03958")
private String cotNationBaseArea;

@Schema(description = "국가 지점 번호", example = "다사49085184")
private String cotNationPointNumber;

@Schema(description = "좌표 정보 (GeoJson)")
private List<BigDecimal> cotCoordData;

@Schema(description = "콘텐츠 좌표 타입", example = "1")
private String cotCoordType;

@Schema(description = "X 좌표", example = "126.923533416")
private String cotCoordX;

@Schema(description = "Y 좌표", example = "37.564525958")
private String cotCoordY;

@Schema(description = "사용 유무", example = "1")
private String cotContsStat;

@Schema(description = "등록자/수정자", example = "motif77")
private String cotWriter;

@Schema(description = "콘텐츠 서브카테고리", example = "4")
private String cotThemeSubId;

@Schema(description = "기타 정보 1", example = "")
private String cotExtraData_01;

@Schema(description = "링크 URL", example = "https://www.jigushop.co.kr/")
private String cotExtraData_02;

@Schema(description = "동영상 URL", example = "")
private String cotMovieUrl;

@Schema(description = "음성파일 URL", example = "")
private String cotVoiceUrl;

@Schema(description = "콘텐츠 상세", example = "콘텐츠 상세 내용")
private String cotContsDetail;

@Schema(description = "이미지 URL1")
private String cotImgMainUrl;

@Schema(description = "이미지 URL2")
private String cotImgMainUrl2;

@Schema(description = "이미지 URL3")
private String cotImgMainUrl3;

@Schema(description = "이미지 URL4")
private String cotImgMainUrl4;

@Schema(description = "이미지 URL5")
private String cotImgMainUrl5;

@Schema(description = "코디네이트 스타일")
private String cotCoordStyle;

@Schema(description = "라인 패턴", example = "L")
private String cotLinePattern;

@Schema(description = "라인 무게", example = "4")
private String cotLineWeight;

@Schema(description = "라인 색상", example = "#0000FF")
private String cotLineColor;

}
Loading
Loading