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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user