-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClassDiagram2.puml
132 lines (121 loc) · 4.75 KB
/
ClassDiagram2.puml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@startuml ClassDiagram2
package vendmachtrack.springboot.controller {
class HealthController {
+ getHealth(): ResponseEntity<String>
}
class MachineTrackerController {
- machtrackService: MachineTrackerService
+ getVendMachList(): ResponseEntity<HashMap<Integer, String>>
+ getVendMachLocation(id: int): ResponseEntity<String>
+ getInventory(id: int): ResponseEntity<HashMap<String, Integer>>
+ addItem(id: int, item: String, quantity: int): ResponseEntity<HashMap<String, Integer>>
+ removeItem(id: int, item: String, quantity: int): ResponseEntity<HashMap<String, Integer>>
+ addVendMach(id: int, location: String): ResponseEntity<HashMap<Integer, String>>
+ removeVendMach(id: int): ResponseEntity<HashMap<Integer, String>>
+ changeLocation(id: int, location: String): ResponseEntity<HashMap<Integer, String>>
}
}
package vendmachtrack.springboot.exception {
class ErrorDetails {
- timestamp: Date
- error: String
- details: String
+ getTimestamp(): Date
+ getError(): String
+ getDetails(): String
}
class GlobalExceptionHandler {
+ resourceNotFoundException(ex: ResourceNotFoundException, request: WebRequest): ResponseEntity<?>
+ illegalInputException(ex: IllegalInputException, request: WebRequest): ResponseEntity<?>
}
class IllegalInputException {
+ IllegalInputException(message: String)
}
class ResourceNotFoundException {
+ ResourceNotFoundException(message: String)
}
}
package vendmachtrack.springboot.service {
class MachineTrackerService {
+ getVendMachList(): HashMap<Integer, String>
+ getVendMachLocation(id: int): String
+ getInventory(id: int): HashMap<String, Integer>
+ addItem(id: int, item: String, quantity: int): HashMap<String, Integer>
+ removeItem(id: int, item: String, quantity: int): HashMap<String, Integer>
+ addVendMach(id: int, location: String): HashMap<Integer, String>
+ removeVendMach(id: int): HashMap<Integer, String>
+ changeLocation(id: int, location: String): HashMap<Integer, String>
}
}
package vendmachtrack.jsonio {
class VendmachtrackPersistence {
- fromJson: FromJson
- toJson: ToJson
+ getVendmachtrack(): MachineTracker
+ saveVendmachtrack(vendmachtrack: MachineTracker): MachineTracker
}
}
package vendmachtrack.springboot.repository {
class MachineTrackerRepository {
- persistence: VendmachtrackPersistence
+ getVendmachtrack(): MachineTracker
+ saveVendmachtrack(vendmachtrack: MachineTracker): MachineTracker
+ getVendMach(id: int): VendingMachine
+ changeLocation(id: int, location: String): VendingMachine
+ addItem(id: int, item: String, quantity: int): VendingMachine
+ removeItem(id: int, item: String, quantity: int): VendingMachine
+ addVendMach(id: int, location: String): MachineTracker
+ removeVendMach(id: int): MachineTracker
}
}
package vendmachtrack.core {
class MachineTracker {
- machines: List<VendingMachine>
+ removeVendingMachine(v: VendingMachine): void
+ addVendingMachine(v: VendingMachine): void
+ getMachines(): List<VendingMachine>
+ setMachines(machines: List<VendingMachine>): void
}
class VendingMachine {
- status: HashMap<String, Integer>
- id: int
- location: String
+ getStatus(): HashMap<String, Integer>
+ getId(): int
+ getLocation(): String
+ addItem(item: String, quantity: int): void
+ removeItem(item: String, quantity: int): boolean
+ setStatus(status: HashMap<String, Integer>): void
+ setId(id: int): void
+ setLocation(location: String): void
}
}
package vendmachtrack.core {
class Item {
- name: String
- price: double
+ Item(name: String, price: double)
+ getName(): String
+ getPrice(): double
+ setName(newName: String): void
+ setPrice(newPrice: double): void
}
}
class ResponseEntity<T> {
- body: T
- statusCode: HttpStatus
+ getBody(): T
+ getStatusCode(): HttpStatus
}
MachineTrackerRepository --|> VendmachtrackPersistence
VendmachtrackPersistence --|> MachineTracker
MachineTrackerService --|> MachineTracker
MachineTrackerService --|> MachineTrackerRepository
MachineTrackerController --|> MachineTrackerService
MachineTrackerController --|> ResponseEntity
GlobalExceptionHandler --|> ResourceNotFoundException
GlobalExceptionHandler --|> IllegalInputException
MachineTrackerService --|> ResourceNotFoundException
MachineTracker "1" o-- "*" VendingMachine : tracks
VendingMachine "1" o-- "*" Item : contains
@enduml