package com.playlet.web.service.app.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.playlet.common.core.text.Convert;
import com.playlet.system.domain.PlayletItemType;
import com.playlet.system.domain.PlayletUserAccount;
import com.playlet.system.service.IPlayletItemTypeService;
import com.playlet.system.service.IPlayletUserAccountService;
import com.playlet.web.service.app.PlayletUserAccountAppService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date: 2024-03-25 15:33
 * @Author: 但星霖
 * @Version: v1.0
 * @Description: 短剧用户提现账户app接口实现层
 */
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletUserAccountAppServiceImpl implements PlayletUserAccountAppService {

    private final IPlayletUserAccountService playletUserAccountService;

    @Override
    public PageInfo<PlayletUserAccount> getAccountList(PlayletUserAccount playletUserAccount, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PlayletUserAccount> list = playletUserAccountService.selectPlayletUserAccountList(playletUserAccount);
        return PageInfo.of(list);
    }

    @Override
    public PlayletUserAccount selectPlayletUserAccountById(Long id) {
        return playletUserAccountService.selectPlayletUserAccountById(id);
    }

    @Override
    public List<PlayletUserAccount> selectPlayletUserAccountList(PlayletUserAccount playletUserAccount) {
        return playletUserAccountService.selectPlayletUserAccountList(playletUserAccount);
    }

    @Override
    public int insertPlayletUserAccount(PlayletUserAccount playletUserAccount) {
        // todo: 此处等待补充逻辑 看看一共有多少条数据。
        // todo：添加银行卡类型枚举进行判断。
        return playletUserAccountService.insertPlayletUserAccount(playletUserAccount);
    }

    @Override
    public int updatePlayletUserAccount(PlayletUserAccount playletUserAccount) {
        return playletUserAccountService.updatePlayletUserAccount(playletUserAccount);
    }

    @Override
    public int deletePlayletUserAccountByIds(String ids) {
        return playletUserAccountService.deletePlayletUserAccountByIds(ids);
    }

    @Override
    public int deletePlayletUserAccountById(Long id) {
        return playletUserAccountService.deletePlayletUserAccountById(id);
    }
}
