//注册的项目名称
@FeignClient("cubemall-search")
public interface SearchFeign {
@GetMapping("/spuinfo/putonsale/{spuId}")
R putOnSale(@PathVariable("spuId") Long supId);
}
public R putOnSale(Long spuId) throws RemoteServiceCallException {
try{
R r = searchFeign.putOnSale(spuId);
}catch (Exception e){
e.printStackTrace();
throw new RemoteServiceCallException("远程服务调用失败,商品上架失败");
}
return R.ok("商品上架成功");
}