general style improvements + javadoc
This commit is contained in:
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user