-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from Kid-Bean/refactor/ldy/performance
refactor: 낙관적 락을 이용한 데드락 관리
- Loading branch information
Showing
5 changed files
with
36 additions
and
21 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/main/java/soongsil/kidbean/server/imagequiz/application/ImageQuizServiceFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package soongsil.kidbean.server.imagequiz.application; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Component; | ||
import soongsil.kidbean.server.imagequiz.dto.response.ImageQuizSolveScoreResponse; | ||
import soongsil.kidbean.server.quizsolve.dto.request.QuizSolvedRequest; | ||
|
||
@RequiredArgsConstructor | ||
@Component | ||
public class ImageQuizServiceFacade { | ||
|
||
private final ImageQuizService imageQuizService; | ||
private final MemberScoreUpdateStrategy memberScoreUpdateStrategy; | ||
|
||
public ImageQuizSolveScoreResponse solveImageQuizzes( | ||
List<QuizSolvedRequest> quizSolvedRequestList, Long memberId | ||
) { | ||
ImageQuizSolveScoreResponse score = | ||
imageQuizService.solveImageQuizzes(quizSolvedRequestList, memberId); | ||
|
||
if (score.score() != 0) { | ||
memberScoreUpdateStrategy.updateUserScore(score.score(), memberId); | ||
} | ||
|
||
return score; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters