package com.fzm.mall.server.front.asset.service;

import com.fzm.mall.server.front.asset.model.UserAsset;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fzm.mall.server.front.asset.model.dto.AssetTranDTO;
import com.fzm.mall.server.front.asset.model.dto.coin.FrozenCoinDTO;
import com.fzm.mall.server.front.asset.model.po.qo.CoinLogQO;
import com.fzm.mall.server.front.asset.model.po.qo.CoinQO;
import com.fzm.mall.server.front.asset.model.vo.asset.UserAssetVo;
import com.fzm.mall.server.front.asset.model.vo.coin.CoinLogVO;
import com.fzm.mall.server.front.asset.model.vo.coin.UserCoinVO;
import com.fzm.mall.server.front.base.PageVO;
import com.fzm.mall.server.front.goods.model.vo.PageVo;
import com.fzm.mall.server.front.user.model.User;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 用户资产信息表 服务类
 * </p>
 *
 * @author fzm
 * @since 2021-03-01
 */
public interface IUserAssetService extends IService<UserAsset> {
    PageVO<UserAsset> pageAsset(final UserAssetVo userAssetVo);

    String mallAssetTrans(AssetTranDTO dto, User user);

    UserAssetVo getOwnAsset(String uid,String coin);
    /**
     * 查询是否有充足的指定币
     */
    default boolean coinEnough(String uid, String isToken, String coin, String block, String amount) {
        return false;
    }

    /**
     * 增加用户币
     */
    default boolean addUserCoin(String uid, Integer isToken, String coin, Integer block, String amount, int channel, String address) {
        return false;
    }

    /**
     * 增加用户币不记录日志
     */
    default boolean addUserCoinNoLog(String uid, Integer isToken, String coin, Integer block, String amount) {
        return false;
    }

    /**
     * 减少用户币
     */
    default boolean minusUserCoin(String uid, Integer isToken, String coin, Integer block, String amount, int channel, String address) {
        return false;
    }

    /**
     * 减少用户币不记录日志
     */
    default boolean minusUserCoinNoLog(String uid, Integer isToken, String coin, Integer block, String amount) {
        return false;
    }

    /**
     * 冻结用户币
     */
    default boolean frozenUserCoin(String uid, Integer isToken, String coin, Integer block, String amount) {
        return false;
    }

    /**
     * 解冻用户币
     */
    default boolean unfrozenUserCoin(String uid, Integer isToken, String coin, Integer block, String amount) {
        return false;
    }

    /**
     * 减少用户冻结币
     */
    default boolean minusUserfrozenCoin(String uid, Integer isToken, String coin, Integer block, String amount, int channel, String address) {
        return false;
    }

    /**
     * 增加用户冻结币
     */
    default boolean addUserfrozenCoin(String uid, Integer isToken, String coin, Integer block, String amount, int channel, String address){
        return false;
    }

    /**
     * 查询用户指定资产
     */
    default UserAsset coin(String uid, String isToken, String coin, String block) {
        return null;
    }

    /**
     * 分页查询用户账户资产
     */
    default PageVO<UserCoinVO> pageCoin(CoinQO coinQO) {
        return null;
    }

    /**
     * 分页查询用户充提币记录
     */
    default PageVO<CoinLogVO> pageLog(CoinLogQO coinLogQO) {
        return null;
    }


    /**
     * 批量冻结积分
     */
    default boolean batchfrozenUserCoin(List<FrozenCoinDTO> frozenCoinList){return false;}

    /**
     * 批量解冻积分
     */
    default boolean unbatchfrozenUserCoin(List<FrozenCoinDTO> frozenCoinList){return false;}

    // NOTC使用获取指定用户指定资产
    default List<UserAsset> coinList(String uid, List<String> coins) {
        return null;
    }

    int delAsset(String uid, BigDecimal unpaidAmount,String coionName);

    UserAsset getCoin(String uid, String value);

    List<UserAsset> getList(String uid, PageVo pageVo);

    Integer getCount(String uid);

    BigDecimal getAllNotMallCoin(String uid,String mallCoin);

    void addCoin(Long id, BigDecimal amount);

    int frozenUserAssets(String uid, String coin, Integer number);

    int unfrozenUserAsset(String uid, Integer number, String coin);

    void addUserfrozenAsset(Long id, BigDecimal amount);

    UserAsset getAmountByUidAndCoinForUpdate(String uid, String string);

    int deleteFrozen(Long id, BigDecimal amount);


    int addReward(String uid, String commentId, BigDecimal evaluationRefund);

    int deleteAmount(Long id, BigDecimal amount);
}
