-
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 #60 from TeamMiso/feat/point-give
포인트 지급하기 API 구현
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/andreas311/miso/domain/user/application/port/input/GivePointUseCase.kt
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,5 @@ | ||
package andreas311.miso.domain.user.application.port.input | ||
|
||
interface GivePointUseCase { | ||
fun execute() | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/kotlin/andreas311/miso/domain/user/application/service/GivePointService.kt
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,18 @@ | ||
package andreas311.miso.domain.user.application.service | ||
|
||
import andreas311.miso.common.annotation.RollbackService | ||
import andreas311.miso.domain.auth.application.port.output.UserSecurityPort | ||
import andreas311.miso.domain.user.application.port.input.GivePointUseCase | ||
import andreas311.miso.domain.user.application.port.output.CommandUserPort | ||
|
||
@RollbackService | ||
class GivePointService( | ||
private val commandUserPort: CommandUserPort, | ||
private val userSecurityPort: UserSecurityPort | ||
) : GivePointUseCase { | ||
override fun execute() { | ||
val user = userSecurityPort.currentUser() | ||
|
||
commandUserPort.saveUser(user.addPoint(100)) | ||
} | ||
} |