Compare commits
No commits in common. "c29988acf491635eaf7b0a15d650f59d4732de50" and "eadbf56dae4cb07a60ce6a653503451d0b1b01a1" have entirely different histories.
c29988acf4
...
eadbf56dae
|
@ -27,15 +27,10 @@ class OrderService(
|
||||||
) {
|
) {
|
||||||
@Transactional
|
@Transactional
|
||||||
fun order(contentId: Long, orderType: OrderType, container: String, member: Member) {
|
fun order(contentId: Long, orderType: OrderType, container: String, member: Member) {
|
||||||
|
val order = Order(type = orderType)
|
||||||
val content = audioContentRepository.findByIdAndActive(contentId)
|
val content = audioContentRepository.findByIdAndActive(contentId)
|
||||||
?: throw SodaException("잘못된 콘텐츠 입니다\n다시 시도해 주세요.")
|
?: throw SodaException("잘못된 콘텐츠 입니다\n다시 시도해 주세요.")
|
||||||
|
|
||||||
val order = if (content.isOnlyRental) {
|
|
||||||
Order(type = OrderType.RENTAL)
|
|
||||||
} else {
|
|
||||||
Order(type = orderType)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (member.id!! == content.member!!.id!!) throw SodaException("자신이 올린 콘텐츠는 구매할 수 없습니다.")
|
if (member.id!! == content.member!!.id!!) throw SodaException("자신이 올린 콘텐츠는 구매할 수 없습니다.")
|
||||||
if (repository.isExistOrdered(memberId = member.id!!, contentId = contentId)) {
|
if (repository.isExistOrdered(memberId = member.id!!, contentId = contentId)) {
|
||||||
throw SodaException("이미 구매한 콘텐츠 입니다.")
|
throw SodaException("이미 구매한 콘텐츠 입니다.")
|
||||||
|
|
Loading…
Reference in New Issue