使用swagger构建restful api

This commit is contained in:
程序猿DD
2016-04-18 15:59:23 +08:00
parent c9a00c2e96
commit 1b11e8a76c
@@ -3,6 +3,7 @@ package com.didispace.web;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/** /**
* *
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class HelloController { public class HelloController {
@ApiIgnore
@RequestMapping(value = "/hello", method = RequestMethod.GET) @RequestMapping(value = "/hello", method = RequestMethod.GET)
public String index() { public String index() {
return "Hello World"; return "Hello World";