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
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
TMAP_APP_KEY: ${{ secrets.TMAP_APP_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TOURAPI_SERVICE_KEY: ${{ secrets.TOURAPI_SERVICE_KEY }}

jobs:
build:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
TMAP_APP_KEY: ${{ secrets.TMAP_APP_KEY }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TOURAPI_SERVICE_KEY: ${{ secrets.TOURAPI_SERVICE_KEY }}

steps:
- uses: actions/checkout@v2
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/com/mey/backend/BackendApplication.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.mey.backend;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
@EnableJpaAuditing
@SpringBootApplication
public class BackendApplication {
public static void main(String[] args) {
SpringApplication.run(BackendApplication.class, args);
}
}
package com.mey.backend;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@SpringBootApplication
public class BackendApplication {

public static void main(String[] args) {
SpringApplication.run(BackendApplication.class, args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ChatResponse createPlaceInfoResponse(String message, List<Place> places,
.placeId(place.getPlaceId())
.name(place.getNameKo())
.description(place.getDescriptionKo())
.address(place.getAddress())
.address(place.getAddressKo())
.themes(place.getThemes())
.costInfo(place.getCostInfo())
.build())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private String createDocumentFromPlace(Place place) {
StringBuilder document = new StringBuilder();
document.append("장소명: ").append(place.getNameKo()).append("\n");
document.append("설명: ").append(place.getDescriptionKo()).append("\n");
document.append("주소: ").append(place.getAddress()).append("\n");
document.append("주소: ").append(place.getAddressKo()).append("\n");
document.append("지역: ").append(place.getRegion().getNameKo()).append("\n");
document.append("테마: ").append(String.join(", ", place.getThemes())).append("\n");
document.append("비용정보: ").append(place.getCostInfo()).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public String generateRouteRecommendationAnswerWithPlaces(String question, java.
""",
place.getNameKo(),
place.getDescriptionKo(),
place.getAddress(),
place.getAddressKo(),
place.getRegion().getNameKo(),
String.join(", ", place.getThemes()),
place.getCostInfo(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mey.backend.domain.place.dto.PlaceResponseDto;
import com.mey.backend.domain.place.dto.PlaceSimpleResponseDto;
import com.mey.backend.domain.place.dto.PlaceThemeResponseDto;
import com.mey.backend.domain.place.dto.RelatedResponseDto;
import com.mey.backend.domain.place.service.PlaceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -34,9 +35,20 @@ public List<PlaceSimpleResponseDto> searchPlaces(@RequestParam String keyword) {
)
@GetMapping("/{placeId}")
public PlaceResponseDto getPlaceDetail(@PathVariable Long placeId) {

return placeService.getPlaceDetail(placeId);
}

@Operation(
summary = "장소 ID로 연계 관광지 정보 조회",
description = "장소 ID로 연계 관광지 정보를 조회한 결과를 반환합니다."
)
@GetMapping("/{placeId}/related/{language}")
public List<RelatedResponseDto> getRelatedPlaces(@PathVariable Long placeId, @PathVariable String language) {

return placeService.getRelatedPlaces(placeId, language);
}

@Operation(
summary = "인기 장소 조회",
description = "인기 장소 리스트를 조회한 결과를 반환합니다."
Expand Down
110 changes: 55 additions & 55 deletions src/main/java/com/mey/backend/domain/place/dto/PlaceResponseDto.java
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
package com.mey.backend.domain.place.dto;
import com.mey.backend.domain.place.entity.Place;
import lombok.Getter;
import java.util.List;
import java.util.Map;
@Getter
public class PlaceResponseDto {
private Long id;
private Long regionId;
private String nameKo;
private String nameEn;
private String descriptionKo;
private String descriptionEn;
private Double longitude;
private Double latitude;
private String imageUrl;
private String address;
private String contactInfo;
private String websiteUrl;
private String kakaoPlaceId;
private String tourApiPlaceId;
private Map<String, String> openingHours;
private List<String> themes;
private String costInfo;
public PlaceResponseDto(Place place) {
this.id = place.getPlaceId();
this.regionId = place.getRegion() != null ? place.getRegion().getRegionId() : null;
this.nameKo = place.getNameKo();
this.nameEn = place.getNameEn();
this.descriptionKo = place.getDescriptionKo();
this.descriptionEn = place.getDescriptionEn();
this.longitude = place.getLongitude();
this.latitude = place.getLatitude();
this.imageUrl = place.getImageUrl();
this.address = place.getAddress();
this.contactInfo = place.getContactInfo();
this.websiteUrl = place.getWebsiteUrl();
this.kakaoPlaceId = place.getKakaoPlaceId();
this.tourApiPlaceId = place.getTourApiPlaceId();
this.openingHours = place.getOpeningHours();
this.themes = place.getThemes();
this.costInfo = place.getCostInfo();
}
package com.mey.backend.domain.place.dto;

import com.mey.backend.domain.place.entity.Place;
import lombok.Getter;

import java.util.List;
import java.util.Map;

@Getter
public class PlaceResponseDto {

private Long id;
private Long regionId;

private String nameKo;
private String nameEn;

private String descriptionKo;
private String descriptionEn;

private Double longitude;
private Double latitude;

private String imageUrl;
private String address;
private String contactInfo;
private String websiteUrl;

private String kakaoPlaceId;
private String tourApiPlaceId;

private Map<String, String> openingHours;
private List<String> themes;

private String costInfo;

public PlaceResponseDto(Place place) {
this.id = place.getPlaceId();
this.regionId = place.getRegion() != null ? place.getRegion().getRegionId() : null;
this.nameKo = place.getNameKo();
this.nameEn = place.getNameEn();
this.descriptionKo = place.getDescriptionKo();
this.descriptionEn = place.getDescriptionEn();
this.longitude = place.getLongitude();
this.latitude = place.getLatitude();
this.imageUrl = place.getImageUrl();
this.address = place.getAddressKo();
this.contactInfo = place.getContactInfo();
this.websiteUrl = place.getWebsiteUrl();
this.kakaoPlaceId = place.getKakaoPlaceId();
this.tourApiPlaceId = place.getTourApiPlaceId();
this.openingHours = place.getOpeningHours();
this.themes = place.getThemes();
this.costInfo = place.getCostInfo();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mey.backend.domain.place.dto;

import lombok.*;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class RelatedResponseDto {
private String title;
private String address;
private String tel;
private String firstImage;
private String contentTypeName;
private double distance;
}
164 changes: 93 additions & 71 deletions src/main/java/com/mey/backend/domain/place/entity/Place.java
Original file line number Diff line number Diff line change
@@ -1,71 +1,93 @@
package com.mey.backend.domain.place.entity;

import com.mey.backend.domain.common.entity.BaseTimeEntity;
import com.mey.backend.domain.region.entity.Region;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import java.util.List;
import java.util.Map;

@Entity
@Table(name = "places")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Place extends BaseTimeEntity {

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

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "region_id", nullable = false)
private Region region;

@Column(nullable = false)
private String nameKo;

@Column(nullable = false)
private String nameEn;

@Column(nullable = false, columnDefinition = "TEXT")
private String descriptionKo;

@Column(nullable = false, columnDefinition = "TEXT")
private String descriptionEn;

@Column(nullable = false)
private Double longitude;

@Column(nullable = false)
private Double latitude;

@Column(nullable = false)
private String imageUrl;

@Column(nullable = false)
private String address;

private String contactInfo;

private String websiteUrl;

private String kakaoPlaceId;

private String tourApiPlaceId;

@JdbcTypeCode(SqlTypes.JSON)
@Column(columnDefinition = "json")
private Map<String, String> openingHours; // 예: "monday": "09:00-18:00"

@JdbcTypeCode(SqlTypes.JSON)
@Column(nullable = false, columnDefinition = "json")
private List<String> themes;

@Column(nullable = false)
private String costInfo;
}
package com.mey.backend.domain.place.entity;

import com.mey.backend.domain.common.entity.BaseTimeEntity;
import com.mey.backend.domain.region.entity.Region;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import java.util.List;
import java.util.Map;

@Entity
@Table(name = "places")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Place extends BaseTimeEntity {

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

@ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "region_id", nullable = false)
private Region region;

@Column(nullable = false)
private String nameKo;

@Column(nullable = false)
private String nameEn;

// @Column(nullable = false)
// private String nameJp;
//
// @Column(nullable = false)
// private String nameCh;

@Column(nullable = false, columnDefinition = "TEXT")
private String descriptionKo;

@Column(nullable = false, columnDefinition = "TEXT")
private String descriptionEn;


// @Column(nullable = false, columnDefinition = "TEXT")
// private String descriptionJp;
//
// @Column(nullable = false, columnDefinition = "TEXT")
// private String descriptionCh;

@Column(nullable = false)
private Double longitude;

@Column(nullable = false)
private Double latitude;

@Column(nullable = false)
private String imageUrl;

@Column(nullable = false)
private String addressKo;

// @Column(nullable = false)
// private String addressEn;
//
// @Column(nullable = false)
// private String addressJp;
//
// @Column(nullable = false)
// private String addressCh;

private String contactInfo;

private String websiteUrl;

private String kakaoPlaceId;

@Column(unique = true)
private String tourApiPlaceId;

@JdbcTypeCode(SqlTypes.JSON)
@Column(columnDefinition = "json")
private Map<String, String> openingHours; // 예: "monday": "09:00-18:00"

@JdbcTypeCode(SqlTypes.JSON)
@Column(nullable = false, columnDefinition = "json")
private List<String> themes;

private String costInfo;
}
Loading