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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface RankingData {

Integer getReviewCount();

Float getRating();
Double getRating();

String getProfileImage();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class RankingResponseDto {

private Long userId;
private String userNickname;
private Float rating;
private Double rating;
private Integer reviewCount;
private Category category;
private Integer rank;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ORDER BY (
SELECT r.reviewee.id as userId,
r.reviewee.nickname as userNickname,
CAST(COUNT(r.reviewId) AS INTEGER) as reviewCount,
AST(AVG(r.rating) AS FLOAT) as rating,
CAST(AVG(r.rating) AS DOUBLE) as rating,
p.profileImage as profileImage
FROM Review r
JOIN r.lesson l
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private void createReviews(List<User> instructors, List<User> students, List<Les
// 평점은 metadata의 rating μ£Όλ³€μœΌλ‘œ 생성
double baseRating = metadata.getRating();
double reviewRating = Math.max(1.0d, Math.min(5.0d,
baseRating + (random.nextFloat() - 0.5d) * 2)); // Β±1점 λ²”μœ„
baseRating + (random.nextDouble() - 0.5d) * 2)); // Β±1점 λ²”μœ„

Review review = Review.builder()
.reviewer(randomStudent)
Expand Down Expand Up @@ -228,7 +228,7 @@ private int generateReviewCount() {

private double generateRating() {
// 3.0 ~ 5.0 μ‚¬μ΄μ˜ 평점 생성 (μ†Œμˆ˜μ  1자리)
double rating = 3.0d + random.nextFloat() * 2.0d;
double rating = 3.0d + random.nextDouble() * 2.0d;
return Math.round(rating * 10) / 10.0d;
}
}