pom.xml添加依赖

net.sourceforge.plantuml

plantuml

1.2020.10

对应controller写入plantuml脚本

package com.imddysc.testweb.controller;

import java.io.ByteArrayOutputStream;

import java.io.IOException;

import org.springframework.http.MediaType;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

import org.springframework.web.bind.annotation.RequestParam;

import org.springframework.web.bind.annotation.ResponseBody;

import org.springframework.web.bind.annotation.RestController;

import net.sourceforge.plantuml.FileFormat;

import net.sourceforge.plantuml.FileFormatOption;

import net.sourceforge.plantuml.SourceStringReader;

@RestController

public class PlantUMLServerController {

@ResponseBody

@RequestMapping(value = "/ping", method = RequestMethod.GET)

public String ping() throws IOException {

System.out.println("Ping");

return "OK!";

}

@ResponseBody

@RequestMapping(value = "/uml", method = RequestMethod.GET, produces = MediaType.IMAGE_PNG_VALUE)

public byte[] generateImageFromUmlScript(@RequestParam(value = "script", defaultValue = "@startuml;actor Kaka;@enduml") String script) throws IOException {

System.out.println("Generate UML for: "+script);

SourceStringReader reader = new SourceStringReader(script.replace(';','\n'));

ByteArrayOutputStream bos = new ByteArrayOutputStream();

reader.generateImage(bos, new FileFormatOption(FileFormat.PNG, false));

return bos.toByteArray();

}

}

二、

服务器需要安装 curl  graphviz 等。

yum install -y curl curl-devel graphviz graphviz-devel

@startuml

!include

!include

!include

!include

title Cloudinsight sprites example

skinparam monochrome true

rectangle "\nwebapp" as webapp

queue "" as kafka

rectangle "\ndaemon" as daemon

database "" as cassandra

webapp -> kafka

kafka -> daemon

daemon --> cassandra

@enduml

plantuml 依赖_Plantuml的基本使用相关推荐

  1. plantuml 依赖_PlantUML参考手册

    title: PlantUML参考手册 date: 2020-03-03 15:37:35 tags: - UML - 手册 categories: - 手册 - UML PlantUML参考手册 前 ...

  2. plantuml 依赖_PlantUML快速入门

    UML 的简介 统一建模语言(UML)是一个通用的可视化建模语言,用于对软件进行描述.可视化处理.构造和建立软件系统制品的文档.其重要性就不多言(虽然没见到多少人用,但我仍然认为它很重要,只要大家愿意 ...

  3. plantuml 依赖_plantuml语法

    活动图(新语法) 当前活动图(activity diagram)的语法有诸多限制和缺点,比如代码难以维护. 所以从V7947开始提出一种全新的.更好的语法格式和软件实现供用户使用(beta版). 就像 ...

  4. plantuml 依赖_PlantUML入门

    by tot in unsplash 1. 背景 随着工作时间的增长,越发觉得用专业的图形(用例图,时序图,ER图等等)去准确表达想法是很重要的.比如针对某个需求绘制的的用例图,比一段乏味的文字来的更 ...

  5. plantuml 依赖_遇见PlantUML

    前言 来到公司实习也快一个月了,最大的体会就是,虽然大部分时间做的是简单的增删该查,但不同于在学校时写的Demo,你要充分考虑程序的鲁棒性(健壮性).可扩展性(可维护性).时间/空间复杂度等.因为是要 ...

  6. plantuml 依赖_ubuntu安装PlantUML

    1. 安装graphviz 这是PlantUML依赖的图形库,支持所有OS, 可以在此下载 http://graphviz.org/Download..php ubuntu平台可以直接到这里: htt ...

  7. plantuml 依赖_使用PlantUML绘制类图

    本文基于sublime的PlantUML插件绘制类图.如需了解插件安装,请点击 Sublime安装PlantUML插件 类的UML表示 使用UML表示一个类,主要由三部分组成. 类名 . 属性 . 方 ...

  8. plantuml样式_PlantUML 简明教程

    PlantUML 简介 PlantUML 是一个开源项目,支持快速绘制时序图.用例图.类图.活动图.组件图.状态图.对象图.部署图等.同时还支持非 UML 图的甘特图.架构图等.例如下面等用例图: @ ...

  9. plantuml语法_PlantUML实践 | 思维导图

    ❝ 思维导图又叫心智导图,用于表达发散性思维的图形工具. ❞ 语法 使用一些运算符(如:+,-,*)来决定图形方向. 相同运算符数量则在同一级. 运算符数量越多,层级越深. 支持内置前缀图标标记,如旗 ...

最新文章

  1. 怎样修改Ubuntu的root帐户密码并使用root登录
  2. 持续推进预估时间问题研究,滴滴盖亚计划开放ETA数据集
  3. 告别 CNN?一张图等于 16x16 个字,计算机视觉也用上 Transformer 了
  4. 基于JDK 1.8 的 Java 容器UML图
  5. [LeetCode] 回溯算法
  6. 5款没有专利纠葛的Linux发行版
  7. 空壳公司骗贷的常见手段及风控措施
  8. 【opencv】opencv在图片、视频嵌中英文字符的方法
  9. 关于华科的计算系统结构专业
  10. Spring Cloud Gateway –配置简单路由
  11. P5706 【深基2.例8】再分肥宅水(python3实现)
  12. dbgview OutputDebugString输出函数
  13. mongodb对数组元素及内嵌文档进行增删改查操作(转)
  14. 【LeetCode】Copy List with Random Pointer
  15. wordpress 资料管理系统_说一说库存管理系统。
  16. 初识Python导图笔记
  17. 在Sun新解决方案中心亲历虚拟化(多图)
  18. 并发编程学习之Condition和顺序访问
  19. 5G协议下载地址及介绍
  20. 关于系统安装之U盘制作【install.wim】

热门文章

  1. 施耐德140系列PLC模块140NOM25200C Modicon Quantum140XBP00600 140XBP01000 140XBP01600 140CPS11100 140CPS11420
  2. 让 Lua 访问数据库
  3. 解析las文件_LAS 数据集文件结构
  4. 寒冰王座 HDU - 1248
  5. 两路音频合成一路电路_CD4013构成音频线路输出双路转换器
  6. screenshot python_python 截图screenshot处理
  7. 离散数学学习笔记----集合代数
  8. JavaScript中函数
  9. SEOer必学的技能:好的软文首先就是做好标题党!
  10. html加入window播放器,使用 HTML 和 Windows Media Player