package com.pinyougou.sellergoods.service;
import java.util.List;
import com.pinyougou.pojo.TbBrand;
/**
* 品牌服务层接口
* @author Administrator
*
*/
public interface BrandService {
/**
* 返回全部列表
* @return
*/
public List<TbBrand> findAll();
}
package com.pinyougou.sellergoods.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import com.pinyougou.mapper.TbBrandMapper;
import com.pinyougou.pojo.TbBrand;
import com.pinyougou.sellergoods.service.BrandService;
@Service
public class BrandServiceImpl implements BrandService {
@Autowired
private TbBrandMapper brandMapper;
@Override
public List<TbBrand> findAll() {
return brandMapper.selectByExample(null);
}
}
package com.pinyougou.manager.controller;
import java.util.List;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.config.annotation.Reference;
import com.pinyougou.pojo.TbBrand;
import com.pinyougou.sellergoods.service.BrandService;
/**
* 品牌 controller
* @author Administrator
*/
@RestController
@RequestMapping("/brand")
public class BrandController {
@Reference
private BrandService brandService;
/**
* 返回全部列表
* @return
*/
@RequestMapping("/findAll")
public List<TbBrand> findAll(){
return brandService.findAll();
}
}
java.lang.IllegalStateException: Failed to check the status of the service
com.pinyougou.sellergoods.service.BrandService. No provider available for the service
com.pinyougou.sellergoods.service.BrandService from the url
zookeeper://192.168.25.129:2181/com.alibaba.dubbo.registry.RegistryService?application=pinyo
ugou-manager
web&dubbo=2.8.4&interface=com.pinyougou.sellergoods.service.BrandService&methods=updat
e,get,delete,selectOptionList,add,getListByPage&pid=3980&revision=0.0.1-
SNAPSHOT&side=consumer×tamp=1501146823396 to the consumer 172.16.17.14 use
dubbo version 2.8.4
org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within
timeout: 5000 org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:876)
org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:98)
org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:92)
org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:80)
com.alibaba.dubbo.remoting.zookeeper.zkclient.ZkclientZookeeperClient.<init>(ZkclientZook
eeperClient.java:26)
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |