Skip to content

Commit

Permalink
[KAN-000] add naver review, rating
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok committed May 26, 2024
1 parent c4b200b commit 283d39d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class Restaurant(
@Column(name = "latitude")
var latitude: Double,

@Column(name = "naver_rating_avg")
var naverRatingAvg: Double,

@Column(name = "naver_review_count")
var naverReviewCount: Int,

@OneToMany(mappedBy = "restaurantId", cascade = [CascadeType.ALL], fetch = FetchType.LAZY)
var menus: MutableList<Menu> = mutableListOf()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ data class RestaurantDto(
@Schema(description = "latitude")
val latitude: Double,

@Schema(description = "네이버 평점 평균")
val naverRatingAvg: Double,
@Schema(description = "네이버 리뷰 수")
val naverReviewCount: Int,

@Schema(description = "식당 상세 정보")
val detailInfo: RestaurantDetailDto
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ data class RestaurantEsDocument(
discountContent = discountContent,
longitude = 0.0, // RDB
latitude = 0.0, // RDB
naverRatingAvg = naverRating ?: 0.0,
naverReviewCount = naverReviewCount.toInt(),
detailInfo = RestaurantDetailDto(
contactNumber = "",
address = address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ data class RestaurantProjectionDto(
discountContent = restaurant.discountContent,
longitude = restaurant.longitude,
latitude = restaurant.latitude,
naverRatingAvg = restaurant.naverRatingAvg,
naverReviewCount = restaurant.naverReviewCount,
detailInfo = RestaurantDetailDto(
contactNumber = restaurant.contactNumber,
address = restaurant.address,
Expand Down

0 comments on commit 283d39d

Please sign in to comment.