This plugin helps to generate Spring REST controller endpoints by just using the signature of that endpoint.
In the intellij idea editor, writing the endpoint signature and press ctrl + space
( or whatever key stroke for autocompletion),
this action will provide an option to create the equivalent REST endpoint.
URL | GENERATED METHOD |
GET /user/{id} |
/*
* Generated from 'GET user/{id}'
*/
@GetMapping("user/{id}")
public ResponseEntity<?> getUserById(@PathVariable("id") Long id) {
//FIXME: Provide a valid implementation for this method
throw new RuntimeException("Not implemented yet");
} |
get post/{id}/book/?name=&kk= |
/*
* Generated from 'get post/{id}/book/?name=&kk='
*/
@GetMapping("post/{id}/book/")
public ResponseEntity<List<?>> getPostBookByPostId(@PathVariable("id") Long postId,
@RequestParam("name") String name,
@RequestParam("kk") String kk) {
//FIXME: Provide a valid implementation for this method
throw new RuntimeException("Not implemented yet");
} |
POST /book |
/*
* Generated from 'POST /book'
*/
@PostMapping("/book")
public ResponseEntity<Void> createBook(@RequestBody Object requestBody) {
//FIXME: Provide a valid implementation for this method
return ResponseEntity.status(HttpStatus.CREATED).build();
} |