Compare commits

...

2 Commits

Author SHA1 Message Date
Klaus c8764be69f coin -> can 으로 변경 2023-08-13 19:47:28 +09:00
Klaus c9970ce7ca 불필요한 logger 제거 2023-08-09 12:17:37 +09:00
12 changed files with 22 additions and 27 deletions

View File

@ -38,7 +38,7 @@ class AdminCanService(
val member = memberRepository.findByIdOrNull(request.memberId) val member = memberRepository.findByIdOrNull(request.memberId)
?: throw SodaException("잘못된 회원번호 입니다.") ?: throw SodaException("잘못된 회원번호 입니다.")
if (request.can <= 0) throw SodaException("0 코인 이상 입력하세요.") if (request.can <= 0) throw SodaException("1 캔 이상 입력하세요.")
if (request.method.isBlank()) throw SodaException("기록내용을 입력하세요.") if (request.method.isBlank()) throw SodaException("기록내용을 입력하세요.")
val charge = Charge(0, request.can, status = ChargeStatus.ADMIN) val charge = Charge(0, request.can, status = ChargeStatus.ADMIN)

View File

@ -90,15 +90,15 @@ class CanPaymentService(
useCanRepository.save(useCan) useCanRepository.save(useCan)
setUseCoinCalculate(recipientId, useRewardCan, useChargeCan, useCan, paymentGateway = PaymentGateway.PG) setUseCanCalculate(recipientId, useRewardCan, useChargeCan, useCan, paymentGateway = PaymentGateway.PG)
setUseCoinCalculate( setUseCanCalculate(
recipientId, recipientId,
useRewardCan, useRewardCan,
useChargeCan, useChargeCan,
useCan, useCan,
paymentGateway = PaymentGateway.GOOGLE_IAP paymentGateway = PaymentGateway.GOOGLE_IAP
) )
setUseCoinCalculate( setUseCanCalculate(
recipientId, recipientId,
useRewardCan, useRewardCan,
useChargeCan, useChargeCan,
@ -107,7 +107,7 @@ class CanPaymentService(
) )
} }
private fun setUseCoinCalculate( private fun setUseCanCalculate(
recipientId: Long?, recipientId: Long?,
useRewardCan: TotalSpentCan, useRewardCan: TotalSpentCan,
useChargeCan: TotalSpentCan?, useChargeCan: TotalSpentCan?,
@ -271,8 +271,8 @@ class CanPaymentService(
) ?: throw SodaException("잘못된 예약정보 입니다.") ) ?: throw SodaException("잘못된 예약정보 입니다.")
useCan.isRefund = true useCan.isRefund = true
val useCoinCalculates = useCanCalculateRepository.findByUseCanIdAndStatus(useCan.id!!) val useCanCalculates = useCanCalculateRepository.findByUseCanIdAndStatus(useCan.id!!)
useCoinCalculates.forEach { useCanCalculates.forEach {
it.status = UseCanCalculateStatus.REFUND it.status = UseCanCalculateStatus.REFUND
val charge = Charge(0, it.can, status = ChargeStatus.REFUND_CHARGE) val charge = Charge(0, it.can, status = ChargeStatus.REFUND_CHARGE)
charge.title = "${it.can}" charge.title = "${it.can}"

View File

@ -150,7 +150,7 @@ class AudioContentService(
val theme = themeQueryRepository.findThemeByIdAndActive(id = request.themeId) val theme = themeQueryRepository.findThemeByIdAndActive(id = request.themeId)
?: throw SodaException("잘못된 테마입니다. 다시 선택해 주세요.") ?: throw SodaException("잘못된 테마입니다. 다시 선택해 주세요.")
if (request.price in 1..9) throw SodaException("콘텐츠의 최소금액은 10코인 입니다.") if (request.price in 1..9) throw SodaException("콘텐츠의 최소금액은 10 입니다.")
// DB에 값 추가 // DB에 값 추가
val audioContent = AudioContent( val audioContent = AudioContent(

View File

@ -67,7 +67,7 @@ class AudioContentCommentQueryRepositoryImpl(
"$cloudFrontHost/profile/default-profile.png" "$cloudFrontHost/profile/default-profile.png"
}, },
comment = it.comment, comment = it.comment,
donationCoin = it.donationCan ?: 0, donationCan = it.donationCan ?: 0,
date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")), date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")),
replyCount = commentReplyCountByAudioContentCommentId(it.id!!) replyCount = commentReplyCountByAudioContentCommentId(it.id!!)
) )
@ -131,7 +131,7 @@ class AudioContentCommentQueryRepositoryImpl(
"$cloudFrontHost/profile/default-profile.png" "$cloudFrontHost/profile/default-profile.png"
}, },
comment = it.comment, comment = it.comment,
donationCoin = it.donationCan ?: 0, donationCan = it.donationCan ?: 0,
date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")), date = date.format(DateTimeFormatter.ofPattern("yyyy.MM.dd E hh:mm a")),
replyCount = 0 replyCount = 0
) )

View File

@ -11,7 +11,7 @@ data class GetAudioContentCommentListItem(
val nickname: String, val nickname: String,
val profileUrl: String, val profileUrl: String,
val comment: String, val comment: String,
val donationCoin: Int, val donationCan: Int,
val date: String, val date: String,
val replyCount: Int val replyCount: Int
) )

View File

@ -58,7 +58,7 @@ class ExplorerQueryRepository(
creatorId: Long, creatorId: Long,
limit: Long, limit: Long,
offset: Long = 0, offset: Long = 0,
withDonationCoin: Boolean withDonationCan: Boolean
): List<MemberDonationRankingResponse> { ): List<MemberDonationRankingResponse> {
val creator = QMember("creator") val creator = QMember("creator")
val member = QMember("user") val member = QMember("user")
@ -82,7 +82,7 @@ class ExplorerQueryRepository(
.fetch() .fetch()
.map { .map {
val account = it.get(member)!! val account = it.get(member)!!
val donationCoin = it.get(donation)!! val donationCan = it.get(donation)!!
MemberDonationRankingResponse( MemberDonationRankingResponse(
account.id!!, account.id!!,
account.nickname, account.nickname,
@ -91,7 +91,7 @@ class ExplorerQueryRepository(
} else { } else {
"$cloudFrontHost/profile/default-profile.png" "$cloudFrontHost/profile/default-profile.png"
}, },
if (withDonationCoin) donationCoin else 0 if (withDonationCan) donationCan else 0
) )
} }
} }

View File

@ -4,5 +4,5 @@ data class MemberDonationRankingResponse(
val userId: Long, val userId: Long,
val nickname: String, val nickname: String,
val profileImage: String, val profileImage: String,
val donationCoin: Int val donationCan: Int
) )

View File

@ -31,7 +31,7 @@ class FaqController(private val service: FaqService) {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("hasRole('ADMIN')") @PreAuthorize("hasRole('ADMIN')")
fun deleteCoin(@PathVariable id: Long) = ApiResponse.ok(service.delete(id), "삭제되었습니다.") fun deleteCan(@PathVariable id: Long) = ApiResponse.ok(service.delete(id), "삭제되었습니다.")
@GetMapping @GetMapping
fun getFaqList(@RequestParam("category") category: String) = ApiResponse.ok(service.getFaqList(category)) fun getFaqList(@RequestParam("category") category: String) = ApiResponse.ok(service.getFaqList(category))

View File

@ -1,7 +1,6 @@
package kr.co.vividnext.sodalive.fcm package kr.co.vividnext.sodalive.fcm
import kr.co.vividnext.sodalive.member.MemberRepository import kr.co.vividnext.sodalive.member.MemberRepository
import org.slf4j.LoggerFactory
import org.springframework.context.event.EventListener import org.springframework.context.event.EventListener
import org.springframework.scheduling.annotation.Async import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component import org.springframework.stereotype.Component
@ -28,8 +27,6 @@ class FcmSendListener(
private val pushService: FcmService, private val pushService: FcmService,
private val memberRepository: MemberRepository private val memberRepository: MemberRepository
) { ) {
private val logger = LoggerFactory.getLogger(FcmSendListener::class.java)
@Async @Async
@EventListener @EventListener
fun send(fcmEvent: FcmEvent) { fun send(fcmEvent: FcmEvent) {
@ -94,8 +91,6 @@ class FcmSendListener(
container = fcmEvent.container container = fcmEvent.container
) )
logger.info("pushTokens: $pushTokens")
for (tokens in pushTokens) { for (tokens in pushTokens) {
pushService.send( pushService.send(
tokens = tokens, tokens = tokens,

View File

@ -642,7 +642,7 @@ class LiveRoomService(
.getMemberDonationRanking( .getMemberDonationRanking(
room.member!!.id!!, room.member!!.id!!,
3, 3,
withDonationCoin = false withDonationCan = false
) )
.asSequence() .asSequence()
.map { it.userId } .map { it.userId }
@ -786,7 +786,7 @@ class LiveRoomService(
fun getDonationTotal(roomId: Long): GetLiveRoomDonationTotalResponse { fun getDonationTotal(roomId: Long): GetLiveRoomDonationTotalResponse {
return GetLiveRoomDonationTotalResponse( return GetLiveRoomDonationTotalResponse(
totalDonationCoin = repository.getDonationTotal(roomId = roomId) ?: 0 totalDonationCan = repository.getDonationTotal(roomId = roomId) ?: 0
) )
} }
@ -908,8 +908,8 @@ class LiveRoomService(
) ?: throw SodaException("후원에 실패한 캔이 환불되지 않았습니다\n고객센터로 문의해주세요.") ) ?: throw SodaException("후원에 실패한 캔이 환불되지 않았습니다\n고객센터로 문의해주세요.")
useCan.isRefund = true useCan.isRefund = true
val useCoinCalculates = useCanCalculateRepository.findByUseCanIdAndStatus(useCan.id!!) val useCanCalculates = useCanCalculateRepository.findByUseCanIdAndStatus(useCan.id!!)
useCoinCalculates.forEach { useCanCalculates.forEach {
it.status = UseCanCalculateStatus.REFUND it.status = UseCanCalculateStatus.REFUND
val charge = Charge(0, it.can, status = ChargeStatus.REFUND_CHARGE) val charge = Charge(0, it.can, status = ChargeStatus.REFUND_CHARGE)
charge.title = "${it.can}" charge.title = "${it.can}"

View File

@ -1,3 +1,3 @@
package kr.co.vividnext.sodalive.live.room.donation package kr.co.vividnext.sodalive.live.room.donation
data class GetLiveRoomDonationTotalResponse(val totalDonationCoin: Int) data class GetLiveRoomDonationTotalResponse(val totalDonationCan: Int)

View File

@ -31,7 +31,7 @@ class ServiceNoticeController(private val service: ServiceNoticeService) {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@PreAuthorize("hasRole('ADMIN')") @PreAuthorize("hasRole('ADMIN')")
fun deleteCoin(@PathVariable id: Long) = ApiResponse.ok(service.delete(id), "삭제되었습니다.") fun deleteCan(@PathVariable id: Long) = ApiResponse.ok(service.delete(id), "삭제되었습니다.")
@GetMapping @GetMapping
fun getNoticeList(pageable: Pageable, timezone: String) = ApiResponse.ok(service.getNoticeList(pageable, timezone)) fun getNoticeList(pageable: Pageable, timezone: String) = ApiResponse.ok(service.getNoticeList(pageable, timezone))