package com.init.springCloud;
import javax.servlet.http.HttpServletRequest;
import org.springframework.http.MediaType;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ProviderController {
@RequestMapping(value = "/search/{id}", method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Person searchPerson(@PathVariable Integer id,HttpServletRequest request){
Person person = new Person();
person.setId(id);
person.setName("Spirit");
person.setMessage(request.getRequestURL().toString());
return person;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
4.Spring Cloud服务管理框架Eureka项目集群.rar (36个子文件)
euraka-server
.project 771B
src
test
resources
java
main
resources
application.yml 432B
java
com
init
springCloud
ServerApp.java 594B
target
classes
com
init
springCloud
ServerApp.class 1KB
application.yml 432B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
pom.xml 1024B
.classpath 1KB
eureka-provider
.project 773B
src
test
resources
java
main
resources
application.yml 167B
java
com
init
springCloud
ProviderController.java 879B
ProviderApp.java 602B
Person.java 198B
target
classes
com
init
springCloud
ProviderApp.class 1KB
ProviderController.class 1KB
Person.class 2KB
application.yml 167B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
pom.xml 1KB
.classpath 1KB
eureka-consumer
.project 773B
src
test
resources
java
main
resources
application.yml 192B
java
com
init
springCloud
ConsumerController.java 818B
ConsumerApp.java 404B
target
classes
com
init
springCloud
ConsumerApp.class 768B
ConsumerController.class 1KB
application.yml 192B
test-classes
.settings
org.eclipse.wst.common.project.facet.core.xml 122B
org.eclipse.m2e.core.prefs 90B
org.eclipse.jdt.core.prefs 430B
pom.xml 1KB
.classpath 1KB
共 36 条
- 1
资源评论
MrSpirit
- 粉丝: 154
- 资源: 30
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功