Advertisement
ArturCzopek

swagger-hello-3

Apr 20th, 2017
15,782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import org.springframework.web.bind.annotation.PathVariable;
  2. import org.springframework.web.bind.annotation.RequestMapping;
  3. import org.springframework.web.bind.annotation.RequestMethod;
  4. import org.springframework.web.bind.annotation.RestController;
  5.  
  6. @RestController
  7. public class HelloController {
  8.  
  9.     @RequestMapping(value = "/hello", method = RequestMethod.GET)
  10.     public String hello() {
  11.         return "Hello, swagger!";
  12.     }
  13.  
  14.     @RequestMapping(value = "/hello", method = RequestMethod.POST)
  15.     public void helloOnConsole() {
  16.         System.out.println("Hello, swagger on console!");
  17.     }
  18.  
  19.     @RequestMapping(value = "/bye/{name}", method = RequestMethod.DELETE)
  20.     public void byePerson(@PathVariable String name) {
  21.         System.out.println("Bye bye, " + name);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement