|
|
|
@ -4,10 +4,7 @@ import com.qniao.daca.domian.aggregate.rtcchannel.constant.RtcChannelTypeEnum; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.request.UserConsumeVirtualAccountDto; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.request.UserCostChannelGiftDto; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.request.UserCostIMGiftDto; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.response.CheckOneOnOneRtcConsumeVo; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.response.CostGiftVo; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.response.FreezeOneOnOneRtcConsumeVo; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.response.UserConsumeVirtualAccountVo; |
|
|
|
import com.qniao.dam.api.command.virtualaccount.user.response.*; |
|
|
|
import com.qniao.dam.api.query.product.user.response.UserGetProductByCategoryVo; |
|
|
|
import com.qniao.dam.domain.aggregate.order.entity.Order; |
|
|
|
import com.qniao.dam.domain.aggregate.order.entity.OrderItem; |
|
|
|
@ -394,9 +391,28 @@ public class VirtualAccountApplicationService extends BaseApplicationService { |
|
|
|
vo.setAvailableBalance(virtualAccount.getBalance()); |
|
|
|
vo.setUnitSellingPrice(productSpec.getUnitSellingPrice()); |
|
|
|
} else { |
|
|
|
vo.setFreezeBalance(0); |
|
|
|
vo.setAvailableBalance(Objects.nonNull(virtualAccount) ? virtualAccount.getBalance() : 0); |
|
|
|
vo.setUnitSellingPrice(productSpec.getUnitSellingPrice()); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
public QueryOneOnOneRtcConsumeVo queryOneOnOneRtcConsume(Long userId, RtcChannelTypeEnum rtcChannelType) { |
|
|
|
QueryOneOnOneRtcConsumeVo vo = new QueryOneOnOneRtcConsumeVo(); |
|
|
|
UserGetProductByCategoryVo productSpec = null; |
|
|
|
if (RtcChannelTypeEnum.ONE_ON_ONE_VOICE.equals(rtcChannelType)) { |
|
|
|
//一对一语音 |
|
|
|
productSpec = productQueryService.getProductByCategory(ProductSubCategoryEnum.CHAT_VOICE_FEE.getValue()); |
|
|
|
} else if (RtcChannelTypeEnum.ONE_ON_ONE_VIDEO.equals(rtcChannelType)) { |
|
|
|
//一对一视频 |
|
|
|
productSpec = productQueryService.getProductByCategory(ProductSubCategoryEnum.CHAT_VIDEO_FEE.getValue()); |
|
|
|
} |
|
|
|
vo.setUnitSellingPrice(productSpec.getUnitSellingPrice()); |
|
|
|
VirtualAccount virtualAccount = virtualAccountQueryService.queryBy(userId); |
|
|
|
if (Objects.nonNull(virtualAccount)) { |
|
|
|
vo.setAvailableBalance(virtualAccount.getBalance()); |
|
|
|
} |
|
|
|
return vo; |
|
|
|
} |
|
|
|
} |