首页>代码>dubbo+zookeeper+spring boot+mybatis配置搭建分布式架构项目实例,一个服务消费,两个服务提供,负载均衡>/dubbo/dubbo-consumer/src/main/java/cn/jsxwsl/dubbo/controller/UserController.java
package cn.jsxwsl.dubbo.controller;
import cn.jsxwsl.dubbo.bean.User;
import cn.jsxwsl.dubbo.service.UserService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class UserController {
@Reference()
private UserService userService;
@RequestMapping(value = "/users.json", method = RequestMethod.GET)
public List<User> users(){
return userService.getUserList();
}
}
最近下载更多
徐万强 LV9
2023年9月11日
空心菜4 LV9
2023年7月10日
cgp0219 LV6
2022年5月5日
eahity LV2
2022年4月24日
denliv_hui LV14
2022年2月11日
Rommel LV27
2021年10月12日
ewan007 LV30
2021年9月27日
huangxiaoke20 LV17
2021年7月19日
sleepcat88 LV13
2021年5月25日
lebu9527 LV11
2021年3月3日

最近浏览