Skip to content

Commit 9340066

Browse files
committed
update
1 parent 44a66e5 commit 9340066

20 files changed

+8470
-15
lines changed

docker-compose.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
## zookeeper
2-
## broker
3-
## kafka
41
version: '2'
52
services:
3+
mysql:
4+
image: mysql
5+
environment:
6+
MYSQL_ROOT_PASSWORD: 12042003
7+
MYSQL_DATABASE: my_database
8+
MYSQL_USER: root
9+
MYSQL_PASSWORD: 12042003
10+
ports:
11+
- "3306:3306"
12+
13+
mongodb:
14+
image: mongo
15+
volumes:
16+
- ./mongo_data:/data/db
17+
ports:
18+
- "27017:27017"
19+
620
zookeeper:
721
image: confluentinc/cp-zookeeper:7.4.3
822
hostname: zookeeper
@@ -60,4 +74,4 @@ services:
6074
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
6175
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
6276
CONFLUENT_METRICS_TOPIC_REPLICATION: 1
63-
PORT: 9021
77+
PORT: 9021

order-service/src/main/java/com/hoangtien2k3/orderservice/api/CartController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class CartController {
4141
@ApiResponse(code = 204, message = "No content", response = ResponseEntity.class)
4242
})
4343
@GetMapping
44-
@PreAuthorize("hasAuthority('ADMIN')")
44+
@PreAuthorize("hasAuthority('ADMIN') and hasAuthority('USER')")
4545
public Mono<ResponseEntity<List<CartDto>>> findAll() {
4646
log.info("*** CartDto List, controller; fetch all categories *");
4747
return cartService.findAll()
@@ -55,7 +55,7 @@ public Mono<ResponseEntity<List<CartDto>>> findAll() {
5555
@ApiResponse(code = 204, message = "No content", response = ResponseEntity.class)
5656
})
5757
@GetMapping("/all")
58-
@PreAuthorize("hasAuthority('ADMIN')")
58+
@PreAuthorize("hasAuthority('ADMIN') and hasAuthority('USER')")
5959
public Mono<ResponseEntity<Page<CartDto>>> findAll(@RequestParam(defaultValue = "0") int page,
6060
@RequestParam(defaultValue = "10") int size,
6161
@RequestParam(defaultValue = "cartId") String sortBy,

order-service/src/main/java/com/hoangtien2k3/orderservice/api/OrderController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class OrderController {
3636
@ApiResponse(code = 204, message = "No content", response = ResponseEntity.class)
3737
})
3838
@GetMapping
39-
@PreAuthorize("hasAuthority('ADMIN')")
39+
@PreAuthorize("hasAuthority('ADMIN') or hasAuthority('USER')")
4040
public Mono<ResponseEntity<List<OrderDto>>> findAll() {
4141
log.info("*** OrderDto List, controller; fetch all orders *");
4242
return orderService.findAll()

order-service/src/main/java/com/hoangtien2k3/orderservice/dto/user/UserDto.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package com.hoangtien2k3.orderservice.dto.user;
22

3-
import com.fasterxml.jackson.annotation.JsonInclude;
4-
import com.fasterxml.jackson.annotation.JsonInclude.Include;
5-
import com.fasterxml.jackson.annotation.JsonProperty;
6-
import com.hoangtien2k3.orderservice.dto.order.CartDto;
73
import lombok.*;
84

95
import java.io.Serial;
@@ -26,8 +22,4 @@ public class UserDto implements Serializable {
2622
private String phone;
2723
private String avatar;
2824

29-
@JsonProperty("cart")
30-
@JsonInclude(Include.NON_NULL)
31-
private CartDto cartDto;
32-
3325
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/main/resources/script/prod_log.log.2024-01-11.0164195069014672.tmp

Lines changed: 519 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/main/resources/script/stage_log.log.2024-01-11.0155877474559432.tmp

Lines changed: 3995 additions & 0 deletions
Large diffs are not rendered by default.

src/main/resources/script/stage_log.log.2024-01-11.0155878003945833.tmp

Lines changed: 3935 additions & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

0 commit comments

Comments
 (0)