Files
gpf_pet_hospital/pet_hospital_sequence_diagram.puml
王子琦 f9bfb8556b add
2026-02-09 21:14:30 +08:00

64 lines
1.4 KiB
Plaintext

@startuml
!theme plain
skinparam backgroundColor #FFFFFF
skinparam sequence {
ArrowColor #333333
LifeLineBorderColor #777777
LifeLineBackgroundColor #FFFFFF
LifeLineBorderColor #AAAAAA
ParticipantBorderColor #AAAAAA
ParticipantBackgroundColor #F5F5F5
ParticipantFontColor #333333
ParticipantFontSize 12
}
title Pet Hospital Appointment Booking Process
actor Customer as C
participant "UserController" as UC
participant "UserService" as US
participant "AppointmentService" as AS
participant "AppointmentMapper" as AM
database "Database" as DB
C -> UC: Login(username, password)
UC -> US: login(username, password)
US -> DB: SELECT user FROM user WHERE username=?
activate US
return AuthUser
return JWT Token
deactivate US
C -> UC: View available pets
UC -> US: getPetsByOwnerId(userId)
activate US
US -> DB: SELECT pets FROM pet WHERE ownerId=?
return List<Pet>
deactivate US
C -> UC: Book appointment(Appointment)
activate UC
UC -> AS: book(Appointment)
activate AS
AS -> DB: INSERT appointment
activate AM
AM -> DB: Insert appointment record
return Success
deactivate AM
return Appointment ID
deactivate AS
return Success Response
deactivate UC
C -> UC: View appointments
UC -> AS: getByUserId(userId)
activate AS
AS -> DB: SELECT appointments FROM appointment WHERE userId=?
return List<Appointment>
deactivate AS
return Appointment List
deactivate UC
note right: Customer receives confirmation\nof successful booking
@enduml