Skip to content

Commit d34fdd4

Browse files
authored
YEL-92 [feat] 투표 조회하기 구독여부 추가
YEL-92 [feat] 투표 조회하기 구독여부 추가
2 parents 40c5387 + 1c534cc commit d34fdd4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/main/java/com/yello/server/domain/question/dto/response/QuestionForVoteResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public record QuestionForVoteResponse(
99
QuestionVO question,
1010
List<FriendShuffleResponse> friendList,
1111
List<String> keywordList,
12-
Integer questionPoint
12+
Integer questionPoint,
13+
String subscribe
1314
) {
1415

1516
}

src/main/java/com/yello/server/domain/user/entity/User.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,11 @@ public void increaseRecommendCount() {
163163
}
164164

165165
public void plusPoint(Integer point) {
166-
this.point += point;
166+
if (this.getSubscribe() == Subscribe.NORMAL) {
167+
this.point += point;
168+
return;
169+
}
170+
this.point += point * 2;
167171
}
168172

169173
public void minusPoint(Integer point) {

src/main/java/com/yello/server/domain/vote/service/VoteService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ private QuestionForVoteResponse generateVoteQuestion(User user, Question questio
215215
.keywordList(getShuffledKeywords(question))
216216
.question(QuestionVO.of(question))
217217
.questionPoint(randomPoint())
218+
.subscribe(user.getSubscribe().toString())
218219
.build();
219220
}
220221

0 commit comments

Comments
 (0)