알람
- 추가 슬롯 구매 기능 추가
This commit is contained in:
@@ -5,6 +5,8 @@ import kr.co.vividnext.sodalive.common.SodaException
|
||||
import kr.co.vividnext.sodalive.member.Member
|
||||
import org.springframework.security.core.annotation.AuthenticationPrincipal
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.PathVariable
|
||||
import org.springframework.web.bind.annotation.PostMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
|
||||
@@ -21,4 +23,19 @@ class AlarmController(private val service: AlarmService) {
|
||||
service.getSlotQuantityAndPrice(memberId = member.id!!)
|
||||
)
|
||||
}
|
||||
|
||||
@PostMapping("/buy-slot/{container}")
|
||||
fun buyExtraSlot(
|
||||
@PathVariable("container") container: String,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
|
||||
ApiResponse.ok(
|
||||
service.buyExtraSlot(
|
||||
memberId = member.id!!,
|
||||
container = container
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user