PlantUML作為一個插件安裝在IDEA中,可以用代碼實現各種圖,可千萬別被他名字給矇蔽了。像經常用的ER圖、UML圖、思維導圖等。
ER圖
@startuml
class Base {
Long id 編號
}
class User {
String name 名字
String nickname 暱稱
Integer gender 性別
}
class Order {
BigDecimal price 價格
String order_no 訂單號
Integer order_status 訂單狀態
}
Base
Base
User "1" -- "n" Order
interface UserService
abstract class AbstractUserServiceImpl
UserService
AbstractUserServiceImpl
class UserServiceImpl
@enduml
時序圖
@startuml
title 時序圖通用模板
actor A
actor B
box "db_adaptor" #LightBlue
collections db_adaptor1
collections db_adaptor2
end box
database db1
database db2
A -> B: post req1
note left: 左側備註
activate B
A
A --> B: get 查詢job進度
note over A,B #green:一直查詢job直到成功
B -> db_adaptor1: post req2
db_adaptor1 -[#green]-> db1:db operate
db_adaptor2 -[#green]-> db2:db operate
B
note right: 右側備註
A
deactivate B
@enduml
腦圖
@startmindmap
+ OS
++ Windows
+++ Windows 95
+++ Windows 98
+++ Windows NT
++ Linux
-- Mac
--- Black Mac
--- Mac OS
@endmindmap
閱讀更多 碼向未來 的文章