1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

example annotations clearer

This commit is contained in:
赵禹光
2019-08-23 15:36:31 +08:00
parent 00835121cb
commit 3eb75988e3
16 changed files with 53 additions and 67 deletions

View File

@@ -3,11 +3,7 @@ package com.alibaba.cloud.examples;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @author xiaojing
@@ -22,12 +18,12 @@ public class ProviderApplication {
@RestController
class EchoController {
@RequestMapping(value = "/echo/{string}", method = RequestMethod.GET)
@GetMapping(value = "/echo/{string}")
public String echo(@PathVariable String string) {
return "hello Nacos Discovery " + string;
}
@RequestMapping(value = "/divide", method = RequestMethod.GET)
@GetMapping(value = "/divide")
public String divide(@RequestParam Integer a, @RequestParam Integer b) {
return String.valueOf(a / b);
}