Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a72c9f9e3 | |||
| 942e13ced9 | |||
| 5a0092c711 | |||
| 1229cec774 | |||
| f614d5572d | |||
| 37bf5de999 | |||
| 1f36994661 | |||
| 1af8c04e32 | |||
| 30fc547604 | |||
| dbda2f5491 | |||
| 2ac755ddca | |||
| 4f014e03ca | |||
| 81f58a52bf | |||
| f5b66d9bb8 |
@@ -1,36 +0,0 @@
|
||||
name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: "temurin"
|
||||
java-version: "25"
|
||||
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-maven-
|
||||
|
||||
- name: Build and Test all modules
|
||||
run: ./mvnw -B clean verify -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false
|
||||
|
||||
- name: Publish Test Report
|
||||
uses: scacap/action-surefire-report@v1
|
||||
if: failure()
|
||||
with:
|
||||
github_token: ${{ secrets.ACCESS_TOKEN }}
|
||||
@@ -1,10 +1,3 @@
|
||||
# [1.1.0-dev.1](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0...v1.1.0-dev.1) (2026-03-24)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add inventory entity, service, test ([5a72c9f](https://git.demonkernel.io.vn/FoodSurf/backend/commit/5a72c9f9e38cd9f00fe3884d9ddc52675324bd31))
|
||||
|
||||
# [1.0.0-dev.21](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.20...v1.0.0-dev.21) (2026-03-23)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.1.0-dev.1</version>
|
||||
<version>1.0.0-dev.21</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -48,11 +48,6 @@
|
||||
<artifactId>lib</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jdbc-h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-hibernate-orm-panache</artifactId>
|
||||
@@ -148,8 +143,8 @@
|
||||
<configuration>
|
||||
<argLine>@{argLine}</argLine>
|
||||
<systemPropertyVariables>
|
||||
<native.image.path>
|
||||
${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
||||
<native.image.path
|
||||
>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
|
||||
<java.util.logging.manager
|
||||
>org.jboss.logmanager.LogManager</java.util.logging.manager>
|
||||
<maven.home>${maven.home}</maven.home>
|
||||
|
||||
@@ -30,7 +30,7 @@ public abstract class UserModel extends BaseEntity {
|
||||
@Transactional
|
||||
public void signup(String name, String phone, String rawPassword) {
|
||||
// Check existed user
|
||||
UserModel existedUser = find("phone", phone).firstResult();
|
||||
UserModel existedUser = UserModel.find("phone", phone).firstResult();
|
||||
|
||||
if (existedUser != null) throw new BadRequestException("ExistedUser");
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Database
|
||||
# Cấu hình Database
|
||||
quarkus.datasource.db-kind=postgresql
|
||||
quarkus.datasource.username=postgres
|
||||
quarkus.datasource.password=password
|
||||
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
|
||||
|
||||
# Tự động tạo bảng từ Entity (chỉ dùng cho môi trường dev)
|
||||
quarkus.hibernate-orm.database.generation=update
|
||||
|
||||
# Docker
|
||||
## URL của Gitea Registry (thường là gitea.yourdomain.com)
|
||||
# URL của Gitea Registry (thường là gitea.yourdomain.com)
|
||||
quarkus.container-image.registry=git.demonkernel.io.vn
|
||||
quarkus.container-image.group=foodsurf
|
||||
quarkus.container-image.name=account-service
|
||||
@@ -16,9 +16,4 @@ quarkus.container-image.build=true
|
||||
quarkus.container-image.builder=docker
|
||||
|
||||
# Redis
|
||||
quarkus.redis.hosts=redis://localhost:6379
|
||||
|
||||
|
||||
# Dependency
|
||||
quarkus.index-dependency.lib.group-id=com.drinkool
|
||||
quarkus.index-dependency.lib.artifact-id=lib
|
||||
quarkus.redis.hosts=redis://localhost:6379
|
||||
+6
-9
@@ -1,25 +1,22 @@
|
||||
package com.drinkool.models;
|
||||
package com.drinkool;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import com.drinkool.entities.CustomerEntity;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.*;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@Entity
|
||||
@Table
|
||||
class TestUserEntity extends UserModel {}
|
||||
|
||||
@QuarkusTest
|
||||
public class UserModelTest {
|
||||
class CustomerSignupTest {
|
||||
|
||||
@Test
|
||||
// @TestIransaction
|
||||
@Transactional
|
||||
public void testSignupSuccess() {
|
||||
//dang nhap thanh cong
|
||||
TestUserEntity user = new TestUserEntity();
|
||||
CustomerEntity user = new CustomerEntity();
|
||||
String phone =
|
||||
"+8477" + String.format("%07d", (new Random()).nextInt(10000000));
|
||||
String password = "02092006Danh";
|
||||
@@ -30,7 +27,7 @@ public class UserModelTest {
|
||||
assertEquals(phone, user.phone);
|
||||
assertNotNull(user.hashedPassword, "password phai hash");
|
||||
|
||||
TestUserEntity savedUser = TestUserEntity.find(
|
||||
CustomerEntity savedUser = CustomerEntity.find(
|
||||
"phone",
|
||||
phone
|
||||
).firstResult();
|
||||
@@ -1,9 +0,0 @@
|
||||
# Database
|
||||
%test.quarkus.datasource.db-kind=h2
|
||||
%test.quarkus.datasource.jdbc.url=jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1
|
||||
|
||||
%test.quarkus.hibernate-orm.database.generation=drop-and-create
|
||||
|
||||
# Docker
|
||||
%test.quarkus.container-image.build=false
|
||||
%test.quarkus.container-image.push=false
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.1.0-dev.1</version>
|
||||
<version>1.0.0-dev.21</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
@@ -48,11 +48,6 @@
|
||||
<artifactId>lib</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-jdbc-h2</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.rest-assured</groupId>
|
||||
<artifactId>rest-assured</artifactId>
|
||||
|
||||
@@ -1,9 +1,2 @@
|
||||
# Quarkus
|
||||
quarkus.http.host=0.0.0.0
|
||||
|
||||
# Database
|
||||
# Database
|
||||
%test.quarkus.datasource.db-kind=h2
|
||||
%test.quarkus.datasource.jdbc.url=jdbc:h2:mem:test_db;DB_CLOSE_DELAY=-1
|
||||
|
||||
%test.quarkus.hibernate-orm.database.generation=drop-and-create
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.1.0-dev.1</version>
|
||||
<version>1.0.0-dev.21</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.1.0-dev.1</version>
|
||||
<version>1.0.0-dev.21</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.drinkool.dtos;
|
||||
|
||||
public class AddInventory {
|
||||
|
||||
public String name;
|
||||
public int quantity;
|
||||
public String unit;
|
||||
public String name;
|
||||
public int quantity;
|
||||
public String unit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user