Compare commits

...

2 Commits

Author SHA1 Message Date
TakahashiNguyen 6eb075c4b5 fix: add field role for user model (#32)
Release package / release (push) Successful in 13m22s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com>
Reviewed-on: #32
2026-04-20 08:39:50 +00:00
gitea-actions 4ab284e966 chore: release [ci skip] 2026-04-20 07:58:34 +00:00
11 changed files with 37 additions and 9 deletions
+7
View File
@@ -1,3 +1,10 @@
## [1.5.9](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.8...v1.5.9) (2026-04-20)
### Bug Fixes
* better redis connection ([#31](https://git.demonkernel.io.vn/FoodSurf/backend/issues/31)) ([b7bf016](https://git.demonkernel.io.vn/FoodSurf/backend/commit/b7bf0164e6a4a7f37324c4cdab5c8e6158e81615))
## [1.5.8](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.7...v1.5.8) (2026-04-19) ## [1.5.8](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.7...v1.5.8) (2026-04-19)
+1 -1
View File
@@ -9,7 +9,7 @@
<parent> <parent>
<groupId>com.drinkool</groupId> <groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId> <artifactId>drinkool</artifactId>
<version>1.5.8</version> <version>1.5.9</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@@ -10,6 +10,10 @@ import java.util.UUID;
@Table(name = Role.Customer) @Table(name = Role.Customer)
public class CustomerEntity extends UserModel { public class CustomerEntity extends UserModel {
public CustomerEntity() {
super(Role.Customer);
}
@Transactional @Transactional
public void signup(String phone) { public void signup(String phone) {
this.signup(phone, phone, UUID.randomUUID().toString().substring(0, 32)); this.signup(phone, phone, UUID.randomUUID().toString().substring(0, 32));
@@ -12,6 +12,10 @@ public class ManagerEntity extends UserModel {
public boolean isVerified; public boolean isVerified;
public ManagerEntity() {
super(Role.Manager);
}
public void signup( public void signup(
String name, String name,
String phone, String phone,
@@ -23,6 +23,15 @@ public abstract class UserModel extends BaseEntity {
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY) @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
public String hashedPassword; public String hashedPassword;
@Transient
public String role;
protected UserModel(String role) {
this.role = role;
}
public UserModel() {}
@Transactional @Transactional
public void signup(String name, String phone, String rawPassword) { public void signup(String name, String phone, String rawPassword) {
UserModel existedUser = UserModel.find("phone", phone).firstResult(); UserModel existedUser = UserModel.find("phone", phone).firstResult();
@@ -12,7 +12,11 @@ import org.junit.jupiter.api.Test;
@Entity @Entity
@Table(name = "test_users") @Table(name = "test_users")
class TestUserEntity extends UserModel {} class TestUserEntity extends UserModel {
public TestUserEntity() {
super("TestRole");
}
}
@QuarkusTest @QuarkusTest
public class UserModelTest { public class UserModelTest {
+1 -1
View File
@@ -9,7 +9,7 @@
<parent> <parent>
<groupId>com.drinkool</groupId> <groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId> <artifactId>drinkool</artifactId>
<version>1.5.8</version> <version>1.5.9</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
+1 -1
View File
@@ -9,7 +9,7 @@
<parent> <parent>
<groupId>com.drinkool</groupId> <groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId> <artifactId>drinkool</artifactId>
<version>1.5.8</version> <version>1.5.9</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
+3 -3
View File
@@ -15,7 +15,7 @@ spec:
spec: spec:
containers: containers:
- name: account-pod - name: account-pod
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.8 image: git.demonkernel.io.vn/foodsurf/account-service:1.5.9
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- containerPort: 8080 - containerPort: 8080
@@ -73,7 +73,7 @@ spec:
spec: spec:
containers: containers:
- name: eatery-pod - name: eatery-pod
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.8 image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.9
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- containerPort: 8080 - containerPort: 8080
@@ -129,7 +129,7 @@ spec:
spec: spec:
containers: containers:
- name: gateway-pod - name: gateway-pod
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.8 image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.9
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
ports: ports:
- containerPort: 8080 - containerPort: 8080
+1 -1
View File
@@ -9,7 +9,7 @@
<parent> <parent>
<groupId>com.drinkool</groupId> <groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId> <artifactId>drinkool</artifactId>
<version>1.5.8</version> <version>1.5.9</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
+1 -1
View File
@@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.drinkool</groupId> <groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId> <artifactId>drinkool</artifactId>
<version>1.5.8</version> <version>1.5.9</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<properties> <properties>
<maven.compiler.source>25</maven.compiler.source> <maven.compiler.source>25</maven.compiler.source>