package com.xisc.pm.infra.feign;

import com.xisc.pm.common.dto.ProductionPlanningApiDTO;
import com.xisc.pm.infra.feign.fallback.SmApiFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @date 2024/10/18 15:37
 * @description
 */
@FeignClient(value = "${xisc.service.sm.name:xisc-sm}", fallbackFactory = SmApiFeignFallbackFactory.class)
public interface SmApiFeign {
    /**
     * 炼钢生产计划接口
     *
     * @param organizationId 租户
     * @param requestList    请求入参
     * @return
     */
    @PostMapping({"/v1/{organizationId}/sm-api/production-planning/api"})
    ResponseEntity<String> productionPlanningApi(@PathVariable Long organizationId,
                                               @RequestBody List<ProductionPlanningApiDTO> requestList);

    /**
     * 炉次回收
     *
     * @param organizationId 租户
     * @param ponoList       制造命令号
     * @return
     */
    @PostMapping("/v1/{organizationId}/sm-api/heat-retracted/api")
    ResponseEntity<String> heatRetracted(@PathVariable Long organizationId,
                                       @RequestBody List<String> ponoList);
}
