Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e72ccf4e96 | |||
| 8487a8ff19 | |||
| dc5bc731b3 | |||
| d45ed26a07 | |||
| 4a0e0e935c |
@@ -1,3 +1,17 @@
|
||||
## [1.5.30](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.29...v1.5.30) (2026-05-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add menu item fields ([#55](https://git.demonkernel.io.vn/FoodSurf/backend/issues/55)) ([dc5bc73](https://git.demonkernel.io.vn/FoodSurf/backend/commit/dc5bc731b3345663d2640a500ecfb77e81929ab2))
|
||||
|
||||
## [1.5.28](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.27...v1.5.28) (2026-05-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* resolved minor issue ([#53](https://git.demonkernel.io.vn/FoodSurf/backend/issues/53)) ([43734b5](https://git.demonkernel.io.vn/FoodSurf/backend/commit/43734b51aafad7f823ff5d34322cc6fb6f4e6699))
|
||||
|
||||
## [1.5.27](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.5.26...v1.5.27) (2026-05-12)
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.drinkool.entities;
|
||||
|
||||
import com.drinkool.Role;
|
||||
import com.drinkool.models.UserModel;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.ArrayList;
|
||||
@@ -11,6 +13,7 @@ import java.util.List;
|
||||
@Table(name = Role.Manager)
|
||||
public class ManagerEntity extends UserModel {
|
||||
|
||||
@JsonIgnore
|
||||
@OneToMany(
|
||||
mappedBy = "serve",
|
||||
cascade = CascadeType.ALL,
|
||||
@@ -18,6 +21,7 @@ public class ManagerEntity extends UserModel {
|
||||
)
|
||||
public List<StaffEntity> staffs = new ArrayList<>();
|
||||
|
||||
@JsonIgnore
|
||||
@Column(nullable = true)
|
||||
public String bankAccount;
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ public class ManagerService extends BaseService<ManagerEntity> {
|
||||
.build();
|
||||
|
||||
return Response.accepted()
|
||||
.entity(manager)
|
||||
.header(InternalValue.userId, manager.id.toString())
|
||||
.header(InternalValue.role, Role.Manager)
|
||||
.build();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -23,5 +23,9 @@ public class AddMenuItem implements MenuItemInterface {
|
||||
@NonNull
|
||||
private Double price;
|
||||
|
||||
private Boolean available;
|
||||
|
||||
private String description;
|
||||
|
||||
private String imageUrl;
|
||||
}
|
||||
|
||||
@@ -26,5 +26,9 @@ public class UpdateMenuItem implements EntityInterface, MenuItemInterface {
|
||||
|
||||
Double price;
|
||||
|
||||
Boolean available;
|
||||
|
||||
String description;
|
||||
|
||||
String imageUrl;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,16 @@ public class MenuItemEntity extends BaseEntity implements MenuItemInterface {
|
||||
@Column(nullable = false)
|
||||
public Double price;
|
||||
|
||||
@Column(columnDefinition = "boolean default true")
|
||||
public Boolean available;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "eatery_id")
|
||||
public EateryEntity eatery;
|
||||
|
||||
@Column(columnDefinition = "TEXT default ''")
|
||||
public String description;
|
||||
|
||||
@Column(nullable = true)
|
||||
public String imageUrl;
|
||||
|
||||
|
||||
@@ -88,6 +88,8 @@ public class EateryServiceTest {
|
||||
new AddMenuItem(
|
||||
faker.food().dish(),
|
||||
faker.number().randomDouble(2, 10, 100),
|
||||
true,
|
||||
"",
|
||||
""
|
||||
)
|
||||
).id;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -9,6 +9,9 @@ import jakarta.json.bind.Jsonb;
|
||||
import jakarta.ws.rs.core.HttpHeaders;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class GraphqlBase {
|
||||
|
||||
@@ -39,18 +42,25 @@ public abstract class GraphqlBase {
|
||||
gqlRequest.variables
|
||||
);
|
||||
|
||||
if (response.hasError()) {
|
||||
return Response.status(400)
|
||||
.entity(jsonb.toJson(response.getErrors()))
|
||||
.build();
|
||||
}
|
||||
Map<String, Object> gqlBody = new HashMap<>();
|
||||
|
||||
return Response.ok(jsonb.toJson(response.getData()))
|
||||
gqlBody.put("data", response.getData());
|
||||
gqlBody.put("errors", response.getErrors());
|
||||
return Response.ok(jsonb.toJson(gqlBody))
|
||||
.type(MediaType.APPLICATION_JSON)
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Response.serverError().entity("Lỗi kết nối tới service").build();
|
||||
Map<String, Object> errorBody = new HashMap<>();
|
||||
errorBody.put(
|
||||
"errors",
|
||||
List.of(Map.of("message", "Lỗi kết nối tới service: " + e.getMessage()))
|
||||
);
|
||||
|
||||
return Response.serverError()
|
||||
.type(MediaType.APPLICATION_JSON)
|
||||
.entity(jsonb.toJson(errorBody))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: account-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.27
|
||||
image: git.demonkernel.io.vn/foodsurf/account-service:1.5.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: cart-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/cart-service:1.5.27
|
||||
image: git.demonkernel.io.vn/foodsurf/cart-service:1.5.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: eatery-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.27
|
||||
image: git.demonkernel.io.vn/foodsurf/eatery-service:1.5.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: file-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/file-service:1.5.27
|
||||
image: git.demonkernel.io.vn/foodsurf/file-service:1.5.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- name: file-volume
|
||||
|
||||
@@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: gateway-pod
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.27
|
||||
image: git.demonkernel.io.vn/foodsurf/gateway-service:1.5.30
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>com.drinkool</groupId>
|
||||
<artifactId>drinkool</artifactId>
|
||||
<version>1.5.27</version>
|
||||
<version>1.5.30</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ public interface MenuItemInterface {
|
||||
void setName(String x);
|
||||
Double getPrice();
|
||||
void setPrice(Double x);
|
||||
Boolean getAvailable();
|
||||
void setAvailable(Boolean x);
|
||||
String getImageUrl();
|
||||
void setImageUrl(String x);
|
||||
String getDescription();
|
||||
void setDescription(String x);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user