-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2eceab4
commit ef20d41
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/main/java/guru/springframework/msscbeerservice/web/controller/BeerController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package guru.springframework.msscbeerservice.web.controller; | ||
|
||
import guru.springframework.msscbeerservice.web.model.BeerDto; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* Created by jt on 2019-05-12. | ||
*/ | ||
@RequestMapping("/api/v1/beer") | ||
@RestController | ||
public class BeerController { | ||
|
||
|
||
@GetMapping("/{beerId}") | ||
public ResponseEntity<BeerDto> getBeerById(@PathVariable("beerId") UUID beerId){ | ||
|
||
//todo impl | ||
return new ResponseEntity<>(BeerDto.builder().build(), HttpStatus.OK); | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity saveNewBeer(@RequestBody BeerDto beerDto){ | ||
|
||
//todo impl | ||
return new ResponseEntity(HttpStatus.CREATED); | ||
} | ||
|
||
@PutMapping("/{beerId}") | ||
public ResponseEntity updateBeerById(@PathVariable("beerId") UUID beerId, @RequestBody BeerDto beerDto){ | ||
|
||
//todo impl | ||
return new ResponseEntity(HttpStatus.NO_CONTENT); | ||
} | ||
|
||
} |