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.User;
import com.ruoyi.cai.dto.admin.vo.AccountAdminVo;
import com.ruoyi.cai.enums.AccountBusinessEnum;
import com.ruoyi.cai.enums.AccountChangeEnum;
import com.ruoyi.common.core.domain.PageQuery;
import org.springframework.transaction.annotation.Transactional;

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

    Account getByUserId(Long userId);

    ConsumeLog decr(ConsumeLog log, AccountBusinessEnum businessEnum);

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

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

    void recharge(ConsumeLog consumeLog);

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

    void distribution(Long userId, Long amount, AccountChangeEnum oneEnum,Long traceId);
}
