Skip to content

Commit

Permalink
adding beer controller. closes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
springframeworkguru committed May 12, 2019
1 parent 2eceab4 commit ef20d41
Showing 1 changed file with 39 additions and 0 deletions.
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);
}

}

0 comments on commit ef20d41

Please sign in to comment.