-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
179 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
kbazaar/src/main/java/com/kampus/kbazaar/product/ProductRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 39 additions & 2 deletions
41
kbazaar/src/main/java/com/kampus/kbazaar/product/ProductResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
package com.kampus.kbazaar.product; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.List; | ||
|
||
public record ProductResponse(Long id, String name, String sku, BigDecimal price, int quantity) {} | ||
public class ProductResponse { | ||
private List<Product> products; | ||
private int currentPage; | ||
private int totalPages; | ||
private long totalItems; | ||
|
||
public List<Product> getProducts() { | ||
return products; | ||
} | ||
|
||
public void setProducts(List<Product> products) { | ||
this.products = products; | ||
} | ||
|
||
public int getCurrentPage() { | ||
return currentPage; | ||
} | ||
|
||
public void setCurrentPage(int currentPage) { | ||
this.currentPage = currentPage; | ||
} | ||
|
||
public int getTotalPages() { | ||
return totalPages; | ||
} | ||
|
||
public void setTotalPages(int totalPages) { | ||
this.totalPages = totalPages; | ||
} | ||
|
||
public long getTotalItems() { | ||
return totalItems; | ||
} | ||
|
||
public void setTotalItems(long totalItems) { | ||
this.totalItems = totalItems; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
server.port=8080 | ||
#server.servlet.context-path=/api | ||
# [local | dev | test | prod] | ||
#spring.profiles.active=local | ||
|
||
spring.jpa.generate-ddl=true | ||
spring.jpa.hibernate.ddl-auto=update | ||
spring.jpa.show-sql=true | ||
spring.jpa.properties.hibernate.format_sql=true | ||
|
||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres | ||
spring.datasource.username=postgres | ||
spring.datasource.password=postgres | ||
|
||
spring.datasource.driver-class-name=org.postgresql.Driver | ||
spring.datasource.hikari.maximum-pool-size=1 | ||
|
||
spring.sql.init.mode=always | ||
spring.sql.init.schema-locations=classpath:sql/schema/*.sql | ||
spring.sql.init.data-locations=classpath:sql/data/*.sql | ||
security.jwt.secret=1ukPr@a1M@1T@1D3rN@NgJoNMaHenKubT@ | ||
|
||
# swagger | ||
springdoc.swagger-ui.enabled=true | ||
|
||
# Feature Toggle | ||
enabled.feature.promotion.list.api=true | ||
enabled.feature.shipping-fee.api=true | ||
server.port=8080 | ||
#server.servlet.context-path=/api | ||
# [local | dev | test | prod] | ||
#spring.profiles.active=local | ||
|
||
spring.jpa.generate-ddl=true | ||
spring.jpa.hibernate.ddl-auto=update | ||
spring.jpa.show-sql=true | ||
spring.jpa.properties.hibernate.format_sql=true | ||
|
||
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres | ||
spring.datasource.username=postgres | ||
spring.datasource.password=postgres | ||
|
||
spring.datasource.driver-class-name=org.postgresql.Driver | ||
spring.datasource.hikari.maximum-pool-size=1 | ||
|
||
spring.sql.init.mode=always | ||
spring.sql.init.schema-locations=classpath:sql/schema/*.sql | ||
spring.sql.init.data-locations=classpath:sql/data/*.sql | ||
security.jwt.secret=1ukPr@a1M@1T@1D3rN@NgJoNMaHenKubT@ | ||
|
||
# swagger | ||
springdoc.swagger-ui.enabled=true | ||
|
||
# Feature Toggle | ||
enabled.feature.promotion.list.api=true | ||
enabled.feature.shipping-fee.api=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters