mirror of
https://github.com/st-tu-dresden-praktikum/swt23w23
synced 2024-07-19 21:04:36 +02:00
Add users sequence diagram
This commit is contained in:
parent
4052224dba
commit
ad88c6e067
97
src/main/asciidoc/models/design/seq_users.puml
Normal file
97
src/main/asciidoc/models/design/seq_users.puml
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
@startuml
|
||||||
|
|
||||||
|
participant User
|
||||||
|
participant "User:customer" as User_customer
|
||||||
|
participant "User:admin" as User_admin
|
||||||
|
participant UserController
|
||||||
|
participant UserManagement
|
||||||
|
participant UserRepository
|
||||||
|
participant UserDataInitializier
|
||||||
|
participant Spring
|
||||||
|
|
||||||
|
== Create Admin ==
|
||||||
|
|
||||||
|
UserDataInitializier -> UserManagement : createAdmin()
|
||||||
|
activate UserDataInitializier
|
||||||
|
activate UserManagement
|
||||||
|
UserManagement -> UserRepository : "save(User:admin)"
|
||||||
|
activate User_admin
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository : User_admin
|
||||||
|
deactivate UserRepository
|
||||||
|
UserDataInitializier <-- UserManagement : User
|
||||||
|
deactivate UserManagement
|
||||||
|
deactivate UserDataInitializier
|
||||||
|
deactivate User_admin
|
||||||
|
|
||||||
|
== Create Customer ==
|
||||||
|
|
||||||
|
UserDataInitializier -> UserManagement : createCustomer(String,String,String)
|
||||||
|
activate UserDataInitializier
|
||||||
|
activate UserManagement
|
||||||
|
UserManagement -> UserRepository : "save(User:customer)"
|
||||||
|
activate User_customer
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository : User
|
||||||
|
deactivate UserRepository
|
||||||
|
UserDataInitializier <-- UserManagement : User
|
||||||
|
deactivate UserManagement
|
||||||
|
deactivate UserDataInitializier
|
||||||
|
deactivate User_customer
|
||||||
|
|
||||||
|
== Delete User (Customer) ==
|
||||||
|
|
||||||
|
Spring -> UserController : deleteUser()
|
||||||
|
activate User_customer
|
||||||
|
activate Spring
|
||||||
|
activate UserController
|
||||||
|
UserController -> UserManagement : deleteUser(UserIdentifier)
|
||||||
|
activate UserManagement
|
||||||
|
UserManagement -> UserRepository : deleteById(UserIdentifier)
|
||||||
|
activate UserRepository
|
||||||
|
UserManagement <-- UserRepository
|
||||||
|
deactivate UserRepository
|
||||||
|
UserController <-- UserManagement
|
||||||
|
deactivate UserManagement
|
||||||
|
destroy User_customer
|
||||||
|
UserController <-- Spring: "redirect:/"
|
||||||
|
deactivate UserController
|
||||||
|
deactivate Spring
|
||||||
|
|
||||||
|
== View Profile ==
|
||||||
|
|
||||||
|
Spring -> UserController : index(Model)
|
||||||
|
activate User
|
||||||
|
activate Spring
|
||||||
|
activate UserController
|
||||||
|
UserController -> Spring : model.addAttribute("user",User)
|
||||||
|
UserController <-- Spring : Model
|
||||||
|
Spring <-- UserController : "profile"
|
||||||
|
deactivate Spring
|
||||||
|
deactivate UserController
|
||||||
|
'technically spring is sending requests to User
|
||||||
|
'but i wrote these requests in profile.html
|
||||||
|
'so i'm not sure if i should add them
|
||||||
|
deactivate User
|
||||||
|
|
||||||
|
== Edit Profile ==
|
||||||
|
|
||||||
|
Spring -> UserController : editProfile(String:password,String:address,String:username)
|
||||||
|
activate User
|
||||||
|
activate Spring
|
||||||
|
activate UserController
|
||||||
|
UserController -> User : [!String:username.isBlank()] setUsername(String:username)
|
||||||
|
UserController <-- User : boolean
|
||||||
|
UserController -> User : [!String:address.isBlank()] setAddress(String:address)
|
||||||
|
UserController <-- User : boolean
|
||||||
|
UserController -> User : [!String:password.isBlank()] setPassword(String:password)
|
||||||
|
UserController <-- User : boolean
|
||||||
|
UserController -> UserManagement : save(User:LoggedIn)
|
||||||
|
activate UserManagement
|
||||||
|
UserController <-- UserManagement : User
|
||||||
|
Spring <-- UserController : "redirect:/profile"
|
||||||
|
deactivate Spring
|
||||||
|
deactivate UserController
|
||||||
|
deactivate User
|
||||||
|
|
||||||
|
@enduml
|
BIN
src/main/asciidoc/models/design/seq_users.svg
(Stored with Git LFS)
Normal file
BIN
src/main/asciidoc/models/design/seq_users.svg
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in a new issue