Skip to content

Commit

Permalink
adding web data model. closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
springframeworkguru committed May 12, 2019
1 parent 3b4fd78 commit 2eceab4
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package guru.springframework.msscbeerservice.web.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.UUID;

/**
* Created by jt on 2019-05-12.
*/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BeerDto {
private UUID id;
private Integer version;

private OffsetDateTime createdDate;
private OffsetDateTime lastModifiedDate;

private String beerName;

private BeerStyleEnum beerStyle;

private Long upc;

private BigDecimal price;

private Integer quantityOnHand;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package guru.springframework.msscbeerservice.web.model;


import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* Created by jt on 2019-05-12.
*/
public class BeerPagedList extends PageImpl<BeerDto> {

public BeerPagedList(List<BeerDto> content, Pageable pageable, long total) {
super(content, pageable, total);
}

public BeerPagedList(List<BeerDto> content) {
super(content);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package guru.springframework.msscbeerservice.web.model;

/**
* Created by jt on 2019-05-12.
*/
public enum BeerStyleEnum {
LAGER, PILSNER, STOUT, GOSE, PORTER, ALE, WHEAT, IPA, PALE_ALE, SAISON
}

0 comments on commit 2eceab4

Please sign in to comment.