首页>代码>spring cloud之服务消费(基础)LoadBalancerClient使用>/springcloud/demo-client/src/main/java/org/demo/client/controller/DcController.java
package org.demo.client.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class DcController {
	
	@Autowired
	DiscoveryClient discoveryClient;

	@GetMapping("/dc")
	public String dc() {
		String services = "Services: " + discoveryClient.getServices();
		System.out.println(services);
		return services;
	}
}
最近下载更多
qq2499293861  LV1 2020年2月29日
hecky999  LV1 2020年1月4日
莱茵河  LV1 2019年8月23日
chrisyxg  LV10 2019年7月22日
四一八九  LV2 2019年3月12日
zhangsanfengaaa  LV7 2018年12月21日
吉祥至宝  LV2 2018年4月30日
jiangbb868  LV13 2018年1月30日
haiwen  LV19 2017年12月22日
Yuancc  LV21 2017年11月30日
最近浏览更多
2775645521  LV5 4月2日
hubing 1月23日
暂无贡献等级
落后就要挨打  LV26 2023年10月19日
秦sir3067683450  LV10 2022年12月31日
冰枫xjz8  LV31 2022年12月6日
李智豪  LV2 2022年5月20日
mingbai326 2022年5月12日
暂无贡献等级
陈朋 2021年11月22日
暂无贡献等级
pxqtsht  LV15 2021年11月3日
china_0221  LV41 2021年11月1日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友