Skip to content

Commit

Permalink
YEL-92 [feat] 투표하기 구독 여부 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonjeongs committed Aug 14, 2023
1 parent 40c5387 commit 1c534cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public record QuestionForVoteResponse(
QuestionVO question,
List<FriendShuffleResponse> friendList,
List<String> keywordList,
Integer questionPoint
Integer questionPoint,
String subscribe
) {

}
6 changes: 5 additions & 1 deletion src/main/java/com/yello/server/domain/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ public void increaseRecommendCount() {
}

public void plusPoint(Integer point) {
this.point += point;
if (this.getSubscribe() == Subscribe.NORMAL) {
this.point += point;
return;
}
this.point += point * 2;
}

public void minusPoint(Integer point) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ private QuestionForVoteResponse generateVoteQuestion(User user, Question questio
.keywordList(getShuffledKeywords(question))
.question(QuestionVO.of(question))
.questionPoint(randomPoint())
.subscribe(user.getSubscribe().toString())
.build();
}

Expand Down

0 comments on commit 1c534cc

Please sign in to comment.