Skip to content

Commit 05caee0

Browse files
committed
Spring Boot RESTful API
1 parent aa5e579 commit 05caee0

File tree

4 files changed

+3
-30
lines changed

4 files changed

+3
-30
lines changed

springboot-examples/springboot-restfulapi/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<dependency>
3333
<groupId>mysql</groupId>
3434
<artifactId>mysql-connector-java</artifactId>
35-
<scope>runtime</scope>
3635
</dependency>
3736
</dependencies>
3837

springboot-examples/springboot-restfulapi/src/main/java/com/hellokoding/springboot/restful/product/Product.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package com.hellokoding.springboot.restful.product;
22

3-
import org.hibernate.annotations.CreationTimestamp;
4-
import org.hibernate.annotations.UpdateTimestamp;
5-
63
import javax.persistence.Entity;
74
import javax.persistence.GeneratedValue;
85
import javax.persistence.GenerationType;
96
import javax.persistence.Id;
107
import java.math.BigDecimal;
11-
import java.util.Date;
128

139
@Entity
1410
public class Product {
@@ -22,12 +18,6 @@ public class Product {
2218

2319
private BigDecimal price;
2420

25-
@CreationTimestamp
26-
private Date createdAt;
27-
28-
@UpdateTimestamp
29-
private Date updatedAt;
30-
3121
public Long getId() {
3222
return id;
3323
}
@@ -59,20 +49,4 @@ public BigDecimal getPrice() {
5949
public void setPrice(BigDecimal price) {
6050
this.price = price;
6151
}
62-
63-
public Date getCreatedAt() {
64-
return createdAt;
65-
}
66-
67-
public void setCreatedAt(Date createdAt) {
68-
this.createdAt = createdAt;
69-
}
70-
71-
public Date getUpdatedAt() {
72-
return updatedAt;
73-
}
74-
75-
public void setUpdatedAt(Date updatedAt) {
76-
this.updatedAt = updatedAt;
77-
}
7852
}

springboot-examples/springboot-restfulapi/src/main/java/com/hellokoding/springboot/restful/product/ProductRespository.java renamed to springboot-examples/springboot-restfulapi/src/main/java/com/hellokoding/springboot/restful/product/ProductRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
import org.springframework.data.jpa.repository.JpaRepository;
44

5-
public interface ProductRespository extends JpaRepository<Product, Long> {
5+
public interface ProductRepository extends JpaRepository<Product, Long> {
66
}

springboot-examples/springboot-restfulapi/src/main/java/com/hellokoding/springboot/restful/product/ProductService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
@Service
1010
public class ProductService {
11-
private final ProductRespository productRespository;
11+
private final ProductRepository productRespository;
1212

1313
@Autowired
14-
public ProductService(ProductRespository productRespository) {
14+
public ProductService(ProductRepository productRespository) {
1515
this.productRespository = productRespository;
1616
}
1717

0 commit comments

Comments
 (0)