package com.crm.manager.controller;

import com.crm.manager.service.finance.FinanceFollowTransferFeignService;
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.follow.transfer.FinanceFollowTransferSearchDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.finance.follow.transfer.FinanceFollowTransferApproveEntity;
import com.crm.rely.backend.core.entity.finance.follow.transfer.FinanceFollowTransferDeleteEntity;
import com.crm.rely.backend.core.entity.finance.follow.transfer.FinanceFollowTransferSearchEntity;
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("/follow/transfer")
public class FinanceFollowTransferController {


    @Autowired
    private FinanceFollowTransferFeignService service;

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

        return service.approve(entity);
    }

    @PostMapping("/delete")
    public BaseResultDto delete(@RequestBody @Validated FinanceFollowTransferDeleteEntity entity) throws Exception {
        return service.delete(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<FinanceFollowTransferSearchDto> searcherList(@RequestBody @Validated FinanceFollowTransferSearchEntity entity) throws Exception {
        return service.searcherList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<FinanceFollowTransferSearchDto> searcherSingle(@RequestBody @Validated SingleLongEntity entity) throws Exception {
        return service.searcherSingle(entity);
    }

}
