1

general style improvements + javadoc

This commit is contained in:
Christoph
2020-03-06 22:18:11 +01:00
parent e05c6f4e3a
commit cc174b3269
18 changed files with 103 additions and 70 deletions

View File

@ -10,15 +10,22 @@ import java.util.List;
@RestController
public class SwaggerAPIController {
@RequestMapping(value = "/products", method = RequestMethod.GET)
public List<String> getProducts(){
List<String> productList = new ArrayList<>();
productList.add("Honey");
productList.add("Almond");
return productList;
}
@RequestMapping(value = "/products", method = RequestMethod.POST)
public String createProduct() {
return "Product is saved successfully";
}
/**
* Ein Beispiel für eine API mit Swagger.
*
* @return Eine Liste von Produkten, repräsentiert durch Strings
*/
@RequestMapping(value = "/products", method = RequestMethod.GET)
public List<String> getProducts() {
List<String> productList = new ArrayList<>();
productList.add("Honey");
productList.add("Almond");
return productList;
}
@RequestMapping(value = "/products", method = RequestMethod.POST)
public String createProduct() {
return "Product is saved successfully";
}
}