package com.crm.manager.controller;

import com.crm.manager.service.ucard.UcardWalletWithdrawFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.ucard.UcardWalletWithdrawDto;
import com.crm.rely.backend.core.entity.ucard.CardWalletWithdrawApproveEntity;
import com.crm.rely.backend.core.entity.ucard.UcardWalletWithdrawPageEntity;
import com.crm.rely.backend.core.entity.ucard.WalletWithdrawApplyEntity;
import com.crm.rely.backend.exception.ServiceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 钱包服务接口
 */
@Slf4j
@RestController
@RequestMapping("/ucard/wallet/withdraw/manager")
public class UcardWalletWithdrawController {

    @Autowired
    private UcardWalletWithdrawFeignService walletWithdrawFeignService;

    /**
     * 钱包提款分页列表
     */
    @PostMapping("/page")
    ResultWithPagerDto<UcardWalletWithdrawDto> getWalletWithdrawPage(@RequestBody UcardWalletWithdrawPageEntity entity) throws ServiceException{
        return walletWithdrawFeignService.getWalletWithdrawPage(entity);
    }

    /**
     * 钱包提款申请
     */
    @PostMapping("/apply")
    BaseResultDto walletWithdrawApply(@RequestBody WalletWithdrawApplyEntity entity) throws ServiceException{
        return walletWithdrawFeignService.walletWithdrawApply(entity);
    }

    /**
     * 钱包提款审核
     */
    @PostMapping("/approve")
    BaseResultDto walletWithdrawApprove(@RequestBody CardWalletWithdrawApproveEntity entity) throws ServiceException{
        return walletWithdrawFeignService.walletWithdrawApprove(entity);
    }

}
