package com.yn.bftl.thirdparty.modules.chinaums.controller;

import com.yn.bftl.thirdparty.modules.chinaums.dto.byx.ByxCreateMemberDTO;
import com.yn.bftl.thirdparty.modules.chinaums.dto.byx.ByxCreateMemberRuleDTO;
import com.yn.bftl.thirdparty.modules.chinaums.service.ProfitSharingService;
import com.yn.bftl.thirdparty.modules.chinaums.vo.byx.ByxChinaumsProfitSharingPartnerVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(value = "ProfitSharingController", tags = "分账相关业务")
@RestController
@RequestMapping("/chinaums/profit_sharing")
public class ProfitSharingController {

    @Resource
    private ProfitSharingService profitSharingService;

    // 百业兴业务
    @ApiOperation(value = "添加关联分账方, 一般在项目上线前调用完成之后，不予调用，实时调用")
    @RequestMapping(value = "/statement/create_partner", method = RequestMethod.POST)
    public void addPartner(ByxCreateMemberDTO byxCreateMemberDTO) {
        profitSharingService.addPartner(byxCreateMemberDTO);
    }

    @ApiOperation(value = "查询关联分账方")
    @RequestMapping(value = "/statement/query_partner", method = RequestMethod.POST)
    public ByxChinaumsProfitSharingPartnerVO queryPartner() {
        return profitSharingService.queryPartner();
    }

    @ApiOperation(value = "添加分账规则, 一般在项目上线前调用完成之后，不予调用，非实时，需要银行审核")
    @RequestMapping(value = "/statement/create_rules", method = RequestMethod.POST)
    public void addRules(ByxCreateMemberRuleDTO byxCreateMemberRuleDTO) {
        profitSharingService.addRules(byxCreateMemberRuleDTO);
    }

    @ApiOperation(value = "同步更新审核状态")
    @RequestMapping(value = "/statement/rules/syn_status", method = RequestMethod.POST)
    public void synApproveStatus() {
        profitSharingService.synApproveStatus();
    }
}
