package cn.iocoder.yudao.module.hrm.api.crmcontract;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.hrm.api.crmcontract.dto.CrmContractProductDTO;
import cn.iocoder.yudao.module.hrm.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 流程实例")
public interface ContractApi {

    String PREFIX = ApiConstants.PREFIX + "/crm/contract";

    @PostMapping(PREFIX + "/create")
    @Operation(summary = "创建合同商品信息")
    CommonResult<Boolean> createProduct(@RequestBody List<CrmContractProductDTO> createReqVO);

    @GetMapping(PREFIX + "/get-product")
    @Operation(summary = "获得合同商品信息")
    @Parameter(name = "contractId", description = "合同ID", required = true)
    CommonResult<List<CrmContractProductDTO>> getProduct(@RequestParam("contractId") Long contractId);
}
