diff --git a/ddl/insert_mock_data.sql b/ddl/insert_mock_data.sql index fa24ff9..c4cf91c 100644 --- a/ddl/insert_mock_data.sql +++ b/ddl/insert_mock_data.sql @@ -1,3 +1,5 @@ +USE `dittodining`; + INSERT INTO restaurant(restaurant_id,name,address,description,maximum_price_per_person,minimum_price_per_person,latitude,longitude,business_hours_json,recommendation_score,average_score_from_naver,total_review_count_from_naver,average_score_from_kakao,total_review_count_from_kakao,total_review_count) VALUES (1,'농민백암순대 본점','서울특별시 강남구 선릉로86길 40-4','다코숨은맛집'', ''수요미식회'', ''혼밥'', ''식사모임''',13000,10000,127.0530139,37.5037,'[ { "dayOfWeek": "DAY_OF_WEEK_SUNDAY", diff --git a/server/repository/recommendation/restaurant_recommendation_repository.go b/server/repository/recommendation/restaurant_recommendation_repository.go index c2a8e36..ea4b6c0 100644 --- a/server/repository/recommendation/restaurant_recommendation_repository.go +++ b/server/repository/recommendation/restaurant_recommendation_repository.go @@ -32,7 +32,7 @@ func (r *restaurantRecommendationRepository) FindAllByRestaurantRecommendationRe whereConditions := make([]interface{}, 0) if cursorRestaurantRecommendationID != nil { - whereConditions = append(whereConditions, "restaurant_recommendation_request_id < ?", *cursorRestaurantRecommendationID) + whereConditions = append(whereConditions, "restaurant_recommendation_id > ?", *cursorRestaurantRecommendationID) } limitQuery := 10 @@ -46,7 +46,7 @@ func (r *restaurantRecommendationRepository) FindAllByRestaurantRecommendationRe RestaurantRecommendationRequestID: restaurantRecommendationRequestID, }, whereConditions...). - Order("restaurant_recommendation_request_id DESC"). + Order("restaurant_recommendation_id ASC"). Limit(limitQuery). Find(&recommendations) if result.Error != nil {