package com.crm.manager.controller;

import com.crm.manager.service.finance.FinanceCustomTransferFeignService;
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.finance.custom.FinanceCustomTransferSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.finance.custom.FinanceCustomTransferApproveEntity;
import com.crm.rely.backend.core.entity.finance.custom.FinanceCustomTransferDeleteEntity;
import com.crm.rely.backend.core.entity.finance.custom.FinanceCustomTransferSearchEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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("/custom/transfer")
public class FinanceCustomTransferController {


    @Autowired
    private FinanceCustomTransferFeignService service;

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

        return service.approve(entity);
    }

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

        return service.delete(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<FinanceCustomTransferSearchDto> searcherList(@RequestBody @Validated FinanceCustomTransferSearchEntity entity) throws Exception {

        return service.searcherList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<FinanceCustomTransferSearchDto> searcherSingle(@RequestBody @Validated SingleLongEntity entity) throws Exception {

        return service.searcherSingle(entity);
    }
}
