Skip to content

Commit df9ada5

Browse files
KoSeonJeclaude
andcommitted
refactor: [DDING-000] 변수명 명확화 및 CLAUDE.md 변수명 지침 추가
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5bde7e7 commit df9ada5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- 완전히 실행 가능한 코드만 제공한다 (의사코드 금지)
1818
- `@Valid`, `@NotNull` 등 DTO 검증 어노테이션 적용
1919
- secrets/환경변수 하드코딩 절대 금지
20+
- **변수명은 의미를 알 수 있도록 작성한다**`dto`, `r`, `p` 같은 축약 금지, 역할이 드러나는 이름 사용 (예: `dto``rawRanking`, `r``ranking`)
2021

2122
### 새 기능 추가 시 필수 순서
2223
1. (DB 변경 시) `resources/db/migration/`에 Flyway 마이그레이션 파일 추가

src/main/java/ddingdong/ddingdongBE/domain/feed/service/GeneralFeedRankingService.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,20 @@ private int getLastMonthRank(Long clubId, int year, int month) {
8282
.orElse(0);
8383
}
8484

85-
private ClubFeedRankingQuery toClubFeedRankingQuery(int rank, MonthlyFeedRankingDto dto) {
86-
long feedScore = dto.getFeedCount() * FEED_WEIGHT;
87-
long viewScore = dto.getViewCount() * VIEW_WEIGHT;
88-
long likeScore = dto.getLikeCount() * LIKE_WEIGHT;
89-
long commentScore = dto.getCommentCount() * COMMENT_WEIGHT;
85+
private ClubFeedRankingQuery toClubFeedRankingQuery(int rank, MonthlyFeedRankingDto rawRanking) {
86+
long feedScore = rawRanking.getFeedCount() * FEED_WEIGHT;
87+
long viewScore = rawRanking.getViewCount() * VIEW_WEIGHT;
88+
long likeScore = rawRanking.getLikeCount() * LIKE_WEIGHT;
89+
long commentScore = rawRanking.getCommentCount() * COMMENT_WEIGHT;
9090
long totalScore = feedScore + viewScore + likeScore + commentScore;
91-
return ClubFeedRankingQuery.of(rank, dto.getClubId(), dto.getClubName(),
91+
return ClubFeedRankingQuery.of(rank, rawRanking.getClubId(), rawRanking.getClubName(),
9292
feedScore, viewScore, likeScore, commentScore, totalScore);
9393
}
9494

95-
private long calculateScore(MonthlyFeedRankingDto dto) {
96-
return dto.getFeedCount() * FEED_WEIGHT
97-
+ dto.getViewCount() * VIEW_WEIGHT
98-
+ dto.getLikeCount() * LIKE_WEIGHT
99-
+ dto.getCommentCount() * COMMENT_WEIGHT;
95+
private long calculateScore(MonthlyFeedRankingDto rawRanking) {
96+
return rawRanking.getFeedCount() * FEED_WEIGHT
97+
+ rawRanking.getViewCount() * VIEW_WEIGHT
98+
+ rawRanking.getLikeCount() * LIKE_WEIGHT
99+
+ rawRanking.getCommentCount() * COMMENT_WEIGHT;
100100
}
101101
}

0 commit comments

Comments
 (0)