Skip to content

Commit

Permalink
[KAN-000] add naver review, rating (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkyoungdeok authored May 26, 2024
1 parent c4b200b commit 676bded
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
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
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ object RestaurantUtil {
discountContent = discountContent,
menus = menus,
longitude = longitude,
latitude = latitude
latitude = latitude,
naverRatingAvg = 0.0,
naverReviewCount = 0
)
}

Expand Down

0 comments on commit 676bded

Please sign in to comment.