Skip to content

Commit 34b9014

Browse files
committed
hotfix: 인기도 가중치 비중 변경
1 parent 8684432 commit 34b9014

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/main/java/modelly/modelly_be/domain/recruitment/repository/recruitmentRepository/RecruitmentRepositoryCustomImpl.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import modelly.modelly_be.domain.recruitment.entity.QRecruitmentDate;
2121
import modelly.modelly_be.domain.recruitment.entity.enums.RecruitmentStatus;
2222
import modelly.modelly_be.domain.reservation.entity.QReservation;
23-
import modelly.modelly_be.domain.reservation.entity.enums.ReservationStatus;
2423
import modelly.modelly_be.global.entity.Category;
2524
import modelly.modelly_be.global.entity.SubCategory;
2625
import modelly.modelly_be.domain.review.entity.QReview;
@@ -30,7 +29,6 @@
3029
import modelly.modelly_be.global.utils.Coordinate;
3130

3231
import java.time.LocalDate;
33-
import java.time.LocalDateTime;
3432
import java.time.YearMonth;
3533
import java.util.*;
3634
import java.util.stream.Collectors;
@@ -307,12 +305,12 @@ public List<PopularRecruitmentListResponse> findPopularRecruitments(Category cat
307305

308306

309307
// 인기도 점수
310-
// 전체 예약수(40) + 전체 리뷰수(30) + 평점(20) + 전체 찜수(10)
308+
// 전체 예약수(40) + 전체 리뷰수(25) + 평점(25) + 전체 찜수(10)
311309
NumberExpression<Double> popularityScore =
312310
qRecruitment.reservationCount.doubleValue().multiply(40)
313-
.add(qRecruitment.designer.reviewCount.doubleValue().multiply(30))
311+
.add(qRecruitment.designer.reviewCount.doubleValue().multiply(25))
314312
.add(qRecruitment.likeCount.doubleValue().multiply(10))
315-
.add(ratingWithPenalty.multiply(20));
313+
.add(ratingWithPenalty.multiply(25));
316314

317315
List<Tuple> tuples = queryFactory
318316
.select(

src/main/java/modelly/modelly_be/domain/user/dto/response/DesignerListResponseDto.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public record DesignerListResponseDto(
1717
Double distance,
1818
boolean isLiked,
1919
LocalDateTime createdAt,
20-
double averageRating
20+
double averageRating,
21+
double popularityScore
2122
) {
2223
}

src/main/java/modelly/modelly_be/domain/user/repository/designerRepository/DesignerRepositoryCustomImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public List<DesignerListResponseDto> findPopularDesigners(Long userId, Category
131131
.when(averageRating.lt(3.0)).then(0.5)
132132
.otherwise(averageRating);
133133

134-
// 전체 예약수(40) + 전체 리뷰수(30) + 평점(20) + 전체 찜수(10)
134+
// 전체 예약수(40) + 전체 리뷰수(25) + 평점(25) + 전체 찜수(10)
135135
NumberExpression<Double> popularityScore =
136136
qDesigner.reservationCount.doubleValue().multiply(40)
137-
.add(qDesigner.reviewCount.doubleValue().multiply(30))
137+
.add(qDesigner.reviewCount.doubleValue().multiply(25))
138138
.add(qDesigner.likeCount.doubleValue().multiply(10))
139-
.add(ratingWithPenalty.multiply(20));
139+
.add(ratingWithPenalty.multiply(25));
140140

141141
return queryFactory.select(
142142
Projections.constructor(DesignerListResponseDto.class,
@@ -150,7 +150,8 @@ public List<DesignerListResponseDto> findPopularDesigners(Long userId, Category
150150
ExpressionUtils.as(getDistanceExpression(userCoordinate), "distance"),
151151
qDesignerLike.id.isNotNull(),
152152
qDesigner.createdAt,
153-
averageRating
153+
averageRating,
154+
popularityScore
154155
))
155156
.from(qDesigner)
156157
.leftJoin(qDesignerLike).on(isLikedByMe(userId))

0 commit comments

Comments
 (0)