zhibing.pu
2024-08-21 5c41048a7b55e5df92fc88996ef10e58cbf967d1
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/GoodsClient.java
@@ -1,15 +1,26 @@
package com.ruoyi.other.api.feignClient;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.TGoods;
import com.ruoyi.other.api.factory.GoodsFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
 * 商品服务
 * @author ruoyi
 * @author zhibing.pu
 * @Date 2024/8/16 13:47
 */
@FeignClient(contextId = "GoodsClient", value = ServiceNameConstants.CONTRACT_SERVICE, fallbackFactory = GoodsFallbackFactory.class)
@FeignClient(contextId = "GoodsClient", value = ServiceNameConstants.OTHER_SERVICE, fallbackFactory = GoodsFallbackFactory.class)
public interface GoodsClient {
   /**
    * 根据id获取商品信息
    * @param id
    * @return
    */
   @PostMapping("/t-goods/getGoodsById/{id}")
   R<TGoods> getGoodsById(@PathVariable("id") Integer id);
}