利用PlantUML画序列图常用的一些颜色配置等使用的例子

摘要: 在设计系统的时候,一张图胜过很多语言描述,因此很多系统在做设计的时候,序列图是必不可少的一项。画UML图有很多工具,但作为程序员来说,我觉得最爽的还是plantUML, 它用编程的方式实现图形

在设计系统的时候,一张图胜过很多语言描述,因此很多系统在做设计的时候,序列图是必不可少的一项。画UML图有很多工具,但作为程序员来说,我觉得最爽的还是plantUML, 它用编程的方式实现图形。

plantuml的使用,在其官网上有非常详细的描述。在这里不介绍了。这里只记录我自己常用的一些配色方式,字体处理,DPI设置等,因为脑袋记不住那么多配置。因此用一个常用的序列图来记录。

用plantuml 编写代码如下。

@startuml
title The withdrawal amount is greater than the threshold of currency. Manual withdrawal sequence diagram\n
skinparam sequenceArrowThickness 1
skinparam roundcorner 20
'skinparam maxmessagesize 60
skinparam backgroundColor #fff
skinparam handwritten false
skinparam dpi 100
skinparam sequence {
	ArrowColor black
	ActorBorderColor #000
	LifeLineBorderColor black
	LifeLineBackgroundColor #CCC
	ParticipantBorderColor #000
	ParticipantBackgroundColor default
	'ParticipantFontName Impact
	ParticipantFontSize 14
	ParticipantFontColor #000
	ActorFontColor black
	ActorFontSize 14
	'ActorFontName Aapex
}
skinparam activity{
  ArrowFontSize 14
  FontSize 14
}

autonumber
box "Client Side"
	actor User as user
	participant "Web Front" as front
	participant "User Center Application" as uc #ccc
end box
Database "Database" as db

box "Admin Side"

	participant "Web Admin Application" as admin
	actor "Admin User" as adminer
end box


user -> front: open withdraw page
front -> front: user fill in withdrawal parameters
front -> uc: send withdrawal application
note right of uc: withdrawal amount is greater than\n the threshold of currency
uc->db:save withdrawal application
db->uc:response

uc-->front:response to web front,\n application status is processing.
' adminer operation
==  ==
adminer->admin:open withdrawal audit page
admin->db:query unapproved records
db->admin: response unapproved records
admin->admin:audit record
admin->db:update status of record,\n status is waiting
db->admin: response update result
note right of admin:Manual processing of account information\nand get transaction id
admin->admin:fill in transaction id, and confirm withdrawal.
admin->db:update account information
db->admin:response result.
==  ==
user->front:open withdrawal page
front->uc:query withdrawal progress
uc->db:get progress of \n withdrawal
db->uc:response staus of withdrawal
uc->front:response staus of withdrawal


@enduml

最终效果的呈现就如上图所示。

上一篇: 广电网络电话192段号码申请
下一篇: Web3与元宇宙
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号