File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 클래스 다이어그램
2+
3+ ---
4+ ``` mermaid
5+ classDiagram
6+ class User {
7+ - Long id
8+ - String userId
9+ - String email
10+ - LocalDate birthdate
11+ - Gender gender
12+ --
13+ + boolean hasEnoughPoint(Long amount)
14+ + void deductPoint(Long amount)
15+ }
16+
17+ class Point {
18+ - Long id
19+ - User user
20+ - Long value
21+ --
22+ + void increase(Long amount)
23+ + void decrease(Long amount)
24+ }
25+
26+ class Product {
27+ - Long id
28+ - Brand brand
29+ - String name
30+ - String description
31+ - Long price
32+ - int stock
33+ --
34+ + boolean isOutOfStock()
35+ + boolean hasSufficientStock(int quantity)
36+ + void decreaseStock(int quantity)
37+ }
38+
39+ class Brand {
40+ - Long id
41+ - String name
42+ - String description
43+ --
44+ + List~Product~ getProducts()
45+ }
46+
47+ class Like {
48+ - Long id
49+ - User user
50+ - Product product
51+ - TIMESTAMP deleted_at
52+ --
53+ + void toggle()
54+ }
55+
56+ class Order {
57+ - Long id
58+ - User user
59+ - List~OrderItem~ items
60+ - OrderStatus status
61+ --
62+ + Long getTotalPrice()
63+ + void markPaid()
64+ }
65+
66+ class OrderItem {
67+ - Long id
68+ - Product product
69+ - int quantity
70+ - Long price
71+ --
72+ + Long getSubTotal()
73+ }
74+
75+ User "1" --> "1..*" Order
76+ User "1" --> "1..*" Like
77+ User "1" --> "1" Point
78+ Order "1" --> "1..*" OrderItem
79+ Product "1" --> "1..*" Like
80+ Brand "1" --> "1..*" Product
81+
82+ ```
You can’t perform that action at this time.
0 commit comments