package com.crm.manager.controller;

import com.crm.manager.service.ucard.UcardWalletAddressFeignService;
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.vaultody.VaultodyDepositAddressDto;
import com.crm.rely.backend.core.entity.ucard.vaultody.VaultodyDepositAddressPageEntity;
import com.crm.rely.backend.core.entity.ucard.vaultody.VaultodyResetDepositAddressEntity;
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/address")
public class UcardWalletAddressController {

    @Autowired
    private UcardWalletAddressFeignService ucardWalletAddressFeignService;

    /**
     * 钱包地址分页列表
     */
    @PostMapping("/page")
    ResultWithPagerDto<VaultodyDepositAddressDto> getDepositAddressPage(@RequestBody VaultodyDepositAddressPageEntity entity) throws ServiceException{
        return ucardWalletAddressFeignService.getDepositAddressPage(entity);
    }

    /**
     * 重置钱包地址
     */
    @PostMapping("/reset")
    BaseResultDto resetDepositAddress(@RequestBody VaultodyResetDepositAddressEntity entity) throws ServiceException{
        return ucardWalletAddressFeignService.resetDepositAddress(entity);
    }

}
