Skip to content

Commit

Permalink
feat(version): New Version
Browse files Browse the repository at this point in the history
- Upgrade to Java 13
- Add coverage with Jacoco and Coverals
- Some refactor

Took 1 minute
  • Loading branch information
gbzarelli committed May 3, 2020
1 parent bdcd2b4 commit 4636d44
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import br.com.beblue.musicstore.controller.dto.DiscDTO;
import br.com.beblue.musicstore.exception.NoValuePresentException;
import br.com.beblue.musicstore.service.DiscService;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
Expand All @@ -15,6 +18,7 @@

@RestController
@RequestMapping(DiscRestController.ROOT_PATH)
@AllArgsConstructor(access = AccessLevel.PACKAGE, onConstructor = @__(@Autowired))
class DiscRestController implements DiscController {

static final String ROOT_PATH = "/disc";
Expand All @@ -23,10 +27,6 @@ class DiscRestController implements DiscController {

private final DiscService discService;

DiscRestController(final DiscService discService) {
this.discService = discService;
}

@GetMapping(value = PATH_BY_GENRE, produces = MediaType.APPLICATION_JSON_VALUE)
public Page<DiscDTO> listDiscsByGenre(@PathVariable final String genre, final Pageable pageable) {
return discService.getDiscsByGenre(genre, pageable);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import br.com.beblue.musicstore.controller.GenreController;
import br.com.beblue.musicstore.controller.dto.GenreDTO;
import br.com.beblue.musicstore.service.GenreService;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -12,16 +15,13 @@

@RestController
@RequestMapping(GenreRestController.ROOT_PATH)
@AllArgsConstructor(access = AccessLevel.PACKAGE, onConstructor = @__(@Autowired))
class GenreRestController implements GenreController {

static final String ROOT_PATH = "/genre";

private final GenreService genreService;

GenreRestController(final GenreService genreService) {
this.genreService = genreService;
}

@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public List<GenreDTO> getAllGenres() {
return genreService.getAllGenres();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import br.com.beblue.musicstore.exception.NoValuePresentException;
import br.com.beblue.musicstore.service.SaleSearchService;
import br.com.beblue.musicstore.service.SaleService;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.format.annotation.DateTimeFormat;
Expand All @@ -16,6 +19,7 @@

@RestController
@RequestMapping(SaleRestController.ROOT_PATH)
@AllArgsConstructor(access = AccessLevel.PACKAGE, onConstructor = @__(@Autowired))
class SaleRestController implements SaleController {

static final String ROOT_PATH = "/sale";
Expand All @@ -25,12 +29,6 @@ class SaleRestController implements SaleController {
private final SaleService saleService;
private final SaleSearchService saleSearchService;

SaleRestController(final SaleService saleService,
final SaleSearchService saleSearchService) {
this.saleService = saleService;
this.saleSearchService = saleSearchService;
}

@PostMapping()
public SaleResponseDTO registerOrder(@RequestBody final SaleRequestDTO request) throws NoValuePresentException {
return saleService.registerOrder(request);
Expand Down

0 comments on commit 4636d44

Please sign in to comment.