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

import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
import com.cf.imes.module.system.api.machine.dto.MachineDTO;
import com.cf.imes.module.system.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.RequestParam;

import java.util.Collection;
import java.util.List;

@FeignClient(name = ApiConstants.NAME) // TODO 晨丰：fallbackFactory =
@Tag(name = "RPC 服务 - 机台")
public interface MachineApi {

    String PREFIX = ApiConstants.PREFIX + "/machine";

    @GetMapping(PREFIX + "/get-cutting")
    @Operation(summary = "获得开料机台信息")
    @Parameter(name = "id", description = "机台id", example = "1024", required = true)
    CommonResult<CuttingRespDTO> getCutting(@RequestParam("id") Long id);


    @GetMapping(PREFIX + "/get-drill")
    @Operation(summary = "获得钻孔机台信息")
    @Parameter(name = "id", description = "机台id", example = "1024", required = true)
    CommonResult<CuttingRespDTO> getDrill(@RequestParam("id") Long id);


    @GetMapping(PREFIX + "/list")
    @Operation(summary = "获得机台基本信息列表")
    @Parameter(name = "ids", description = "机台id", example = "1024", required = true)
    CommonResult<List<CuttingRespDTO>> list(@RequestParam("ids") Collection<Long> ids);

    @GetMapping(PREFIX + "/get-machine-detail")
    @Operation(summary = "获得机台详情")
    @Parameter(name = "id", description = "机台id", example = "1024", required = true)
    CommonResult<MachineDTO> getMachineDetail(@RequestParam("id") Long id);

}
