package com.ruoyi.ss.channelWithdraw.service.impl;

import com.ruoyi.ss.channelWithdraw.domain.ChannelWithdraw;
import com.ruoyi.ss.channelWithdraw.domain.ChannelWithdrawQuery;
import com.ruoyi.ss.channelWithdraw.domain.ChannelWithdrawVO;
import com.ruoyi.ss.channelWithdraw.mapper.ChannelWithdrawMapper;
import com.ruoyi.ss.channelWithdraw.service.ChannelWithdrawService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 提现渠道Service业务层处理
 *
 * @author ruoyi
 * @date 2024-08-02
 */
@Service
public class ChannelWithdrawServiceImpl implements ChannelWithdrawService
{
    @Resource
    private ChannelWithdrawMapper rlChannelWithdrawMapper;

//    @Autowired
//    private AccountService accountService;

    /**
     * 查询提现渠道
     *
     * @param channelId 提现渠道主键
     * @return 提现渠道
     */
    @Override
    public ChannelWithdrawVO selectChannelWithdrawByChannelId(Long channelId)
    {
        return rlChannelWithdrawMapper.selectChannelWithdrawByChannelId(channelId);
    }

    /**
     * 查询提现渠道列表
     *
     * @param channelWithdraw 提现渠道
     * @return 提现渠道
     */
    @Override
    public List<ChannelWithdrawVO> selectChannelWithdrawList(ChannelWithdrawQuery channelWithdraw)
    {
        return rlChannelWithdrawMapper.selectChannelWithdrawList(channelWithdraw);
    }

    /**
     * 查询所有提现渠道列表
     *
     * @return 提现渠道
     */
    @Override
    public List<ChannelWithdrawVO> selectAllChannelWithdrawList() {
        return rlChannelWithdrawMapper.selectAllChannelWithdrawList();
    }

    /**
     * 新增提现渠道
     *
     * @param channelWithdraw 提现渠道
     * @return 结果
     */
    @Override
    public int insertChannelWithdraw(ChannelWithdraw channelWithdraw)
    {
        return rlChannelWithdrawMapper.insertChannelWithdraw(channelWithdraw);
    }

    /**
     * 修改提现渠道
     *
     * @param channelWithdraw 提现渠道
     * @return 结果
     */
    @Override
    public int updateChannelWithdraw(ChannelWithdraw channelWithdraw)
    {
        return rlChannelWithdrawMapper.updateChannelWithdraw(channelWithdraw);
    }

    /**
     * 批量删除提现渠道
     *
     * @param channelIds 需要删除的提现渠道主键
     * @return 结果
     */
    @Override
    public int deleteChannelWithdrawByChannelIds(Long[] channelIds)
    {
        return rlChannelWithdrawMapper.deleteChannelWithdrawByChannelIds(channelIds);
    }

    /**
     * 删除提现渠道信息
     *
     * @param channelId 提现渠道主键
     * @return 结果
     */
    @Override
    public int deleteChannelWithdrawByChannelId(Long channelId)
    {
        return rlChannelWithdrawMapper.deleteChannelWithdrawByChannelId(channelId);
    }

    @Override
    public List<ChannelWithdrawVO> selectEnabledList(Long userId) {
        // 查询用户账户列表
//        List<AccountVO> accountList = accountService.selectByUserId(userId);
//        if (CollectionUtils.isEmptyElement(accountList)) {
//            return Collections.emptyList();
//        }
        // 查询渠道列表
//        ChannelWithdrawQuery query = new ChannelWithdrawQuery();
//        query.setAccountTypes(CollectionUtils.map(accountList, AccountVO::getAccountType));
//        query.setEnabled(true);
//        return this.selectChannelWithdrawList(query);
        return null;
    }
}
