package com.crm.manager.controller;

import com.crm.manager.service.merchant.MerchantTransferFeignService;
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.merchant.MerchantTransferDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.merchant.MerchantTransferApproveEntity;
import com.crm.rely.backend.core.entity.merchant.MerchantTransferDeleteEntity;
import com.crm.rely.backend.core.entity.merchant.MerchantTransferSearchEntity;
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;

@RestController
@RequestMapping("/transfer")
public class MerchantTransferController {


    @Autowired
    private MerchantTransferFeignService service;


    @PostMapping("/delete")
    public BaseResultDto delete(@RequestBody MerchantTransferDeleteEntity entity) throws Exception {

        return service.delete(entity);
    }

    @PostMapping("/approve")
    public BaseResultDto approve(@RequestBody MerchantTransferApproveEntity entity) throws Exception {


        return service.approve(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<MerchantTransferDto> searchPage(@RequestBody MerchantTransferSearchEntity entity) throws Exception {

        return service.searchPage(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto searchSingle(@RequestBody SingleLongEntity entity) throws Exception {

        return service.searchSingle(entity);
    }

    @PostMapping("/callback")
    public BaseResultDto callback(@RequestBody SingleLongEntity entity) throws Exception {

        return service.callback(entity);
    }
}
