开发者社区 问答 正文

如何在controller里调用别人的dubbo接口?

我有一个接口,public interface ITbVsSpPriceApi {

SpPriceDto findPrice(Long id) throws ApiException;

SpPriceDto findSpPrice(Long id, String spName) throws ApiException;

void deleteSpPrice(Long id) throws ApiException;

TbVsSpService updateSpPrice(Long id, Integer spId, String spName, String vType, Double vsPrice, Double vsOrgPrice, Double vsDiscountPrice, String eFee, String virtualFee) throws ApiException;

}

如何在controller里面调用里面的方法呢?求大神帮忙

展开
收起
a123456678 2016-03-19 09:41:50 5587 分享 版权
1 条回答
写回答
取消 提交回答
  • @RestController
    public class ShopController {
        
        @Autowired
        private ShopService shopService;
        
        /**
         * 获取商店详情
         * 
         * @param userId
         *            用户id
         * @param shopId
         *            商家id
         *                                         
         * @return 商店详情
         */
        @RequestMapping(value = "/getShopDeatil")
        public ResultObject getShopDeatil(@RequestParam("userId") String userId,
                                  @RequestParam("shopId") Integer shopId) {
    
            System.out.println("请求路径:/getShopDeatil"+"\n"+"{"+"\n"+
                    "loginInfo:"+userId+"\n"+
                    "password:"+shopId+"\n"+
                    "}"
                    );
            ResultObject ro = shopService.getShopDetail(userId, shopId);
            return ro;
        }
    }    
    
    2019-07-17 19:07:18
    赞同 展开评论
问答分类:
问答标签:
问答地址: