mermaid test
classDiagram
Animal <|-- Duck
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}
zenuml
@Client "Client"
@APIGateway "API Gateway"
@AuthService "Auth Service"
@BackendService "Backend Service"
Client -> APIGateway.sendRequest(){
APIGateway -> AuthService.validateToken(){
if(tokenValid){
@return AuthService -> APIGateway: token valid
}
}
if(authenticated){
APIGateway -> BackendService.processRequest(){
// (green) Processing the business logic
BackendService -> BackendService.processData()
@return BackendService -> APIGateway: processed response
}
@return APIGateway -> Client: success response
} else {
@return APIGateway -> Client: unauthorized error
}
}
zenuml
title Order Service
@Actor Client #FFEBE6
@Boundary OrderController #0747A6
@EC2 <<BFF>> OrderService #E3FCEF
group BusinessService {
@Lambda PurchaseService
@AzureFunction InvoiceService
}
@Starter(Client)
// `POST /orders`
OrderController.post(payload) {
OrderService.create(payload) {
order = new Order(payload)
if(order != null) {
par {
PurchaseService.createPO(order)
InvoiceService.createInvoice(order)
}
}
}
}
zenuml
// An example for a RESTful endpoint<br>
// Go to the "Cheat sheet" tab or https://docs.zenuml.com
// to find all syntax<br>
// `POST /v1/book/{id}/borrow`
BookLibService.Borrow(id) {
User = Session.GetUser()
if(User.isActive) {
try {
BookRepository.Update(id, onLoan, User)
receipt = new Receipt(id, dueDate)
} catch (BookNotFoundException) {
ErrorService.onException(BookNotFoundException)
} finally {
Connection.close()
}
}
return receipt
}
1 |
|
mermaid test
https://withesse.co/post/mermaidtest/