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


import com.cf.imes.module.system.api.process.dto.ProcessDTO;
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.math.BigDecimal;
import java.util.List;

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


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


    @GetMapping(PREFIX + "/getProcess")
    @Operation(summary = "查看当前工序的信息")
    @Parameter(name = "processId", description = "工序ID", required = true, example = "1024")
    BigDecimal getProcess(@RequestParam("processId") Long processId);


    @GetMapping(PREFIX + "/getUserProcess")
    @Operation(summary = "查看当前工序的信息")
    @Parameter(name = "userId", description = "用户ID", required = true, example = "1")
    List<ProcessDTO> getUserProcess(@RequestParam("userId") Long userId);

}
