package com.crm.manager.service.risk;

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.risk.copy.trade.RiskCopyTradeDto;
import com.crm.rely.backend.core.dto.risk.copy.trade.record.RiskCopyTradeRecordDto;
import com.crm.rely.backend.core.entity.risk.copy.trade.RiskCopyTradeAddEntity;
import com.crm.rely.backend.core.entity.risk.copy.trade.RiskCopyTradeDeleteEntity;
import com.crm.rely.backend.core.entity.risk.copy.trade.RiskCopyTradeSearchPageEntity;
import com.crm.rely.backend.core.entity.risk.copy.trade.record.RiskCopyTradeRecordAddEntity;
import com.crm.rely.backend.core.entity.risk.copy.trade.record.RiskCopyTradeRecordCloseEntity;
import com.crm.rely.backend.core.entity.risk.copy.trade.record.RiskCopyTradeRecordSearchPageEntity;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "RISKBBI-SERVICE", path = "/risk/copy/trade/manager")
public interface RiskCopyTradeFeignService {


    @PostMapping("/add")
    BaseResultDto add(@RequestBody @Validated RiskCopyTradeAddEntity entity) throws Exception;

    /**
     * 删除规则
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/delete")
    BaseResultDto delete(@RequestBody @Validated RiskCopyTradeDeleteEntity entity) throws Exception;


    /**
     * 查看绑定列表
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/list")
    ResultWithPagerDto<RiskCopyTradeDto> searchPage(@RequestBody @Validated RiskCopyTradeSearchPageEntity entity) throws Exception;

    /**
     * 查看绑定主账户持仓订单列表-关系列表中有是否订单已拷贝标记
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/search/record/list")
    ResultWithPagerDto<RiskCopyTradeRecordDto> searchRecordList(@RequestBody @Validated RiskCopyTradeRecordSearchPageEntity entity) throws Exception;

    /**
     * 订单拷贝
     *
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/record/add")
    BaseResultDto searchRecordAdd(@RequestBody @Validated RiskCopyTradeRecordAddEntity entity) throws Exception;

    @PostMapping("/record/close")
    BaseResultDto searchRecordClose(@RequestBody @Validated RiskCopyTradeRecordCloseEntity entity) throws Exception;
}
