package com.sunxung.factoring.web.fundmanagement;

import com.sunxung.factoring.component.annotation.OperationLog;
import com.sunxung.factoring.component.enums.OperationTypeEnum;
import com.sunxung.factoring.entity.ResponseJson;
import com.sunxung.factoring.entity.fundmanagement.FinancialInstitutionInfo;
import com.sunxung.factoring.entity.underlying.CustomerFileSearch;
import com.sunxung.factoring.service.fundmanagement.FinancialInstitutionService;
import com.sunxung.factoring.service.underlying.UnderlyingBasicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Yafan Wang
 * @Date 2023/2/22 14:25
 */
@RestController
@RequestMapping("/api")
public class SopApiController {

    @Autowired
    private FinancialInstitutionService financialInstitutionService;
    @Autowired
    private UnderlyingBasicInfoService underlyingBasicInfoService;
    /**
     * sop向贸理通推送资方数据
     */
    @PostMapping("/financialInstitution/addFinancialInstitution")
    @OperationLog(operationModule = "sop向贸理通推送资方数据",operationType = OperationTypeEnum.OTHER,description = "sop向贸理通推送资方数据")
    public boolean findFinancialInstitution(@RequestBody FinancialInstitutionInfo financialInstitutionInfo){
        return financialInstitutionService.addFinancialInstitution(financialInstitutionInfo);
    }

    @PostMapping(value = "/underlyingBasicInfo/allFile")
    @ResponseBody
    public Object getAllBusinessFile(@RequestBody CustomerFileSearch customerFileSearch ) {
        return new ResponseJson(underlyingBasicInfoService.getAllBusinessFile(customerFileSearch));
    }
}
