IT虾米网

【转】Dubbo使用例子并且和Spring集成使用

一.编写客户端和服务器端共用接口类
1.登录接口类
public interface LoginService {
    public User login(String name, String psw);
}
2.注册接口类
public interface RegisterService {
     public User createUser(String name, String psw);
}
二服务器端
1.登录接口实现
public class LoginServiceImpl implements LoginService{
    public User login(String name, String psw){
        User user = null;
        if(name.equals("penngo") && psw.equals("123")){
            user = new User();
            user.setId(1);
            user.setName("penngo");
        }
        return user;
    }
}
文档来源:Dubbo使用例子并且和Spring集成使用
posted @ 2016-12-06 21:09  落叶的博客  阅读(174)  评论(0编辑  收藏  举报