package com.cf.imes.module.system.api.systemconfig;

import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.api.systemconfig.dto.ProcessSchemeDTO;
import com.cf.imes.module.system.api.systemconfig.dto.SystemConfigRespDTO;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 系统配置feign接口
 *
 * @author Gqr
 * @since 2024/11/15 11:26
 */
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰：fallbackFactory =
@Tag(name = "RPC 服务 - 系统配置")
public interface SystemConfigApi {
    String PREFIX = ApiConstants.PREFIX + "/system-config";

    @GetMapping(PREFIX + "/organ/custom-plateno-config")
    @Operation(summary = "获取组织下自定义版编号配置")
    CommonResult<SystemConfigRespDTO> getOrgCustomPlateNoConfig();

    @GetMapping(PREFIX + "/organ/custom-plateno-config/{id}")
    @Operation(summary = "获取组织下自定义版编号配置")
    CommonResult<SystemConfigRespDTO> getById(@PathVariable("id") Long id);

    @GetMapping(PREFIX + "/organ/process-config-List")
    @Operation(summary = "获取排单下的加工方案组的配置信息")
    CommonResult<List<SystemConfigRespDTO>> getProcessByIds(@RequestParam("processIds") List<Long> processIds);

    @GetMapping(PREFIX + "/organ/process-config-size")
    @Operation(summary = "获取方案组对应的配置数量")
    CommonResult<Integer> getProcessSizeByIds(@RequestParam("processIds") List<Long> processIds);

    @GetMapping(PREFIX + "/organ/default-process-config")
    @Operation(summary = "获取默认的加工方案组的配置信息")
    CommonResult<SystemConfigRespDTO> getDefaultProcessConfig();

    @GetMapping(PREFIX + "/organ/plan-process-config")
    @Operation(summary = "获取排单下加工方案组的配置信息和具体配置项的配置信息")
    CommonResult<List<ProcessSchemeDTO>> getProcessById(@RequestParam("processId") Long processId);


    @PostMapping(PREFIX + "/organ/plan-scheme-config")
    @Operation(summary = "获取排单下加工方案组的配置信息和具体配置项的配置信息")
    CommonResult<List<ProcessSchemeDTO>> getPlanProcessSchemeConfig(@RequestBody List<ProcessSchemeDTO> schemeDTOList);


    @GetMapping(PREFIX + "/organ/process-config")
    @Operation(summary = "获取加工方案组的配置信息")
    CommonResult<List<ProcessSchemeDTO>> getProcessSchemeConfig(@RequestParam("processId") Long processId);


    @GetMapping(PREFIX + "/organ/sealedge-config")
    @Operation(summary = "获取组织下封边条对应配置")
    CommonResult<List<SystemConfigRespDTO>> getOrgSealEdgeConfig();
}
