package com.ruoyi.cai.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.cai.domain.Account;
import com.ruoyi.cai.domain.ConsumeLog;
import com.ruoyi.cai.domain.Gift;
import com.ruoyi.cai.domain.User;
import com.ruoyi.cai.dto.admin.vo.AccountAdminVo;
import com.ruoyi.cai.dto.video.VideoSettleResp;
import com.ruoyi.cai.dto.video.WithholdingFeeUserResp;
import com.ruoyi.cai.enums.ConsumeLogType;
import com.ruoyi.cai.enums.account.AccountChangeCodeEnum;
import com.ruoyi.cai.ws.bean.Room;
import com.ruoyi.common.core.domain.PageQuery;

/**
 * 用户账户Service接口
 *
 * @author 77
 * @date 2023-12-23
 */
public interface AccountService extends IService<Account> {

    Account getByUserId(Long userId);

    ConsumeLog guardDecr(ConsumeLog log, ConsumeLogType consumeLogType);

    ConsumeLog giftDecr(ConsumeLog consumeLog, ConsumeLogType consumeLogType, Gift gift);

    Long imDesc(User fromUser, User toUser, Long price);

    void withdraw(Long userId, Long incomeCoin, Long traceId);

    void withdrawFail(Long userId, Long incomeCoin, Long traceId);

    void recharge(ConsumeLog consumeLog);

    Page<AccountAdminVo> pageAdmin(PageQuery pageQuery, AccountAdminVo bo);

    boolean distribution(ConsumeLog consumeLog, Long userId, Long amount, AccountChangeCodeEnum accountChangeEnum);

    WithholdingFeeUserResp withholdingFeeUser(Long userId, Long price);

    VideoSettleResp videoSettle(Room room);
}
