package cn.jorian.framework.jcloudsonsumer.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@RestController
@RequestMapping("/hello")
public class HelloController {
@Autowired
private RestTemplate resttemplate;
@RequestMapping("/hello")
public String hello(){
//指出服务地址 http://{服务提供者应用名名称}/{具体的controller}
String url="http://provider-user/user/sayHello";
//返回值类型和我们的业务返回值一致
return resttemplate.getForObject(url, String.class);
}
@RequestMapping("/hi")
public String hi(){
//指出服务地址 http://{服务提供者应用名名称}/{具体的controller}
String url="http://provider-user/user/sayHi";
//返回值类型和我们的业务返回值一致
return resttemplate.getForObject(url, String.class);
}
@RequestMapping("/haha")
public String haha(){
//指出服务地址 http://{服务提供者应用名名称}/{具体的controller}
String url="http://provider-user/user/sayHaha";
//返回值类型和我们的业务返回值一致
return resttemplate.getForObject(url, String.class);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
j-cloud.rar (81个子文件)
j-cloud
j-cloud-consumer-feign
HELP.md 1KB
mvnw.cmd 7KB
pom.xml 3KB
src
test
java
cn
jorian
framework
jcloudconsumerfeign
JCloudConsumerFeignApplicationTests.java 253B
main
resources
application.properties 175B
templates
static
java
cn
jorian
framework
jcloudconsumerfeign
controller
Hellocontroller.java 891B
JCloudConsumerFeignApplication.java 571B
service
UserClient.java 854B
.mvn
wrapper
maven-wrapper.properties 1019B
maven-wrapper.jar 59KB
mvnw 10KB
.gitignore 395B
j-cloud-consumer-feign.iml 81B
j-cloud-provider1
HELP.md 781B
mvnw.cmd 7KB
pom.xml 3KB
src
test
java
cn
jorian
framework
jcloudprovider1
JCloudProvider1ApplicationTests.java 245B
main
resources
application.properties 165B
java
cn
jorian
framework
jcloudprovider1
JCloudProvider1Application.java 446B
controller
UserController.java 628B
.mvn
wrapper
maven-wrapper.properties 1019B
maven-wrapper.jar 59KB
target
classes
application.properties 165B
cn
jorian
framework
jcloudprovider1
controller
UserController.class 905B
JCloudProvider1Application.class 872B
test-classes
cn
jorian
framework
jcloudprovider1
JCloudProvider1ApplicationTests.class 602B
generated-test-sources
test-annotations
generated-sources
annotations
mvnw 10KB
.gitignore 395B
pom.xml 430B
j-cloud-server-eureka
HELP.md 765B
mvnw.cmd 7KB
pom.xml 2KB
src
test
java
cn
jorian
framework
jcloudservereureka
JCloudServerEurekaApplicationTests.java 251B
main
resources
application.properties 246B
java
cn
jorian
framework
jcloudservereureka
JCloudServerEurekaApplication.java 462B
.mvn
wrapper
maven-wrapper.properties 1019B
maven-wrapper.jar 59KB
target
classes
application.properties 246B
cn
jorian
framework
jcloudservereureka
JCloudServerEurekaApplication.class 894B
test-classes
cn
jorian
framework
jcloudservereureka
JCloudServerEurekaApplicationTests.class 617B
generated-test-sources
test-annotations
generated-sources
annotations
mvnw 10KB
.gitignore 395B
j-cloud-sonsumer
HELP.md 781B
mvnw.cmd 7KB
pom.xml 3KB
src
test
java
cn
jorian
framework
jcloudsonsumer
JCloudSonsumerApplicationTests.java 243B
main
resources
application.properties 169B
java
cn
jorian
framework
jcloudsonsumer
RestTemplateConfiguration.java 463B
controller
HelloController.java 1KB
JCloudSonsumerApplication.java 443B
.mvn
wrapper
maven-wrapper.properties 1019B
maven-wrapper.jar 59KB
target
classes
application.properties 169B
cn
jorian
framework
jcloudsonsumer
RestTemplateConfiguration.class 777B
controller
HelloController.class 1KB
JCloudSonsumerApplication.class 867B
test-classes
cn
jorian
framework
jcloudsonsumer
JCloudSonsumerApplicationTests.class 597B
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst 202B
inputFiles.lst 358B
generated-test-sources
test-annotations
generated-sources
annotations
mvnw 10KB
.gitignore 395B
j-cloud-gateway
HELP.md 967B
mvnw.cmd 7KB
pom.xml 3KB
src
test
java
cn
jorian
framework
jcloudgateway
JCloudGatewayApplicationTests.java 241B
main
resources
application.properties 384B
java
cn
jorian
framework
jcloudgateway
JCloudGatewayApplication.java 440B
.mvn
wrapper
maven-wrapper.properties 1019B
maven-wrapper.jar 59KB
target
classes
application.properties 384B
cn
jorian
framework
jcloudgateway
JCloudGatewayApplication.class 862B
test-classes
cn
jorian
framework
jcloudgateway
JCloudGatewayApplicationTests.class 592B
generated-test-sources
test-annotations
generated-sources
annotations
mvnw 10KB
.gitignore 395B
.idea
jarRepositories.xml 864B
workspace.xml 10KB
misc.xml 1KB
compiler.xml 1KB
.gitignore 184B
encodings.xml 571B
j-cloud.iml 81B
共 81 条
- 1
资源评论
iawsky
- 粉丝: 3
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功