package cn.iocoder.yudao.module.system.api.supplier;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
import cn.iocoder.yudao.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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = ApiConstants.NAME) // TODO 芋艿：fallbackFactory =
@Tag(name = "RPC 服务 - 供应商新增编辑")
public interface SupplierApi {

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

    @PostMapping(PREFIX + "/saveOrEdit")
    @Operation(summary = "新增编辑供应商")
    CommonResult saveOrEdit(@RequestBody SupplierRpcDTO supplier);


    @GetMapping(PREFIX + "/getNameById")
    @Operation(summary = "获取供应商名称")
    @Parameter(name = "id", description = "供应商id", example = "1", required = true)
    CommonResult<String> getNameById(@RequestParam("id") Long id);
}
