File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
src/main/java/guru/springframework/spring6restmvc Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1
1
package guru .springframework .spring6restmvc .model ;
2
2
3
+ import lombok .Builder ;
3
4
import lombok .Data ;
4
5
5
6
import java .math .BigDecimal ;
9
10
/**
10
11
* Created by jt, Spring Framework Guru.
11
12
*/
13
+ @ Builder
12
14
@ Data
13
15
public class Beer {
14
16
private UUID id ;
Original file line number Diff line number Diff line change
1
+ package guru .springframework .spring6restmvc .services ;
2
+
3
+ import guru .springframework .spring6restmvc .model .Beer ;
4
+
5
+ import java .util .UUID ;
6
+
7
+ /**
8
+ * Created by jt, Spring Framework Guru.
9
+ */
10
+ public interface BeerService {
11
+
12
+ Beer getBeerById (UUID id );
13
+ }
Original file line number Diff line number Diff line change
1
+ package guru .springframework .spring6restmvc .services ;
2
+
3
+ import guru .springframework .spring6restmvc .model .Beer ;
4
+ import guru .springframework .spring6restmvc .model .BeerStyle ;
5
+
6
+ import java .math .BigDecimal ;
7
+ import java .time .LocalDateTime ;
8
+ import java .util .UUID ;
9
+
10
+ /**
11
+ * Created by jt, Spring Framework Guru.
12
+ */
13
+ public class BeerServiceImpl implements BeerService {
14
+ @ Override
15
+ public Beer getBeerById (UUID id ) {
16
+ return Beer .builder ()
17
+ .id (id )
18
+ .version (1 )
19
+ .beerName ("Galaxy Cat" )
20
+ .beerStyle (BeerStyle .PALE_ALE )
21
+ .upc ("12356" )
22
+ .price (new BigDecimal ("12.99" ))
23
+ .quantityOnHand (122 )
24
+ .createdDate (LocalDateTime .now ())
25
+ .updateDate (LocalDateTime .now ())
26
+ .build ();
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments