package com.crm.ucard.controller;

import com.crm.rely.backend.core.constant.FeignClientAnnotation;
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.UcardWalletDepositTransactionDto;
import com.crm.rely.backend.core.entity.ucard.UcardWalletDepositTransactionPageEntity;
import com.crm.rely.backend.exception.ServiceException;
import com.crm.ucard.service.UcardExportService;
import com.crm.ucard.service.VaultodyService;
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;

import java.util.List;

/**
 * 银行卡服务接口
 */
@Slf4j
@RestController
@RequestMapping("/ucard/encrypted/manager")
public class ManagerEncryptedController {

    @Autowired
    private VaultodyService vaultodyService;
    @Autowired
    private UcardExportService ucardExportService;

    /**
     * 加密货币交易分页列表
     */
    @PostMapping("/wallet/transaction/page")
    @FeignClientAnnotation
    ResultWithPagerDto<UcardWalletDepositTransactionDto> getWalletDepositTransactionPage(@RequestBody UcardWalletDepositTransactionPageEntity entity) throws ServiceException{
        return vaultodyService.getWalletDepositTransactionPage(entity);
    }

    /**
     * 加密货币交易记录导出
     */
    @PostMapping("/wallet/transaction/list/export")
    @FeignClientAnnotation
    BaseResultDto<List<UcardWalletDepositTransactionDto>> encryptedWalletTransactionListExport(@RequestBody UcardWalletDepositTransactionPageEntity entity) throws ServiceException{
        return ucardExportService.encryptedWalletTransactionListExport(entity);
    }

}
