Skip to content

Commit f729a0d

Browse files
authored
Merge pull request SpringCloud#33 from jang675953/patch-1
Update TestController.java
2 parents a8441e2 + f095747 commit f729a0d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ch6-2/ch6-2-provider-service/src/main/java/cn/springcloud/book/controller/TestController.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
public class TestController {
1111

1212
@RequestMapping(value = "/getUser",method = RequestMethod.GET)
13-
public String getUser(@RequestParam("username") String username){
14-
return "This is real user";
13+
public String getUser(@RequestParam("username") String username) throws Exception{
14+
if(username.equals("spring")) {
15+
return "This is real user";
16+
}else {
17+
throw new Exception();
18+
}
1519
}
1620
}

0 commit comments

Comments
 (0)