Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6eb075c4b5 | |||
| 4ab284e966 | |||
| b7bf0164e6 | |||
| 715fbaf202 | |||
| a5359db271 | |||
| 95ca126670 |
@@ -1,3 +1,24 @@
|
||||
## [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)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add sms otp protocol ([#30](https://git.demonkernel.io.vn/FoodSurf/backend/issues/30)) ([a5359db](https://git.demonkernel.io.vn/FoodSurf/backend/commit/a5359db271fc020dfc579fb62c2aa468852070a8))
|
||||
|
||||
## [1.5.7](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.6...v1.5.7) (2026-04-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add logout, quick signup and quick login ([#29](https://git.demonkernel.io.vn/FoodSurf/backend/issues/29)) ([4811934](https://git.demonkernel.io.vn/FoodSurf/backend/commit/4811934b84f7684410297a8f7d1f7ff14611a25a))
|
||||
|
||||
## [1.5.6](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.5...v1.5.6) (2026-04-19)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<version>1.5.9</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ import java.util.UUID;
|
||||
@Table(name = Role.Customer)
|
||||
public class CustomerEntity extends UserModel {
|
||||
|
||||
public CustomerEntity() {
|
||||
super(Role.Customer);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void signup(String phone) {
|
||||
this.signup(phone, phone, UUID.randomUUID().toString().substring(0, 32));
|
||||
|
||||
@@ -12,6 +12,10 @@ public class ManagerEntity extends UserModel {
|
||||
|
||||
public boolean isVerified;
|
||||
|
||||
public ManagerEntity() {
|
||||
super(Role.Manager);
|
||||
}
|
||||
|
||||
public void signup(
|
||||
String name,
|
||||
String phone,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.drinkool.mapper;
|
||||
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import jakarta.ws.rs.BadRequestException;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.jboss.resteasy.reactive.server.ServerExceptionMapper;
|
||||
|
||||
public class ExceptionHandlersMapper {
|
||||
|
||||
@@ -23,6 +23,15 @@ public abstract class UserModel extends BaseEntity {
|
||||
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
|
||||
public String hashedPassword;
|
||||
|
||||
@Transient
|
||||
public String role;
|
||||
|
||||
protected UserModel(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public UserModel() {}
|
||||
|
||||
@Transactional
|
||||
public void signup(String name, String phone, String rawPassword) {
|
||||
UserModel existedUser = UserModel.find("phone", phone).firstResult();
|
||||
|
||||
@@ -41,8 +41,7 @@ public class CustomerService extends BaseService<CustomerEntity> {
|
||||
|
||||
newCustomer.signup(input.phone);
|
||||
|
||||
return Response.status(Response.Status.CREATED)
|
||||
.build();
|
||||
return Response.status(Response.Status.CREATED).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
quarkus.datasource.db-kind=postgresql
|
||||
quarkus.datasource.username=postgres
|
||||
quarkus.datasource.password=password
|
||||
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres
|
||||
quarkus.datasource.jdbc.url=jdbc:postgresql://host.docker.internal:5432/postgres
|
||||
|
||||
quarkus.hibernate-orm.database.generation=update
|
||||
|
||||
@@ -16,7 +16,7 @@ quarkus.container-image.builder=docker
|
||||
quarkus.container-image.additional-tags=latest
|
||||
|
||||
# Redis
|
||||
quarkus.redis.hosts=redis://localhost:6379
|
||||
quarkus.redis.hosts=redis://${REDIS_SERVICE_SERVICE_HOST:localhost}:${REDIS_SERVICE_SERVICE_PORT:6379}
|
||||
|
||||
|
||||
# Dependency
|
||||
|
||||
@@ -12,7 +12,11 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
@Entity
|
||||
@Table(name = "test_users")
|
||||
class TestUserEntity extends UserModel {}
|
||||
class TestUserEntity extends UserModel {
|
||||
public TestUserEntity() {
|
||||
super("TestRole");
|
||||
}
|
||||
}
|
||||
|
||||
@QuarkusTest
|
||||
public class UserModelTest {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<version>1.5.9</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<version>1.5.9</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class CustomerController extends BaseController {
|
||||
return accountService.quickSignup(input);
|
||||
}
|
||||
|
||||
@POST()
|
||||
@POST
|
||||
@Path(Url.QuickLogin)
|
||||
public Uni<Response> proxyQuickLogin(QuickLogin input) {
|
||||
return accountService.quickLogin(input);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.drinkool.controller;
|
||||
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.dtos.SmsOtp;
|
||||
import com.drinkool.services.BaseService;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.eclipse.microprofile.rest.client.inject.RestClient;
|
||||
|
||||
@Path("/api")
|
||||
public class IndexController {
|
||||
|
||||
@Inject
|
||||
@RestClient
|
||||
BaseService baseService;
|
||||
|
||||
@POST
|
||||
@Path(Url.SmsOtp)
|
||||
public Uni<Response> smsOtp(SmsOtp input) {
|
||||
return baseService.smsOtp(input);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.drinkool.services;
|
||||
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.dtos.SmsOtp;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
||||
|
||||
@RegisterRestClient(configKey = "account")
|
||||
@Path("")
|
||||
public interface BaseService {
|
||||
@POST
|
||||
@Path(Url.SmsOtp)
|
||||
Uni<Response> smsOtp(SmsOtp input);
|
||||
}
|
||||
@@ -15,12 +15,12 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: account-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.6
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.9
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
env:
|
||||
- name: QUARKUS_REDIS_HOST
|
||||
- name: REDIS_SERVICE
|
||||
value: "redis-service"
|
||||
- name: QUARKUS_DATASOURCE_PASSWORD
|
||||
valueFrom:
|
||||
@@ -73,7 +73,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: eatery-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.6
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.9
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
@@ -129,7 +129,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: gateway-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.6
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.9
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<version>1.5.9</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user