package com.github.wxiaoqi.security.admin.rest.admin;


import com.github.wxiaoqi.security.admin.biz.CompanyWalletBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyWalletCathBiz;
import com.github.wxiaoqi.security.admin.biz.CompanyWalletDetailBiz;
import com.github.wxiaoqi.security.admin.dto.*;
import com.github.wxiaoqi.security.admin.entity.CompanyWalletCath;
import com.github.wxiaoqi.security.admin.entity.CompanyWalletDetail;
import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import com.github.wxiaoqi.security.admin.vo.CompanyWalletDetailVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("backstage/wallet")
public class AdminCompanyWalletDetailController extends BaseController<CompanyWalletDetailBiz, CompanyWalletDetail> implements UserRestInterface {

    @Autowired
    UserFeign userFeign;

    @Override
    public UserFeign getUserFeign() {
        return userFeign;
    }


    @Autowired
    CompanyWalletCathBiz walletCathBiz;

    @Autowired
    CompanyWalletBiz walletBiz;


    @RequestMapping(value = "selectList", method = RequestMethod.GET)
    @ApiModelProperty(value = "营收明细列表")
    public ObjectRestResponse<PageDataVO<CompanyWalletDetailVo>> selectList(WalletDetailDTO walletDetailDTO) {
        setPowerData(walletDetailDTO);
        return ObjectRestResponse.succ(baseBiz.selectList(walletDetailDTO));
    }


    @RequestMapping(value = "sumAmount", method = RequestMethod.GET)
    @ApiModelProperty(value = "营收统计")
    public ObjectRestResponse sumAmount(WalletDetailDTO walletDetailDTO) {
        setPowerData(walletDetailDTO);
        return ObjectRestResponse.succ(baseBiz.getSumAmount(walletDetailDTO));
    }



    @RequestMapping(value = "cath/selectList", method = RequestMethod.GET)
    @ApiModelProperty(value = "提现明细列表")
    public ObjectRestResponse<PageDataVO<CompanyWalletDetailVo>> cathSelectList(WalletCathDTO walletCathDTO) {
        setPowerData(walletCathDTO);
        return ObjectRestResponse.succ(walletCathBiz.selectList(walletCathDTO));
    }


    @RequestMapping(value = "amount/selectList", method = RequestMethod.GET)
    @ApiModelProperty(value = "钱包列表")
    public ObjectRestResponse<PageDataVO<CompanyWalletDetailVo>> amountSelectList(CompanyWalletDTO walletDTO) {
        setPowerData(walletDTO);
        return ObjectRestResponse.succ(walletBiz.selectList(walletDTO));
    }



    @RequestMapping(value = "withDrawProcess", method = RequestMethod.POST)
    @ApiModelProperty(value = "提现审核")
    public ObjectRestResponse withDrawProcess(@RequestBody CompanyWalletCath companyWalletCath) {
        walletCathBiz.withDrawProcess(companyWalletCath);
        return ObjectRestResponse.succ();
    }


    @RequestMapping(value = "selectListByCath", method = RequestMethod.GET)
    @ApiModelProperty(value = "提现记录")
    public ObjectRestResponse<PageDataVO<CompanyWalletDetailVo>> selectListByCath(WalletCathDTO walletCathDTO) {
        return ObjectRestResponse.succ(walletCathBiz.selectList(walletCathDTO));
    }


}