diff --git a/README-EN.md b/README-EN.md index d101417f..3b97d3f7 100644 --- a/README-EN.md +++ b/README-EN.md @@ -27,7 +27,6 @@ Blossom doesn't rely on any third-party storage or image hosting; it functions a You can write in Markdown with non-destructive syntax extensions, content created here can be displayed correctly in any Markdown software. - ### Quick Migration All images and articles support one-click backup and export, making migration easy within minutes. The exported files can seamlessly be opened with local software like VS Code or Obsidian. @@ -75,15 +74,18 @@ However, sustaining a livelihood through open-source software is challenging. Th **Thanks to every sponsor for their strong support, Blossom becomes better because of all of you.** -| Sponsors | Sponsors | Sponsors | Sponsors | -| :------------------- | :---------------- | :---------------- | :---------------- | -| i just walked away🏃 | KalyanYang | dsx | 熊猫不是猫 | -| 白驹过隙 | Alipay-\*发 | Alipay-\*琛 | Alipay Anonymous | -| 疾风剑豪索隆 | 放羊的星星 | 立冬 | 给你一支烟 | -| 林诗 | Criesgod | Alipay-\*伟 | 黑醋栗和丁香 | -| Mr_tg000 | Lucky | egil | Glimpse | -| Alipay-\*\*衡 | Alipay-\*\*福 | Alipay-\*\*盼 | 何其正 | -| -A 明 | 开心。 | Please | | +| Sponsors | Sponsors | Sponsors | Sponsors | +| :------------------- | :------------ | :------------ | :--------------- | +| i just walked away🏃 | KalyanYang | dsx | 熊猫不是猫 | +| 白驹过隙 | Alipay-\*发 | Alipay-\*琛 | Alipay Anonymous | +| 疾风剑豪索隆 | 放羊的星星 | 立冬 | 给你一支烟 | +| 林诗 | Criesgod | Alipay-\*伟 | 黑醋栗和丁香 | +| Mr_tg000 | Lucky | egil | Glimpse | +| Alipay-\*\*衡 | Alipay-\*\*福 | Alipay-\*\*盼 | 何其正 | +| -A 明 | 开心。 | Please | 樹梢 | +| Alipay-\*\*耀 | Crius | 初五 | 一巷灯火深 | +| Alipay-\*\*鲲 | 木辰音 | 宁采臣 | Alipay-\*\*雷 | +| Klaus | | | | --- diff --git a/README.md b/README.md index ec4738de..c1b59fa0 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,10 @@ docker compose -f docker/compose/blossom-mysql8.yaml up -d | 林诗 | Criesgod | 支付宝用户-\*伟 | 黑醋栗和丁香 | | Mr_tg000 | Lucky | egil | Glimpse | | 支付宝用户-\*\*衡 | 支付宝用户-\*\*福 | 支付宝用户-\*\*盼 | 何其正 | -| -A 明 | 开心。 | Please | | +| -A 明 | 开心。 | Please | 樹梢 | +| 支付宝用户-\*\*耀 | Crius | 初五 | 一巷灯火深 | +| 支付宝用户-\*\*鲲 | 木辰音 | 宁采臣 | 支付宝用户-\*\*雷 | +| Klaus | | | | --- diff --git a/SPONSORS.md b/SPONSORS.md index 0bccb6a5..34a5607f 100644 --- a/SPONSORS.md +++ b/SPONSORS.md @@ -10,4 +10,7 @@ | 林诗 | Criesgod | 支付宝用户-\*伟 | 黑醋栗和丁香 | | Mr_tg000 | Lucky | egil | Glimpse | | 支付宝用户-\*\*衡 | 支付宝用户-\*\*福 | 支付宝用户-\*\*盼 | 何其正 | -| -A 明 | 开心。 | Please | | +| -A 明 | 开心。 | Please | 樹梢 | +| 支付宝用户-\*\*耀 | Crius | 初五 | 一巷灯火深 | +| 支付宝用户-\*\*鲲 | 木辰音 | 宁采臣 | 支付宝用户-\*\*雷 | +| Klaus | | | | diff --git a/blossom-backend/.gitignore b/blossom-backend/.gitignore index dadece4d..02abcc47 100644 --- a/blossom-backend/.gitignore +++ b/blossom-backend/.gitignore @@ -3,6 +3,7 @@ target/ !.mvn/wrapper/maven-wrapper.jar #!**/src/main/** !**/src/test/** +/smart-doc-2.6.7/ ### static ### /backend/src/main/resources/static/blog/** diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/base/search/message/consumer/IndexMsgConsumer.java b/blossom-backend/backend/src/main/java/com/blossom/backend/base/search/message/consumer/IndexMsgConsumer.java index 414f8aa6..347294b0 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/base/search/message/consumer/IndexMsgConsumer.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/base/search/message/consumer/IndexMsgConsumer.java @@ -60,7 +60,7 @@ public class IndexMsgConsumer { try (Directory directory = FSDirectory.open(this.searchProperties.getUserIndexDirectory(userId)); IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(new StandardAnalyzer()))) { // 查询最新的消息 - ArticleEntity article = this.articleService.selectById(id, false, true, false); + ArticleEntity article = this.articleService.selectById(id, false, true, false, userId); Document document = new Document(); document.add(new StringField("id", Convert.toStr(id), Field.Store.YES)); document.add(new TextField("name", article.getName(), Field.Store.YES)); diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/config/PropertiesCheckListener.java b/blossom-backend/backend/src/main/java/com/blossom/backend/config/PropertiesCheckListener.java index d3d60cab..fc72efa2 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/config/PropertiesCheckListener.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/config/PropertiesCheckListener.java @@ -41,15 +41,21 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { "\n[CHECK] 数据库配置: {}" + "\n[CHECK] 数据库用户: {}" + "\n[CHECK] 数据库密码: {}" + - "\n[CHECK] 图片前缀: {}" + - "\n[CHECK] 图片存储: {}" + + "\n[CHECK] 文件前缀: {}, 非 [http://www.xxx.com/] 内容会强制覆盖后台配置" + + "\n[CHECK] 文件存储: {}" + + "\n[CHECK] 文件大小: {}" + + "\n[CHECK] 授权时长: {}" + + "\n[CHECK] 重置密码: {}" + "\n[CHECK] ==========================================================================================================================\n\n", get(env, SpringUtil.PROFILE_ACTION), get(env, "project.base.version"), get(env, "spring.datasource.url"), get(env, "spring.datasource.username"), get(env, "spring.datasource.password"), get(env, "project.iaas.blos.domain"), - get(env, "project.iaas.blos.default-path") + get(env, "project.iaas.blos.default-path"), + get(env, "spring.servlet.multipart.max-file-size"), + get(env, "project.auth.clients[0].duration"), + get(env, "project.auth.password-reset") ); String defaultPath = get(env, "project.iaas.blos.default-path"); diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleController.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleController.java index 400c9937..be4f8299 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleController.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleController.java @@ -92,7 +92,7 @@ public R info(@RequestParam("id") Long id, if (showHtml == null) { showHtml = false; } - ArticleEntity article = baseService.selectById(id, showToc, showMarkdown, showHtml); + ArticleEntity article = baseService.selectById(id, showToc, showMarkdown, showHtml, AuthContext.getUserId()); XzException400.throwBy(ObjUtil.isNull(article), "文章不存在"); ArticleInfoRes res = article.to(ArticleInfoRes.class); res.setTags(DocUtil.toTagList(article.getTags())); @@ -177,7 +177,7 @@ public R updName(@Validated @RequestBody ArticleUpdNameReq name) { */ @PostMapping("/upd/tag") public R> updTag(@Validated @RequestBody ArticleUpdTagReq req) { - ArticleEntity info = baseService.selectById(req.getId(), false, false, false); + ArticleEntity info = baseService.selectById(req.getId(), false, false, false, AuthContext.getUserId()); List tags = DocUtil.toTagList(info.getTags()); if (tags.contains(req.getTag().toLowerCase()) || tags.contains(req.getTag().toUpperCase())) { tags.remove(req.getTag().toLowerCase()); @@ -196,7 +196,7 @@ public R> updTag(@Validated @RequestBody ArticleUpdTagReq req) { */ @PostMapping("/del") public R delete(@Validated @RequestBody DelReq req) { - baseService.delete(req.getId()); + baseService.delete(req.getId(), AuthContext.getUserId()); return R.ok(); } @@ -219,7 +219,7 @@ public R star(@Validated @RequestBody ArticleStarReq req) { */ @GetMapping("/download") public void download(@RequestParam("id") Long id, HttpServletResponse response) throws IOException { - ArticleEntity article = baseService.selectById(id, false, true, false); + ArticleEntity article = baseService.selectById(id, false, true, false, AuthContext.getUserId()); if (StrUtil.isBlank(article.getMarkdown())) { throw new IllegalArgumentException("文章内容为空,无法导出"); } @@ -240,7 +240,7 @@ public void download(@RequestParam("id") Long id, HttpServletResponse response) */ @GetMapping("/download/html") public void downloadHtml(@RequestParam("id") Long id, HttpServletResponse response) throws IOException { - ArticleEntity article = baseService.selectById(id, false, false, true); + ArticleEntity article = baseService.selectById(id, false, false, true, AuthContext.getUserId()); if (StrUtil.isBlank(article.getHtml())) { throw new IllegalArgumentException("文章内容为空,无法导出"); } @@ -271,6 +271,7 @@ public R upload(@RequestParam("file") MultipartFile file, @RequestParam(value ArticleEntity article = new ArticleEntity(); article.setMarkdown(content); article.setPid(pid); + article.setUserId(AuthContext.getUserId()); article.setName(FileUtil.getPrefix(file.getOriginalFilename())); baseService.insert(article); } catch (Exception e) { @@ -302,7 +303,7 @@ public R createTempVisitKey(@RequestParam("id") Long id) { public String content(@RequestParam("k") String s, HttpServletResponse resp) { ArticleTempVisitService.TempVisit visit = tempVisitService.get(s); XzException404.throwBy(ObjUtil.isNull(visit), "文章不存在或您无权限查看"); - ArticleEntity article = baseService.selectById(visit.getArticleId(), false, false, true); + ArticleEntity article = baseService.selectById(visit.getArticleId(), false, false, true, visit.getUserId()); resp.setContentType("text/html"); return ArticleUtil.toHtml(article, userService.selectById(visit.getUserId())); } diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleService.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleService.java index f29450e8..404fc6ea 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleService.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleService.java @@ -129,7 +129,7 @@ public List listTree(ArticleQueryReq req) { * @param showMarkdown 是否返回 markdown 正文 * @param showHtml 是否返回 html 正文 */ - public ArticleEntity selectById(Long id, boolean showToc, boolean showMarkdown, boolean showHtml) { + public ArticleEntity selectById(Long id, boolean showToc, boolean showMarkdown, boolean showHtml, Long userId) { QueryWrapper where = new QueryWrapper<>(); List column = CollUtil.newArrayList("id", "pid", "name", "icon", "tags", "sort", "cover", "describes", "star_status", "open_status", "pv", "uv", "likes", "words", "version", "cre_time", "upd_time"); @@ -143,7 +143,7 @@ public ArticleEntity selectById(Long id, boolean showToc, boolean showMarkdown, column.add("html"); } where.select(column); - where.eq("id", id).last("limit 1"); + where.eq("id", id).eq("user_id", userId).last("limit 1"); return baseMapper.selectOne(where); } @@ -200,8 +200,8 @@ public Integer updateContentById(ArticleEntity req) { */ @EnableIndex(type = IndexMsgTypeEnum.DELETE, id = "#id") @Transactional(rollbackFor = Exception.class) - public void delete(Long id) { - ArticleEntity article = selectById(id, false, true, true); + public void delete(Long id, Long userId) { + ArticleEntity article = selectById(id, false, true, true, userId); XzException404.throwBy(ObjUtil.isNull(article), "文章不存在"); /* @since 1.10.0 diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleTempVisitService.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleTempVisitService.java index 39626ade..8140a8e0 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleTempVisitService.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/draft/ArticleTempVisitService.java @@ -76,19 +76,4 @@ public TempVisit(Long articleId, Long userId) { this.userId = userId; } } - - -// public static void main(String[] args) throws InterruptedException { -// ArticleTempService a = new ArticleTempService(); -// String key = a.create(20034L); -// System.out.println(key); -// -// Thread.sleep(2000); -// Long v1 = a.get(key); -// System.out.println(v1); -// -// Thread.sleep(5000); -// Long v2 = a.get(key); -// System.out.println(v2); -// } } diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/open/ArticleOpenController.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/open/ArticleOpenController.java index 2299cd5e..9d8a9408 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/open/ArticleOpenController.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/article/open/ArticleOpenController.java @@ -9,6 +9,7 @@ import com.blossom.backend.base.paramu.UserParamEnum; import com.blossom.backend.base.paramu.UserParamService; import com.blossom.backend.base.paramu.pojo.UserParamEntity; +import com.blossom.backend.config.BlConstants; import com.blossom.backend.server.article.draft.ArticleService; import com.blossom.backend.server.article.draft.pojo.ArticleEntity; import com.blossom.backend.server.article.draft.pojo.ArticleInfoRes; @@ -57,7 +58,9 @@ public class ArticleOpenController { */ @AuthIgnore @GetMapping("/info") - public R infoOpen(@RequestParam("id") Long id, HttpServletRequest request) { + public R infoOpen(@RequestHeader(BlConstants.REQ_HEADER_USERID) Long userId, + @RequestParam("id") Long id, + HttpServletRequest request) { log.info("公开文章被查看:{}", id); ArticleOpenEntity open = openService.selectById(id, true, false, true); XzException404.throwBy(ObjUtil.isNull(open), "文章不存在"); @@ -68,7 +71,7 @@ public R infoOpen(@RequestParam("id") Long id, HttpServletReques res.setSyncTime(open.getSyncTime()); res.setType(DocTypeEnum.A.getType()); - ArticleEntity article = articleService.selectById(id, false, false, false); + ArticleEntity article = articleService.selectById(id, false, false, false, userId); if (article != null) { res.setTags(DocUtil.toTagList(article.getTags())); res.setName(article.getName()); diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureBlosController.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureBlosController.java index 11b77cfe..5574facc 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureBlosController.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureBlosController.java @@ -129,11 +129,11 @@ private void sendfile(String filename, HttpServletResponse resp) { long size = fileChannel.size(); String contentType = Files.probeContentType(file); if (contentType == null) { - contentType = MediaType.APPLICATION_OCTET_STREAM_VALUE; + contentType = probContentType(filename); } resp.setContentType(contentType); resp.setContentLengthLong(size); - // resp.setHeader(HttpHeaders.CACHE_CONTROL,"max-age=3600"); + // resp.setHeader(HttpHeaders.CACHE_CONTROL, "max-age=13600"); long position = 0; WritableByteChannel channel = Channels.newChannel(os); @@ -149,5 +149,12 @@ private void sendfile(String filename, HttpServletResponse resp) { } } + private String probContentType(String filename) { + if (filename.endsWith(".svg")) { + return "image/svg+xml"; + } + return MediaType.APPLICATION_OCTET_STREAM_VALUE; + } + // endregion } diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureService.java b/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureService.java index dc4332bf..6646ff38 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureService.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/server/picture/PictureService.java @@ -178,7 +178,6 @@ public PictureEntity insert(MultipartFile file, String filename, Long pid, Long PictureEntity originPic; if ((originPic = baseMapper.selectByPathName(pic.getPathName())) != null) { - // 如果允许重复上传, 则修改大小 if (repeatUpload) { PictureEntity upd = new PictureEntity(); @@ -187,12 +186,13 @@ public PictureEntity insert(MultipartFile file, String filename, Long pid, Long upd.setCreTime(new Date()); baseMapper.updById(upd); pic.setId(originPic.getId()); - return pic; + } else { + throw new XzException400HTTP("图片[" + pic.getPathName() + "]已存在, 请重命名文件或选择其他路径!"); } - throw new XzException400HTTP("图片[" + pic.getPathName() + "]已存在, 请重命名文件或选择其他路径!"); + } else { + baseMapper.insert(pic); } - baseMapper.insert(pic); // 入库后进行文件上传操作 try (InputStream inputStream = file.getInputStream()) { osManager.put(pic.getPathName(), inputStream); diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/HeWeatherDTO.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/HeWeatherDTO.java deleted file mode 100644 index 9a289819..00000000 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/HeWeatherDTO.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.blossom.backend.thirdparty.hefeng; - -import com.fasterxml.jackson.annotation.JsonInclude; -import lombok.Data; - -import java.util.List; - -/** - * 天气信息 - * - * @author xzzz - */ -@Data -@SuppressWarnings("all") -@JsonInclude(JsonInclude.Include.NON_NULL) -public class HeWeatherDTO { - - private Location location; - private Now now; - private List hourly; - private List daily; - - /** - * 位置 - */ - @Data - @JsonInclude(JsonInclude.Include.NON_NULL) - static class Location { - /** - * 地区-城市名称 - */ - private String name; - } - - /** - * 当前天气 - */ - @Data - @JsonInclude(JsonInclude.Include.NON_NULL) - static class Now { - /** - * 实况观测时间 - */ - private String obsTime; - /** - * 实况温度,默认单位:摄氏度 - */ - private String temp; - /** - * 实况体感温度,默认单位:摄氏度 - */ - private String feelsLike; - /** - * 当前天气状况和图标的代码 - */ - private String icon; - private String iconValue; - /** - * 实况天气状况的文字描述,包括阴晴雨雪等天气状态的描述 - */ - private String text; - /** - * 实况风向360角度 - */ - private String wind360; - /** - * 实况风向 - */ - private String windDir; - /** - * 实况风力等级 - */ - private String windScale; - /** - * 实况风速,公里/小时 - */ - private String windSpeed; - /** - * 实况相对湿度,百分比数值 - */ - private String humidity; - /** - * 实况降水量,默认单位:毫米 - */ - private String precip; - /** - * 实况大气压强,默认单位:百帕 - */ - private String pressure; - /** - * 实况能见度,默认单位:公里 - */ - private String vis; - /** - * 实况云量,百分比数值 - */ - private String cloud; - /** - * 实况露点温度 - */ - private String dew; - - } - - /** - * 天气预报 - */ - @Data - @JsonInclude(JsonInclude.Include.NON_NULL) - static class Daily { - /** - * 预报日期2013-12-30 - */ - private String fxDate; - /** - * 预报当天最高温度 - */ - private String tempMax; - /** - * 预报当天最低温度 - */ - private String tempMin; - private String iconDay; - private String iconValueDay; - private String textDay; - private String iconNight; - private String iconValueNight; - private String textNight; - } - - /** - * 逐小时预报 - */ - @Data - @JsonInclude(JsonInclude.Include.NON_NULL) - static class Hourly { - /** - * 逐小时预报时间 - */ - private String fxTime; - /** - * 逐小时预报温度 - */ - private String temp; - /** - * 逐小时预报天气状况图标代码 - */ - private String icon; - /** - * 图标 - */ - private String iconValue; - /** - * 逐小时预报天气状况文字描述 - */ - private String text; - } -} diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherController.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherController.java index 6f540fda..8353b2c2 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherController.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherController.java @@ -1,6 +1,7 @@ package com.blossom.backend.thirdparty.hefeng; import cn.hutool.core.util.StrUtil; +import com.blossom.backend.thirdparty.hefeng.pojo.WeatherRes; import com.blossom.common.base.pojo.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -24,9 +25,9 @@ public class WeatherController { * 获取天气信息 */ @GetMapping - public R weather(@RequestParam(value = "location",required = false)String location) { + public R weather(@RequestParam(value = "location",required = false)String location) { if (StrUtil.isBlank(location)) { - return R.ok(new HeWeatherDTO()); + return R.ok(new WeatherRes()); } return R.ok(weatherManager.findWeatherAll(location)); } diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherManager.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherManager.java index 98fb90d1..3b84db0e 100644 --- a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherManager.java +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/WeatherManager.java @@ -3,13 +3,12 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.map.MapUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpRequest; -import cn.hutool.http.HttpResponse; -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; import com.blossom.backend.base.param.ParamEnum; import com.blossom.backend.base.param.ParamService; +import com.blossom.backend.thirdparty.hefeng.pojo.*; import com.blossom.common.base.exception.XzException400; +import com.blossom.common.base.util.json.JsonUtil; +import com.blossom.common.base.util.okhttp.HttpUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -29,7 +28,6 @@ * curl -L -X GET --compressed 'https://geoapi.qweather.com/v2/city/lookup?location=101100101&key=' * } * - * * @author : xzzz */ @Component @@ -43,6 +41,8 @@ public class WeatherManager { private static final String WEATHER_ALL = "weather_all"; + private static final String SUCCESS = "200"; + @Autowired private ParamService paramService; @@ -50,79 +50,84 @@ public class WeatherManager { * 查询天气信息 */ @Cacheable(cacheNames = WEATHER_ALL, key = "'location_' + #location", unless = "#result == null") - public HeWeatherDTO findWeatherAll(String location) { - Map maps = initParam(location); + public WeatherRes findWeatherAll(String location) { + Map maps = initParam(location); if (maps == null) { log.info("未配置天气信息, 忽略天气查询"); - HeWeatherDTO weather = new HeWeatherDTO(); - HeWeatherDTO.Location l = new HeWeatherDTO.Location(); + WeatherRes weather = new WeatherRes(); + CityRes.Location l = new CityRes.Location(); l.setName("未配置天气"); weather.setLocation(l); return weather; } - HttpResponse city; - HttpResponse now; - HttpResponse daily; - HttpResponse hourly; + String cityStr, nowStr, dailyStr, hourlyStr; + CityRes city = null; + NowRes now = null; + DailyRes daily = null; + HourlyRes hourly = null; try { - city = HttpRequest.get(URL_CITY).form(maps).execute(); - now = HttpRequest.get(URL_NOW).form(maps).execute(); - daily = HttpRequest.get(URL_DAILY).form(maps).execute(); - hourly = HttpRequest.get(URL_HOURLY).form(maps).execute(); + cityStr = HttpUtil.get(URL_CITY, maps); + if (StrUtil.isNotBlank(cityStr)) { + city = JsonUtil.toObj(cityStr, CityRes.class); + } + + nowStr = HttpUtil.get(URL_NOW, maps); + if (StrUtil.isNotBlank(nowStr)) { + now = JsonUtil.toObj(nowStr, NowRes.class); + } + + dailyStr = HttpUtil.get(URL_DAILY, maps); + if (StrUtil.isNotBlank(dailyStr)) { + daily = JsonUtil.toObj(dailyStr, DailyRes.class); + } + + hourlyStr = HttpUtil.get(URL_HOURLY, maps); + if (StrUtil.isNotBlank(hourlyStr)) { + hourly = JsonUtil.toObj(hourlyStr, HourlyRes.class); + } } catch (Exception e) { throw new XzException400("获取天气信息失败:" + e.getMessage()); } - JSONObject locationJson = JSONUtil.parseObj(city.body()); - JSONObject nowJson = JSONUtil.parseObj(now.body()); - JSONObject dailyJson = JSONUtil.parseObj(daily.body()); - JSONObject hourlyJson = JSONUtil.parseObj(hourly.body()); + WeatherRes weather = new WeatherRes(); - HeWeatherDTO weather = new HeWeatherDTO(); - - if ("200".equals(locationJson.getStr("code"))) { - List los = JSONUtil.toList(locationJson.getJSONArray("location"), HeWeatherDTO.Location.class); - if (CollUtil.isNotEmpty(los)) { - weather.setLocation(los.get(0)); - } + if (city != null && city.getCode().equals(SUCCESS) && CollUtil.isNotEmpty(city.getLocation())) { + weather.setLocation(city.getLocation().get(0)); } else { - log.error("获取城市信息失败,body : [{}]", locationJson.toString()); + log.error("获取城市信息失败, resp: {}", cityStr); } - // 1. 当前时间 - if ("200".equals(nowJson.getStr("code"))) { - HeWeatherDTO.Now heNow = JSONUtil.toBean(nowJson.getJSONObject("now"), HeWeatherDTO.Now.class); - heNow.setIconValue(HeCondCode.getIcon(heNow.getIcon())); - weather.setNow(heNow); + if (now != null && now.getCode().equals(SUCCESS)) { + now.getNow().setIconValue(HeCondCode.getIcon(now.getNow().getIcon())); + weather.setNow(now.getNow()); } else { - log.error("获取当天气失败,body : [{}]", nowJson.toString()); + log.error("获取当前天气失败, resp: [{}]", nowStr); } - // 2. 天气预报 - if ("200".equals(dailyJson.getStr("code"))) { - List daily3D = JSONUtil.toList(dailyJson.getJSONArray("daily"), HeWeatherDTO.Daily.class); + if (daily != null && daily.getCode().equals(SUCCESS) && CollUtil.isNotEmpty(daily.getDaily()) && daily.getDaily().size() >= 3) { + List d3ds = new ArrayList<>(); for (int i = 0; i < 3; i++) { - daily3D.get(i).setIconValueDay(HeCondCode.getIcon(daily3D.get(i).getIconDay())); - daily3D.get(i).setIconValueNight(HeCondCode.getIcon(daily3D.get(i).getIconNight())); + DailyRes.Daily d3d = daily.getDaily().get(i); + d3d.setIconValueDay(HeCondCode.getIcon(d3d.getIconDay())); + d3d.setIconValueNight(HeCondCode.getIcon(d3d.getIconNight())); + d3ds.add(d3d); } - weather.setDaily(daily3D); + weather.setDaily(d3ds); } else { - log.error("获取3日天气预报失败,body : [{}]", dailyJson.toString()); + log.error("获取3日天气预报失败, resp: {}", cityStr); } - // 3. 小时预报 - if ("200".equals(hourlyJson.getStr("code"))) { - List originalHourly = JSONUtil.toList(hourlyJson.getJSONArray("hourly"), HeWeatherDTO.Hourly.class); - List newHourly = new ArrayList<>(); - newHourly.add(originalHourly.get(0)); + if (hourly != null && hourly.getCode().equals(SUCCESS) && CollUtil.isNotEmpty(hourly.getHourly()) && hourly.getHourly().size() >= 1) { + List hours = new ArrayList<>(); for (int i = 0; i < 1; i++) { - newHourly.get(i).setIconValue(HeCondCode.getIcon(newHourly.get(i).getIcon())); + HourlyRes.Hourly hour = hourly.getHourly().get(i); + hour.setIconValue(HeCondCode.getIcon(hour.getIcon())); + hours.add(hour); } - weather.setHourly(newHourly); + weather.setHourly(hours); } else { - log.error("获取小时预报失败,body : [{}]}", hourlyJson.toString()); + log.error("获取小时预报失败, resp: {}", cityStr); } - return weather; } @@ -139,10 +144,10 @@ public void clearAll(String location) { * * @return 返回查询参数 */ - public Map initParam(String location) { + public Map initParam(String location) { Map paramMap = paramService.selectMap(false, ParamEnum.HEFENG_KEY); if (MapUtil.isNotEmpty(paramMap) && StrUtil.isNotBlank(paramMap.get(ParamEnum.HEFENG_KEY.name()))) { - Map map = new HashMap<>(2); + Map map = new HashMap<>(2); map.put("location", location); map.put("key", paramMap.get(ParamEnum.HEFENG_KEY.name())); return map; diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/CityRes.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/CityRes.java new file mode 100644 index 00000000..75ffcfac --- /dev/null +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/CityRes.java @@ -0,0 +1,25 @@ +package com.blossom.backend.thirdparty.hefeng.pojo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * 城市信息 + */ +@Data +public class CityRes { + + private String code; + + private List location; + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Location { + String name; + String id; + } + +} diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/DailyRes.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/DailyRes.java new file mode 100644 index 00000000..283abb7b --- /dev/null +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/DailyRes.java @@ -0,0 +1,40 @@ +package com.blossom.backend.thirdparty.hefeng.pojo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +@Data +public class DailyRes { + + private String code; + + private List daily; + + /** + * 天气预报 + */ + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Daily { + /** + * 预报日期2013-12-30 + */ + private String fxDate; + /** + * 预报当天最高温度 + */ + private String tempMax; + /** + * 预报当天最低温度 + */ + private String tempMin; + private String iconDay; + private String iconValueDay; + private String textDay; + private String iconNight; + private String iconValueNight; + private String textNight; + } +} diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/HourlyRes.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/HourlyRes.java new file mode 100644 index 00000000..0a1a5796 --- /dev/null +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/HourlyRes.java @@ -0,0 +1,42 @@ +package com.blossom.backend.thirdparty.hefeng.pojo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +@Data +public class HourlyRes { + + private String code; + + private List hourly; + + /** + * 逐小时预报 + */ + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Hourly { + /** + * 逐小时预报时间 + */ + private String fxTime; + /** + * 逐小时预报温度 + */ + private String temp; + /** + * 逐小时预报天气状况图标代码 + */ + private String icon; + /** + * 图标 + */ + private String iconValue; + /** + * 逐小时预报天气状况文字描述 + */ + private String text; + } +} diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/NowRes.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/NowRes.java new file mode 100644 index 00000000..bf5c90c2 --- /dev/null +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/NowRes.java @@ -0,0 +1,82 @@ +package com.blossom.backend.thirdparty.hefeng.pojo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +/** + * 当前天气 + */ +@Data +public class NowRes { + + private String code; + + private Now now; + + @Data + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class Now { + /** + * 实况观测时间 + */ + private String obsTime; + /** + * 实况温度,默认单位:摄氏度 + */ + private String temp; + /** + * 实况体感温度,默认单位:摄氏度 + */ + private String feelsLike; + /** + * 当前天气状况和图标的代码 + */ + private String icon; + private String iconValue; + /** + * 实况天气状况的文字描述,包括阴晴雨雪等天气状态的描述 + */ + private String text; + /** + * 实况风向360角度 + */ + private String wind360; + /** + * 实况风向 + */ + private String windDir; + /** + * 实况风力等级 + */ + private String windScale; + /** + * 实况风速,公里/小时 + */ + private String windSpeed; + /** + * 实况相对湿度,百分比数值 + */ + private String humidity; + /** + * 实况降水量,默认单位:毫米 + */ + private String precip; + /** + * 实况大气压强,默认单位:百帕 + */ + private String pressure; + /** + * 实况能见度,默认单位:公里 + */ + private String vis; + /** + * 实况云量,百分比数值 + */ + private String cloud; + /** + * 实况露点温度 + */ + private String dew; + + } +} diff --git a/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/WeatherRes.java b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/WeatherRes.java new file mode 100644 index 00000000..0f4ee46e --- /dev/null +++ b/blossom-backend/backend/src/main/java/com/blossom/backend/thirdparty/hefeng/pojo/WeatherRes.java @@ -0,0 +1,20 @@ +package com.blossom.backend.thirdparty.hefeng.pojo; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.List; + +/** + * 天气信息 + * + * @author xzzz + */ +@Data +@JsonInclude(JsonInclude.Include.NON_NULL) +public class WeatherRes { + private CityRes.Location location; + private NowRes.Now now; + private List hourly; + private List daily; +} diff --git a/blossom-backend/smart-doc-2.6.7/.gitignore b/blossom-backend/smart-doc-2.6.7/.gitignore deleted file mode 100644 index 59d72b87..00000000 --- a/blossom-backend/smart-doc-2.6.7/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -#Compiled class file -*.class - -.idea -*.iml -target - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.war -*.ear -*.zip -*.tar.gz -*.rar -*.jar -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* diff --git a/blossom-backend/smart-doc-2.6.7/.travis.yml b/blossom-backend/smart-doc-2.6.7/.travis.yml deleted file mode 100644 index 588ffee4..00000000 --- a/blossom-backend/smart-doc-2.6.7/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: java -jdk: - - oraclejdk8 -install: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -script: mvn test -after_success: - - mvn clean cobertura:cobertura coveralls:report -env: - global: - secure: xxx diff --git a/blossom-backend/smart-doc-2.6.7/CHANGELOG.md b/blossom-backend/smart-doc-2.6.7/CHANGELOG.md deleted file mode 100644 index 2f72b1ae..00000000 --- a/blossom-backend/smart-doc-2.6.7/CHANGELOG.md +++ /dev/null @@ -1,990 +0,0 @@ -## smart-doc版本 - -### 版本号:2.6.7 - -- 更新日期: 2023-03-28 -- 更新内容: - 1. 修复JAX-RS Produces注解使用时contentType为空的bug,[#415](https://github.com/smart-doc-group/smart-doc/issues/415) - 2. 修复不能忽略被继承类中相应字段bug。[#453](https://github.com/smart-doc-group/smart-doc/issues/453) - 3. 修复使用@see tag时的未写注释导致空指针问腿。[#451](https://github.com/smart-doc-group/smart-doc/issues/451) - 4. 修复openapi的生成bug。[#458](https://github.com/smart-doc-group/smart-doc/issues/458) - 5. 修复openapi无法归类的问题。 [#pr460](https://github.com/smart-doc-group/smart-doc/pull/460) - -### 版本号:2.6.6 - -- 更新日期: 2023-03-08 -- 更新内容: - 1. 修复集合或者数组入参推送torna数据错误,[#415](https://github.com/smart-doc-group/smart-doc/issues/415) - 2. 请求注解consumes支持。[#424](https://github.com/smart-doc-group/smart-doc/issues/424) - 3. url中path param占位符解析优化。[#447](https://github.com/smart-doc-group/smart-doc/issues/447) - -### 版本号:2.6.5 - -- 更新日期: 2023-02-27 -- 更新内容: - 1. 修复集合或者数组入参推送torna数据错误,[#415](https://github.com/smart-doc-group/smart-doc/issues/415) - 2. 文档泛型支持数组类型标注。[#421](https://github.com/smart-doc-group/smart-doc/issues/421) - 3. list 和list 类型openapi生成错误。[#423](https://github.com/smart-doc-group/smart-doc/issues/423) - 4. 修复设置requestFieldToUnderline为true时path参数丢失,[#103](https://github.com/smart-doc-group/smart-doc/issues/103) - 5. 优化自定义字典值处理接口DictionaryValuesResolver[#pr428](https://github.com/smart-doc-group/smart-doc/pull/428) - 6. 修复HTML模版文档的描述展示[#pr438](https://github.com/smart-doc-group/smart-doc/pull/438) - -### 版本号:2.6.4 - -- 更新日期: 2023-01-28 -- 更新内容: - 1. 支持没有getter方法的枚举字典提取,[#408](https://github.com/smart-doc-group/smart-doc/issues/408) - 2. 优化插件遇到源码语法错误时的报错提示。[#402](https://github.com/smart-doc-group/smart-doc/issues/402) - 3. URL 结尾存在多余'/' 。[#396](https://github.com/smart-doc-group/smart-doc/issues/396) - 4. 支持SpringBoot 3.0和Jakarta EE 10. - 5. 二维数据推送torna类型错误,[#380](https://github.com/smart-doc-group/smart-doc/issues/380) - 6. 优化插件对常用无关文档依赖做加载优化。 - 7. 支持controller继承接口中的注解[#pr392](https://github.com/smart-doc-group/smart-doc/pull/392)。 - -### 版本号:2.6.3 - -- 更新日期: 2022-12-10 -- 更新内容: - 1. 单个接口推送到torna目录显示优化,[#385](https://github.com/smart-doc-group/smart-doc/pull/385) - 2. 修改timestamp类型在文档中显示错误。 - 3. 修改枚举重复问题。 - 4. 支持SpringBoot 3.0和Jakarta EE 10. - 5. 二维数据推送torna类型错误,[#380](https://github.com/smart-doc-group/smart-doc/issues/380) - 6. 优化插件对常用无关文档依赖做加载优化。 - 7. 支持controller继承接口中的注解[#pr392](https://github.com/smart-doc-group/smart-doc/pull/392)。 - -### 版本号:2.6.2 - -- 更新日期: 2022-10-29 -- 更新内容: - 1. 修复枚举渲染换行问题,[#377](https://github.com/smart-doc-group/smart-doc/issues/377) - 2. 文档url显示错误,[#379](https://github.com/smart-doc-group/smart-doc-maven-plugin/issues/379) - 3. 优化openapi文档生成 - -### 版本号:2.6.1 - -- 更新日期: 2022-10-23 -- 更新内容: - 1. 修复枚举渲染和rpc文档字段类型,[#377](https://github.com/smart-doc-group/smart-doc/issues/377) - 2. markdown文档字段描述填充错误,[#378](https://github.com/smart-doc-group/smart-doc-maven-plugin/issues/378) - 3. 格式化markdown模板错误 - -### 版本号:2.6.0 - -- 更新日期: 2022-10-15 -- 更新内容: - 1. 修复markdown从出现换行错误导致渲染混乱,[#340](https://github.com/smart-doc-group/smart-doc-maven-plugin/issues/17) - 2. Post请求中文参数编码错误,[#19](https://github.com/smart-doc-group/smart-doc-maven-plugin/issues/19) - 3. 支持推送@since到torna的注释中,[#344](https://github.com/smart-doc-group/smart-doc/issues/344) - 4. spring mvc mapping method数组书写方式解析错误,[#361](https://github.com/smart-doc-group/smart-doc/issues/361) - 5. 修复jax-rs方法上绑定集合解析错误,[#358](https://github.com/smart-doc-group/smart-doc/issues/358) - 6. 修复customResponseFields配置无效错误,[#355](https://github.com/smart-doc-group/smart-doc/issues/355) - 7. 对Jackson注解@JsonNaming驼峰转下划线的支持,[#349](https://github.com/smart-doc-group/smart-doc/issues/349) - 8. curl请求用例显示混乱。 - 9. 修复常量解析private字段被解析是发生异常问题,[#356](https://github.com/smart-doc-group/smart-doc/issues/356) - 10. RequestMapping中params解析出错,[#374](https://github.com/smart-doc-group/smart-doc/issues/374) - 11. 自循环依赖对象字段显示优化,[#376](https://github.com/smart-doc-group/smart-doc/issues/376) - 12. maven 插件是否能考虑支持appToken,[#354](https://github.com/smart-doc-group/smart-doc/issues/354) - 13. 优化到大量的代码,和2.5.3对比变化非常大。 - -### 版本号:2.5.3 - -- 更新日期: 2022-09-10 -- 更新内容: - 1. 使用@see注释内容不是枚举类名运行错误,[#340](https://github.com/smart-doc-group/smart-doc/issues/340) - 2. jsr校验注解支持常量替换,[#334](https://github.com/smart-doc-group/smart-doc/issues/334) - 3. 支持推送@since到torna的注释中,[#344](https://github.com/smart-doc-group/smart-doc/issues/344) - -### 版本号:2.5.2 - -- 更新日期: 2022-09-02 -- 更新内容: - 1. 修复query参数推送到torna被设置到body中,[#336](https://github.com/smart-doc-group/smart-doc/issues/336) - 2. 请求头参数支持mock值设置,[#337](https://github.com/smart-doc-group/smart-doc/issues/337) - 3. 支持错误码自定义解析器。[#338](https://github.com/smart-doc-group/smart-doc/issues/338) - 4. 修改字段@see 非枚举时错误,[#340](https://github.com/smart-doc-group/smart-doc/issues/340) - 5. 修复openapi表单对象请求参数丢失。 - -### 版本号:2.5.1 - -- 更新日期: 2022-08-27 -- 更新内容: - 1. 升级qdox,解决字段名使用record报错问题,[#231](https://github.com/smart-doc-group/smart-doc/issues/231) - 2. 优化枚举在文档中的展示[#332](https://github.com/smart-doc-group/smart-doc/issues/332) - 3. 修改date类型文档显示错误 - 4. 修复list参数入参样例错误 - 5. 修复2.5.0不支持jdk 8的问题 - 6. html特殊字符增加转义处理,解决html文档显示问题[#333](https://github.com/smart-doc-group/smart-doc/issues/333) - -### 版本号:2.5.0 - -- 更新日期: 2022-08-20 -- 更新内容: - 1. 修复使用@see指向枚举类不存在时空指针问题,改成提示性异常处理,帮助用户可以定位问题,[#331](https://github.com/smart-doc-group/smart-doc/issues/331) - 2. 支持更多jdk 8时间类型[#315](https://github.com/smart-doc-group/smart-doc/issues/315) - 3. 支持jsr验证规则提取[#267](https://github.com/smart-doc-group/smart-doc/issues/267) - -### 版本号:2.4.9 - -- 更新日期: 2022-08-07 -- 更新内容: - 1. 支持使用@see指向枚举类,[#306](https://github.com/smart-doc-group/smart-doc/issues/306) - 2. 修复枚举请求的用例展示错误 - -### 版本号:2.4.8 - -- 更新日期: 2022-07-09 -- 更新内容: - 1. 支持servlet 3.0 文件上传[#294](https://github.com/smart-doc-group/smart-doc/issues/294) - 2. 修复表单复杂对象嵌套Request-example错误问题[#284](https://github.com/smart-doc-group/smart-doc/issues/284) - 3. 修复注释换行导致html文档链接无法点击问题[#290](https://github.com/smart-doc-group/smart-doc/issues/290) - 4. 修复实现接口的枚举作为字段时生成文档报错,[#292](https://github.com/smart-doc-group/smart-doc/issues/292) - 5. 修复Delete Option json请求没有request body的问题[#300](https://github.com/smart-doc-group/smart-doc/issues/300) - 6. 修复OpenAPI导出一级菜单未使用注释名的bug,[#296](https://github.com/smart-doc-group/smart-doc/issues/296) - 7. 新增对JAX-RS @PATCH、@HEAD 的支持[#pr303](https://github.com/smart-doc-group/smart-doc/pull/303) - 8. 自增serverEnv配置用户支持在postman中设置服务器地址变量,[#280](https://github.com/smart-doc-group/smart-doc/issues/280) - - -### 版本号:2.4.7 - -- 更新日期: 2022-06-13 -- 更新内容: - 1. 修复2.4.6版本使用高版本jdk出现module权限的问题 - 2. 修复bug[#283](https://github.com/smart-doc-group/smart-doc/issues/283) - - -### 版本号:2.4.6 - -- 更新日期: 2022-05-29 -- 更新内容: - 1. 新增枚举字典扫描,[#264](https://github.com/smart-doc-group/smart-doc/issues/264) - 2. BigDecimal类型输出优化,[#268](https://github.com/smart-doc-group/smart-doc/issues/268) - 3. 对不规范的mock注释增加检查,[#262](https://github.com/smart-doc-group/smart-doc/issues/262) - -### 版本号:2.4.5 - -- 更新日期: 2022-05-10 -- 更新内容: - 1. 修复部分代码空指针问题,加固健壮性 - 2. 修复curl example错误问题,改为方法名[#256](https://github.com/smart-doc-group/smart-doc/issues/256) - -#### 版本号:2.4.4 - -- 更新日期: 2022-05-03 -- 更新内容: - 1. 优化对mongodb ObjectId类型的解析[#240](https://github.com/smart-doc-group/smart-doc/issues/240) - 2. 优化OpenAPI生成时operationId值的填充,改为方法名[#235](https://github.com/smart-doc-group/smart-doc/issues/235) - 3. 修复请求参数为Long类型数组时自定义mock提取错误[#244](https://github.com/smart-doc-group/smart-doc/issues/244) - 4. 修复文档说明生成输出多个br标签[#248](https://github.com/smart-doc-group/smart-doc/issues/248) - 5. 修复query param参数显示在Request-body中的问题[#242](https://github.com/smart-doc-group/smart-doc/issues/242) - 6. 修复Controller类上RequestMapping多path包含parameter时的解析错误[#206](https://github.com/smart-doc-group/smart-doc/issues/206) - 7. 修复多文件上传,推送到torna的类型错误[#234](https://github.com/smart-doc-group/smart-doc/issues/234) - 8. 修复分组验证在OpenAPI中不生效问题[#243](https://github.com/smart-doc-group/smart-doc/issues/243) - 9. 修复OpenAPI数据类型设置错误[#253](https://github.com/smart-doc-group/smart-doc/issues/253) - 10. 支持在smart-doc.json配置中对@RequestHeader进行忽略了[#250](https://github.com/smart-doc-group/smart-doc/issues/250) - 11. 修复controller注释html文档导航链接无效的问题[#255](https://github.com/smart-doc-group/smart-doc/issues/255) - 12. 支持内部类枚举私有属性解析。 - 13. 移除Spring标记过时的`application/json;charset=UTF-8`,默认改为`application/json` - -#### 版本号:2.4.3 - -- 更新日期: 2022-04-17 -- 更新内容: - 1. 支持生成openapi时不生成请求和返回用例[#233](https://github.com/smart-doc-group/smart-doc/issues/233) - 2. 优化对map返回结构的解析[#223](https://github.com/smart-doc-group/smart-doc/issues/223) - 3. 修复生成openapi的时候对contentType的处理转义[#232](https://github.com/smart-doc-group/smart-doc/issues/232) - 4. 修改分组归档处理[#226](https://github.com/smart-doc-group/smart-doc/issues/226) - -#### 版本号:2.4.2 - -- 更新日期: 2022-04-04 -- 更新内容: - 1. 修改2.4.1静态常量自动解析不完善的问题。 - 2. 新增header自动常量解析。 - 3. 修改某些特殊情况下泛型继承解析问题[#215](https://github.com/smart-doc-group/smart-doc/issues/215) - 4. 优化对文档中特殊大于和小于符号的处理。 - -#### 版本号:2.4.1 - -- 更新日期: 2022-03-26 -- 更新内容: - 1. customResponseFields新增replaceName配置支持替换字段名。 - 2. 修复获取非@param注释tag值错误bug。 - 3. 支持静态常量自动解析,无需再使用apiConstants来配置。 - 4. 修复dubbo rpc - -#### 版本号:2.4.0 - -- 更新日期: 2022-03-06 -- 更新内容: - 1. 支持字段多泛型嵌套private B body;的解析 - -#### 版本号:2.3.9 - -- 更新日期: 2022-02-26 -- 更新内容: - 1. 支持推送已过时的接口标记到torna。 - 2. rpc mock完善。 - 3. dubbo接口文档支持导出字典。 - 4. 支持solon,https://gitee.com/noear/solon - -#### 版本号:2.3.8 - -- 更新日期: 2022-02-19 -- 更新内容: - 1. 支持多层继承解析。 - 2. 优化生成postman post请求文档。 - -#### 版本号:2.3.7 - -- 更新日期: 2022-01-17 -- 更新内容: - 1. 支持JAX-RS。 - 2. 优化对项目文件的加载。 - 3. 解决文件数据未获取到是数据错误的bug。 - -#### 版本号:2.3.6 - -- 更新日期: 2022-01-02 -- 更新内容: - 1. 导出postman时serverUrl不再强制要求设置协议。 - 2. 修改设置responseBodyAdvice后推送torna数据错误。 - 3. 解决gradle插件不能在kts脚本中添加include和exclude的问题。 - -#### 版本号:2.3.5 - -- 更新日期: 2021-12-18 -- 更新内容: - 1. 修改author名称多余的双引号。 - 2. 修复接口常量被当做字段的问题。 - 3. 增强插件对旧版本依赖jar的过滤,防止新版本qdox解析错误。 - -#### 版本号:2.3.4 - -- 更新日期: 2021-12-05 -- 更新内容: - 1. 修复将@NotEmpty放到字段最前面,后面其他注解不会被分析的bug。 - 2. 插件增强对projectName设置。 - 3. 增强插件对旧版本依赖jar的过滤,防止新版本qdox解析错误。 - -#### 版本号:2.3.3 - -- 更新日期: 2021-11-29 -- 更新内容: - 1. 支持OffsetDateTime。 - 2. 修复html文档搜索清空后目录显示不全的bug。 - 3. 修复非分组使用时html文档目录序号错乱问题。 - 4. 修复英文请求头转义问题。 - -#### 版本号:2.3.2 - -- 更新日期: 2021-11-21 -- 更新内容: - 1. 修复debug调试页搜索后目录锚点错误。 - 2. 修复生成openapi时List等基本类型数组入参时类型转换错误。 - 3. 优化泛型类型显示,当泛型类型的实参类型是基本类型时直接显示为基本类型。 - 4. 新增对@RequestAttribute参数的忽略。 - 5. 修复@RequstBody使用基本类型时的请求参数示例错误 - -#### 版本号:2.3.1 - -- 更新日期: 2021-11-13 -- 更新内容: - 1. 修复debug调试不支持请求头设置中文值的bug。 - 2. 修复response自定义tag设置返回未格式化换行问题。 - 3. 修复枚举类型字段指定mock不生效的问题。 - 4. 新增对@SessionAttribute参数做忽略。 - 5. 支持controller实现接口,并使用default方法。 - -#### 版本号:2.3.0 - -- 更新日期: 2021-11-07 -- 更新内容: - 1. 修复创建html文档丢失search.js文件问题。 - 2. 修复packageFilters配置多个包时只有第一个生效的问题。 - 3. 修复debug调试页面的curl指令错误。 - 4. 修复设置了下载文件接口加download标记后,数据并未生效的bug。 - 5. 优化一些部分常见字段的随机值生成。 - -#### 版本号:2.2.9 - -- 更新日期: 2021-10-31 -- 更新内容: - 1. 修复生成openapi文件上传错误问题。 - 2. 修复文件上传接口推送到torna参数被放置到query参数列表的问题。 - 3. 修改List类型参数推送到torna错误的问题 - 4. 优化outPath配置,只使用torna推送时可以不再要求配置outPath项。 - -#### 版本号:2.2.8 - -- 更新日期: 2021-10-07 -- 更新内容: - 1. 修复html文档无接口注释时锚点跳转错误的问题。 - 2. 修复导出postman时服务端口配置成变量报错的问题。 - -#### 版本号:2.2.7 - -- 更新日期: 2021-09-12 -- 更新内容: - 1. 修复dubbo文档css连接错误。 - 2. 修复分组后组归错误。 - 3. 修复路径常量相似度时替换错误的bug。 - 4. JSR303分组优化,标记Null的分组字段将不再显示在文档中 。 - -#### 版本号:2.2.6 - -- 更新日期: 2021-09-05 -- 更新内容: - 1. 修复html文档静态资源链接错误。 - 2. 不配置分组时不显示分组。 - 3. 修复分组后目录item搜索错误。 - 4. 优化maven插件提示 。 - -#### 版本号:2.2.5 - -- 更新日期: 2021-08-08 -- 更新内容: - 1. 支持在html文档中不显示参数列表。 - 2. html文档使用的资源全部改成本地引用。 - 3. 修复Boolean类型字段命名为is前缀时,is前缀被去除的bug。 - 4. 修复配置了字典码列表后枚举字段注释显示错误[#139](https://github.com/smart-doc-group/smart-doc/issues/139) - 5. 修复分析过程中出现的数组越界异常 。 - 6. 新增接口分组支持。 - -#### 版本号:2.2.4 - -- 更新日期: 2021-08-08 -- 更新内容: - 1. 修复字典码推送torna错误 #https://gitee.com/smart-doc-team/smart-doc/issues/I43JQR。 - 2. 新增jsr303 @size和@length支持。 - 3. 修改html的模板样式错误。 - 4. 修复postman错误#I41G2E 。 - 5. 新增isReplace配置 。 - 6. 修复当存在多个jsr注解时,部分注解失效问题。 - -#### 版本号:2.2.3 - -- 更新日期: 2021-07-18 -- 更新内容: - 1. 增加pathPrefix配置项用于配置上下文,引入该配置项后serverUrl仅用于配置服务器地址。 - 2. 支持请求头常量设置解析。 - 3. 支持使用JsonIgnoreProperties和JSONType注解去忽略多字段。 - 4. 修改部分文档设置allInOneDocFileName无效的问题,[#131](https://github.com/smart-doc-group/smart-doc/issues/131) - 5. 修复dubbo rpc文档模板格式错误 #https://gitee.com/smart-doc-team/smart-doc/issues/I40ZGE . - 6. 支持配置添加拦截器中设置全局请求参数,[#132](https://github.com/smart-doc-group/smart-doc/issues/132) - 7. 修复部分类型mock未推送到torna的问题。 - -#### 版本号:2.2.2 - -- 更新日期: 2021-07-04 -- 更新内容: - 1. 修复url中遇到正则表达解析错误问题. - 2. 修复生成的json样例部分格式化后错误的bug,gitee #I3XSE5。 - 3. 增强对文档中html特殊字符的处理,防止html渲染后显示错误,gitee #I3XO31。 - 4. 请求头设置增强,支持配置urlPatterns和excludePathPatterns两个属性去匹配对应的接口。 - 5. 优化了maven插件的提示,优化后可以将加载了那些目录模块代码路径打印。 - 6. 提供了其它框架扩展文档解析的能力。 - 7. 修复doc模板错误,gitee #I3Y640。 - 8. 修复字典模板错误,[#119](https://github.com/smart-doc-group/smart-doc/issues/119) - 9. 添加忽略HttpServlet对象。 - 10. 支持内置替换Jpa Pageable分页对象,去除不必要的请求参数替换配置。 - 11. packageFilters增强,可使用正则进行匹配,gitee #I3YKZ4 。 - 12. 修复dubbo rpc文档推送到torna数据错误。 - 13. 修复customResponseFields和customRequestFields设置时不同类同名字段覆盖bug,gitee #I3Y6AL。 - 14. 修复高版本gradle中使用implements添加依赖时,gradle插件无法加载依赖导致返回空json的bug。 - -#### 版本号:2.2.1 - -- 更新日期: 2021-06-20 -- 更新内容: - 1. 移除代码中System.out.print打印. - -#### 版本号:2.2.0 - -- 更新日期: 2021-06-20 -- 更新内容: - 1. 修复参数多行注释时,注释提取错误,gitee #I3TYYP. - 2. 修复部分代码可能出现的空指针问题。 - 3. 添加@response tag。支持自己设置response example - 4. 修复推送到torna请求或返回为数组时,示例显示错误 - 5. Character类型解析支持。 - 6. 修复使用Quartz中JobDataMap类型解析错误。 - 7. 移除YapiBuilder。smart-doc不在支持其他第三方接口系统,请使用torna. - -#### 版本号:2.1.9 - -- 更新日期: 2021-05-29 -- 更新内容: - 1. 修复inlineEnum为false时枚举展示在参数中的问题。 - 2. 返回Spring文件下载对象支持自动识别为文件下载,减少手动标记@download tag。 - 3. smart-doc使用的css cdn更换,默认使用国内cdn,提升国内的加载速度,切换英文环境使用google的cdn. - 4. 添加多层泛型嵌套的解析支持。gitee #I3T6UV . - 5. 修复父类是泛型时父类中LocalDateTime类型字段生成json样例错误。 - 6. 添加将接口排序order推送到torna中。 - 7. 修复类上的@ignore tag不生效bug. - 8. 优化字典码推送,空字典码不会像torna发起推送请求。 - -#### 版本号:2.1.8 - -- 更新日期: 2021-05-22 -- 更新内容: - 1. 修复推送接口到torna丢失部分mock值的问题。 - 2. 修复在参数注释中配置类替换时将非类名解析成类名的bug 。 - 3. 支持父类上加@RestController注解的子类能够被识别和扫描 - 4. 新增将业务错误码和定义字典推送到torna。 - 5. 修复maven插件torna-rest和torna-rpc两个task未加编译前缀的问题。 - 6. 修复生成json用例中数组类型json错误的问题。 - 7. 修复customRequestFields中设置字段value在用例中不生效的bug。 - 8. 添加@JsonProperty支持,支持JsonProperty.Access控制字段。 - -#### 版本号:2.1.7 - -- 更新日期: 2021-05-12 -- 更新内容: - 1. 添加推送接口作者信息到torna数据错误的bug。 - 2. 修复空参数curl命令多余?号问题,github 。 - -#### 版本号:2.1.6 - -- 更新日期: 2021-05-10 -- 更新内容: - 1. 修复不允许List中放文件上传对象错误的bug。 - 2. 添加推送接口作者信息到torna,通过配置author设置推送人,不配置默认为计算机用户名。 - 3. 添加推送queryParams参数到torna(需要使用torna 1.6.0+) - -#### 版本号:2.1.5 - -- 更新日期: 2021-05-05 -- 更新内容: - 1. 修复requestBodyAdvice请求样例丢之。 - 2. 添加dubbo文档到torna的推送。 - -#### 版本号:2.1.4 - -- 更新日期: 2021-04-24 -- 更新内容: - 1. 修复Controller继承时,父类的Mapping未继承的问题。 - 2. 修复配置responseBodyAdvice后,controller中void方法返回显示错误。 - 3. 修复往torna推送漏掉pathParams的问题。 - 4. 修复非json请求集合中绑定枚举强制检查错误的问题。 - 5. 新增requestBodyAdvice支持,可以实现请求参数包装。 - 6. 修复泛型为List数据时,类型为object问题。 - 7. 修复customFiled为继承参数时配置失效问题。 - -#### 版本号:2.1.3 - -- 更新日期: 2021-04-11 -- 更新内容: - 1. 增强对文件上传的支持。 - 2. 增加customRequestFields配置项,[#97](https://github.com/smart-doc-group/smart-doc/issues/97) - 3. 修复往torna推送漏掉pathParams的问题。 - 4. 修改debug测试页面,支持post表单请求 - 5. 修改表单请求对象中枚举字段默认值错误的bug - -#### 版本号:2.1.2 - -- 更新日期: 2021-03-29 -- 更新内容: - 1. 修复Map嵌套在某些结构体中栈溢出问题,gitee #I3CCLY。 - 2. 修复Torna数据推送问题。 - -#### 版本号:2.1.1 - -- 更新日期: 2021-03-24 -- 更新内容: - 1. 修复Map嵌套在某些结构体中栈溢出问题,gitee #I3CCLY。 - 2. 修复Torna数据推送问题。 - -#### 版本号:2.1.0 - -- 更新日期: 2021-03-21 -- 更新内容: - 1. 导出的postman的url资源下添加缺失的protocol。 - 2. 增加@ignoreParams自定义tag来过滤掉不想显示在文档中参数。 - 3. 增加了自动生成版本记录的功能。 - 4. 修改torna推送的bug。 - 5. 支持旧的SpringMVC项目的url后缀,新项目不建议加什么破玩意后缀。 - -#### 版本号:2.0.9 - -- 更新日期: 2021-03-12 -- 更新内容: - 1. 支持UUID和ZonedDateTime字段类型,[#89](https://github.com/smart-doc-group/smart-doc/issues/89) - 2. 对map参数增加开关来兼容旧项目,还是不建议使用map参数。 - 3. 完成和Torna的对接。 - -#### 版本号:2.0.8 - -- 更新日期: 2021-02-26 -- 更新内容: - 1. 修复文件上传的参数丢失的注释。 - 2. 修复2.0.7新增忽略接口方法后解析父类字段缺失注释bug。 - 3. 修改byte类型的转换,将过去的string转为int8。 - -#### 版本号:2.0.7 - -- 更新日期: 2021-01-30 -- 更新内容: - 1. 修复postman的url中不附加的context-path的问题。 - 2. 修复带正则的path路径参数解析出现截取越界的问题。 - 3. 添加对默认接口实现中get方法重写忽略的能力解析。 - 4. 修改数组、map等字段类型的自定义mock值显示错误问题。 - 5. 修复对mapping中headers的处理。 - -#### 版本号:2.0.6 - -- 更新日期: 2021-01-15 -- 更新内容: - 1. 修复带正则的path路径参数在postman中用例问题。 - 2. 增强对祖传不良代码的分析兼容。 - -#### 版本号:2.0.5 - -- 更新日期: 2021-01-09 -- 更新内容: - 1. 修复集合类无泛型参数作为入参出参时的数组越界。 - 2. 修复新开tab访问的url拼接问题。 - -#### 版本号:2.0.3-2.0.4 - -- 更新日期: 2021-01-01 -- 更新内容: - 1. 修改页面的错误列表标题显示。 - 2. 修改debug页面curl header语法错误。 - 3. 修改debug页面json参数输入框,允许粘贴小段文本。 - 4. 解决使用dubbo 2.7+,在provider中生成文档出错问题[#77](https://github.com/smart-doc-group/smart-doc/issues/77) - -#### 版本号:2.0.2 - -- 更新日期: 2020-12-27 -- 更新内容: - 1. 修改创建openapi时的空指针异常。 - 2. 修改debug页面时未使用mock值的问题。 - 3. debug页面可以根据请求动态更新curl命令。 - 4. 优化debug页面中的文件下载测试。 - 5. 优化enum入参mock错误的bug。 - 6. mock页面支持使用新窗口打开后端渲染的页面。 - 7. 修改生成一些字段值生成错误的bug。 - 8. 修改类中使用集合字段未指定泛型可能出错的bug。 - 9. 优化set等集合类在文档中的类型显示。 - 10. 添加对集合字段中枚举的处理。 - 11. 枚举序列化支持优化。 - 12. 调试页面新增Highlight支持。 - -#### 版本号:2.0.1 - -- 更新日期: 2020-12-20 -- 更新内容: - 1. debug调试页面支持文件上传。 - 2. 修改简单请求参数mock值和类型不匹配问题。 - 3. debug页面完全支持文件下载测试。 - 4. 所有html的文档支持接口目录搜索。 - 5. 剔除flexmark依赖,旧的非allInOne模板删除,统一h5文档样式。 - -#### 版本号:2.0.0 - -- 更新日期: 2020-12-13 -- 更新内容: - 1. 优化了文档的显示,将query和path单独提出来做了展示 - 2. 优化openapi 3.0文档规范的支持,可集成swagger ui等ui使用。 - 3. 优化postman collection 2.0的支持。 - 4. 添加分组支持group。 - 5. 修改mock的一些bug和增强使用 - 6. 支出创建debug页面 - -#### 版本号:1.9.9.1 - -- 更新日期: 2020-11-23 -- 更新内容: - 1. 这是一个紧急修改版本。 - 2. 解决1.9.9版本controller中存在非路径映射方法时的错误。 - -#### 版本号:1.9.9 - -- 更新日期: 2020-11-23 -- 更新内容: - 1. 修改1.9.8启用严格检查注释模式下的bug。 - 2. 修改使用泛型数组参数时解析错误。 - 3. 修复ResponseEntity中的数组解析错误。 - 4. 修复controller方法标注ignore后文档序号错误。 - 5. 增加对@RequestMapping注解的path属性的解析支持 - 6. 修复postman中formdata表单不显示描述信息的问题 - 7. html5 allInOne模板支持代码高亮。 - -#### 版本号:1.9.8 - -- 更新日期: 2020-11-10 -- 更新内容: - 1. 忽略Class对象的解析。 - 2. 增加对抽象Controller方法的解析。 - 3. 修改阿里版本dubbo注解名称解析错误 。 - 4. 修改模拟值生成错误。 - 5. 支持ResponseBodyAdvice通用接口响应包装设置。 - 6. 修复类同时继承和基类和实现接口中可能出现字段重复的bug。 - -#### 版本号:1.9.7 - -- 更新日期: 2020-10-24 -- 更新内容: - 1. 修复restful接口泛型中使用?时的解析错误。 - 2. 优化rpc html非all in one的问题。 - 3. 对rest query参数自动添加描述,增加可读性。 - 4. support ali dubbo,#I22CF7 . - 5. support @RequestMapping headers. - -#### 版本号:1.9.6 - -- 更新日期: 2020-10-09 -- 更新内容: - 1. 修复RequestParam 解析错误。 - 2. 修复泛型中使用?时的解析错误。 - 3. 修改服务url的地址为空字符串,不再提供默认http前缀 - 4. 增加泛型实际类型的显示开关控制。 - 5. 修复类继承一个泛型类时的解析错误。 - 6. 优化smart-doc maven插件,提升用户在多模块下的使用体验。 - -#### 版本号:1.9.5 - -- 更新日期: 2020-09-19 -- 更新内容: - 1. 接口参数无注解时将required设置为false。 - 2. 修改html自适应。 - -#### 版本号:1.9.4 - -- 更新日期: 2020-09-06 -- 更新内容: - 1. 添加order tag支持对api做排序。 - 2. 优化一些重复的代码。 - 3. 修改基础url中使用常量出现空格的问题。 - 4. 添加生成yapi文件的功能。 - -#### 版本号:1.9.3 - -- 更新日期: 2020-08-30 -- 更新内容: - 1. 修复Get请求用例参数值被去空格问题。 - 2. 修改复杂参数表树型数据转化的错误。 - 3. 修复非allInOne模板使用渲染错误。 - 4. 修复一些泛型例子解析错误bug。 - 5. 优化MultipartFile文件上传参数处理,不对该参数进行展开分析。 - -###https://github.com/smart-doc-group/smart-doc/issues/ 版本号:1.9.2 - -- 更新日期: 2020-08-23 -- 更新内容: - 1. 修改前面版本修改引发的普通jsr 303验证解析错误问题。 - 2. 新增忽略请求参数对象的配置gitee #I1RBJO。 - 3. 修改smart-doc的beetl配置避免和用户的业务中beetl配置冲突。 - 4. 新增ApiDataBuilder中获取树形格式参数数据的接口[#40](https://github.com/smart-doc-group/smart-doc/issues/40) - 5. 新增对Open Api 3.0的支持。 - 6. 修改字典表空时内部发生空指针的问题。 - 7. 优化curl用例,增加请求头。 - -#### 版本号:1.9.1 - -- 更新日期: 2020-08-02 -- 更新内容: - 1. 修改进去版本更新导致的泛型解析问题。 - 2. 修改1.8.9版本修改后带来的dubbo接口文档显示问题 - 3. 修改smart-doc-maven-plugin生成dubbo文档时缺乏配置文件错误问题。 - 4. 修改gradle插件的对多模块的支持。 - -#### 版本号:1.9.0 - -- 更新日期: 2020-07-19 -- 更新内容: - 1. 修改dubbo html依赖部分错乱问题。 - 2. 新增自定义输出文件名称的配置。 - 3. 添加请求和响应示例的开关配置项。 - 4. 修改使用JSR303参数校验时,默认分组验证被忽略问题。 - 5. 修改jackson JsonIgnore注解在参数对象中不生效的问题。 - -#### 版本号:1.8.9 - -- 更新日期: 2020-07-05 -- 更新内容: - 1. 修改[#38](https://github.com/smart-doc-group/smart-doc/issues/38) - 2. 修改gitee #I1LBKO。 - 3. 修改fix #39多泛型解析顺序问题。 - 4. 优化支持gitee #I1IQKY常量解析需求 - -#### 版本号:1.8.8 - -- 更新日期: 2020-06-21 -- 更新内容: - 1. 修改忽略对LinkedHashMap的解析,gitee #I1JI5W。 - 2. 修改接口或和实现类合并分析是字段重复问题,gitee #I1JHMW。 - 3. 优化接口方法字段不能获取docletTag的问题。 - 4. 优化枚举参数展示,支持自定义控制显示。 - 5. 添加Feign的支持。 - 6. 优化递归执行,对外提供递归次数限制。 - -#### 版本号:1.8.7 - -- 更新日期: 2020-06-01 -- 更新内容: - 1. 增加对java接口的分析,例如Jpa的分页Page类。 - 2. 增强对使用@RequestBody绑定参数方法的解析。 - 3. 增加dubbo rpc文档生成支持。 - 4. 增加将驼峰字段格式转化为下划线格式。 - 5. maven插件和gradle插件提供includes支持,方便自行配置加载第三方库。 - 6. fix https://github.com/smart-doc-group/smart-doc/issues/32. - 7. 增加文档接口根据接口标题排序功能。 - -#### 版本号:1.8.6 - -- 更新日期: 2020-05-09 -- 更新内容: - 1. 增加localTime支持[gitee #I1F7CW](https://gitee.com/sunyurepository/smart-doc/issues/I1F7CW)。 - 2. 优化smart-doc导入Postman - collection时的header问题[gitee #I1EX42](https://gitee.com/sunyurepository/smart-doc/issues/I1EX42) - 3. 优化smart-doc-maven-plugin加载source的过滤,支持使用通配符来过滤。 - 4. 首次发布gradle插件,发布smart-doc-gradle-plugin插件, - 5. 修复通用泛型解析出错[git #28](https://github.com/smart-doc-group/smart-doc/issues/28)。 - -#### 版本号:1.8.5 - -- 更新日期: 2020-04-19 -- 更新内容: - 1. maven插件错误码列表导出bug[git #I1EHXA](https://gitee.com/sunyurepository/smart-doc/issues/I1EHXA) - 2. 增加@PatchMapping支持[gitee #I1EDRF](https://gitee.com/sunyurepository/smart-doc/issues/I1EDRF) - 3. 解决javadoc包含重复tag生成文档报错[gitee #I1ENNM](https://gitee.com/sunyurepository/smart-doc/issues/I1ENNM) - 4. 修改当请求参数为泛型时数据解析错误问题。 - 5. 修复分组验证空指针问题,不对返回对象做分组验证处理。 - 6. 优化smart-doc-maven-plugin对多级maven项目的加载。 - 7. 支持请求参数对象替换成另外的对象来渲染文档 - -#### 版本号:1.8.4 - -- 更新日期: 2020-03-30 -- 更新内容: - 1. Controller新增时候@ignore - tag,可适应该tag忽略不需要生成文档的controller[git #24](https://github.com/smart-doc-group/smart-doc/issues/24) - 2. 参数中包含 HttpSession时smart-doc卡主,[gitee #I1CA9M](https://gitee.com/sunyurepository/smart-doc/issues/I1CA9M) - 3. 解决一些复杂分组场景smart-doc报错的问题[gitee #I1CPSM](https://gitee.com/sunyurepository/smart-doc/issues/I1CPSM) - 4. 解决smart-doc-maven-plugin插件读取配置乱码问题。 - -#### 版本号:1.8.3 - -- 更新日期: 2020-03-21 -- 更新内容: - 1. 增加从接口方法getter或者setter方法中读取注释。 - 2. 修改smart-doc默认编码为utf-8,解决生成文档乱码问题。 - 3. 增加对代码中@author tag的支持,支持多作者。 - -#### 版本号:1.8.2 - -- 更新日期: 2020-03-13 -- 更新内容: - 1. 修改gitee #I19IYW 。 - 2. 修改文档模板中的title设置错误。 - 3. 修改gitee #I191EO - 4. 支持@Validated 分组 - -#### 版本号:1.8.1 - -- 更新日期: 2020-01-22 -- 更新内容: - 1. 增加对接口get方法的分析。 - 2. 增加对第三方jar中list泛型数据的解析。 - 3. 删除原来冗长的SourceBuilder代码。 - 4. 修改AdocDocBuilder、HtmlApiDocBuilder、ApiDocBuilder的方法名规范化,单元测试的升级需要做小部分变更。 - 5. 修改1.8.0重构后的请求示例将header放入普通参数的bug。 - 6. 修改参数加上@Validated注解后,文档里没有该参数信息的bug。 - 7. 新增@Deprecated标注接口的支持(使用line through完成样式标记) - -#### 版本号:1.8.0 - -- 更新日期: 2020-01-01 -- 更新内容: - 1. 修改参数上多个验证注解不支持的问题。 - 2. 修改支持上传文件参数不列举到文档的问题。 - 3. 新增ApiDataBuilder用于获取smart-doc生成的文档数据,包含header、字典、错误码等。 - 4. 合并fork分支的github book html5模板,新增搜索和锚点。 - 5. 新增自定义@mock tag用于指定生成文档的字段值,@param 的参数注释增加mock值的功能(@param name 姓名|张三) - 6. 重点:smart-doc的maven插件smart-doc-maven-plugin增强对maven标准项目的支持。 - 7. 全面支持spring的表单参数绑定解析。 - 8. postman json生成支持所有参数自动回填。再也不用自己建参数了。 - 9. 优化对实体类中枚举字段的支持。 - 10. 增加对实体中静态常量常量字段的过滤。 - -#### 版本号:1.7.9 - -- 更新日期: 2019-12-16 -- 更新内容: - 1. 修改request请求参数中嵌套对象不能解析的bug,参考gitee #I16AN2. - 2. controller参数是数组时添加@PathVariable注解会报空指针,参考gitee #I16F6G - 3. 新增ApiDataBuilder用于获取smart-doc生成的文档数据,包含header、字典、错误码等。 - 4. 修改github https://github.com/smart-doc-group/smart-doc/issues/9 文档错误bug. - 5. 新增接口的@author展示,方法从文档中查到找到接口负责人,生成文档可以选择关闭显示。 - 6. 重点:smart-doc的maven插件smart-doc-maven-plugin 1.0.0版本发布。 - -#### 版本号:1.7.8 - -- 更新日期: 2019-12-02 -- 更新内容: - 1. 修改Spring Controller使用非Spring Web注解时生成的响应示例出错的bug。 - 2. 修改使用mybatis-plus实体继承Model对象时将log字段输出到文档的问题。 - 3. 添加对transient修饰字段文档输出开关,默认不输出。 - 4. html文档添加项目名称显示 - 5. 修改[#github 4](https://github.com/smart-doc-group/smart-doc/issues/4) 泛型中Void类型解析死循环 - 6. 修改[#github 5](https://github.com/smart-doc-group/smart-doc/issues/5) 简单枚举参数解析空指针异常 - 7. 添加导出PostMan json数据 - -#### 版本号:1.7.7 - -- 更新日期:2019-11-18 -- 更新内容: - 1. 修改timestamp类型字段创建json示例错误bug。 - 2. fix #I1545A 单接口多路径bug。 - 3. 修改部分url生成部署空格问题。 - 4. 优化对java.util.concurrent.ConcurrentMap的解析。 - -#### 版本号:1.7.6 - -- 更新日期:2019-11-13 -- 更新内容: - 1. fix #I14PT5 header重复渲染到文档 - 2. fix #I14MV7 不设置dataDictionaries出现空指针错误 - 3. 增加请求参数枚举字段解析(试用功能) - -#### 版本号:1.7.5 - -- 更新日期:2019-11-06 -- 更新内容: - 1. 优化文档中错误列表的标题,可根据语言环境变化显示中文或因为。 - 2. 解决项目外jar中内部类生成文档错误的bug。 - 3. 支持环形依赖分析。只要你敢写! - 4. 修改使用SpringMvc或者SpringBoot上传时接口的Content-Type显示错误。 - 5. 支持设置项目作为markdown的一级标题。 - 6. 修改方法注释相同引起的html链接跳转错误。 - 7. 添加生成AllInOne的覆盖配置项,默认自动加版本号不覆盖。 - 8. 新增枚举字典码导出到文档的功能。 - -#### 版本号:1.7.4 - -- 更新日期:2019-10-29 -- 更新内容: - 1. 修改gitee上bug #I1426C。 - 2. 修改gitee上bug #I13ZAL,1.7.0~1.7.3 结构优化后产生的bug,建议用户升级。 - 3. 修改gitee上bug #I13U4C。 - 4. 修改设置中文语言环境(默认中文)下错误码列表title显示英文的问题。 - 5. 优化AllInOne的markdown展示,生成时带上自动产生的序号。 - -#### 版本号:1.7.3 - -- 更新日期:2019-10-24 -- 更新内容: - 1. 优化html5模板左侧文档目录展示,能够展开和收缩。 - 2. 修改gitee上bug #I13R3K。 - 3. 修改gitee上bug #I13NR1。 - 4. 开放的文档数据获取接口添加返回方法的唯一id和方法名称,方便一些企业自己做对接。 - -#### 版本号:1.7.2 - -- 更新日期:2019-10-19 -- 更新内容: - 1. 优化注释换行\n\r问题,依赖common-util 1.8.7。 - 2. 修改gitee上bug #I135PG、#I13NR1。 - 3. 添加@requestHeader注解的支持,文档自定将参数绑定到请求头列表中。 - 4. 增加javadoc apiNote tag的支持。 - 5. 解决扫描分析controller中private方法的问题。 - 6. 添加支持@RequestParam注解重写参数名和设置默认值的文档解析。 - 7. 支持使用@PostMapping和@PutMapping请求自定义注解接收单个json参数场景下生成json请求实例。 - 8. 新增对Spring ResponseEntity的解析。 - 9. 增加内部类返回结构解析。 - 10. 修改文档中显示的字段类型,float、double等由原来的number直接变成具体类型。 - -#### 版本号:1.7.1 - -- 更新日期:已废弃 -- 更新内容: - 1. 优化注释换行\n\r问题。 - 2. 修改bug #I135PG - 3. 添加requestHeader功能 - -#### 版本号:1.7.0 - -- 更新日期:2019-09-30 -- 更新内容: - 1. 优化代码。 - 2. 添加生成HTML5和Asciidoctor文档的功能。 - 3. 增加开放API数据接口功能。 - 4. 支持Callable,Future,CompletableFuture等异步接口返回的推导。 - 5. 支持Spring Boot Web Flux(Controller方式书写)。 - -#### 版本号:1.6.4 - -- 更新日期:2019-09-23 -- 更新内容: - 1. 优化代码 - 2. 增加对普通的get请求参数拼装示例的生成 - 3. 增加spring mvc占位符restful url请求示例生成 - -#### 版本号:1.6.2 - -- 更新日期:2019-09-13 -- 更新内容: - 1. 修改字段注释多行显示错误bug - 2. 字段描述文档增加@Since tag的支持 - 3. 解析代码忽略WebRequest类防止生产过多信息 - 4. 升级基础库依赖版本 - -#### 版本号:1.3 - -- 更新日期:2018-09-15 -- 更新内容: - 1. 增加PutMapping和DeleteMapping支持 - 2. 添加字符串date和Date类型时间的模拟值生成 - -#### 版本号:1.2 - -- 更新日期:2018-09-04 -- 更新内容: - 1. 根据用户反馈增加controller报名过滤功能,该功能为可选项 - -#### 版本号:1.1 - -- 更新日期:2018-08-30 -- 更新内容: - 1. 修改PostMapping和GetMapping value为空报错的bug - 2. 增强时间字段的mock数据创建 - 3. 修改smart-doc解析自引用对象出错的bug - -#### 版本号:1.0 - -- 更新日期:2018-08-25 -- 更新内容: - 1. smart-doc增加将所有文档导出归档到一个markdown中件的功能 - 2. 参考阿里开发手册将直接提升到1.0,之前的版本主要是个人内部测试 - -#### 版本号:0.5 - -- 更新日期:2018-08-23 -- 更新内容: - 1. 将api-doc重命名为smart-doc并发布到中央仓库 - -#### 版本号:0.4 - -- 更新日期:2018-07-11 -- 更新内容: - 1. 修改api-doc对类继承属性的支持。 - -#### 版本号:0.3 - -- 更新日期:2018-07-10 -- 更新内容: - 1. api-doc增加对jackson和fastjson注解的支持,可根据注解定义来生成返回信息。 - -### 版本号:0.2 - -- 更新日期:2018-07-07 -- 更新内容: - 1. 修改api-doc泛型推导的bug. - -### 版本号:0.1 - -- 更新日期:2018-06-25 -- 更新内容: - 1. 手册将api-doc发布到中央仓库 \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/LICENSE b/blossom-backend/smart-doc-2.6.7/LICENSE deleted file mode 100644 index 261eeb9e..00000000 --- a/blossom-backend/smart-doc-2.6.7/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/blossom-backend/smart-doc-2.6.7/css/AllInOne.css b/blossom-backend/smart-doc-2.6.7/css/AllInOne.css deleted file mode 100644 index 8562d47c..00000000 --- a/blossom-backend/smart-doc-2.6.7/css/AllInOne.css +++ /dev/null @@ -1,7 +0,0 @@ -article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}script{display:none!important}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}html,body{font-size:100%}body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}a:hover{cursor:pointer}img,object,embed{max-width:100%;height:auto}object,embed{height:100%}img{-ms-interpolation-mode:bicubic}.left{float:left!important}.right{float:right!important}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}.text-justify{text-align:justify!important}.hide{display:none}img,object,svg{display:inline-block;vertical-align:middle}textarea{height:auto;min-height:50px}select{width:100%}.center{margin-left:auto;margin-right:auto}.spread{width:100%}p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}a{color:#364149;text-decoration:underline;line-height:inherit}a:hover,a:focus{color:#364149}a img{border:0}p{font-family:inherit;font-weight:400;font-size:1em;line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}p aside{font-size:.875em;line-height:1.35;font-style:italic}h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}h1{font-size:2.125em}h2{font-size:1.6875em}h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}h4,h5{font-size:1.125em}h6{font-size:1em}hr{border:solid #ddddd8;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em;height:0}em,i{font-style:italic;line-height:inherit}strong,b{font-weight:bold;line-height:inherit}small{font-size:60%;line-height:inherit}code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)} -ul,ol,dl{font-size:1em;line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}ul,ol{margin-left:1.5em}ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0;font-size:1em}ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit}ul.square{list-style-type:square}ul.circle{list-style-type:circle}ul.disc{list-style-type:disc}ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}dl dt{margin-bottom:.3125em;font-weight:bold}dl dd{margin-bottom:1.25em}abbr,acronym{text-transform:uppercase;font-size:90%;color:rgba(0,0,0,.8);border-bottom:1px dotted #ddd;cursor:help}abbr{text-transform:none}blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}blockquote cite{display:block;font-size:.9375em;color:rgba(0,0,0,.6)}blockquote cite:before{content:"\2014 \0020"}blockquote cite a,blockquote cite a:visited{color:rgba(0,0,0,.6)}blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}@media only screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}h1{font-size:2.75em}h2{font-size:2.3125em}h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}h4{font-size:1.4375em}}table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}table thead,table tfoot{background:#f7f8f7;font-weight:bold}table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6}h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}.clearfix:after,.float-group:after{clear:both}*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}*:not(pre)>code.nobreak{word-wrap:normal}*:not(pre)>code.nowrap{white-space:nowrap}pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}em em{font-style:normal}strong strong{font-weight:400}.keyseq{color:rgba(51,51,51,.8)}kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}.keyseq kbd:first-child{margin-left:0}.keyseq kbd:last-child{margin-right:0}.menuseq,.menuref{color:#000}.menuseq b:not(.caret),.menuref{font-weight:inherit}.menuseq{word-spacing:-.02em}.menuseq b.caret{font-size:1.25em;line-height:.8}.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}b.button:before,b.button:after{position:relative;top:-1px;font-weight:400}b.button:before{content:"[";padding:0 3px 0 2px}b.button:after{content:"]";padding:0 2px 0 3px}p a>code:hover{color:rgba(0,0,0,.9)}#header,#content,#footnotes,#footer{width:100%;margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}#header:before,#header:after,#content:before,#content:after,#footnotes:before,#footnotes:after,#footer:before,#footer:after{content:" ";display:table}#header:after,#content:after,#footnotes:after,#footer:after{clear:both}#content{margin-top:1.25em}#content:before{content:none}#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #ddddd8}#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #ddddd8;padding-bottom:8px}#header .details{border-bottom:1px solid #ddddd8;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:-ms-flexbox;display:-webkit-flex;display:flex;-ms-flex-flow:row wrap;-webkit-flex-flow:row wrap;flex-flow:row wrap}#header .details span:first-child{margin-left:-.125em}#header .details span.email a{color:rgba(0,0,0,.85)}#header .details br{display:none} -#header .details br+span:before{content:"\00a0\2013\00a0"}#header .details br+span.author:before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}#header .details br+span#revremark:before{content:"\00a0|\00a0"}#header #revnumber{text-transform:capitalize}#header #revnumber:after{content:"\00a0"}#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #ddddd8;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}#toc{border-bottom:1px solid #efefed;padding-bottom:.5em}#toc>ul{margin-left:.125em;padding-left:1.25em}#toc ul.sectlevel0>li>a{font-style:italic}#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}#toc li{line-height:1.3334;margin-top:.3334em;padding-bottom:4px;padding-top:4px}#toc a{text-decoration:none}#toc a:active{text-decoration:underline}#toctitle{color:#7a2518;font-size:1.2em}@media only screen and (min-width:768px){#toctitle{font-size:1.375em}body.toc2{padding-left:15em;padding-right:0}#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;#padding:1.25em 1em;height:100%;overflow:auto}#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}#toc.toc2>ul{font-size:.9em;margin-bottom:0}#toc.toc2 ul ul{margin-left:0;padding-left:1em}#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}body.toc2.toc-right{padding-left:0;padding-right:15em}body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}#toc.toc2{width:20em}#toc.toc2 #toctitle{font-size:1.375em;border-bottom:1px solid rgba(0,0,0,.07);padding-top:20px;padding-bottom:15px}#toc.toc2 #toctitle span{padding-left:1.25em;padding-bottom:15px}#toc.toc2>ul{font-size:.95em}#toc.toc2 ul ul{padding-left:1.25em}body.toc2.toc-right{padding-left:0;padding-right:20em}}#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}#content #toc>:first-child{margin-top:0}#content #toc>:last-child{margin-bottom:0}#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}#footer-text{color:rgba(255,255,255,.8);line-height:1.44}.sect1{padding-bottom:.625em}@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}.sect1+.sect1{border-top:1px solid #efefed}#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}table.tableblock>caption.title{white-space:nowrap;overflow:visible;max-width:0}.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{color:rgba(0,0,0,.85)}table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inherit}.admonitionblock>table{border-collapse:separate;border:0;background:0;width:100%} -.admonitionblock>table td.icon{text-align:center;width:80px}.admonitionblock>table td.icon img{max-width:initial}.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #ddddd8;color:rgba(0,0,0,.6)}.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}.exampleblock>.content{border-style:solid;border-width:1px;border-color:#e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;-webkit-border-radius:4px;border-radius:4px}.exampleblock>.content>:first-child{margin-top:0}.exampleblock>.content>:last-child{margin-bottom:0}.sidebarblock{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}.sidebarblock>:first-child{margin-top:0}.sidebarblock>:last-child{margin-bottom:0}.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}.literalblock pre,.listingblock pre:not(.highlight),.listingblock pre[class="highlight"],.listingblock pre[class^="highlight "],.listingblock pre.CodeRay,.listingblock pre.prettyprint{background:#f7f7f8}.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}.listingblock pre.highlightjs{padding:0}.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}.listingblock pre.prettyprint{border-width:0}.listingblock>.content{position:relative}.listingblock code[data-lang]:before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:#999}.listingblock:hover code[data-lang]:before{display:block}.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:0}table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}table.pyhltable td.code{padding-left:.75em;padding-right:0}pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}pre.pygments .lineno{display:inline-block;margin-right:.25em}table.pyhltable .linenodiv{background:none!important;padding-right:0!important}.quoteblock{margin:0 1em 1.25em 1.5em;display:table}.quoteblock>.title{margin-left:-1.5em;margin-bottom:.75em}.quoteblock blockquote,.quoteblock blockquote p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}.quoteblock blockquote{margin:0;padding:0;border:0}.quoteblock blockquote:before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}.quoteblock .attribution{margin-top:.5em;margin-right:.5ex;text-align:right}.quoteblock .quoteblock{margin-left:0;margin-right:0;padding:.5em 0;border-left:3px solid rgba(0,0,0,.6)}.quoteblock .quoteblock blockquote{padding:0 0 0 .75em}.quoteblock .quoteblock blockquote:before{display:none}.verseblock{margin:0 1em 1.25em 1em}.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility} -.verseblock pre strong{font-weight:400}.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}.quoteblock .attribution br,.verseblock .attribution br{display:none}.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}.quoteblock.abstract{margin:0 0 1.25em 0;display:block}.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}table.tableblock{max-width:100%;border-collapse:separate}table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px 0}table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0 0}table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}table.frame-all{border-width:1px}table.frame-sides{border-width:0 1px}table.frame-topbot{border-width:1px 0}th.halign-left,td.halign-left{text-align:left}th.halign-right,td.halign-right{text-align:right}th.halign-center,td.halign-center{text-align:center}th.valign-top,td.valign-top{vertical-align:top}th.valign-bottom,td.valign-bottom{vertical-align:bottom}th.valign-middle,td.valign-middle{vertical-align:middle}table thead th,table tfoot th{font-weight:bold}tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}p.tableblock>code:only-child{background:0;padding:0}p.tableblock{font-size:1em}td>div.verse{white-space:pre}ol{margin-left:1.75em}ul li ol{margin-left:1.5em}dl dd{margin-left:1.125em}dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}ul.unstyled,ol.unstyled{margin-left:0}ul.checklist{margin-left:.625em}ul.checklist li>p:first-child>.fa-square-o:first-child,ul.checklist li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}ul.checklist li>p:first-child>input[type="checkbox"]:first-child{margin-right:.25em}ul.inline{margin:0 auto .625em auto;margin-left:-1.375em;margin-right:0;padding:0;list-style:none;overflow:hidden}ul.inline>li{list-style:none;float:left;margin-left:1.375em;display:block}ul.inline>li>*{display:block}.unstyled dl dt{font-weight:400;font-style:normal}ol.arabic{list-style-type:decimal}ol.decimal{list-style-type:decimal-leading-zero}ol.loweralpha{list-style-type:lower-alpha}ol.upperalpha{list-style-type:upper-alpha}ol.lowerroman{list-style-type:lower-roman}ol.upperroman{list-style-type:upper-roman}ol.lowergreek{list-style-type:lower-greek}.hdlist>table,.colist>table{border:0;background:0}.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:0}td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}td.hdlist1{font-weight:bold;padding-bottom:1.25em}.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}.colist>table tr>td:first-of-type{padding:.4em .75em 0 .75em;line-height:1;vertical-align:top}.colist>table tr>td:first-of-type img{max-width:initial}.colist>table tr>td:last-of-type{padding:.25em 0}.thumb,.th{line-height:0;display:inline-block;border:solid 4px #fff;-webkit-box-shadow:0 0 0 1px #ddd;box-shadow:0 0 0 1px #ddd}.imageblock.left,.imageblock[style*="float:left"]{margin:.25em .625em 1.25em 0}.imageblock.right,.imageblock[style*="float:right"]{margin:.25em 0 1.25em .625em}.imageblock>.title{margin-bottom:0}.imageblock.thumb,.imageblock.th{border-width:6px}.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}.image.left{margin-right:.625em}.image.right{margin-left:.625em}a.image{text-decoration:none;display:inline-block}a.image object{pointer-events:none}sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}sup.footnote a,sup.footnoteref a{text-decoration:none} -sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}#footnotes .footnote:last-of-type{margin-bottom:0}#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0}.gist .file-data>table td.line-data{width:99%}div.unbreakable{page-break-inside:avoid}.big{font-size:larger}.small{font-size:smaller}.underline{text-decoration:underline}.overline{text-decoration:overline}.line-through{text-decoration:line-through}.aqua{color:#00bfbf}.aqua-background{background-color:#00fafa}.black{color:#000}.black-background{background-color:#000}.blue{color:#0000bf}.blue-background{background-color:#0000fa}.fuchsia{color:#bf00bf}.fuchsia-background{background-color:#fa00fa}.gray{color:#606060}.gray-background{background-color:#7d7d7d}.green{color:#006000}.green-background{background-color:#007d00}.lime{color:#00bf00}.lime-background{background-color:#00fa00}.maroon{color:#600000}.maroon-background{background-color:#7d0000}.navy{color:#000060}.navy-background{background-color:#00007d}.olive{color:#606000}.olive-background{background-color:#7d7d00}.purple{color:#600060}.purple-background{background-color:#7d007d}.red{color:#bf0000}.red-background{background-color:#fa0000}.silver{color:#909090}.silver-background{background-color:#bcbcbc}.teal{color:#006060}.teal-background{background-color:#007d7d}.white{color:#bfbfbf}.white-background{background-color:#fafafa}.yellow{color:#bfbf00}.yellow-background{background-color:#fafa00}span.icon>.fa{cursor:default}a span.icon>.fa{cursor:inherit}.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}.admonitionblock td.icon .icon-note:before{content:"\f05a";color:#19407c}.admonitionblock td.icon .icon-tip:before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}.admonitionblock td.icon .icon-warning:before{content:"\f071";color:#bf6900}.admonitionblock td.icon .icon-caution:before{content:"\f06d";color:#bf3400}.admonitionblock td.icon .icon-important:before{content:"\f06a";color:#bf0000}.conum[data-value]{display:inline-block;color:#fff!important;background-color:rgba(0,0,0,.8);-webkit-border-radius:100px;border-radius:100px;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}.conum[data-value] *{color:#fff!important}.conum[data-value]+b{display:none}.conum[data-value]:after{content:attr(data-value)}pre .conum[data-value]{position:relative;top:-.125em}b.conum *{color:inherit!important}.conum:not([data-value]):empty{display:none}dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}h1,h2,p,td.content,span.alt{letter-spacing:-.01em}p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}p{margin-bottom:1.25rem}.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}.print-only{display:none!important}@media print{@page{margin:1.25cm .75cm}*{-webkit-box-shadow:none!important;box-shadow:none!important;text-shadow:none!important}a{color:inherit!important;text-decoration:underline!important}a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}abbr[title]:after{content:" (" attr(title) ")"}pre,blockquote,tr,img,object,svg{page-break-inside:avoid}thead{display:table-header-group}svg{max-width:100%}p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}#toc,.sidebarblock,.exampleblock>.content{background:none!important}#toc{border-bottom:1px solid #ddddd8!important;padding-bottom:0!important}.sect1{padding-bottom:0!important}.sect1+.sect1{border:0!important}#header>h1:first-child{margin-top:1.25rem} - body.book #header{text-align:center}body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em 0}body.book #header .details{border:0!important;display:block;padding:0!important}body.book #header .details span:first-child{margin-left:0!important}body.book #header .details br{display:block}body.book #header .details br+span:before{content:none!important}body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}.listingblock code[data-lang]:before{display:block}#footer{background:none!important;padding:0 .9375em}#footer-text{color:rgba(0,0,0,.6)!important;font-size:.9em}.hide-on-print{display:none!important}.print-only{display:block!important}.hide-for-print{display:none!important}.show-for-print{display:inherit!important}}#content .page-footer{height:100px;border-top:1px solid #ccc;overflow:hidden;padding:10px 0;font-size:14px;color:gray}#content .footer-modification{float:right}#content .footer-modification a{text-decoration:none}.sectlevel2{display:none}.submenu{background:#e7e7e6}.submenu li{border:0}.submenu a{color:#555} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/css/index.css b/blossom-backend/smart-doc-2.6.7/css/index.css deleted file mode 100644 index 39b2fe5d..00000000 --- a/blossom-backend/smart-doc-2.6.7/css/index.css +++ /dev/null @@ -1,232 +0,0 @@ -.book-summary { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - position: absolute; - top: 0; - left: -300px; - bottom: 0; - z-index: 1; - overflow-y: auto; - width: 300px; - color: #364149; - background: #fafafa; - border-right: 1px solid rgba(0, 0, 0, .07); - -webkit-transition: left 250ms ease; - -moz-transition: left 250ms ease; - -o-transition: left 250ms ease; - transition: left 250ms ease -} - -.book-summary ul.summary { - list-style: none; - margin: 0; - padding: 0; - -webkit-transition: top .5s ease; - -moz-transition: top .5s ease; - -o-transition: top .5s ease; - transition: top .5s ease -} - -.book-summary ul.summary li { - list-style: none -} - -.book-summary ul.summary li.header { - padding: 10px 15px; - padding-top: 20px; - text-transform: uppercase; - color: #939da3 -} - -.book-summary ul.summary li.divider { - height: 1px; - margin: 7px 0; - overflow: hidden; - background: rgba(0, 0, 0, .07) -} - -.book-summary ul.summary li i.fa-check { - display: none; - position: absolute; - right: 9px; - top: 16px; - font-size: 9px; - color: #3c3 -} - -.book-summary ul.summary li.done > a { - color: #364149; - font-weight: 400 -} - -.book-summary ul.summary li.done > a i { - display: inline -} - -.book-summary ul.summary li a, .book-summary { - display: block; - padding: 10px 15px; - border-bottom: 0; - color: #364149; - background: 0; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - position: relative -} - -.book-summary ul.summary li a:hover { - text-decoration: underline -} - -.book-summary ul.summary li a:focus { - outline: 0 -} - -.book-summary ul.summary li.active > a { - color: #008cff; - background: 0; - text-decoration: none -} - -.book-summary ul.summary li ul { - padding-left: 20px -} - -@media (max-width: 600px) { - .book-summary { - width: calc(100% - 60px); - bottom: 0; - left: -100% - } -} - -.book.with-summary .book-summary { - left: 0 -} - -.book.without-animation .book-summary { - -webkit-transition: none !important; - -moz-transition: none !important; - -o-transition: none !important; - transition: none !important -} - -.book { - position: relative; - width: 100%; - height: 100% -} - -@media (min-width: 600px) { - .book.with-summary .book-body { - left: 300px - } -} - -@media (max-width: 600px) { - .book.with-summary { - overflow: hidden - } - - .book.with-summary .book-body { - -webkit-transform: translate(calc(100% - 60px), 0); - -moz-transform: translate(calc(100% - 60px), 0); - -ms-transform: translate(calc(100% - 60px), 0); - -o-transform: translate(calc(100% - 60px), 0); - transform: translate(calc(100% - 60px), 0) - } -} - -.book.without-animation .book-body { - -webkit-transition: none !important; - -moz-transition: none !important; - -o-transition: none !important; - transition: none !important -} - -.book-body { - position: absolute; - top: 0; - right: 0; - left: 0; - bottom: 0; - overflow-y: hidden; - color: #000; - background: #fff; - -webkit-transition: left 250ms ease; - -moz-transition: left 250ms ease; - -o-transition: left 250ms ease; - transition: left 250ms ease -} - -@media (max-width: 1240px) { - .book-body { - -webkit-transition: -webkit-transform 250ms ease; - -moz-transition: -moz-transform 250ms ease; - -o-transition: -o-transform 250ms ease; - transition: transform 250ms ease; - padding-bottom: 20px - } -} - -#book-search-input { - padding: 6px; - background: 0; - transition: top .5s ease; - border-bottom: 1px solid rgba(0, 0, 0, .07); - border-top: 1px solid rgba(0, 0, 0, .07); - margin-bottom: 10px; - margin-top: -1px -} - -#book-search-input input, #book-search-input input:focus, #book-search-input input:hover { - width: 100%; - background: 0; - border: 1px solid transparent; - box-shadow: none; - outline: 0; - line-height: 22px; - padding: 7px 7px; - color: inherit -} - -a { - text-decoration: none -} - -body, html { - height: 100% -} - -html { - font-size: 62.5% -} - -body { - margin: 0 -} - -body { - text-rendering: optimizeLegibility; - font-smoothing: antialiased; - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - letter-spacing: .2px; - text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100% -} - -#reference { - padding-top: 10px; - padding-bottom: 10px; - padding-left: 15px -} - -.footer_link { - margin-bottom: 45px -} - -.line-through { - text-decoration: line-through; -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/css/markdown.css b/blossom-backend/smart-doc-2.6.7/css/markdown.css deleted file mode 100644 index 74b65ffa..00000000 --- a/blossom-backend/smart-doc-2.6.7/css/markdown.css +++ /dev/null @@ -1 +0,0 @@ -body{margin:0;padding:0;height:auto;bottom:0;top:0;left:0;right:0;font-size:1rem;line-height:1.42857;overflow-x:hidden;background:inherit;tab-size:4}.margin-tb-zero,.markdown-body ol ol,.markdown-body ul ol,.markdown-body ol ul,.markdown-body ul ul,.markdown-body ol ul ol,.markdown-body ul ul ol,.markdown-body ol ul ul,.markdown-body ul ul ul{margin-top:0;margin-bottom:0}.markdown-body{font-family:"Helvetica Neue",Helvetica,"Segoe UI",Arial,freesans,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;color:#333;line-height:1.6;word-wrap:break-word;padding:45px;background:#fff;#border-top:1px solid #ddd;-webkit-border-radius:0 0 3px 3px;#max-width:55%;#margin-left:15%;border-radius:0 0 3px 3px;max-width:800px;margin:0 auto;padding:30px 30px 100px}.markdown-body>*:first-child{margin-top:0!important}.markdown-body>*:last-child{margin-bottom:0!important}.markdown-body *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:1em;margin-bottom:16px;font-weight:bold;line-height:1.4}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre{margin-top:0;margin-bottom:16px}.markdown-body h1{margin:.67em 0;padding-bottom:.3em;font-size:2.25em;line-height:1.2;border-bottom:1px solid #eee}.markdown-body h2{padding-bottom:.3em;font-size:1.75em;line-height:1.225;border-bottom:1px solid #eee}.markdown-body h3{font-size:1.5em;line-height:1.43}.markdown-body h4{font-size:1.25em}.markdown-body h5{font-size:1em}.markdown-body h6{font-size:1em;color:#777}.markdown-body ol,.markdown-body ul{padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ol ul,.markdown-body ul ul{list-style-type:circle}.markdown-body ol ul ul,.markdown-body ul ul ul{list-style-type:square}.markdown-body ol{list-style-type:decimal}.markdown-body ul{list-style-type:disc}.markdown-body blockquote{margin-left:0;margin-right:0;padding:0 15px;color:#777;border-left:4px solid #ddd}.markdown-body table{#display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;text-align:left}thead{background-color:#f8f8f8}.markdown-body table tr{#background-color:#fff;border-top:1px solid #ccc}.markdown-body table tr:nth-child(2n){background-color:#f8f8f8}.markdown-body table th,.markdown-body table td{padding:6px 13px;border:1px solid #ddd}.markdown-body pre{word-wrap:normal;padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f7f7f7;-webkit-border-radius:3px;border-radius:3px}.markdown-body pre code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;font-size:100%;line-height:inherit;word-wrap:normal;white-space:pre;border:0;-webkit-border-radius:3px;border-radius:3px;background-color:transparent}.markdown-body pre code:before,.markdown-body pre code:after{content:normal}.markdown-body code{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;padding:0;padding-top:.2em;padding-bottom:.2em;margin:0;font-size:85%;background-color:rgba(0,0,0,0.04);-webkit-border-radius:3px;border-radius:3px}.markdown-body code:before,.markdown-body code:after{letter-spacing:-0.2em;content:"\00a0"}.markdown-body a{color:#4078c0;text-decoration:none;background:transparent}.markdown-body img{max-width:100%;max-height:100%;-webkit-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 0 10px #555;box-shadow:0 0 10px #555}.markdown-body strong{font-weight:bold}.markdown-body em{font-style:italic}.markdown-body del{text-decoration:line-through}.task-list-item{list-style-type:none}.task-list-item input{font:13px/1.4 Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";margin:0 .35em .25em -1.6em;vertical-align:middle}.task-list-item input[disabled]{cursor:default}.task-list-item input[type="checkbox"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}.task-list-item input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}.markdown-body .page-footer{margin-top:45px;height:50px;border-top:1px solid #ccc;overflow:hidden;padding:10px 0;font-size:14px;color:gray}.markdown-body .footer-modification{float:right}.markdown-body .footer-modification a{text-decoration:none} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/demoOut/AllInOne.md b/blossom-backend/smart-doc-2.6.7/demoOut/AllInOne.md deleted file mode 100644 index 4a716f4c..00000000 --- a/blossom-backend/smart-doc-2.6.7/demoOut/AllInOne.md +++ /dev/null @@ -1,8 +0,0 @@ - -| Version | Update Time | Status | Author | Description | -|---------|-------------|--------|--------|-------------| -|v2023-10-08 21:33:08|2023-10-08 21:33:08|auto|@Administrator|Created by smart-doc| - - - - diff --git a/blossom-backend/smart-doc-2.6.7/pom.xml b/blossom-backend/smart-doc-2.6.7/pom.xml deleted file mode 100644 index a56c0352..00000000 --- a/blossom-backend/smart-doc-2.6.7/pom.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - com.github.shalousun - 4.0.0 - smart-doc - jar - 2.6.7-BL-SNAPSHOT - - smart-doc - https://github.com/smart-doc-group/smart-doc.git - Smart-doc is a tool that supports both JAVA RESTFUL API and Apache Dubbo RPC interface document - generation. - - - - - The Apache Software License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - https://github.com/smart-doc-group/smart-doc.git - scm:https://github.com/smart-doc-group/smart-doc.git - scm:https://github.com/smart-doc-group/smart-doc.git - - - - shalousun - 836575280@qq.com - https://github.com/shalousun - - - - UTF-8 - 5.9.2 - 5.8.18 - - - - cn.hutool - hutool-all - ${hutool.version} - - - org.junit.jupiter - junit-jupiter - ${junit.jupiter.version} - test - - - com.ibeetl - beetl - 3.14.1.RELEASE - - - com.github.shalousun - qdox - 2.0.3 - - - net.datafaker - datafaker - 1.4.0 - - - com.github.shalousun - common-util - 2.1.8 - - - org.apache.commons - commons-lang3 - - - - - com.google.code.gson - gson - 2.10.1 - - - org.slf4j - slf4j-api - 2.0.5 - - - - - com.blossom - backend - 1.12.0-SNAPSHOT - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.10.1 - - 1.8 - 1.8 - UTF-8 - - - - - org.apache.maven.plugins - maven-source-plugin - 3.2.1 - - - package - - jar-no-fork - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.4.0 - - - package - - jar - - - - - - smart-doc - - - - release - - - - org.apache.maven.plugins - maven-gpg-plugin - 3.0.1 - - - sign-artifacts - verify - - sign - - - - - - - - - oss - https://oss.sonatype.org/content/repositories/snapshots/ - - - oss - https://oss.sonatype.org/service/local/staging/deploy/maven2/ - - - - - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/ApiDocGen.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/ApiDocGen.java deleted file mode 100644 index b1bc33b8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/ApiDocGen.java +++ /dev/null @@ -1,320 +0,0 @@ -package com.power.doc; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.db.Db; -import cn.hutool.db.Entity; -import cn.hutool.db.ds.DSFactory; -import cn.hutool.setting.Setting; -import com.blossom.backend.base.auth.enums.GrantTypeEnum; -import com.blossom.backend.base.auth.exception.AuthRCode; -import com.blossom.backend.base.user.UserTypeEnum; -import com.blossom.backend.server.doc.DocTypeEnum; -import com.blossom.backend.server.folder.FolderTypeEnum; -import com.blossom.common.base.enums.YesNo; -import com.blossom.common.base.pojo.RCode; -import com.power.doc.builder.HtmlApiDocBuilder; -import com.power.doc.model.*; -import lombok.extern.slf4j.Slf4j; - -import javax.sql.DataSource; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -/** - * Smart-Doc 文档生成工具 - *

官方文档地址 - *

- *

使用 Smart-Doc 时重写了 html 页面样式与, 使之更符合中文阅读习惯。并重写了字典读取, 可以手动添加非枚举类型的字典信息。 - *

在使用前需要先编译 smart-doc 项目, 使用如下命令: - *

mvn clean install -Dmaven.test.skip=true -Dfile.encoding=UTF-8 -Dmaven.javadoc.skip=true 
- */ -@Slf4j -@SuppressWarnings("all") -public class ApiDocGen { - - private static String IP_DEVE = "http://127.0.0.1"; - private static String VERSION = "v1.11.0"; - - private static final List sourceCodePath = new ArrayList() {{ - this.add("blossom-backend/common/common-base"); - this.add("blossom-backend/common/common-cache"); - this.add("blossom-backend/common/common-db"); - this.add("blossom-backend/common/common-iaas"); - this.add("blossom-backend/backend/src/main/java/com/blossom/backend"); - this.add("blossom-backend/expand-sentinel/expand-sentinel-metric"); - }}; - - private static final boolean genDictFromDB = true; - private static final String dictDbSetting = "dict-db.setting"; - private static final String dictQuerySQL = "select param_name,param_desc from base_sys_param"; - - public static void main(String[] args) throws SQLException { - long start = System.currentTimeMillis(); - genDoc(); - System.out.println(SEPARATOR); - System.out.println("接口文档生成结束, 用时: " + (System.currentTimeMillis() - start) + " ms"); - } - - /** - * 生成接口文档 - */ - public static void genDoc() throws SQLException { - ApiConfig config = new ApiConfig(); - config.setProjectName(PROJECT_NAME); - config.setOutPath("doc/backend-api"); - config.setServerUrl(IP_DEVE); - config.setStyle("darcula"); // 另一个代码块样式 solarized-light - config.setAllInOne(true); - // 创建一个类似swagger的可调试接口的文档页面, 仅在AllInOne模式中起作用。 - config.setCreateDebugPage(false); - // 请求示例 - config.setRequestExample(true); - // 设置为 true 会将枚举详情展示到参数表中, 默认关闭 - config.setInlineEnum(true); - // 是否显示接口作者名称 - config.setShowAuthor(false); - // 配置true会在注释栏自动显示泛型的真实类型短类名 - config.setDisplayActualType(true); - // 文件名 - config.setAllInOneDocFileName("index.html"); - // 源码扫描地址 - config.setSourceCodePaths(sourceCodePath()); - // api分组 - config.setGroups(groups()); - // 数据字典 - config.setDataDictionaries(dataDict()); - // 动态数据字典 - config.setDataDictionariesDynamic(dataDictDynamic()); - // 错误码列表 - config.setErrorCodeDictionaries(errorCodes()); - // 版本更新日志 - config.setRevisionLogs(revisions()); - - System.out.println(SEPARATOR); - System.out.println("正在生成 Html 接口文档..."); - HtmlApiDocBuilder.buildApiDoc(config); - } - - /** - * 版本说明 - */ - private static List revisions() { - List visions = new ArrayList<>(); - RevisionLog apiUrl = new RevisionLog(); - apiUrl.setVersion("1.访问地址"); - apiUrl.setRemarks("开发环境: " + IP_DEVE); - visions.add(apiUrl); - - RevisionLog authHowToUse = new RevisionLog(); - authHowToUse.setVersion("2.Token使用"); - authHowToUse.setRemarks( - "使用 /login 接口登录后, 将会返回 Token 信息。" + - "\n遵循标准 Bearer 使用规范, 需将 Token 传入请求头 \"Authorization\" 字段中, 并在前拼接 \"Bearer \"。" + - "\n例如:\"Authorization\" : \"Bearer ad047609fcde4ebbb358a6a4b0f38f43\"" + - "\n可参阅:https://learning.postman.com/docs/sending-requests/authorization/#bearer-token。" - ); - visions.add(authHowToUse); - - - RevisionLog standards = new RevisionLog(); - standards.setVersion("3.接口规范"); - standards.setRemarks( - "为了提高沟通效率, 降低思考成本, API一律符合如下规范." + - "\n1. 接口统一返回 Http 响应码 200, 业务响应码 [20000] 为正常, 业务响应码 [AUTH-40101] 为未授权。" + - "\n2. 接口只包含 Get,Post 请求, Get 请求为查询, Post 请求为增删改。" + - "\n3. 文档是使用 [OP] 标签的接口为开放接口, 该接口可以在未授权的情况下调用。" + - "\n4. 基础的[增删改查]API路径为:" + - "\n a. /list : 列表, 不是所有业务都有该接口, 通常是确保业务没有大量数据, 如菜单列表" + - "\n b. /page : 分页列表" + - "\n c. /info : 详情, 绝大部分详情只能通过业务ID查询" + - "\n d. /save : 新增修改接口合并, 会根据是否传入对应业务ID来判断, 适用于新增修改字段基本相同的业务" + - "\n f. /add : 新增, 传入ID无效" + - "\n g. /upd : 修改, 需要传入ID" + - "\n h. /del : 删除" + - "\n i. 其他业务请求请参照具体API" - ); - visions.add(standards); - - RevisionLog docHelp = new RevisionLog(); - docHelp.setVersion("4.文档说明"); - docHelp.setRemarks( - "本接口文档的使用事项" + - "\n1. [OP] : 接口名称中包含[OP] 即说明该接口为开放接口, 可以在非登录情况下调用。" + - "\n2. [TBC]: 接口名称中包含[TBC]即说明该接口具体业务需求尚不明确, 需要进一步等待确认。" - ); - visions.add(docHelp); - return visions; - } - - /** - * 指明文件路径 - */ - private static List sourceCodePath() { - List results = new ArrayList<>(); - for (String s : sourceCodePath) { - SourceCodePath path = new SourceCodePath(); - path.setPath(s); - results.add(path); - } - return results; - } - - /** - * 增加接口分组 - */ - private static List groups() { - List results = new ArrayList<>(); - - ApiGroup common = new ApiGroup(); - common.setName("通用功能"); - common.setApis("com.blossom.backend.base.*"); - results.add(common); - - ApiGroup biz = new ApiGroup(); - biz.setName("业务功能"); - biz.setApis("com.blossom.backend.server.*"); - results.add(biz); - - ApiGroup tp = new ApiGroup(); - tp.setName("三方接口"); - tp.setApis("com.blossom.backend.thirdparty.*"); - results.add(tp); - - ApiGroup sentinel = new ApiGroup(); - sentinel.setName("拓展功能"); - sentinel.setApis("com.blossom.expand.sentinel.metric.*"); - results.add(sentinel); - - return results; - } - - /** - * 增加数据字典, 最好在字典中增加说明字段. 如{@link GrantTypeEnum#getDesc()} - */ - private static List dataDict() { - List results = new ArrayList<>(); - - ApiDataDictionary dictGrantType = new ApiDataDictionary(); - dictGrantType.setTitle("登录方式 [GrantTypeEnum]"); - dictGrantType.setEnumClass(GrantTypeEnum.class); - dictGrantType.setCodeField("type"); - dictGrantType.setDescField("desc"); - results.add(dictGrantType); - - ApiDataDictionary yesNo = new ApiDataDictionary(); - yesNo.setTitle("是否,真假字典 [YesNo]"); - yesNo.setEnumClass(YesNo.class); - yesNo.setCodeField("value"); - yesNo.setDescField("name"); - results.add(yesNo); - - ApiDataDictionary userType = new ApiDataDictionary(); - userType.setTitle("用户类型 [UserTypeEnum]"); - userType.setEnumClass(UserTypeEnum.class); - userType.setCodeField("type"); - userType.setDescField("desc"); - results.add(userType); - - ApiDataDictionary docType = new ApiDataDictionary(); - docType.setTitle("文档类型 [DocTypeEnum]"); - docType.setEnumClass(DocTypeEnum.class); - docType.setCodeField("type"); - docType.setDescField("desc"); - results.add(docType); - - ApiDataDictionary folderType = new ApiDataDictionary(); - folderType.setTitle("文件夹类型 [FolderTypeEnum]"); - folderType.setEnumClass(FolderTypeEnum.class); - folderType.setCodeField("type"); - folderType.setDescField("desc"); - results.add(folderType); - -// ApiDataDictionary backupType = new ApiDataDictionary(); -// backupType.setTitle("备份类型 [BackupTypeEnum]"); -// backupType.setEnumClass(BackupTypeEnum.class); -// results.add(backupType); - - return results; - } - - /** - * 配置在数据库中的动态字典。 - */ - private static List dataDictDynamic() throws SQLException { - List doctDocList = new ArrayList<>(); - - if (genDictFromDB) { - long start = System.currentTimeMillis(); - System.out.println("正在查询数据字典..."); - DataSource ds = DSFactory.create(setting).getDataSource(); - - List list = Db.use(ds).query(dictQuerySQL); - List dictList = new ArrayList<>(); - - ApiDocDict params = new ApiDocDict(); - params.setOrder(100); - params.setTitle("系统参数表配置内容"); - - List paramList = new ArrayList<>(); - for (Entity entity : list) { - DataDict param = new DataDict(); - param.setValue(entity.getStr("param_name")); - param.setDesc(entity.getStr("param_desc")); - paramList.add(param); - } - params.setDataDictList(paramList); - doctDocList.add(params); - - System.out.println("查询数据字典完成, 用时: " + (System.currentTimeMillis() - start) + " ms"); - } - - return doctDocList; - } - - /** - * 接口响应码字典, 最好在字典中增加说明字段. 如{@link AuthRCode#getDesc()} - */ - private static List errorCodes() { - List results = new ArrayList<>(); - - ApiErrorCodeDictionary dict1 = new ApiErrorCodeDictionary(); - dict1.setEnumClass(RCode.class); - dict1.setCodeField("code"); - dict1.setDescField("msg"); - results.add(dict1); - - ApiErrorCodeDictionary dict2 = new ApiErrorCodeDictionary(); - dict2.setEnumClass(AuthRCode.class); - dict2.setCodeField("code"); - dict2.setDescField("desc"); - results.add(dict2); - - return results; - } - - private static String SEPARATOR = "==============================================================================="; - private static String PROJECT_NAME = ""; - private static Setting setting; - - /** - * 设置默认日志级别 - */ - static { - System.out.println(SEPARATOR); - PROJECT_NAME = "《Blossom 接口文档》\n 文档版本:" + VERSION + "\n 文档时间:" + DateUtil.now(); - System.out.println(String.format("准备生成接口文档\n项目:%s \n", PROJECT_NAME)); - - System.out.println("环境地址:"); - System.out.println(" - DEV : " + "127.0.0.1:9999"); - - System.out.println(SEPARATOR); - - System.out.println(String.format("数据字典是否从数据库中获取: [%s]", genDictFromDB)); - if (genDictFromDB) { - setting = new Setting(dictDbSetting); - System.out.println("DataBase: " + setting.getStr("url")); - System.out.println("Dict SQL: " + dictQuerySQL); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/AdocDocBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/AdocDocBuilder.java deleted file mode 100644 index e27542ed..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/AdocDocBuilder.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import java.util.List; - -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.template.IDocBuildTemplate; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import static com.power.doc.constants.DocGlobalConstants.ALL_IN_ONE_ADOC_TPL; -import static com.power.doc.constants.DocGlobalConstants.API_DOC_ADOC_TPL; -import static com.power.doc.constants.DocGlobalConstants.DICT_LIST_ADOC; -import static com.power.doc.constants.DocGlobalConstants.DICT_LIST_ADOC_TPL; -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_ADOC; -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_ADOC_TPL; - -/** - * Use to create Asciidoc - * - * @author yu 2019/9/26. - */ -public class AdocDocBuilder { - - private static final String API_EXTENSION = "Api.adoc"; - - private static final String INDEX_DOC = "index.adoc"; - - /** - * build adoc - * - * @param config ApiConfig - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, Boolean.FALSE); - config.setParamsDataToTree(false); - config.setAdoc(true); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - List apiDocList = docBuildTemplate.getApiData(configBuilder); - if (config.isAllInOne()) { - String docName = builderTemplate.allInOneDocName(config, INDEX_DOC, ".adoc"); - apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config); - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_ADOC_TPL, docName); - } else { - builderTemplate.buildApiDoc(apiDocList, config, API_DOC_ADOC_TPL, API_EXTENSION); - builderTemplate.buildErrorCodeDoc(config, ERROR_CODE_LIST_ADOC_TPL, ERROR_CODE_LIST_ADOC, javaProjectBuilder); - builderTemplate.buildDirectoryDataDoc(config, javaProjectBuilder, DICT_LIST_ADOC_TPL, DICT_LIST_ADOC); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDataBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDataBuilder.java deleted file mode 100644 index 253ac56e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDataBuilder.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiAllData; -import com.power.doc.model.ApiConfig; -import com.thoughtworks.qdox.JavaProjectBuilder; - -/** - * @author yu 2019/12/7. - * @since 1.7.9 - */ -public class ApiDataBuilder { - - /** - * Get list of ApiDoc - * - * @param config ApiConfig - * @return List of ApiDoc - */ - public static ApiAllData getApiData(ApiConfig config) { - return getApiData(config, Boolean.FALSE); - } - - /** - * Get list of ApiDoc - * - * @param config ApiConfig - * @return List of ApiDoc - */ - public static ApiAllData getApiDataTree(ApiConfig config) { - return getApiData(config, Boolean.TRUE); - } - - private static ApiAllData getApiData(ApiConfig config, boolean toTree) { - config.setParamsDataToTree(toTree); - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInitForGetApiData(config); - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - ApiAllData apiAllData = builderTemplate.getApiData(config, javaProjectBuilder); - return apiAllData; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDocBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDocBuilder.java deleted file mode 100644 index 424d5f4b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ApiDocBuilder.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import com.power.common.util.DateTimeUtil; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.template.IDocBuildTemplate; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import java.util.List; - -import static com.power.doc.constants.DocGlobalConstants.*; - -/** - * use to create markdown doc - * - * @author yu 2019/09/20 - */ -public class ApiDocBuilder { - - private static final String API_EXTENSION = "Api.md"; - - private static final String DATE_FORMAT = "yyyyMMddHHmm"; - - /** - * @param config ApiConfig - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, Boolean.FALSE); - config.setAdoc(false); - config.setParamsDataToTree(false); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - List apiDocList = docBuildTemplate.getApiData(configBuilder); - if (config.isAllInOne()) { - String version = config.isCoverOld() ? "" : "-V" + DateTimeUtil.long2Str(System.currentTimeMillis(), DATE_FORMAT); - String docName = builderTemplate.allInOneDocName(config, "AllInOne" + version + ".md", ".md"); - apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config); - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_MD_TPL, docName); - } else { - builderTemplate.buildApiDoc(apiDocList, config, API_DOC_MD_TPL, API_EXTENSION); - builderTemplate.buildErrorCodeDoc(config, ERROR_CODE_LIST_MD_TPL, ERROR_CODE_LIST_MD, javaProjectBuilder); - builderTemplate.buildDirectoryDataDoc(config, javaProjectBuilder, DICT_LIST_MD_TPL, DICT_LIST_MD); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/BaseDocBuilderTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/BaseDocBuilderTemplate.java deleted file mode 100644 index 08202333..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/BaseDocBuilderTemplate.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import com.power.common.util.DateTimeUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocLanguage; -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.constants.TemplateVariable; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.RevisionLog; -import com.power.doc.utils.StringUtils; -import org.beetl.core.Resource; -import org.beetl.core.Template; -import org.beetl.core.resource.ClasspathResourceLoader; - -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Reader; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import static com.power.doc.constants.DocGlobalConstants.CSS_CDN; -import static com.power.doc.constants.DocGlobalConstants.CSS_CDN_CH; - -/** - * @author yu 2020/5/16. - */ -public class BaseDocBuilderTemplate { - - public static long NOW = System.currentTimeMillis(); - - public static void copyJarFile(String source, String target) { - ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("/template/"); - Resource resource = resourceLoader.getResource(source); - try (FileWriter fileWriter = new FileWriter(target, false); - Reader reader = resource.openReader()) { - char[] c = new char[1024 * 1024]; - int temp; - int len = 0; - while ((temp = reader.read()) != -1) { - c[len] = (char) temp; - len++; - } - reader.close(); - BufferedWriter bufferedWriter = new BufferedWriter(fileWriter); - bufferedWriter.write(c, 0, len); - bufferedWriter.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - /** - * check condition and init - * - * @param config Api config - * @param checkOutPath check out path - */ - public void checkAndInit(ApiConfig config, boolean checkOutPath) { - this.checkAndInitForGetApiData(config); - if (StringUtil.isEmpty(config.getOutPath()) && !checkOutPath) { - throw new RuntimeException("doc output path can't be null or empty"); - } - } - - /** - * check condition and init for get Data - * - * @param config Api config - */ - public void checkAndInitForGetApiData(ApiConfig config) { - if (Objects.isNull(config)) { - throw new NullPointerException("ApiConfig can't be null"); - } - if (Objects.nonNull(config.getLanguage())) { - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, config.getLanguage().getCode()); - } else { - //default is chinese - config.setLanguage(DocLanguage.CHINESE); - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode()); - } - if (Objects.isNull(config.getRevisionLogs())) { - String strTime = DateTimeUtil.long2Str(NOW, DateTimeUtil.DATE_FORMAT_SECOND); - config.setRevisionLogs( - RevisionLog.builder() - .setRevisionTime(strTime) - .setAuthor("@" + System.getProperty("user.name")) - .setVersion("v" + strTime) - .setRemarks("Created by smart-doc") - .setStatus("auto") - ); - } - if (StringUtil.isEmpty(config.getFramework())) { - config.setFramework(FrameworkEnum.SPRING.getFramework()); - } - if (StringUtil.isEmpty(config.getAuthor())) { - config.setAuthor(System.getProperty("user.name")); - } - if (Objects.isNull(config.getReplace())) { - config.setReplace(Boolean.TRUE); - } - } - - public Map setDirectoryLanguageVariable(ApiConfig config, Template mapper) { - Map titleMap = new HashMap<>(); - if (Objects.nonNull(config.getLanguage())) { - if (DocLanguage.CHINESE.code.equals(config.getLanguage().getCode())) { - mapper.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE); - mapper.binding(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_CN_TITLE); - titleMap.put(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE); - titleMap.put(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_CN_TITLE); - } else { - mapper.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_EN_TITLE); - mapper.binding(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_EN_TITLE); - titleMap.put(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_EN_TITLE); - titleMap.put(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_EN_TITLE); - } - } else { - mapper.binding(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE); - mapper.binding(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_CN_TITLE); - titleMap.put(TemplateVariable.ERROR_LIST_TITLE.getVariable(), DocGlobalConstants.ERROR_CODE_LIST_CN_TITLE); - titleMap.put(TemplateVariable.DICT_LIST_TITLE.getVariable(), DocGlobalConstants.DICT_CN_TITLE); - } - return titleMap; - } - - public void setCssCDN(ApiConfig config, Template template) { - if (DocLanguage.CHINESE.equals(config.getLanguage())) { - template.binding(TemplateVariable.CSS_CND.getVariable(), CSS_CDN_CH); - } else { - template.binding(TemplateVariable.CSS_CND.getVariable(), CSS_CDN); - } - } - - public String allInOneDocName(ApiConfig apiConfig, String fileName, String suffix) { - String allInOneName = apiConfig.getAllInOneDocFileName(); - if (StringUtils.isNotEmpty(apiConfig.getAllInOneDocFileName())) { - if (allInOneName.endsWith(suffix)) { - return allInOneName; - } else { - return allInOneName + suffix; - } - } else if (StringUtil.isNotEmpty(fileName) && fileName.endsWith(suffix)) { - return fileName; - } else { - return fileName + suffix; - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/DocBuilderTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/DocBuilderTemplate.java deleted file mode 100644 index 2e7eab81..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/DocBuilderTemplate.java +++ /dev/null @@ -1,394 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.DateTimeUtil; -import com.power.common.util.FileUtil; -import com.power.doc.constants.DocLanguage; -import com.power.doc.constants.HighlightStyle; -import com.power.doc.constants.TemplateVariable; -import com.power.doc.constants.TornaConstants; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.model.ApiAllData; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.ApiDocDict; -import com.power.doc.model.ApiErrorCode; -import com.power.doc.model.ApiMethodDoc; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.BeetlTemplateUtil; -import com.power.doc.utils.DocUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import org.beetl.core.Template; - -import static com.power.doc.constants.DocGlobalConstants.CSS_CDN; -import static com.power.doc.constants.DocGlobalConstants.CSS_CDN_CH; -import static com.power.doc.constants.DocGlobalConstants.FILE_SEPARATOR; -import static com.power.doc.constants.DocGlobalConstants.SEARCH_JS_OUT; - -/** - * @author yu 2019/9/26. - */ -public class DocBuilderTemplate extends BaseDocBuilderTemplate { - - private static final long now = System.currentTimeMillis(); - - /** - * get all api data - * - * @param config ApiConfig - * @param javaProjectBuilder JavaProjectBuilder - * @return ApiAllData - */ - public ApiAllData getApiData(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - ApiAllData apiAllData = new ApiAllData(); - apiAllData.setProjectName(config.getProjectName()); - apiAllData.setProjectId(DocUtil.generateId(config.getProjectName())); - apiAllData.setLanguage(config.getLanguage().getCode()); - apiAllData.setApiDocList(listOfApiData(config, javaProjectBuilder)); - apiAllData.setErrorCodeList(DocUtil.errorCodeDictToList(config, javaProjectBuilder)); - apiAllData.setRevisionLogs(config.getRevisionLogs()); - apiAllData.setApiDocDictList(DocUtil.buildDictionary(config, javaProjectBuilder)); - return apiAllData; - } - - /** - * Generate api documentation for all controllers. - * - * @param apiDocList list of api doc - * @param config api config - * @param template template - * @param fileExtension file extension - */ - public void buildApiDoc(List apiDocList, ApiConfig config, String template, String fileExtension) { - FileUtil.mkdirs(config.getOutPath()); - for (ApiDoc doc : apiDocList) { - Template mapper = BeetlTemplateUtil.getByName(template); - mapper.binding(TemplateVariable.DESC.getVariable(), doc.getDesc()); - mapper.binding(TemplateVariable.NAME.getVariable(), doc.getName()); - mapper.binding(TemplateVariable.LIST.getVariable(), doc.getList()); - mapper.binding(TemplateVariable.REQUEST_EXAMPLE.getVariable(), config.isRequestExample()); - mapper.binding(TemplateVariable.RESPONSE_EXAMPLE.getVariable(), config.isResponseExample()); - FileUtil.nioWriteFile(mapper.render(), config.getOutPath() + FILE_SEPARATOR + doc.getName() + fileExtension); - } - } - - /** - * Merge all api doc into one document - * - * @param apiDocList list data of Api doc - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @param template template - * @param outPutFileName output file - */ - public void buildAllInOne(List apiDocList, ApiConfig config, JavaProjectBuilder javaProjectBuilder, - String template, String outPutFileName) { - buildDoc(apiDocList, config, javaProjectBuilder, template, outPutFileName, null, null); - } - - /** - * Merge all api doc into one document - * - * @param apiDocList list data of Api doc - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @param template template - * @param outPutFileName output file - * @param apiDoc apiDoc - * @param index index html - */ - public void buildDoc(List apiDocList, ApiConfig config, JavaProjectBuilder javaProjectBuilder, - String template, String outPutFileName, ApiDoc apiDoc, String index) { - String outPath = config.getOutPath(); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - FileUtil.mkdirs(outPath); - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - Template tpl = BeetlTemplateUtil.getByName(template); - String style = config.getStyle(); - tpl.binding(TemplateVariable.STYLE.getVariable(), style); - tpl.binding(TemplateVariable.HIGH_LIGHT_CSS_LINK.getVariable(), config.getHighlightStyleLink()); - tpl.binding(TemplateVariable.BACKGROUND.getVariable(), HighlightStyle.getBackgroundColor(style)); - tpl.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocList); - tpl.binding(TemplateVariable.ERROR_CODE_LIST.getVariable(), errorCodeList); - tpl.binding(TemplateVariable.VERSION_LIST.getVariable(), config.getRevisionLogs()); - tpl.binding(TemplateVariable.VERSION.getVariable(), now); - tpl.binding(TemplateVariable.INDEX_ALIAS.getVariable(), index); - tpl.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - tpl.binding(TemplateVariable.PROJECT_NAME.getVariable(), config.getProjectName()); - tpl.binding(TemplateVariable.REQUEST_EXAMPLE.getVariable(), config.isRequestExample()); - tpl.binding(TemplateVariable.RESPONSE_EXAMPLE.getVariable(), config.isResponseExample()); - tpl.binding(TemplateVariable.DISPLAY_REQUEST_PARAMS.getVariable(), config.isRequestParamsTable()); - tpl.binding(TemplateVariable.DISPLAY_RESPONSE_PARAMS.getVariable(), config.isResponseParamsTable()); - setCssCDN(config, tpl); - - setDirectoryLanguageVariable(config, tpl); - List apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder); - tpl.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList); - - boolean onlyHasDefaultGroup = apiDocList.stream().allMatch(doc -> Objects.equals(TornaConstants.DEFAULT_GROUP_CODE, doc.getGroup())); - int codeIndex = 0; - if (onlyHasDefaultGroup) { - if (apiDocList.size() > 0) { - codeIndex = apiDocList.get(0).getChildrenApiDocs().size(); - } - } else { - codeIndex = apiDocList.size(); - } - tpl.binding(TemplateVariable.API_DOC_LIST_ONLY_HAS_DEFAULT_GROUP.getVariable(), onlyHasDefaultGroup); - - if (CollectionUtil.isNotEmpty(errorCodeList)) { - tpl.binding(TemplateVariable.ERROR_CODE_ORDER.getVariable(), ++codeIndex); - } - - if (CollectionUtil.isNotEmpty(apiDocDictList)) { - tpl.binding(TemplateVariable.DICT_ORDER.getVariable(), ++codeIndex); - } - - if (Objects.nonNull(apiDoc)) { - tpl.binding(TemplateVariable.DESC.getVariable(), apiDoc.getDesc()); - tpl.binding(TemplateVariable.ORDER.getVariable(), apiDoc.order); - tpl.binding(TemplateVariable.LIST.getVariable(), apiDoc.getList());//类名 - } - FileUtil.nioWriteFile(tpl.render(), outPath + FILE_SEPARATOR + outPutFileName); - } - - public void buildSearchJs(ApiConfig config, JavaProjectBuilder javaProjectBuilder, List apiDocList, String template) { - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - Template tpl = BeetlTemplateUtil.getByName(template); - // directory tree - List apiDocs = new ArrayList<>(); - for (ApiDoc apiDoc1 : apiDocList) { - apiDoc1.setOrder(apiDocs.size() + 1); - apiDocs.add(apiDoc1); - } - - boolean isOnlyDefaultGroup = apiDocList.size() == 1; - Map titleMap = setDirectoryLanguageVariable(config, tpl); - // set error code - if (CollectionUtil.isNotEmpty(errorCodeList)) { - ApiDoc apiDoc1 = new ApiDoc(); - int codeIndex = 0; - if (isOnlyDefaultGroup) { - codeIndex = apiDocs.get(0).getChildrenApiDocs().size(); - } else { - codeIndex = apiDocList.size(); - } - apiDoc1.setOrder(codeIndex + 1); - apiDoc1.setDesc(titleMap.get(TemplateVariable.ERROR_LIST_TITLE.getVariable())); - apiDoc1.setList(new ArrayList<>(0)); - apiDoc1.setLink("error_code_list"); - apiDoc1.setAlias("error"); - apiDoc1.setGroup(apiDoc1.getDesc()); - if (isOnlyDefaultGroup) { - apiDocs.get(0).getChildrenApiDocs().add(apiDoc1); - } else { - apiDocs.add(apiDoc1); - } - } - // set dict list - List apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder); - if (CollectionUtil.isNotEmpty(apiDocDictList)) { - ApiDoc apiDoc1 = new ApiDoc(); - int codeIndex = 0; - if (isOnlyDefaultGroup) { - if (apiDocs.size() > 0) { - codeIndex = apiDocs.get(0).getChildrenApiDocs().size(); - } - } else { - codeIndex = apiDocList.size(); - } - apiDoc1.setOrder(codeIndex + 1); - apiDoc1.setLink("dict_list"); - apiDoc1.setAlias("dict"); - apiDoc1.setDesc(titleMap.get(TemplateVariable.DICT_LIST_TITLE.getVariable())); - apiDoc1.setGroup(apiDoc1.getDesc()); - List methodDocs = new ArrayList<>(); - List childrenApiDocs = new ArrayList<>(); - for (ApiDocDict apiDocDict : apiDocDictList) { - ApiMethodDoc methodDoc = new ApiMethodDoc(); - methodDoc.setOrder(apiDocDict.getOrder()); - methodDoc.setDesc(apiDocDict.getTitle()); - methodDocs.add(methodDoc); - - ApiDoc childrenApiDoc = new ApiDoc(); - childrenApiDoc.setOrder(apiDocDict.getOrder()); - childrenApiDoc.setAlias(apiDocDict.getTitle()); - childrenApiDoc.setDesc(apiDocDict.getTitle()); - childrenApiDoc.setName(apiDocDict.getTitle()); - childrenApiDoc.setList(new ArrayList<>(0)); - childrenApiDocs.add(childrenApiDoc); - - } - apiDoc1.setChildrenApiDocs(childrenApiDocs); - apiDoc1.setList(methodDocs); - if (isOnlyDefaultGroup) { - if (apiDocs.size() > 0) { - apiDocs.get(0).getChildrenApiDocs().add(apiDoc1); - } - } else { - apiDocs.add(apiDoc1); - } - } - tpl.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocs); - FileUtil.nioWriteFile(tpl.render(), config.getOutPath() + FILE_SEPARATOR + SEARCH_JS_OUT); - } - - - /** - * build error_code adoc - * - * @param config api config - * @param template template - * @param outPutFileName output file - * @param javaProjectBuilder javaProjectBuilder - */ - public void buildErrorCodeDoc(ApiConfig config, String template, String outPutFileName, JavaProjectBuilder javaProjectBuilder) { - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - Template tpl = BeetlTemplateUtil.getByName(template); - setCssCDN(config, tpl); - tpl.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - tpl.binding(TemplateVariable.LIST.getVariable(), errorCodeList); - FileUtil.nioWriteFile(tpl.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - } - - /** - * build error_code html - * - * @param config api config - * @param javaProjectBuilder javaProjectBuilder - * @param apiDocList list data of Api doc - * @param template template - * @param outPutFileName output file - * @param indexAlias index alias - */ - public void buildErrorCodeDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder, - List apiDocList, String template, String outPutFileName, String indexAlias) { - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - Template errorTemplate = BeetlTemplateUtil.getByName(template); - errorTemplate.binding(TemplateVariable.PROJECT_NAME.getVariable(), config.getProjectName()); - String style = config.getStyle(); - errorTemplate.binding(TemplateVariable.HIGH_LIGHT_CSS_LINK.getVariable(), config.getHighlightStyleLink()); - errorTemplate.binding(TemplateVariable.STYLE.getVariable(), style); - if (CollectionUtil.isEmpty(errorCodeList)) { - errorTemplate.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 1); - } else { - errorTemplate.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 2); - } - // set css cdn - setCssCDN(config, errorTemplate); - List apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder); - errorTemplate.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - errorTemplate.binding(TemplateVariable.VERSION.getVariable(), now); - errorTemplate.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList); - errorTemplate.binding(TemplateVariable.INDEX_ALIAS.getVariable(), indexAlias); - errorTemplate.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocList); - errorTemplate.binding(TemplateVariable.BACKGROUND.getVariable(), HighlightStyle.getBackgroundColor(style)); - errorTemplate.binding(TemplateVariable.ERROR_CODE_LIST.getVariable(), errorCodeList); - setDirectoryLanguageVariable(config, errorTemplate); - FileUtil.nioWriteFile(errorTemplate.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - - } - - /** - * build common_data doc - * - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @param apiDocList list data of Api doc - * @param template template - * @param outPutFileName output file - * @param indexAlias index alias - */ - public void buildDirectoryDataDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder, List apiDocList, - String template, String outPutFileName, String indexAlias) { - List directoryList = DocUtil.buildDictionary(config, javaProjectBuilder); - Template mapper = BeetlTemplateUtil.getByName(template); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - mapper.binding(TemplateVariable.PROJECT_NAME.getVariable(), config.getProjectName()); - String style = config.getStyle(); - mapper.binding(TemplateVariable.HIGH_LIGHT_CSS_LINK.getVariable(), config.getHighlightStyleLink()); - mapper.binding(TemplateVariable.STYLE.getVariable(), style); - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - // set css cdn - setCssCDN(config, mapper); - if (DocLanguage.CHINESE.equals(config.getLanguage())) { - mapper.binding(TemplateVariable.CSS_CND.getVariable(), CSS_CDN_CH); - } else { - mapper.binding(TemplateVariable.CSS_CND.getVariable(), CSS_CDN); - } - if (CollectionUtil.isNotEmpty(errorCodeList)) { - mapper.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 2); - } else { - mapper.binding(TemplateVariable.DICT_ORDER.getVariable(), apiDocList.size() + 1); - } - - mapper.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - mapper.binding(TemplateVariable.VERSION.getVariable(), now); - mapper.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocList); - mapper.binding(TemplateVariable.INDEX_ALIAS.getVariable(), indexAlias); - mapper.binding(TemplateVariable.BACKGROUND.getVariable(), HighlightStyle.getBackgroundColor(style)); - mapper.binding(TemplateVariable.ERROR_CODE_LIST.getVariable(), errorCodeList); - setDirectoryLanguageVariable(config, mapper); - mapper.binding(TemplateVariable.DICT_LIST.getVariable(), directoryList); - FileUtil.nioWriteFile(mapper.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - } - - /** - * build common_data doc - * - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @param template template - * @param outPutFileName output file - */ - public void buildDirectoryDataDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder, String template, String outPutFileName) { - List directoryList = DocUtil.buildDictionary(config, javaProjectBuilder); - Template mapper = BeetlTemplateUtil.getByName(template); - setDirectoryLanguageVariable(config, mapper); - // set css cdn - setCssCDN(config, mapper); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - mapper.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - mapper.binding(TemplateVariable.DICT_LIST.getVariable(), directoryList); - FileUtil.nioWriteFile(mapper.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - } - - private List listOfApiData(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - this.checkAndInitForGetApiData(config); - config.setMd5EncryptedHtmlName(true); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - return docBuildTemplate.getApiData(configBuilder); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/HtmlApiDocBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/HtmlApiDocBuilder.java deleted file mode 100644 index 3dd5531b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/HtmlApiDocBuilder.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import com.power.common.util.FileUtil; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.BeetlTemplateUtil; -import com.power.doc.utils.StringUtils; -import com.thoughtworks.qdox.JavaProjectBuilder; -import org.beetl.core.Template; - -import java.util.List; - -import static com.power.doc.constants.DocGlobalConstants.*; - -/** - * @author yu 2019/9/20. - * @since 1.7+ - */ -public class HtmlApiDocBuilder { - - private static final String ERROR_CODE_HTML = "error.html"; - private static final String DICT_HTML = "dict.html"; - private static final long now = System.currentTimeMillis(); - private static String INDEX_HTML = "index.html"; - private static final String v = "xz_custom_230518"; - - /** - * build controller api - * - * @param config config - */ - public static void buildApiDoc(ApiConfig config) { - System.out.println(v); - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, false); - config.setParamsDataToTree(false); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - List apiDocList = docBuildTemplate.getApiData(configBuilder); - Template indexCssTemplate = BeetlTemplateUtil.getByName(ALL_IN_ONE_CSS); - FileUtil.nioWriteFile(indexCssTemplate.render(), config.getOutPath() + FILE_SEPARATOR + ALL_IN_ONE_CSS_OUT); - BaseDocBuilderTemplate.copyJarFile("js/" + HIGH_LIGHT_JS, config.getOutPath() + FILE_SEPARATOR + HIGH_LIGHT_JS); - BaseDocBuilderTemplate.copyJarFile("css/" + FONT_STYLE, config.getOutPath() + FILE_SEPARATOR + FONT_STYLE); - BaseDocBuilderTemplate.copyJarFile("js/" + JQUERY, config.getOutPath() + FILE_SEPARATOR + JQUERY); - BaseDocBuilderTemplate.copyJarFile("css/" + HIGH_LIGHT_STYLE, config.getOutPath() + FILE_SEPARATOR + HIGH_LIGHT_STYLE); - if (config.isAllInOne()) { - apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config); - if (config.isCreateDebugPage()) { - INDEX_HTML = DEBUG_PAGE_ALL_TPL; - if (StringUtils.isNotEmpty(config.getAllInOneDocFileName())) { - INDEX_HTML = config.getAllInOneDocFileName(); - } - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, DEBUG_PAGE_ALL_TPL, INDEX_HTML); - Template mockJs = BeetlTemplateUtil.getByName(DEBUG_JS_TPL); - FileUtil.nioWriteFile(mockJs.render(), config.getOutPath() + FILE_SEPARATOR + DEBUG_JS_OUT); - } else { - if (StringUtils.isNotEmpty(config.getAllInOneDocFileName())) { - INDEX_HTML = config.getAllInOneDocFileName(); - } - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_HTML_TPL, INDEX_HTML); - } - builderTemplate.buildSearchJs(config, javaProjectBuilder, apiDocList, SEARCH_ALL_JS_TPL); - } else { - String indexAlias; - if (config.isCreateDebugPage()) { - indexAlias = "debug"; - buildDoc(builderTemplate, apiDocList, config, javaProjectBuilder, DEBUG_PAGE_SINGLE_TPL, indexAlias); - Template mockJs = BeetlTemplateUtil.getByName(DEBUG_JS_TPL); - FileUtil.nioWriteFile(mockJs.render(), config.getOutPath() + FILE_SEPARATOR + DEBUG_JS_OUT); - } else { - indexAlias = "api"; - buildDoc(builderTemplate, apiDocList, config, javaProjectBuilder, SINGLE_INDEX_HTML_TPL, indexAlias); - } - builderTemplate.buildErrorCodeDoc(config, javaProjectBuilder, apiDocList, SINGLE_ERROR_HTML_TPL, - ERROR_CODE_HTML, indexAlias); - builderTemplate.buildDirectoryDataDoc(config, javaProjectBuilder, apiDocList, - SINGLE_DICT_HTML_TPL, DICT_HTML, indexAlias); - builderTemplate.buildSearchJs(config, javaProjectBuilder, apiDocList, SEARCH_JS_TPL); - } - - } - - /** - * build ever controller api - * - * @param builderTemplate DocBuilderTemplate - * @param apiDocList list of api doc - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - * @param template template - * @param indexHtml indexHtml - */ - private static void buildDoc(DocBuilderTemplate builderTemplate, List apiDocList, ApiConfig config - , JavaProjectBuilder javaProjectBuilder, String template, String indexHtml) { - FileUtil.mkdirs(config.getOutPath()); - int index = 0; - for (ApiDoc doc : apiDocList) { - if (index == 0) { - doc.setAlias(indexHtml); - } - builderTemplate.buildDoc(apiDocList, config, javaProjectBuilder, template, - doc.getAlias() + ".html", doc, indexHtml); - index++; - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/PostmanJsonBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/PostmanJsonBuilder.java deleted file mode 100644 index 407640b5..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/PostmanJsonBuilder.java +++ /dev/null @@ -1,272 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Optional; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.FileUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.Methods; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.ApiMethodDoc; -import com.power.doc.model.ApiParam; -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.FormData; -import com.power.doc.model.postman.InfoBean; -import com.power.doc.model.postman.ItemBean; -import com.power.doc.model.postman.RequestItem; -import com.power.doc.model.postman.UrlBean; -import com.power.doc.model.postman.request.ParamBean; -import com.power.doc.model.postman.request.RequestBean; -import com.power.doc.model.postman.request.body.BodyBean; -import com.power.doc.model.postman.request.header.HeaderBean; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.DocPathUtil; -import com.power.doc.utils.JsonUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - - -/** - * @author yu 2019/11/21. - */ -public class PostmanJsonBuilder { - - private static final String MSG = "Interface name is not set."; - - /** - * build postman json - * - * @param config Smart-doc ApiConfig - */ - public static void buildPostmanCollection(ApiConfig config) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, false); - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - postManCreate(config, configBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig Object - * @param projectBuilder QDOX avaProjectBuilder - */ - public static void buildPostmanCollection(ApiConfig config, JavaProjectBuilder projectBuilder) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, false); - if (StringUtil.isNotEmpty(config.getServerEnv())) { - config.setServerUrl(config.getServerEnv()); - } - config.setParamsDataToTree(false); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, projectBuilder); - postManCreate(config, configBuilder); - } - - /** - * Build the first layer of Postman Item - * - * @param apiDoc Documentation for each Controller - * @return First layer of Postman Item - */ - private static ItemBean buildItemBean(ApiDoc apiDoc) { - ItemBean itemBean = new ItemBean(); - itemBean.setName(StringUtil.isEmpty(apiDoc.getDesc()) ? MSG : apiDoc.getDesc()); - List itemBeans = new ArrayList<>(); - List apiMethodDocs = apiDoc.getList(); - apiMethodDocs.forEach( - apiMethodDoc -> { - ItemBean itemBean1 = buildItem(apiMethodDoc); - itemBeans.add(itemBean1); - } - ); - itemBean.setItem(itemBeans); - return itemBean; - } - - /** - * Build the second layer of Postman item - * - * @param apiMethodDoc Documentation for each method - * @return The second layer of Postman item - */ - private static ItemBean buildItem(ApiMethodDoc apiMethodDoc) { - ItemBean item = new ItemBean(); - RequestBean requestBean = new RequestBean(); - - item.setName(StringUtil.isEmpty(apiMethodDoc.getDesc()) ? MSG : apiMethodDoc.getDesc()); - item.setDescription(apiMethodDoc.getDetail()); - - requestBean.setDescription(apiMethodDoc.getDesc()); - requestBean.setMethod(apiMethodDoc.getType()); - requestBean.setHeader(buildHeaderBeanList(apiMethodDoc)); - - requestBean.setBody(buildBodyBean(apiMethodDoc)); - requestBean.setUrl(buildUrlBean(apiMethodDoc)); - - item.setRequest(requestBean); - return item; - - } - - private static UrlBean buildUrlBean(ApiMethodDoc apiMethodDoc) { - UrlBean urlBean = new UrlBean(apiMethodDoc.getServerUrl()); - String url = Optional.ofNullable(apiMethodDoc.getRequestExample().getUrl()).orElse(apiMethodDoc.getUrl()); - urlBean.setRaw(DocPathUtil.toPostmanPath(url)); - String shortUrl = DocPathUtil.toPostmanPath(apiMethodDoc.getPath()); - String[] paths = shortUrl.split("/"); - List pathList = new ArrayList<>(); - String serverPath = CollectionUtil.isNotEmpty(urlBean.getPath()) ? urlBean.getPath().get(0) : ""; - // Add server path - if (CollectionUtil.isNotEmpty(urlBean.getPath()) && !shortUrl.contains(serverPath)) { - String[] serverPaths = serverPath.split("/"); - pathList.addAll(Arrays.asList(serverPaths)); - } - // Add mapping path - for (String str : paths) { - if (StringUtil.isNotEmpty(str)) { - pathList.add(str); - } - } - if (shortUrl.endsWith("/")) { - pathList.add(""); - } - - urlBean.setPath(pathList); - - List queryParams = new ArrayList<>(); - if (!apiMethodDoc.getType().equals(Methods.POST.getValue()) || - apiMethodDoc.getContentType().contains(DocGlobalConstants.JSON_CONTENT_TYPE)) { - for (ApiParam apiParam : apiMethodDoc.getQueryParams()) { - ParamBean queryParam = new ParamBean(); - queryParam.setDescription(apiParam.getDesc()); - queryParam.setKey(apiParam.getField()); - queryParam.setValue(apiParam.getValue()); - queryParams.add(queryParam); - } - } - urlBean.setQuery(queryParams); - - List variables = new ArrayList<>(); - for (ApiParam apiParam : apiMethodDoc.getPathParams()) { - ParamBean queryParam = new ParamBean(); - queryParam.setDescription(apiParam.getDesc()); - queryParam.setKey(apiParam.getField()); - queryParam.setValue(apiParam.getValue()); - variables.add(queryParam); - } - urlBean.setVariable(variables); - return urlBean; - } - - /** - * Build payload - * - * @return Body payload - */ - private static BodyBean buildBodyBean(ApiMethodDoc apiMethodDoc) { - BodyBean bodyBean; - if (apiMethodDoc.getContentType().contains(DocGlobalConstants.JSON_CONTENT_TYPE)) { - bodyBean = new BodyBean(Boolean.FALSE);// Json request - bodyBean.setMode(DocGlobalConstants.POSTMAN_MODE_RAW); - if (apiMethodDoc.getRequestExample() != null) { - bodyBean.setRaw(apiMethodDoc.getRequestExample().getJsonBody()); - } - } else { - if (apiMethodDoc.getType().equals(Methods.POST.getValue())) { - bodyBean = new BodyBean(Boolean.TRUE); //Formdata - bodyBean.setMode(DocGlobalConstants.POSTMAN_MODE_FORMDATA); - if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestExample().getFormDataList())) { - bodyBean.setFormdata(apiMethodDoc.getRequestExample().getFormDataList()); - } else { - // if method is post and formdata list size is 0, convert query param to formdata - List queryParams = apiMethodDoc.getQueryParams(); - List formDataList = new ArrayList<>(queryParams.size()); - for (ApiParam apiParam : queryParams) { - FormData formData = new FormData(); - formData.setDescription(apiParam.getDesc()); - formData.setKey(apiParam.getField()); - formData.setType(apiParam.getType()); - formData.setValue(apiParam.getValue()); - formDataList.add(formData); - } - bodyBean.setFormdata(formDataList); - } - } else { - bodyBean = new BodyBean(Boolean.FALSE); - } - } - return bodyBean; - } - - /** - * Build header - * - * @return List of header - */ - private static List buildHeaderBeanList(ApiMethodDoc apiMethodDoc) { - List headerBeans = new ArrayList<>(); - List headers = apiMethodDoc.getRequestHeaders(); - headers.forEach( - apiReqHeader -> { - HeaderBean headerBean = new HeaderBean(); - headerBean.setKey(apiReqHeader.getName()); - headerBean.setName(apiReqHeader.getName()); - headerBean.setValue(apiReqHeader.getValue()); - headerBean.setDisabled(!apiReqHeader.isRequired()); - headerBean.setDescription(apiReqHeader.getDesc()); - headerBeans.add(headerBean); - } - ); - - return headerBeans; - } - - private static void postManCreate(ApiConfig config, ProjectDocConfigBuilder configBuilder) { - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - List apiDocList = docBuildTemplate.getApiData(configBuilder); - RequestItem requestItem = new RequestItem(); - requestItem.setInfo(new InfoBean(config.getProjectName())); - List itemBeans = new ArrayList<>(); - apiDocList.forEach( - apiDoc -> { - ItemBean itemBean = buildItemBean(apiDoc); - itemBeans.add(itemBean); - } - ); - requestItem.setItem(itemBeans); - String filePath = config.getOutPath(); - filePath = filePath + DocGlobalConstants.POSTMAN_JSON; - String data = JsonUtil.toPrettyJson(requestItem); - FileUtil.nioWriteFile(data, filePath); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ProjectDocConfigBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ProjectDocConfigBuilder.java deleted file mode 100644 index 64dfbad5..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/ProjectDocConfigBuilder.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Random; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.logging.Logger; - -import com.power.common.constants.Charset; -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.HighlightStyle; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiConstant; -import com.power.doc.model.ApiDataDictionary; -import com.power.doc.model.ApiErrorCodeDictionary; -import com.power.doc.model.ApiObjectReplacement; -import com.power.doc.model.BodyAdvice; -import com.power.doc.model.CustomField; -import com.power.doc.model.DocJavaField; -import com.power.doc.model.SourceCodePath; -import com.power.doc.utils.JavaClassUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; -import com.thoughtworks.qdox.directorywalker.DirectoryScanner; -import com.thoughtworks.qdox.directorywalker.SuffixFilter; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.parser.ParseException; - -import static com.power.doc.constants.DocGlobalConstants.DEFAULT_SERVER_URL; - -/** - * @author yu 2019/12/21. - */ -public class ProjectDocConfigBuilder { - - private static final Logger log = Logger.getLogger(ProjectDocConfigBuilder.class.getName()); - - private final JavaProjectBuilder javaProjectBuilder; - - private final Map classFilesMap = new ConcurrentHashMap<>(); - - private final Map> enumClassMap = new ConcurrentHashMap<>(); - - private final Map customRespFieldMap = new ConcurrentHashMap<>(); - - private final Map customReqFieldMap = new ConcurrentHashMap<>(); - - private final Map replaceClassMap = new ConcurrentHashMap<>(); - - private final Map constantsMap = new ConcurrentHashMap<>(); - - private final String serverUrl; - - private final ApiConfig apiConfig; - - - public ProjectDocConfigBuilder(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder) { - if (null == apiConfig) { - throw new NullPointerException("ApiConfig can't be null."); - } - this.apiConfig = apiConfig; - if (Objects.isNull(javaProjectBuilder)) { - javaProjectBuilder = JavaProjectBuilderHelper.create(); - } - - if (StringUtil.isEmpty(apiConfig.getServerUrl())) { - this.serverUrl = DEFAULT_SERVER_URL; - } else { - this.serverUrl = apiConfig.getServerUrl(); - } - this.setHighlightStyle(); - javaProjectBuilder.setEncoding(Charset.DEFAULT_CHARSET); - this.javaProjectBuilder = javaProjectBuilder; - try { - this.loadJavaSource(apiConfig.getSourceCodePaths(), this.javaProjectBuilder); - } catch (Exception e) { - log.warning(e.getMessage()); - } - this.initClassFilesMap(); - this.initCustomResponseFieldsMap(apiConfig); - this.initCustomRequestFieldsMap(apiConfig); - this.initReplaceClassMap(apiConfig); - this.initConstants(apiConfig); - this.initDict(apiConfig); - this.checkBodyAdvice(apiConfig.getRequestBodyAdvice()); - this.checkBodyAdvice(apiConfig.getResponseBodyAdvice()); - } - - private void initDict(ApiConfig apiConfig) { - if (enumClassMap.size() == 0) { - return; - } - List dataDictionaries = apiConfig.getDataDictionaries(); - if (Objects.isNull(dataDictionaries)) { - dataDictionaries = new ArrayList<>(); - } - - for (ApiDataDictionary dataDictionary : dataDictionaries) { - dataDictionary.setEnumImplementSet(getEnumImplementsByInterface(dataDictionary.getEnumClass())); - } - - List errorCodeDictionaries = apiConfig.getErrorCodeDictionaries(); - if (Objects.isNull(errorCodeDictionaries)) { - errorCodeDictionaries = new ArrayList<>(); - } - - for (ApiErrorCodeDictionary errorCodeDictionary : errorCodeDictionaries) { - errorCodeDictionary.setEnumImplementSet(getEnumImplementsByInterface(errorCodeDictionary.getEnumClass())); - } - } - - private Set> getEnumImplementsByInterface(Class enumClass) { - if (!enumClass.isInterface()) { - return Collections.emptySet(); - } - Set> set = new HashSet<>(); - enumClassMap.forEach((k, v) -> { - if (enumClass.isAssignableFrom(v)) { - set.add(v); - } - }); - return set; - } - - public JavaClass getClassByName(String simpleName) { - JavaClass cls = javaProjectBuilder.getClassByName(simpleName); - List fieldList = JavaClassUtil.getFields(cls, 0, new LinkedHashMap<>()); - // handle inner class - if (Objects.isNull(cls.getFields()) || fieldList.isEmpty()) { - cls = classFilesMap.get(simpleName); - } else { - List classList = cls.getNestedClasses(); - for (JavaClass javaClass : classList) { - classFilesMap.put(javaClass.getFullyQualifiedName(), javaClass); - } - } - return cls; - } - - private void loadJavaSource(List paths, JavaProjectBuilder builder) { - if (CollectionUtil.isEmpty(paths)) { - builder.addSourceTree(new File(DocGlobalConstants.PROJECT_CODE_PATH)); - } else { - for (SourceCodePath path : paths) { - if (null == path) { - continue; - } - String strPath = path.getPath(); - if (StringUtil.isNotEmpty(strPath)) { - strPath = strPath.replace("\\", "/"); - loadJavaSource(strPath, builder); - } - } - } - } - - private void loadJavaSource(String strPath, JavaProjectBuilder builder) { - DirectoryScanner scanner = new DirectoryScanner(new File(strPath)); - scanner.addFilter(new SuffixFilter(".java")); - scanner.scan(currentFile -> { - try { - builder.addSource(currentFile); - } catch (ParseException | IOException e) { - log.warning(e.getMessage()); - } - }); - } - - private void initClassFilesMap() { - Collection javaClasses = javaProjectBuilder.getClasses(); - for (JavaClass cls : javaClasses) { - if (cls.isEnum()) { - Class enumClass; - ClassLoader classLoader = apiConfig.getClassLoader(); - try { - if (Objects.isNull(classLoader)) { - enumClass = Class.forName(cls.getFullyQualifiedName()); - } else { - enumClass = classLoader.loadClass(cls.getFullyQualifiedName()); - } - enumClassMap.put(cls.getFullyQualifiedName(), enumClass); - } catch (ClassNotFoundException e) { - continue; - } - } - classFilesMap.put(cls.getFullyQualifiedName(), cls); - } - } - - private void initCustomResponseFieldsMap(ApiConfig config) { - if (CollectionUtil.isNotEmpty(config.getCustomResponseFields())) { - for (CustomField field : config.getCustomResponseFields()) { - CustomField.Key key = CustomField.Key.create(field.getOwnerClassName(), field.getName()); - customRespFieldMap.put(key, field); - } - } - } - - private void initCustomRequestFieldsMap(ApiConfig config) { - if (CollectionUtil.isNotEmpty(config.getCustomRequestFields())) { - for (CustomField field : config.getCustomRequestFields()) { - CustomField.Key key = CustomField.Key.create(field.getOwnerClassName(), field.getName()); - customReqFieldMap.put(key, field); - } - } - } - - private void initReplaceClassMap(ApiConfig config) { - if (CollectionUtil.isNotEmpty(config.getApiObjectReplacements())) { - for (ApiObjectReplacement replace : config.getApiObjectReplacements()) { - replaceClassMap.put(replace.getClassName(), replace.getReplacementClassName()); - } - } - } - - private void initConstants(ApiConfig config) { - List apiConstants; - if (CollectionUtil.isEmpty(config.getApiConstants())) { - apiConstants = new ArrayList<>(); - } else { - apiConstants = config.getApiConstants(); - } - try { - for (ApiConstant apiConstant : apiConstants) { - Class clzz = apiConstant.getConstantsClass(); - if (Objects.isNull(clzz)) { - if (StringUtil.isEmpty(apiConstant.getConstantsClassName())) { - throw new RuntimeException("Enum class name can't be null."); - } - clzz = Class.forName(apiConstant.getConstantsClassName()); - } - constantsMap.putAll(JavaClassUtil.getFinalFieldValue(clzz)); - } - } catch (ClassNotFoundException | IllegalAccessException e) { - e.printStackTrace(); - } - } - - private void checkBodyAdvice(BodyAdvice bodyAdvice) { - if (Objects.nonNull(bodyAdvice) && StringUtil.isNotEmpty(bodyAdvice.getClassName())) { - if (Objects.nonNull(bodyAdvice.getWrapperClass())) { - return; - } - try { - Class.forName(bodyAdvice.getClassName()); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Can't find class " + bodyAdvice.getClassName() + " for ResponseBodyAdvice."); - } - } - } - - private void setHighlightStyle() { - String style = apiConfig.getStyle(); - if (DocGlobalConstants.HIGH_LIGHT_DEFAULT_STYLE.equals(style)) { - // use local css file - apiConfig.setHighlightStyleLink(DocGlobalConstants.HIGH_LIGHT_CSS_DEFAULT); - return; - } - if (HighlightStyle.containsStyle(style)) { - apiConfig.setHighlightStyleLink(String.format(DocGlobalConstants.HIGH_LIGHT_CSS_URL_FORMAT, style)); - return; - } - Random random = new Random(); - if (DocGlobalConstants.HIGH_LIGHT_CSS_RANDOM_LIGHT.equals(style)) { - // Eliminate styles that do not match the template - style = HighlightStyle.randomLight(random); - if (HighlightStyle.containsStyle(style)) { - apiConfig.setStyle(style); - apiConfig.setHighlightStyleLink(String.format(DocGlobalConstants.HIGH_LIGHT_CSS_URL_FORMAT, style)); - } else { - apiConfig.setStyle(null); - } - } else if (DocGlobalConstants.HIGH_LIGHT_CSS_RANDOM_DARK.equals(style)) { - style = HighlightStyle.randomDark(random); - if (DocGlobalConstants.HIGH_LIGHT_DEFAULT_STYLE.equals(style)) { - apiConfig.setHighlightStyleLink(DocGlobalConstants.HIGH_LIGHT_CSS_DEFAULT); - } else { - apiConfig.setHighlightStyleLink(String.format(DocGlobalConstants.HIGH_LIGHT_CSS_URL_FORMAT, style)); - } - apiConfig.setStyle(style); - } else { - // Eliminate styles that do not match the template - apiConfig.setStyle(null); - - } - } - - public JavaProjectBuilder getJavaProjectBuilder() { - return javaProjectBuilder; - } - - - public Map getClassFilesMap() { - return classFilesMap; - } - - public Map getCustomRespFieldMap() { - return customRespFieldMap; - } - - public Map getCustomReqFieldMap() { - return customReqFieldMap; - } - - public String getServerUrl() { - return serverUrl; - } - - public ApiConfig getApiConfig() { - return apiConfig; - } - - - public Map getReplaceClassMap() { - return replaceClassMap; - } - - public Map> getEnumClassMap() { - return enumClassMap; - } - - public Map getConstantsMap() { - return constantsMap; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/TornaBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/TornaBuilder.java deleted file mode 100644 index 83e80a6e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/TornaBuilder.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder; - -import cn.hutool.core.util.BooleanUtil; -import com.power.doc.constants.TornaConstants; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.torna.Apis; -import com.power.doc.model.torna.TornaApi; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.StringUtils; -import com.power.doc.utils.TornaUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import java.util.ArrayList; -import java.util.List; - -import static com.power.doc.constants.TornaConstants.DEFAULT_GROUP_CODE; -import static com.power.doc.utils.TornaUtil.buildApis; -import static com.power.doc.utils.TornaUtil.buildErrorCode; - - -/** - * @author xingzi 2021/2/2 18:05 - **/ -public class TornaBuilder { - - /** - * build controller api,for unit testing - * - * @param config config - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - config.setParamsDataToTree(true); - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, Boolean.TRUE); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - List apiDocList = docBuildTemplate.getApiData(configBuilder); - apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config); - buildTorna(apiDocList, config, javaProjectBuilder); - } - - /** - * build torna Data - * - * @param apiDocs apiData - * @param apiConfig ApiConfig - * @param builder JavaProjectBuilder - */ - public static void buildTorna(List apiDocs, ApiConfig apiConfig, JavaProjectBuilder builder) { - TornaApi tornaApi = new TornaApi(); - tornaApi.setAuthor(apiConfig.getAuthor()); - tornaApi.setIsReplace(BooleanUtil.toInt(apiConfig.getReplace())); - Apis api; - List groupApiList = new ArrayList<>(); - //Convert ApiDoc to Apis - for (ApiDoc groupApi : apiDocs) { - List apisList = new ArrayList<>(); - List childrenApiDocs = groupApi.getChildrenApiDocs(); - for (ApiDoc a : childrenApiDocs) { - api = new Apis(); - api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc()); - api.setItems(buildApis(a.getList(), TornaUtil.setDebugEnv(apiConfig, tornaApi))); - api.setIsFolder(TornaConstants.YES); - api.setAuthor(a.getAuthor()); - api.setOrderIndex(a.getOrder()); - apisList.add(api); - } - api = new Apis(); - api.setName(StringUtils.isBlank(groupApi.getDesc()) ? groupApi.getName() : groupApi.getDesc()); - api.setAuthor(tornaApi.getAuthor()); - api.setOrderIndex(groupApi.getOrder()); - api.setIsFolder(TornaConstants.YES); - api.setItems(apisList); - groupApiList.add(api); - - } - tornaApi.setCommonErrorCodes(buildErrorCode(apiConfig, builder)); - // delete default group when only default group - tornaApi.setApis(groupApiList.size() == 1 && DEFAULT_GROUP_CODE.equals(groupApiList.get(0).getName()) ? groupApiList.get(0).getItems() : groupApiList); - // Push to torna - TornaUtil.pushToTorna(tornaApi, apiConfig, builder); - } -} - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/AbstractOpenApiBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/AbstractOpenApiBuilder.java deleted file mode 100644 index b9beb2e7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/AbstractOpenApiBuilder.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package com.power.doc.builder.openapi; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.DocBuilderTemplate; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.model.*; -import com.power.doc.model.openapi.OpenApiTag; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.OpenApiSchemaUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import static com.power.doc.constants.DocGlobalConstants.*; - - -/** - * @author xingzi - * Date 2022/10/12 18:49 - */ -@SuppressWarnings("all") -public abstract class AbstractOpenApiBuilder { - - private String componentKey; - - public String getComponentKey() { - return componentKey; - } - - public void setComponentKey(String componentKey) { - this.componentKey = componentKey; - } - - abstract String getModuleName(); - - /** - * Create OpenAPI definition - * - * @param apiConfig Configuration of smart-doc - * @param apiDocList List of API DOC - */ - abstract void openApiCreate(ApiConfig apiConfig, List apiDocList); - - /** - * Build request - * - * @param apiConfig Configuration of smart-doc - * @param apiMethodDoc Data of method - * @param apiDoc singe api doc - * @return Map of request urls - */ - abstract Map buildPathUrlsRequest(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, ApiDoc apiDoc); - - /** - * response body - * - * @param apiMethodDoc ApiMethodDoc - */ - abstract Map buildResponsesBody(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc); - - protected static final Map STRING_COMPONENT = new HashMap<>(); - - static { - STRING_COMPONENT.put("type", "string"); - STRING_COMPONENT.put("format", "string"); - } - - /** - * Build openapi paths - * - * @param apiConfig Configuration of smart-doc - * @param apiDocList List of API DOC - * @param tags tags - */ - public Map buildPaths(ApiConfig apiConfig, List apiDocList, Set tags) { - Map pathMap = new HashMap<>(500); - Set methodDocs = DocMapping.METHOD_DOCS; - for (ApiMethodDoc methodDoc : methodDocs) { - String path = methodDoc.getPath(); - Map request = buildPathUrls(apiConfig, methodDoc, methodDoc.getClazzDoc()); - if (!pathMap.containsKey(path)) { - pathMap.put(path, request); - } else { - Map oldRequest = (Map) pathMap.get(path); - oldRequest.putAll(request); - } - } - for (Map.Entry docEntry : DocMapping.TAG_DOC.entrySet()) { - String tag = docEntry.getKey(); - tags.add(OpenApiTag.of(tag, tag)); - } - return pathMap; - } - - /** - * Build path urls - * - * @param apiConfig ApiConfig - * @param apiMethodDoc Method - * @param apiDoc ApiDoc - */ - public Map buildPathUrls(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, ApiDoc apiDoc) { - Map request = new HashMap<>(4); - request.put(apiMethodDoc.getType().toLowerCase(), buildPathUrlsRequest(apiConfig, apiMethodDoc, apiDoc)); - return request; - } - - /** - * Build content for responses and requestBody - * - * @param apiConfig ApiConfig - * @param apiMethodDoc ApiMethodDoc - * @param isRep is response - */ - public Map buildContent(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, boolean isRep) { - Map content = new HashMap<>(8); - String contentType = apiMethodDoc.getContentType(); - if (isRep) { - contentType = "*/*"; - } - content.put(contentType, buildContentBody(apiConfig, apiMethodDoc, isRep)); - return content; - - } - - /** - * Build data of content - * - * @param apiConfig ApiConfig - * @param apiMethodDoc ApiMethodDoc - * @param isRep is response - */ - public Map buildContentBody(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, boolean isRep) { - Map content = new HashMap<>(8); - if (Objects.nonNull(apiMethodDoc.getReturnSchema()) && isRep) { - content.put("schema", apiMethodDoc.getReturnSchema()); - } else if (!isRep && Objects.nonNull(apiMethodDoc.getRequestSchema())) { - content.put("schema", apiMethodDoc.getRequestSchema()); - } else { - content.put("schema", buildBodySchema(apiMethodDoc, isRep)); - } - - if (OPENAPI_2_COMPONENT_KRY.equals(componentKey) && !isRep) { - content.put("name", apiMethodDoc.getName()); - } - if (OPENAPI_3_COMPONENT_KRY.equals(componentKey) && - (!isRep && apiConfig.isRequestExample() || (isRep && apiConfig.isResponseExample()))) { - content.put("examples", buildBodyExample(apiMethodDoc, isRep)); - } - return content; - - } - - /** - * Build schema of Body - * - * @param apiMethodDoc ApiMethodDoc - * @param isRep is response - */ - public Map buildBodySchema(ApiMethodDoc apiMethodDoc, boolean isRep) { - Map schema = new HashMap<>(10); - Map innerScheme = new HashMap<>(10); - String requestRef; - if (apiMethodDoc.getContentType().equals(DocGlobalConstants.URL_CONTENT_TYPE)) { - requestRef = componentKey + OpenApiSchemaUtil.getClassNameFromParams(apiMethodDoc.getQueryParams(), COMPONENT_REQUEST_SUFFIX); - } else { - requestRef = componentKey + OpenApiSchemaUtil.getClassNameFromParams(apiMethodDoc.getRequestParams(), COMPONENT_REQUEST_SUFFIX); - } - //remove special characters in url - String responseRef = componentKey + OpenApiSchemaUtil.getClassNameFromParams(apiMethodDoc.getResponseParams(), COMPONENT_RESPONSE_SUFFIX); - if (!isRep && CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) { - if (apiMethodDoc.getIsRequestArray() == 1) { - schema.put("type", ARRAY); - innerScheme.put("$ref", requestRef); - schema.put("items", innerScheme); - } else { - schema.put("$ref", requestRef); - } - } else { - if (apiMethodDoc.getIsResponseArray() == 1) { - schema.put("type", ARRAY); - innerScheme.put("$ref", responseRef); - schema.put("items", innerScheme); - } else if (CollectionUtil.isNotEmpty(apiMethodDoc.getResponseParams())) { - schema.put("$ref", responseRef); - } - } - return schema; - } - - - /** - * Build body example - * - * @param apiMethodDoc ApiMethodDoc - * @param isRep is response - */ - public static Map buildBodyExample(ApiMethodDoc apiMethodDoc, boolean isRep) { - Map content = new HashMap<>(8); - content.put("json", buildExampleData(apiMethodDoc, isRep)); - return content; - - } - - /** - * Build example data - * - * @param apiMethodDoc ApiMethodDoc - * @param isRep is response - */ - public static Map buildExampleData(ApiMethodDoc apiMethodDoc, boolean isRep) { - Map content = new HashMap<>(8); - content.put("summary", "test data"); - if (!isRep) { - content.put("value", StringUtil.isEmpty( - apiMethodDoc.getRequestExample().getJsonBody()) ? apiMethodDoc.getRequestExample().getExampleBody() : - apiMethodDoc.getRequestExample().getJsonBody()); - } else { - content.put("value", apiMethodDoc.getResponseUsage()); - } - return content; - - } - - /** - * Build request parameters - * - * @param apiMethodDoc API data for the method - */ - abstract List> buildParameters(ApiMethodDoc apiMethodDoc); - - abstract Map getStringParams(ApiParam apiParam, boolean hasItems); - - /** - * If it is a get request or @PathVariable set the request parameters - * - * @param apiParam Parameter information - * @return parameters schema - */ - public Map buildParametersSchema(ApiParam apiParam) { - Map schema = new HashMap<>(10); - String openApiType = DocUtil.javaTypeToOpenApiTypeConvert(apiParam.getType()); - schema.put("type", openApiType); - if ("file".equals(apiParam.getType())) { - schema.put("format", "binary"); - schema.put("type", "string"); - } else if ("object".equals(openApiType)) { - if ("enum".equals(apiParam.getType())) { - schema.put("enum", apiParam.getEnumValues()); - } - } else if (ARRAY.equals(apiParam.getType())) { - if (CollectionUtil.isNotEmpty(apiParam.getEnumValues())) { - schema.put("type", "string"); - schema.put("items", apiParam.getEnumValues()); - } else { - schema.put("type", ARRAY); - Map map = new HashMap<>(4); - map.put("type", "string"); - map.put("format", "string"); - schema.put("items", map); - } - } else { - schema.put("type", apiParam.getType()); - schema.put("format", "integer"); - } - return schema; - } - - /** - * If the header is included, set the request parameters - * - * @param header header - */ - public static Map buildParametersSchema(ApiReqParam header) { - Map schema = new HashMap<>(10); - String openApiType = DocUtil.javaTypeToOpenApiTypeConvert(header.getType()); - schema.put("type", openApiType); - schema.put("format", "int16".equals(header.getType()) ? "int32" : header.getType()); - return schema; - } - - /** - * build response - * - * @param apiMethodDoc ApiMethodDoc - * @return response info - */ - public Map buildResponses(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc) { - Map response = new HashMap<>(10); - response.put("200", buildResponsesBody(apiConfig, apiMethodDoc)); - return response; - } - - /** - * component schema - * - * @param apiDocs List of ApiDoc - */ - abstract public Map buildComponentsSchema(List apiDocs); - - /** - * component schema properties - * - * @param apiParam list of ApiParam - */ - public Map buildProperties(List apiParam, Map component, boolean isResp) { - Map properties = new HashMap<>(); - Map propertiesData = new LinkedHashMap<>(); - List requiredList = new ArrayList<>(); - if (apiParam != null) { - int paramsSize = apiParam.size(); - for (ApiParam param : apiParam) { - if (param.isRequired()) { - requiredList.add(param.getField()); - } - if (param.getType().equals("map") &&StringUtil.isEmpty(param.getClassName())) { - continue; - } - if (param.isQueryParam() || param.isPathParam()) { - continue; - } - String field = param.getField(); - propertiesData.put(field, buildPropertiesData(param, component, isResp)); - } - if (!propertiesData.isEmpty()) { - properties.put("properties", propertiesData); - } - if (!CollectionUtil.isEmpty(requiredList)) { - properties.put("required", requiredList); - } - return properties; - } else { - return new HashMap<>(); - } - - } - - /** - * component schema properties data - * - * @param apiParam ApiParam - */ - private Map buildPropertiesData(ApiParam apiParam, Map component, boolean isResp) { - Map propertiesData = new HashMap<>(); - String openApiType = DocUtil.javaTypeToOpenApiTypeConvert(apiParam.getType()); - //array object file map - propertiesData.put("description", apiParam.getDesc()); - if (StringUtil.isNotEmpty(apiParam.getValue())) { - propertiesData.put("example", StringUtil.removeDoubleQuotes(apiParam.getValue())); - } - - if (!"object".equals(openApiType)) { - propertiesData.put("type", openApiType); - propertiesData.put("format", "int16".equals(apiParam.getType()) ? "int32" : apiParam.getType()); - } - if ("map".equals(apiParam.getType())) { - propertiesData.put("type", "object"); - propertiesData.put("description", apiParam.getDesc() + "(map data)"); - } - if ("array".equals(apiParam.getType())) { - propertiesData.put("type", "array"); - if (CollectionUtil.isNotEmpty(apiParam.getChildren())) { - if (!apiParam.isSelfReferenceLoop()) { - Map arrayRef = new HashMap<>(4); - String suffix = isResp ? COMPONENT_RESPONSE_SUFFIX : COMPONENT_REQUEST_SUFFIX; - String childSchemaName = OpenApiSchemaUtil.getClassNameFromParams(apiParam.getChildren(), suffix); - if (childSchemaName.contains(OpenApiSchemaUtil.NO_BODY_PARAM)) { - propertiesData.put("type", "object"); - propertiesData.put("description", apiParam.getDesc() + "(object)"); - } else { - component.put(childSchemaName, buildProperties(apiParam.getChildren(), component, isResp)); - arrayRef.put("$ref", componentKey + childSchemaName); - propertiesData.put("items", arrayRef); - } - } - } - //基础数据类型 - else { - Map arrayRef = new HashMap<>(4); - arrayRef.put("type", "string"); - propertiesData.put("items", arrayRef); - } - } - if ("file".equals(apiParam.getType())) { - propertiesData.put("type", "string"); - propertiesData.put("format", "binary"); - } - if ("object".equals(apiParam.getType())) { - if (CollectionUtil.isNotEmpty(apiParam.getChildren())) { - propertiesData.put("type", "object"); - propertiesData.put("description", apiParam.getDesc() + "(object)"); - String suffix = isResp ? COMPONENT_RESPONSE_SUFFIX : COMPONENT_REQUEST_SUFFIX; - if (!apiParam.isSelfReferenceLoop()) { - String childSchemaName = OpenApiSchemaUtil.getClassNameFromParams(apiParam.getChildren(), suffix); - if (childSchemaName.contains(OpenApiSchemaUtil.NO_BODY_PARAM)) { - propertiesData.put("type", "object"); - propertiesData.put("description", apiParam.getDesc() + "(object)"); - } else { - component.put(childSchemaName, buildProperties(apiParam.getChildren(), component, isResp)); - propertiesData.put("$ref", componentKey + childSchemaName); - } - } - } else { - propertiesData.put("type", "object"); - propertiesData.put("description", apiParam.getDesc() + "(object)"); - } - } - - return propertiesData; - } - - /** - * Get a list of OpenAPI's document data - * - * @param config Configuration of smart-doc - * @param projectBuilder JavaDocBuilder of QDox - */ - public List getOpenApiDocs(ApiConfig config, JavaProjectBuilder projectBuilder) { - DocBuilderTemplate builderTemplate = new DocBuilderTemplate(); - builderTemplate.checkAndInit(config, false); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, projectBuilder); - config.setParamsDataToTree(true); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - return docBuildTemplate.getApiData(configBuilder); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/OpenApiBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/OpenApiBuilder.java deleted file mode 100644 index 768585d3..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/OpenApiBuilder.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.openapi; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.FileUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.Methods; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.*; -import com.power.doc.model.openapi.OpenApiTag; -import com.power.doc.utils.JsonUtil; -import com.power.doc.utils.OpenApiSchemaUtil; -import com.power.doc.utils.StringUtils; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import java.util.*; -import java.util.stream.Collectors; - -import static com.power.doc.constants.DocGlobalConstants.*; - -/** - * @author xingzi - */ -public class OpenApiBuilder extends AbstractOpenApiBuilder { - - @Override - String getModuleName() { - return OPENAPI_3_COMPONENT_KRY; - } - - private static final OpenApiBuilder INSTANCE = new OpenApiBuilder(); - - /** - * For unit testing - * - * @param config Configuration of smart-doc - */ - public static void buildOpenApi(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildOpenApi(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config Configuration of smart-doc - * @param projectBuilder JavaDocBuilder of QDox - */ - public static void buildOpenApi(ApiConfig config, JavaProjectBuilder projectBuilder) { - List apiDocList = INSTANCE.getOpenApiDocs(config, projectBuilder); - INSTANCE.openApiCreate(config, apiDocList); - } - - /** - * Build OpenApi - * - * @param config Configuration of smart-doc - * @param apiDocList List of API DOC - */ - @Override - public void openApiCreate(ApiConfig config, List apiDocList) { - this.setComponentKey(getModuleName()); - Map json = new HashMap<>(8); - json.put("openapi", "3.0.3"); - json.put("info", buildInfo(config)); - json.put("servers", buildServers(config)); - Set tags = new HashSet<>(); - json.put("tags", tags); - json.put("paths", buildPaths(config, apiDocList, tags)); - json.put("components", buildComponentsSchema(apiDocList)); - - String filePath = config.getOutPath(); - filePath = filePath + DocGlobalConstants.OPEN_API_JSON; - String data = JsonUtil.toPrettyJson(json); - FileUtil.nioWriteFile(data, filePath); - } - - /** - * Build openapi info - * - * @param apiConfig Configuration of smart-doc - */ - private static Map buildInfo(ApiConfig apiConfig) { - Map infoMap = new HashMap<>(8); - infoMap.put("title", apiConfig.getProjectName() == null ? "Project Name is Null." : apiConfig.getProjectName()); - infoMap.put("version", "1.0.0"); - return infoMap; - } - - /** - * Build Servers - * - * @param config Configuration of smart-doc - */ - private static List> buildServers(ApiConfig config) { - List> serverList = new ArrayList<>(); - Map serverMap = new HashMap<>(8); - serverMap.put("url", config.getServerUrl() == null ? "" : config.getServerUrl()); - serverList.add(serverMap); - return serverList; - } - - - /** - * Build request - * - * @param apiConfig Configuration of smart-doc - * @param apiMethodDoc ApiMethodDoc - * @param apiDoc apiDoc - */ - public Map buildPathUrlsRequest(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, ApiDoc apiDoc) { - Map request = new HashMap<>(20); - request.put("summary", apiMethodDoc.getDesc()); - request.put("description", apiMethodDoc.getDetail()); -// String tag = StringUtil.isEmpty(apiDoc.getDesc()) ? OPENAPI_TAG : apiDoc.getDesc(); -// if (StringUtil.isNotEmpty(apiMethodDoc.getGroup())) { -// request.put("tags", new String[]{tag}); -// } else { -// request.put("tags", new String[]{tag}); -// } - request.put("tags", apiMethodDoc.getTagRefs().stream().map(TagDoc::getTag).toArray()); - request.put("requestBody", buildRequestBody(apiConfig, apiMethodDoc)); - request.put("parameters", buildParameters(apiMethodDoc)); - request.put("responses", buildResponses(apiConfig, apiMethodDoc)); - request.put("deprecated", apiMethodDoc.isDeprecated()); - List paths = OpenApiSchemaUtil.getPatternResult("[A-Za-z0-9_{}]*", apiMethodDoc.getPath()); - paths.add(apiMethodDoc.getType()); - String operationId = paths.stream().filter(StringUtils::isNotEmpty).collect(Collectors.joining("-")); - request.put("operationId", operationId); - - return request; - } - - /** - * Build request body - * - * @param apiMethodDoc ApiMethodDoc - */ - private Map buildRequestBody(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc) { - Map requestBody = new HashMap<>(8); - boolean isPost = (apiMethodDoc.getType().equals(Methods.POST.getValue()) - || apiMethodDoc.getType().equals(Methods.PUT.getValue()) || - apiMethodDoc.getType().equals(Methods.PATCH.getValue())); - //add content of post method - if (isPost) { - requestBody.put("content", buildContent(apiConfig, apiMethodDoc, false)); - return requestBody; - } - return null; - } - - - /** - * response body - * - * @param apiMethodDoc ApiMethodDoc - * @return response body - */ - @Override - public Map buildResponsesBody(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc) { - Map responseBody = new HashMap<>(10); - responseBody.put("description", "OK"); - responseBody.put("content", buildContent(apiConfig, apiMethodDoc, true)); - return responseBody; - } - - @Override - List> buildParameters(ApiMethodDoc apiMethodDoc) { - Map parameters; - List> parametersList = new ArrayList<>(); - // Handling path parameters - for (ApiParam apiParam : apiMethodDoc.getPathParams()) { - parameters = getStringParams(apiParam, apiParam.isHasItems()); - parameters.put("in", "path"); - List children = apiParam.getChildren(); - if (CollectionUtil.isEmpty(children)) { - parametersList.add(parameters); - } - } - for (ApiParam apiParam : apiMethodDoc.getQueryParams()) { - if (apiParam.isHasItems()) { - parameters = getStringParams(apiParam, false); - Map arrayMap = new HashMap<>(); - arrayMap.put("type", ARRAY); - arrayMap.put("items", getStringParams(apiParam, apiParam.isHasItems())); - parameters.put("schema", arrayMap); - parametersList.add(parameters); - } else { - parameters = getStringParams(apiParam, false); - List children = apiParam.getChildren(); - if (CollectionUtil.isEmpty(children)) { - parametersList.add(parameters); - } - } - } - //with headers - if (!CollectionUtil.isEmpty(apiMethodDoc.getRequestHeaders())) { - for (ApiReqParam header : apiMethodDoc.getRequestHeaders()) { - parameters = new HashMap<>(20); - parameters.put("name", header.getName()); - parameters.put("description", header.getDesc()); - parameters.put("required", header.isRequired()); - parameters.put("example", header.getValue()); - parameters.put("schema", buildParametersSchema(header)); - parameters.put("in", "header"); - parametersList.add(parameters); - } - } - return parametersList; - } - - @Override - Map getStringParams(ApiParam apiParam, boolean hasItems) { - Map parameters; - parameters = new HashMap<>(20); - if (!hasItems) { - parameters.put("name", apiParam.getField()); - parameters.put("description", apiParam.getDesc()); - parameters.put("required", apiParam.isRequired()); - parameters.put("in", "query"); - parameters.put("schema", buildParametersSchema(apiParam)); - } else { - if (OBJECT.equals(apiParam.getType()) || - (ARRAY.equals(apiParam.getType()) && apiParam.isHasItems())) { - parameters.put("type", "object"); - parameters.put("description", "(complex POJO please use @RequestBody)"); - } else { - String desc = apiParam.getDesc(); - if (desc.contains(PARAM_TYPE_FILE)) { - parameters.put("type", PARAM_TYPE_FILE); - } else if (desc.contains("string")) { - parameters.put("type", "string"); - } else { - parameters.put("type", "integer"); - } - } - parameters.putAll(buildParametersSchema(apiParam)); - } - - return parameters; - } - - @Override - public Map buildComponentsSchema(List apiDocs) { - Map schemas = new HashMap<>(4); - Map component = new HashMap<>(); - component.put("string", STRING_COMPONENT); - apiDocs.forEach( - a -> { - List apiMethodDocs = a.getList(); - apiMethodDocs.forEach( - method -> { - //request components - String requestSchema = OpenApiSchemaUtil.getClassNameFromParams(method.getRequestParams(), COMPONENT_REQUEST_SUFFIX); - List requestParams = method.getRequestParams(); - Map prop = buildProperties(requestParams, component, false); - component.put(requestSchema, prop); - //response components - List responseParams = method.getResponseParams(); - String schemaName = OpenApiSchemaUtil.getClassNameFromParams(method.getResponseParams(), COMPONENT_RESPONSE_SUFFIX); - component.put(schemaName, buildProperties(responseParams, component, true)); - } - ); - } - ); - component.remove(OpenApiSchemaUtil.NO_BODY_PARAM); - schemas.put("schemas", component); - return schemas; - } - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/SwaggerBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/SwaggerBuilder.java deleted file mode 100644 index 320c0d1b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/openapi/SwaggerBuilder.java +++ /dev/null @@ -1,305 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.openapi; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.FileUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.*; -import com.power.doc.model.openapi.OpenApiTag; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JsonUtil; -import com.power.doc.utils.OpenApiSchemaUtil; -import com.power.doc.utils.StringUtils; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import java.util.*; - -import static com.power.doc.constants.DocGlobalConstants.*; - - -/** - * @author xingzi - * Date 2022/9/17 15:16 - */ -@SuppressWarnings("all") -public class SwaggerBuilder extends AbstractOpenApiBuilder { - - private static final SwaggerBuilder INSTANCE = new SwaggerBuilder(); - - /** - * For unit testing - * - * @param config Configuration of smart-doc - */ - public static void buildOpenApi(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildOpenApi(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config Configuration of smart-doc - * @param projectBuilder JavaDocBuilder of QDox - */ - public static void buildOpenApi(ApiConfig config, JavaProjectBuilder projectBuilder) { - List apiDocList = INSTANCE.getOpenApiDocs(config, projectBuilder); - INSTANCE.openApiCreate(config, apiDocList); - } - - @Override - String getModuleName() { - return OPENAPI_2_COMPONENT_KRY; - } - - /** - * Build OpenApi - * - * @param config Configuration of smart-doc - */ - public void openApiCreate(ApiConfig config, List apiDocList) { - this.setComponentKey(getModuleName()); - Map json = new HashMap<>(8); - json.put("swagger", "2.0"); - json.put("info", buildInfo(config)); - json.put("host", config.getServerUrl() == null ? "127.0.0.1" : config.getServerUrl()); - json.put("basePath", StringUtils.isNotBlank(config.getPathPrefix()) ? config.getPathPrefix() : "/"); - Set tags = new HashSet<>(); - json.put("tags", tags); - json.put("paths", buildPaths(config, apiDocList, tags)); - json.put("definitions", buildComponentsSchema(apiDocList)); - - String filePath = config.getOutPath(); - filePath = filePath + DocGlobalConstants.OPEN_API_JSON; - String data = JsonUtil.toPrettyJson(json); - FileUtil.nioWriteFile(data, filePath); - } - - /** - * Build openapi info - * - * @param apiConfig Configuration of smart-doc - */ - private static Map buildInfo(ApiConfig apiConfig) { - Map infoMap = new HashMap<>(8); - infoMap.put("title", apiConfig.getProjectName() == null ? "Project Name is Null." : apiConfig.getProjectName()); - infoMap.put("version", "1.0.0"); - return infoMap; - } - - /** - * Build Servers - * - * @param config Configuration of smart-doc - */ - @Deprecated - private static List> buildTags(ApiConfig config) { - List> tagList = new ArrayList<>(); - Map tagMap; - List groups = config.getGroups(); - for (ApiGroup group : groups) { - tagMap = new HashMap<>(4); - tagMap.put("name", group.getName()); - tagMap.put("description", group.getApis()); - tagList.add(tagMap); - } - return tagList; - } - - /** - * Build request - * - * @param apiConfig Configuration of smart-doc - * @param apiMethodDoc ApiMethodDoc - * @param apiDoc apiDoc - */ - public Map buildPathUrlsRequest(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc, ApiDoc apiDoc) { - Map request = new HashMap<>(20); - request.put("summary", apiMethodDoc.getDesc()); - request.put("description", apiMethodDoc.getDetail()); - String tag = StringUtil.isEmpty(apiDoc.getDesc()) ? OPENAPI_TAG : apiDoc.getDesc(); - if (StringUtil.isNotEmpty(apiMethodDoc.getGroup())) { - request.put("tags", new String[]{tag}); - } else { - request.put("tags", new String[]{tag}); - } - List> parameters = buildParameters(apiMethodDoc); - //requestBody - if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) { - Map parameter = new HashMap<>(); - parameter.put("in", "body"); - parameter.putAll(buildContentBody(apiConfig, apiMethodDoc, false)); - parameters.add(parameter); - } - if (hasFile(parameters)) { - List formData = new ArrayList<>(); - formData.add(FILE_CONTENT_TYPE); - request.put("consumes", formData); - } - request.put("parameters", parameters); - request.put("responses", buildResponses(apiConfig, apiMethodDoc)); - request.put("deprecated", apiMethodDoc.isDeprecated()); - String operationId = apiMethodDoc.getUrl().replace(apiMethodDoc.getServerUrl(), ""); - request.put("operationId", String.join("", OpenApiSchemaUtil.getPatternResult("[A-Za-z0-9{}]*", operationId))); - - return request; - } - - /** - * 是否有文件 - * - * @param parameters - * @return - */ - private boolean hasFile(List> parameters) { - for (Map param : parameters) { - if (SWAGGER_FILE_TAG.equals(param.get("in"))) { - return true; - } - } - return false; - } - - /** - * response body - * - * @param apiMethodDoc ApiMethodDoc - */ - @Override - public Map buildResponsesBody(ApiConfig apiConfig, ApiMethodDoc apiMethodDoc) { - Map responseBody = new HashMap<>(10); - responseBody.put("description", "OK"); - if (CollectionUtil.isNotEmpty(apiMethodDoc.getResponseParams()) || - Objects.nonNull(apiMethodDoc.getReturnSchema()) - ) { - responseBody.putAll(buildContentBody(apiConfig, apiMethodDoc, true)); - } - return responseBody; - } - - @Override - List> buildParameters(ApiMethodDoc apiMethodDoc) { - { - Map parameters; - List> parametersList = new ArrayList<>(); - // Handling path parameters - for (ApiParam apiParam : apiMethodDoc.getPathParams()) { - parameters = getStringParams(apiParam, false); - parameters.put("type", DocUtil.javaTypeToOpenApiTypeConvert(apiParam.getType())); - parameters.put("in", "path"); - parametersList.add(parameters); - } - for (ApiParam apiParam : apiMethodDoc.getQueryParams()) { - if (apiParam.getType().equals(ARRAY) || apiParam.isHasItems()) { - parameters = getStringParams(apiParam, false); - parameters.put("type", ARRAY); - parameters.put("items", getStringParams(apiParam, true)); - parametersList.add(parameters); - } else { - parameters = getStringParams(apiParam, false); - parameters.put("type", DocUtil.javaTypeToOpenApiTypeConvert(apiParam.getType())); - parametersList.add(parameters); - } - } - //with headers - if (!CollectionUtil.isEmpty(apiMethodDoc.getRequestHeaders())) { - for (ApiReqParam header : apiMethodDoc.getRequestHeaders()) { - parameters = new HashMap<>(20); - parameters.put("name", header.getName()); - parameters.put("type", DocUtil.javaTypeToOpenApiTypeConvert(header.getType())); - parameters.put("description", header.getDesc()); - parameters.put("required", header.isRequired()); - parameters.put("example", header.getValue()); - parameters.put("schema", buildParametersSchema(header)); - parameters.put("in", "header"); - parametersList.add(parameters); - } - } - return parametersList; - } - } - - @Override - Map getStringParams(ApiParam apiParam, boolean hasItems) { - Map parameters; - parameters = new HashMap<>(20); - if (!hasItems) { - if ("file".equalsIgnoreCase(apiParam.getType())) { - parameters.put("in", SWAGGER_FILE_TAG); - } else { - parameters.put("in", "query"); - } - parameters.put("name", apiParam.getField()); - parameters.put("description", apiParam.getDesc()); - parameters.put("required", apiParam.isRequired()); - parameters.put("type", apiParam.getType()); - } else { - if (OBJECT.equals(apiParam.getType()) || (ARRAY.equals(apiParam.getType()) && apiParam.isHasItems())) { - parameters.put("type", "object(complex POJO please use @RequestBody)"); - } else { - String desc = apiParam.getDesc(); - if (desc.contains(PARAM_TYPE_FILE)) { - parameters.put("type", PARAM_TYPE_FILE); - } else if (desc.contains("string")) { - parameters.put("type", "string"); - } else { - parameters.put("type", "integer"); - } - } - - } - - - return parameters; - } - - @Override - public Map buildComponentsSchema(List apiDocs) { - Map component = new HashMap<>(); - component.put("string", STRING_COMPONENT); - apiDocs.forEach( - a -> { - List apiMethodDocs = a.getList(); - apiMethodDocs.forEach( - method -> { - //request components - String requestSchema = OpenApiSchemaUtil.getClassNameFromParams(method.getRequestParams(), COMPONENT_REQUEST_SUFFIX); - List requestParams = method.getRequestParams(); - Map prop = buildProperties(requestParams, component, false); - component.put(requestSchema, prop); - //response components - List responseParams = method.getResponseParams(); - String schemaName = OpenApiSchemaUtil.getClassNameFromParams(method.getResponseParams(), COMPONENT_RESPONSE_SUFFIX); - component.put(schemaName, buildProperties(responseParams, component, true)); - } - ); - } - ); - component.remove(OpenApiSchemaUtil.NO_BODY_PARAM); - return component; - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcAdocBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcAdocBuilder.java deleted file mode 100644 index 2629a12d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcAdocBuilder.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import java.util.List; - -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.rpc.RpcApiDoc; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_ADOC; -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_ADOC_TPL; -import static com.power.doc.constants.DocGlobalConstants.RPC_ALL_IN_ONE_ADOC_TPL; -import static com.power.doc.constants.DocGlobalConstants.RPC_API_DOC_ADOC_TPL; - -/** - * @author yu 2020/5/17. - */ -public class RpcAdocBuilder { - - private static final String API_EXTENSION = "RpcApi.adoc"; - - private static final String INDEX_DOC = "rpc-index.adoc"; - - /** - * build adoc - * - * @param config ApiConfig - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - config.setAdoc(true); - RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate(); - List apiDocList = builderTemplate.getRpcApiDoc(config, javaProjectBuilder); - if (config.isAllInOne()) { - String docName = builderTemplate.allInOneDocName(config, INDEX_DOC, ".adoc"); - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, RPC_ALL_IN_ONE_ADOC_TPL, docName); - } else { - builderTemplate.buildApiDoc(apiDocList, config, RPC_API_DOC_ADOC_TPL, API_EXTENSION); - builderTemplate.buildErrorCodeDoc(config, ERROR_CODE_LIST_ADOC_TPL, ERROR_CODE_LIST_ADOC, javaProjectBuilder); - } - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcApiDataBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcApiDataBuilder.java deleted file mode 100644 index 30ac8d5d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcApiDataBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.rpc.RpcApiAllData; -import com.thoughtworks.qdox.JavaProjectBuilder; - -/** - * @author yu 2020/5/24. - */ -public class RpcApiDataBuilder { - - /** - * Get list of ApiDoc - * - * @param config ApiConfig - * @return List of ApiDoc - */ - public static RpcApiAllData getApiData(ApiConfig config) { - config.setShowJavaType(true); - if (StringUtil.isEmpty(config.getFramework())) { - config.setFramework(FrameworkEnum.DUBBO.getFramework()); - } - RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate(); - builderTemplate.checkAndInitForGetApiData(config); - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - builderTemplate.getApiData(config, javaProjectBuilder); - return builderTemplate.getApiData(config, javaProjectBuilder); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcDocBuilderTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcDocBuilderTemplate.java deleted file mode 100644 index 27e2b658..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcDocBuilderTemplate.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.DateTimeUtil; -import com.power.common.util.FileUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.BaseDocBuilderTemplate; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.constants.TemplateVariable; -import com.power.doc.factory.BuildTemplateFactory; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDocDict; -import com.power.doc.model.ApiErrorCode; -import com.power.doc.model.rpc.RpcApiAllData; -import com.power.doc.model.rpc.RpcApiDoc; -import com.power.doc.template.IDocBuildTemplate; -import com.power.doc.utils.BeetlTemplateUtil; -import com.power.doc.utils.DocUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import org.beetl.core.Template; - -import static com.power.doc.constants.DocGlobalConstants.FILE_SEPARATOR; -import static com.power.doc.constants.DocGlobalConstants.RPC_OUT_DIR; - -/** - * @author yu 2020/5/16. - */ -public class RpcDocBuilderTemplate extends BaseDocBuilderTemplate { - - private static final String DEPENDENCY_TITLE = "Add dependency"; - private static final long now = System.currentTimeMillis(); - - public void checkAndInit(ApiConfig config) { - if (StringUtil.isEmpty(config.getFramework())) { - config.setFramework(FrameworkEnum.DUBBO.getFramework()); - } - super.checkAndInit(config, false); - config.setOutPath(config.getOutPath() + FILE_SEPARATOR + RPC_OUT_DIR); - } - - /** - * Generate api documentation for all controllers. - * - * @param apiDocList list of api doc - * @param config api config - * @param template template - * @param fileExtension file extension - */ - public void buildApiDoc(List apiDocList, ApiConfig config, String template, String fileExtension) { - FileUtil.mkdirs(config.getOutPath()); - for (RpcApiDoc rpcDoc : apiDocList) { - Template mapper = BeetlTemplateUtil.getByName(template); - mapper.binding(TemplateVariable.DESC.getVariable(), rpcDoc.getDesc()); - mapper.binding(TemplateVariable.NAME.getVariable(), rpcDoc.getName()); - mapper.binding(TemplateVariable.LIST.getVariable(), rpcDoc.getList()); - mapper.binding(TemplateVariable.AUTHOR.getVariable(), rpcDoc.getAuthor()); - mapper.binding(TemplateVariable.PROTOCOL.getVariable(), rpcDoc.getProtocol()); - mapper.binding(TemplateVariable.VERSION.getVariable(), rpcDoc.getVersion()); - mapper.binding(TemplateVariable.URI.getVariable(), rpcDoc.getUri()); - FileUtil.nioWriteFile(mapper.render(), config.getOutPath() + FILE_SEPARATOR + rpcDoc.getShortName() + fileExtension); - } - } - - /** - * Merge all api doc into one document - * - * @param apiDocList list data of Api doc - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @param template template - * @param outPutFileName output file - */ - public void buildAllInOne(List apiDocList, ApiConfig config, JavaProjectBuilder javaProjectBuilder, String template, - String outPutFileName) { - String outPath = config.getOutPath(); - String strTime = DateTimeUtil.long2Str(now, DateTimeUtil.DATE_FORMAT_SECOND); - String rpcConfig = config.getRpcConsumerConfig(); - String rpcConfigConfigContent = null; - if (Objects.nonNull(rpcConfig)) { - rpcConfigConfigContent = FileUtil.getFileContent(rpcConfig); - } - FileUtil.mkdirs(outPath); - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - Template tpl = BeetlTemplateUtil.getByName(template); - tpl.binding(TemplateVariable.API_DOC_LIST.getVariable(), apiDocList); - tpl.binding(TemplateVariable.ERROR_CODE_LIST.getVariable(), errorCodeList); - tpl.binding(TemplateVariable.VERSION_LIST.getVariable(), config.getRevisionLogs()); - tpl.binding(TemplateVariable.DEPENDENCY_LIST.getVariable(), config.getRpcApiDependencies()); - tpl.binding(TemplateVariable.VERSION.getVariable(), now); - tpl.binding(TemplateVariable.CREATE_TIME.getVariable(), strTime); - tpl.binding(TemplateVariable.PROJECT_NAME.getVariable(), config.getProjectName()); - tpl.binding(TemplateVariable.RPC_CONSUMER_CONFIG.getVariable(), rpcConfigConfigContent); - setDirectoryLanguageVariable(config, tpl); - - List apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder); - tpl.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList); - - int codeIndex = apiDocList.isEmpty() ? 1 : apiDocDictList.size(); - - if (CollectionUtil.isNotEmpty(errorCodeList)) { - tpl.binding(TemplateVariable.ERROR_CODE_ORDER.getVariable(), ++codeIndex); - } - - if (CollectionUtil.isNotEmpty(apiDocDictList)) { - tpl.binding(TemplateVariable.DICT_ORDER.getVariable(), ++codeIndex); - } - - setCssCDN(config, tpl); - FileUtil.nioWriteFile(tpl.render(), outPath + FILE_SEPARATOR + outPutFileName); - } - - /** - * Build search js - * - * @param apiDocList list data of Api doc - * @param config api config - * @param javaProjectBuilder projectBuilder - * @param template template - * @param outPutFileName output file - */ - public void buildSearchJs(List apiDocList, ApiConfig config, JavaProjectBuilder javaProjectBuilder - , String template, String outPutFileName) { - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - Template tpl = BeetlTemplateUtil.getByName(template); - // directory tree - List apiDocs = new ArrayList<>(); - RpcApiDoc apiDoc = new RpcApiDoc(); - apiDoc.setAlias(DEPENDENCY_TITLE); - apiDoc.setOrder(1); - apiDoc.setDesc(DEPENDENCY_TITLE); - apiDoc.setList(new ArrayList<>(0)); - apiDocs.add(apiDoc); - for (RpcApiDoc apiDoc1 : apiDocList) { - apiDoc1.setOrder(apiDocs.size() + 1); - apiDocs.add(apiDoc1); - } - Map titleMap = setDirectoryLanguageVariable(config, tpl); - if (CollectionUtil.isNotEmpty(errorCodeList)) { - RpcApiDoc apiDoc1 = new RpcApiDoc(); - apiDoc1.setOrder(apiDocs.size() + 1); - apiDoc1.setDesc(titleMap.get(TemplateVariable.ERROR_LIST_TITLE.getVariable())); - apiDoc1.setList(new ArrayList<>(0)); - apiDocs.add(apiDoc1); - } - - // set dict list - List apiDocDictList = DocUtil.buildDictionary(config, javaProjectBuilder); - tpl.binding(TemplateVariable.DICT_LIST.getVariable(), apiDocDictList); - tpl.binding(TemplateVariable.DIRECTORY_TREE.getVariable(), apiDocs); - FileUtil.nioWriteFile(tpl.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - } - - /** - * build error_code adoc - * - * @param config api config - * @param template template - * @param outPutFileName output file - * @param javaProjectBuilder javaProjectBuilder - */ - public void buildErrorCodeDoc(ApiConfig config, String template, String outPutFileName, JavaProjectBuilder javaProjectBuilder) { - List errorCodeList = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - Template mapper = BeetlTemplateUtil.getByName(template); - mapper.binding(TemplateVariable.LIST.getVariable(), errorCodeList); - FileUtil.nioWriteFile(mapper.render(), config.getOutPath() + FILE_SEPARATOR + outPutFileName); - } - - /** - * get all api data - * - * @param config ApiConfig - * @param javaProjectBuilder JavaProjectBuilder - * @return ApiAllData - */ - public RpcApiAllData getApiData(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - RpcApiAllData apiAllData = new RpcApiAllData(); - apiAllData.setLanguage(config.getLanguage().getCode()); - apiAllData.setProjectName(config.getProjectName()); - apiAllData.setProjectId(DocUtil.generateId(config.getProjectName())); - apiAllData.setApiDocList(listOfApiData(config, javaProjectBuilder)); - apiAllData.setErrorCodeList(DocUtil.errorCodeDictToList(config, javaProjectBuilder)); - apiAllData.setRevisionLogs(config.getRevisionLogs()); - apiAllData.setApiDocDictList(DocUtil.buildDictionary(config, javaProjectBuilder)); - apiAllData.setDependencyList(config.getRpcApiDependencies()); - return apiAllData; - } - - private List listOfApiData(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - this.checkAndInitForGetApiData(config); - config.setMd5EncryptedHtmlName(true); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - return docBuildTemplate.getApiData(configBuilder); - } - - public List getRpcApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - config.setShowJavaType(true); - // check - checkAndInit(config); - ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder); - IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework()); - return docBuildTemplate.getApiData(configBuilder); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcHtmlBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcHtmlBuilder.java deleted file mode 100644 index 4c61d3af..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcHtmlBuilder.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import java.util.List; - -import com.power.common.util.FileUtil; -import com.power.doc.builder.BaseDocBuilderTemplate; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.rpc.RpcApiDoc; -import com.power.doc.utils.BeetlTemplateUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import org.beetl.core.Template; - -import static com.power.doc.constants.DocGlobalConstants.ALL_IN_ONE_CSS; -import static com.power.doc.constants.DocGlobalConstants.ALL_IN_ONE_CSS_OUT; -import static com.power.doc.constants.DocGlobalConstants.FILE_SEPARATOR; -import static com.power.doc.constants.DocGlobalConstants.FONT_STYLE; -import static com.power.doc.constants.DocGlobalConstants.JQUERY; -import static com.power.doc.constants.DocGlobalConstants.RPC_ALL_IN_ONE_HTML_TPL; -import static com.power.doc.constants.DocGlobalConstants.RPC_ALL_IN_ONE_SEARCH_TPL; - -/** - * @author yu 2020/5/17. - */ -public class RpcHtmlBuilder { - - - /** - * build controller api - * - * @param config config - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate(); - List apiDocList = builderTemplate.getRpcApiDoc(config, javaProjectBuilder); - Template indexCssTemplate = BeetlTemplateUtil.getByName(ALL_IN_ONE_CSS); - FileUtil.nioWriteFile(indexCssTemplate.render(), config.getOutPath() + FILE_SEPARATOR + ALL_IN_ONE_CSS_OUT); - BaseDocBuilderTemplate.copyJarFile("css/" + FONT_STYLE, config.getOutPath() + FILE_SEPARATOR + FONT_STYLE); - BaseDocBuilderTemplate.copyJarFile("js/" + JQUERY, config.getOutPath() + FILE_SEPARATOR + JQUERY); - String INDEX_HTML = "rpc-index.html"; - builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, RPC_ALL_IN_ONE_HTML_TPL, INDEX_HTML); - String SEARCH_JS = "search.js"; - builderTemplate.buildSearchJs(apiDocList, config, javaProjectBuilder, RPC_ALL_IN_ONE_SEARCH_TPL, SEARCH_JS); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcMarkdownBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcMarkdownBuilder.java deleted file mode 100644 index c03beaa8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcMarkdownBuilder.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import java.util.List; - -import com.power.common.util.DateTimeUtil; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.rpc.RpcApiDoc; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_MD; -import static com.power.doc.constants.DocGlobalConstants.ERROR_CODE_LIST_MD_TPL; -import static com.power.doc.constants.DocGlobalConstants.RPC_ALL_IN_ONE_MD_TPL; -import static com.power.doc.constants.DocGlobalConstants.RPC_API_DOC_MD_TPL; - -/** - * @author yu 2020/5/16. - */ -public class RpcMarkdownBuilder { - - private static final String API_EXTENSION = "Api.md"; - - private static final String DATE_FORMAT = "yyyyMMddHHmm"; - - /** - * @param config ApiConfig - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param apiConfig ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig apiConfig, JavaProjectBuilder javaProjectBuilder) { - apiConfig.setAdoc(false); - RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate(); - List apiDocList = builderTemplate.getRpcApiDoc(apiConfig, javaProjectBuilder); - if (apiConfig.isAllInOne()) { - String version = apiConfig.isCoverOld() ? "" : "-V" + DateTimeUtil.long2Str(System.currentTimeMillis(), DATE_FORMAT); - String docName = builderTemplate.allInOneDocName(apiConfig, "rpc-all" + version, ".md"); - builderTemplate.buildAllInOne(apiDocList, apiConfig, javaProjectBuilder, RPC_ALL_IN_ONE_MD_TPL, docName); - } else { - builderTemplate.buildApiDoc(apiDocList, apiConfig, RPC_API_DOC_MD_TPL, API_EXTENSION); - builderTemplate.buildErrorCodeDoc(apiConfig, ERROR_CODE_LIST_MD_TPL, ERROR_CODE_LIST_MD, javaProjectBuilder); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java deleted file mode 100644 index a8be4ba8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/builder/rpc/RpcTornaBuilder.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.builder.rpc; - -import cn.hutool.core.util.BooleanUtil; -import com.power.doc.constants.TornaConstants; -import com.power.doc.helper.JavaProjectBuilderHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.rpc.RpcApiDoc; -import com.power.doc.model.torna.Apis; -import com.power.doc.model.torna.DubboInfo; -import com.power.doc.model.torna.TornaApi; -import com.power.doc.utils.StringUtils; -import com.power.doc.utils.TornaUtil; -import com.thoughtworks.qdox.JavaProjectBuilder; - -import java.util.ArrayList; -import java.util.List; - -import static com.power.doc.utils.TornaUtil.buildDubboApis; -import static com.power.doc.utils.TornaUtil.buildErrorCode; - -/** - * @author xingzi 2021/4/28 16:14 - **/ -public class RpcTornaBuilder { - - /** - * build controller api - * - * @param config config - */ - public static void buildApiDoc(ApiConfig config) { - JavaProjectBuilder javaProjectBuilder = JavaProjectBuilderHelper.create(); - buildApiDoc(config, javaProjectBuilder); - } - - - /** - * Only for smart-doc maven plugin and gradle plugin. - * - * @param config ApiConfig - * @param javaProjectBuilder ProjectDocConfigBuilder - */ - public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - config.setParamsDataToTree(true); - RpcDocBuilderTemplate builderTemplate = new RpcDocBuilderTemplate(); - List apiDocList = builderTemplate.getRpcApiDoc(config, javaProjectBuilder); - buildTorna(apiDocList, config, javaProjectBuilder); - } - - public static void buildTorna(List apiDocs, ApiConfig apiConfig, JavaProjectBuilder builder) { - TornaApi tornaApi = new TornaApi(); - tornaApi.setAuthor(apiConfig.getAuthor()); - tornaApi.setIsReplace(BooleanUtil.toInt(apiConfig.getReplace())); - Apis api; - List apisList = new ArrayList<>(); - // Add data - for (RpcApiDoc a : apiDocs) { - api = new Apis(); - api.setName(StringUtils.isBlank(a.getDesc()) ? a.getName() : a.getDesc()); - TornaUtil.setDebugEnv(apiConfig, tornaApi); - api.setItems(buildDubboApis(a.getList())); - api.setIsFolder(TornaConstants.YES); - api.setAuthor(a.getAuthor()); - api.setDubboInfo(new DubboInfo().builder() - .setAuthor(a.getAuthor()) - .setProtocol(a.getProtocol()) - .setVersion(a.getVersion()) - .setDependency(TornaUtil.buildDependencies(apiConfig.getRpcApiDependencies())) - .setInterfaceName(a.getName())); - api.setOrderIndex(a.getOrder()); - apisList.add(api); - } - tornaApi.setCommonErrorCodes(buildErrorCode(apiConfig, builder)); - tornaApi.setApis(apisList); - // Push to torna - TornaUtil.pushToTorna(tornaApi, apiConfig, builder); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ApiReqParamInTypeEnum.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ApiReqParamInTypeEnum.java deleted file mode 100644 index ebe88fd5..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ApiReqParamInTypeEnum.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.power.doc.constants; - -/** - * @author chen qi 2021-07-15 10:55 - **/ -public enum ApiReqParamInTypeEnum { - - /** - * header param - */ - HEADER("header"), - - /** - * query param - */ - QUERY("query"), - - /** - * path param - */ - PATH("path"); - - private final String value; - - ApiReqParamInTypeEnum(String value) { - this.value = value; - } - - public String getValue() { - return value; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocAnnotationConstants.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocAnnotationConstants.java deleted file mode 100644 index 6639b026..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocAnnotationConstants.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * java annotations - * - * @author yu 2019/9/19. - */ -public interface DocAnnotationConstants { - - String SHORT_CONTROLLER = "Controller"; - - String SHORT_REST_CONTROLLER = "RestController"; - - String SHORT_PATH_VARIABLE = "PathVariable"; - - String SHORT_REQ_PARAM = "RequestParam"; - - String SHORT_JSON_IGNORE = "JsonIgnore"; - - /** - * jackson JsonIgnoreProperties annotation - */ - String SHORT_JSON_IGNORE_PROPERTIES = "JsonIgnoreProperties"; - - String SHORT_JSON_PROPERTY = "JsonProperty"; - - String SHORT_JSON_FIELD = "JSONField"; - - String REQUIRED_PROP = "required"; - - String SERIALIZE_PROP = "serialize"; - String DESERIALIZE_PROP = "deserialize"; - - String NAME_PROP = "name"; - - String VALUE_PROP = "value"; - - String PATH_PROP = "path"; - - String GROUP_PROP = "groups"; - - String DEFAULT_VALUE_PROP = "defaultValue"; - - String REQUEST_MAPPING = "RequestMapping"; - - String DEPRECATED = "Deprecated"; - - String JSON_VALUE = "JsonValue"; - - String JSON_CREATOR = "JsonCreator"; - - String MAX = "max"; - - String SIZE = "size"; - - String LENGTH = "length"; - - String JSON_PROPERTY = "JsonProperty"; - - String JSON_NAMING = "JsonNaming"; - - /** - * Fastjson JSONType annotation - */ - String SHORT_JSON_TYPE = "JSONType"; - - /** - * Fastjson JSONType annotation ignores prop - */ - String IGNORE_PROP = "ignores"; - /** - * Jsr303 param message - */ - String MESSAGE = "message"; - /** - * Jsr303 param regexp - */ - String REGEXP = "regexp"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocGlobalConstants.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocGlobalConstants.java deleted file mode 100644 index 8f35b0d4..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocGlobalConstants.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * @author yu 2018/12/15. - */ -public interface DocGlobalConstants { - - int API_ORDER = 0; - - String FILE_SEPARATOR = System.getProperty("file.separator"); - - String HTML_DOC_OUT_PATH = "src/main/resources/static/doc"; - - String ADOC_OUT_PATH = "src/docs/asciidoc"; - - String PROJECT_CODE_PATH = "src" + FILE_SEPARATOR + "main" + FILE_SEPARATOR + "java"; - - String ABSOLUTE_CODE_PATH = System.getProperty("user.dir") + FILE_SEPARATOR + PROJECT_CODE_PATH; - - String DOC_LANGUAGE = "smart-doc_language"; - - String API_DOC_MD_TPL = "ApiDoc.md"; - - String API_DOC_ADOC_TPL = "ApiDoc.adoc"; - - String ALL_IN_ONE_MD_TPL = "AllInOne.md"; - - String ALL_IN_ONE_ADOC_TPL = "AllInOne.adoc"; - - String ALL_IN_ONE_HTML_TPL = "AllInOne.html"; - - String HTML_API_DOC_TPL = "HtmlApiDoc.html"; - - String ERROR_CODE_LIST_MD_TPL = "ErrorCodeList.md"; - - String ERROR_CODE_LIST_ADOC_TPL = "ErrorCodeList.adoc"; - - String ERROR_CODE_LIST_MD = "ErrorCodeList.md"; - - String ERROR_CODE_LIST_ADOC = "ErrorCodeList.adoc"; - - String DICT_LIST_MD = "Dictionary.md"; - - String DICT_LIST_MD_TPL = "Dictionary.md"; - - String DICT_LIST_ADOC = "Dictionary.adoc"; - - String DICT_LIST_ADOC_TPL = "Dictionary.md"; - - String SEARCH_ALL_JS_TPL = "js/search_all.js.btl"; - - String SEARCH_JS_TPL = "js/search.js.btl"; - - String SEARCH_JS_OUT = "search.js"; - - String DEBUG_JS_TPL = "js/debug.js"; - - String DEBUG_JS_OUT = "debug.js"; - - String DEBUG_PAGE_TPL = "mock.html"; - - String DEBUG_PAGE_ALL_TPL = "debug-all.html"; - - String DEBUG_PAGE_SINGLE_TPL = "html/debug.html"; - - String SINGLE_INDEX_HTML_TPL = "html/index.html"; - - String SINGLE_ERROR_HTML_TPL = "html/error.html"; - - String SINGLE_DICT_HTML_TPL = "html/dict.html"; - - String ALL_IN_ONE_CSS = "css/AllInOne.css"; - - String ALL_IN_ONE_CSS_OUT = "AllInOne.css"; - - String FONT_STYLE = "font.css"; - - String HIGH_LIGHT_JS = "highlight.min.js"; - - String JQUERY = "jquery.min.js"; - - String HIGH_LIGHT_STYLE = "xt256.min.css"; - - String RPC_OUT_DIR = "rpc"; - - String RPC_API_DOC_ADOC_TPL = "dubbo/Dubbo.adoc"; - - String RPC_ALL_IN_ONE_ADOC_TPL = "dubbo/DubboAllInOne.adoc"; - - String RPC_ALL_IN_ONE_HTML_TPL = "dubbo/DubboAllInOne.html"; - - String RPC_ALL_IN_ONE_SEARCH_TPL = "dubbo/DubboSearch.btl"; - - String RPC_DEPENDENCY_MD_TPL = "dubbo/DubboApiDependency.md"; - - String RPC_DEPENDENCY_EMPTY_MD_TPL = "dubbo/DubboApiDependencyEmpty.md"; - - String RPC_API_DOC_MD_TPL = "dubbo/Dubbo.md"; - - String RPC_ALL_IN_ONE_MD_TPL = "dubbo/DubboAllInOne.md"; - - String RPC_INDEX_TPL = "dubbo/DubboIndex.btl"; - - String POSTMAN_JSON = "/postman.json"; - - String OPEN_API_JSON = "/openapi.json"; - - String CONTROLLER_FULLY = "org.springframework.stereotype.Controller"; - - String REST_CONTROLLER_FULLY = "org.springframework.web.bind.annotation.RestController"; - - String GET_MAPPING_FULLY = "org.springframework.web.bind.annotation.GetMapping"; - - String POST_MAPPING_FULLY = "org.springframework.web.bind.annotation.PostMapping"; - - String PUT_MAPPING_FULLY = "org.springframework.web.bind.annotation.PutMapping"; - - String PATCH_MAPPING_FULLY = "org.springframework.web.bind.annotation.PatchMapping"; - - String DELETE_MAPPING_FULLY = "org.springframework.web.bind.annotation.DeleteMapping"; - - String REQUEST_MAPPING_FULLY = "org.springframework.web.bind.annotation.RequestMapping"; - - String REQUEST_BODY_FULLY = "org.springframework.web.bind.annotation.RequestBody"; - - String MODE_AND_VIEW_FULLY = "org.springframework.web.servlet.ModelAndView"; - - String FEIGN_CLIENT_FULLY = "org.springframework.cloud.netflix.feign.FeignClient"; - - String FEIGN_CLIENT = "FeignClient"; - - String MULTIPART_FILE_FULLY = "org.springframework.web.multipart.MultipartFile"; - - String JAVA_OBJECT_FULLY = "java.lang.Object"; - - String JAVA_BOOLEAN = "java.lang.Boolean"; - - String JAVA_STRING_FULLY = "java.lang.String"; - - String JAVA_MAP_FULLY = "java.util.Map"; - - String JAVA_LIST_FULLY = "java.util.List"; - - String JAVA_DEPRECATED_FULLY = "java.lang.Deprecated"; - - String DEFAULT_VERSION = "-"; - - String ERROR_CODE_LIST_CN_TITLE = "错误码列表"; - - String ERROR_CODE_LIST_EN_TITLE = "Error Code List"; - - String DICT_CN_TITLE = "数据字典"; - - String DICT_EN_TITLE = "Data Dictionaries"; - - String FIELD_SPACE = "     "; - - String ANY_OBJECT_MSG = "any object."; - - String NO_COMMENTS_FOUND = "No comments found."; - - String SPRING_WEB_ANNOTATION_PACKAGE = "org.springframework.web.bind.annotation"; - - String FILE_CONTENT_TYPE = "multipart/form-data"; - - - String APPLICATION_JSON = "application/json"; - - String JSON_CONTENT_TYPE = "application/json"; - - String URL_CONTENT_TYPE = "application/x-www-form-urlencoded;charset=UTF-8"; - - String POSTMAN_MODE_FORMDATA = "formdata"; - - String POSTMAN_MODE_RAW = "raw"; - - String SHORT_MULTIPART_FILE_FULLY = "MultipartFile"; - - String DEFAULT_SERVER_URL = ""; - - String SHORT_REQUEST_BODY = "RequestBody"; - - String CURL_REQUEST_TYPE = "curl -X %s %s -i %s"; - - String CURL_REQUEST_TYPE_DATA = "curl -X %s %s -i %s --data '%s'"; - - String CURL_POST_PUT_JSON = "curl -X %s -H 'Content-Type: application/json;charset=UTF-8' %s -i %s --data '%s'"; - - String EMPTY = ""; - - String ENUM = "enum"; - - String DUBBO_SWAGGER = "org.apache.dubbo.rpc.protocol.rest.integration.swagger.DubboSwaggerApiListingResource"; - - String ARRAY = "array"; - String PARAM_TYPE_FILE = "file"; - - String OBJECT = "object"; - - String JSON_PROPERTY_READ_WRITE = "JsonProperty.Access.READ_WRITE"; - - String JSON_PROPERTY_READ_ONLY = "JsonProperty.Access.READ_ONLY"; - - String JSON_PROPERTY_WRITE_ONLY = "JsonProperty.Access.WRITE_ONLY"; - - String CSS_CDN_CH = "https://fonts.googleapis.cnpmjs.org"; - - String CSS_CDN = "https://fonts.googleapis.com"; - - String PATH_DELIMITER = "/"; - - - String HIGH_LIGHT_CSS_URL_FORMAT = "https://cdn.bootcdn.net/ajax/libs/highlight.js/10.3.2/styles/%s.min.css"; - - String HIGH_LIGHT_DEFAULT_STYLE = "xt256"; - - String HIGH_LIGHT_CSS_DEFAULT = "xt256.min.css"; - - String HIGH_LIGHT_CSS_RANDOM_LIGHT = "randomLight"; - - String HIGH_LIGHT_CSS_RANDOM_DARK = "randomDark"; - - String MULTI_URL_SEPARATOR = ";\t"; - - String PARAM_PREFIX = "└─ "; - - String OPENAPI_2_COMPONENT_KRY = "#/definitions/"; - - String OPENAPI_3_COMPONENT_KRY = "#/components/schemas/"; - - String COMPONENT_REQUEST_SUFFIX = "_request"; - - String COMPONENT_RESPONSE_SUFFIX = "_response"; - - String SWAGGER_FILE_TAG = "formData"; - - String OPENAPI_TAG = "default"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocLanguage.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocLanguage.java deleted file mode 100644 index fe3da1ee..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocLanguage.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * language support - * - * @author yu 2019/9/21. - */ -public enum DocLanguage { - ENGLISH("en-US"), - CHINESE("zh-CN"); - - public final String code; - - DocLanguage(String code) { - this.code = code; - } - - public String getCode() { - return this.code; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocTags.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocTags.java deleted file mode 100644 index 2f21e161..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocTags.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * @author yu 2019/9/13. - */ -public interface DocTags { - - /** - * java since tag - */ - String SINCE = "since"; - - /** - * java required tag - */ - String REQUIRED = "required"; - - /** - * java param tag - */ - String PARAM = "param"; - - /** - * java apiNote tag for method detail - */ - String API_NOTE = "apiNote"; - - /** - * java author tag for method author - */ - String AUTHOR = "author"; - - /** - * java version tag - */ - String VERSION = "version"; - - /** - * java deprecated tag - */ - String DEPRECATED = "deprecated"; - - /** - * custom ignore tag - */ - String IGNORE = "ignore"; - - /** - * custom @mock tag - */ - String MOCK = "mock"; - - /** - * custom @dubbo tag - */ - String DUBBO = "dubbo"; - - /** - * custom @api tag - */ - String REST_API = "restApi"; - - /** - * custom @order tag - */ - String ORDER = "order"; - - /** - * custom @group tag - */ - String GROUP = "group"; - - /** - * custom @download tag - */ - String DOWNLOAD = "download"; - - /** - * custom @page tag - */ - String PAGE = "page"; - - /** - * custom @ignoreParams tag - */ - String IGNORE_PARAMS = "ignoreParams"; - - - /** - * Ignore ResponseBodyAdvice - */ - String IGNORE_RESPONSE_BODY_ADVICE = "ignoreResponseBodyAdvice"; - - String IGNORE_REQUEST_BODY_ADVICE = "ignoreRequestBodyAdvice"; - - /** - * response tag @since 2.2.0 - */ - String API_RESPONSE = "response"; - - /** - * custom @tag - */ - String TAG = "tag"; - - /** - * custom @dubboRest tag - */ - String DUBBO_REST = "dubboRest"; - - /** - * tag @see - */ - String SEE = "see"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocValidatorAnnotationEnum.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocValidatorAnnotationEnum.java deleted file mode 100644 index 4c427e84..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DocValidatorAnnotationEnum.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - - -import java.util.ArrayList; -import java.util.List; - -/** - * spring validator annotations - * - * @author yu 2019/9/19. - */ -public enum DocValidatorAnnotationEnum { - - NOT_EMPTY("NotEmpty"), - - NOT_BLANK("NotBlank"), - - NOT_NULL("NotNull"), - - NULL("Null"), - - ASSERT_TRUE("AssertTrue"), - - ASSERT_FALSE("AssertFalse"), - - MIN("Min"), - - MAX("Max"), - - DECIMAL_MIN("DecimalMin"), - - DECIMAL_MAX("DecimalMax"), - - SIZE("Size"), - - DIGITS("Digits"), - - PAST("Past"), - - FUTURE("Future"), - - PATTERN("Pattern"), - - EMAIL("Email"), - - LENGTH("Length"), - - RANGE("Range"), - - VALIDATED("Validated"); - - private final String value; - - DocValidatorAnnotationEnum(String value) { - this.value = value; - } - - public static List listValidatorAnnotations() { - List annotations = new ArrayList<>(); - for (DocValidatorAnnotationEnum annotation : DocValidatorAnnotationEnum.values()) { - annotations.add(annotation.value); - } - return annotations; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DubboAnnotationConstants.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DubboAnnotationConstants.java deleted file mode 100644 index 9206338b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/DubboAnnotationConstants.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * dubbo annotation - * - * @author yu 2020/1/29. - */ -public interface DubboAnnotationConstants { - - String SERVICE = "org.apache.dubbo.config.annotation.Service"; - - /** - * @since dubbo 2.7.7 - */ - String DUBBO_SERVICE = "org.apache.dubbo.config.annotation.DubboService"; - - /** - * support ali dubbo - */ - String ALI_DUBBO_SERVICE = "com.alibaba.dubbo.config.annotation.Service"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/FrameworkEnum.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/FrameworkEnum.java deleted file mode 100644 index 0d7c796f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/FrameworkEnum.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -import com.power.common.util.StringUtil; - -/** - * Smart-doc Supported Framework - * - * @author yu 2021/6/27. - */ -public enum FrameworkEnum { - - /** - * Apache Dubbo - */ - DUBBO("dubbo", "com.power.doc.template.RpcDocBuildTemplate"), - - /** - * Spring Framework - */ - SPRING("spring", "com.power.doc.template.SpringBootDocBuildTemplate"), - - /** - * Solon - */ - SOLON("solon", "com.power.doc.template.SolonDocBuildTemplate"), - - /** - * JAX-RS - */ - JAX_RS("JAX-RS", "com.power.doc.template.JaxrsDocBuildTemplate"); - - /** - * Framework name - */ - private final String framework; - - /** - * Framework IDocBuildTemplate implement - */ - private final String className; - - - FrameworkEnum(String framework, String className) { - this.framework = framework; - this.className = className; - } - - public static String getClassNameByFramework(String framework) { - String className = ""; - if (StringUtil.isEmpty(framework)) { - return className; - } - for (FrameworkEnum frameworkEnum : FrameworkEnum.values()) { - if (frameworkEnum.framework.equalsIgnoreCase(framework)) { - className = frameworkEnum.className; - break; - } - } - return className; - } - - - public String getFramework() { - return framework; - } - - public String getClassName() { - return className; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/HighlightStyle.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/HighlightStyle.java deleted file mode 100644 index 655a0919..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/HighlightStyle.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import com.power.common.util.StringUtil; - -/** - * @author jitmit 2020/11/16 - */ -public class HighlightStyle { - - public static final String DEFAULT_STYLE = "github"; - - private static final List DARK_STYLE; - - private static final List LIGHT_STYLE; - - /** - * key is style,value is color - */ - private static final Map background = new HashMap<>(); - - static { - LIGHT_STYLE = Arrays.asList( - DEFAULT_STYLE, - "a11y-light", - "arduino-light", - "ascetic", - "atelier-cave-light", - "atelier-dune-light", - "atelier-estuary-light", - "atelier-forest-light", - "atelier-heath-light", - "atelier-lakeside-light", - "atelier-plateau-light", - "atelier-savanna-light", - "atelier-seaside-light", - "atelier-sulphurpool-light", - "atom-one-light", - "color-brewer", - "docco", - "github-gist", - "googlecode", - "grayscale", - "gruvbox-light", - "idea", - "isbl-editor-light", - "kimbie.light", - "lightfair", - "magula", - "mono-blue", - "nnfx", - "paraiso-light", - "purebasic", - "qtcreator_light", - "routeros", - "school-book", - "solarized-light", - "tomorrow", - "vs", - "xcode" - ); - - } - - static { - DARK_STYLE = Arrays.asList( - "a11y-dark", - "agate", - "an-old-hope", - "androidstudio", - "arta", - "atelier-cave-dark", - "atelier-dune-dark", - "atelier-estuary-dark", - "atelier-forest-dark", - "atelier-heath-dark", - "atelier-lakeside-dark", - "atelier-plateau-dark", - "atelier-savanna-dark", - "atelier-seaside-dark", - "atelier-sulphurpool-dark", - "atom-one-dark-reasonable", - "atom-one-dark", - "brown-paper", - "codepen-embed", - "darcula", - "dark", - "default", - "dracula", - "far", - "foundation", - "gml", - "gradient-dark", - "gruvbox-dark", - "hopscotch", - "hybrid", - "ir-black", - "isbl-editor-dark", - "kimbie.dark", - "lioshi", - "monokai", - "monokai-sublime", - "night-owl", - "nnfx-dark", - "nord", - "obsidian", - "ocean", - "paraiso-dark", - "pojoaque", - "qtcreator_dark", - "railscasts", - "rainbow", - "shades-of-purple", - "solarized-dark", - "srcery", "sunburst", - "tomorrow-night", - "tomorrow-night-blue", - "tomorrow-night-bright", - "tomorrow-night-eighties", - "vs2015", - "xt256", - "zenburn" - ); - } - - static { - background.put("a11y-dark", "#2b2b2b"); - background.put("agate", "#333"); - background.put("androidstudio", "#282b2e"); - background.put("atom-one-light", "#fafafa"); - background.put("an-old-hope", "#1c1d21"); - background.put("arta", "#222"); - background.put("atelier-cave-dark", "#19171c"); - background.put("atelier-cave-light", "#efecf4"); - background.put("atelier-dune-dark", "#20201d"); - background.put("atelier-dune-light", "#fefbec"); - background.put("atelier-estuary-dark", "#22221b"); - background.put("atelier-estuary-light", "#f4f3ec"); - background.put("atelier-forest-dark", "#1b1918"); - background.put("atelier-forest-light", "#f1efee"); - background.put("atelier-heath-dark", "#1b181b"); - background.put("atelier-heath-light", "#f7f3f7"); - background.put("atelier-lakeside-dark", "#161b1d"); - background.put("atelier-lakeside-light", "#ebf8ff"); - background.put("atelier-plateau-dark", "#1b1818"); - background.put("atelier-plateau-light", "#f4ecec"); - background.put("atelier-savanna-dark", "#171c19"); - background.put("atelier-savanna-light", "#ecf4ee"); - background.put("atelier-seaside-dark", "#131513"); - background.put("atelier-seaside-light", "#f4fbf4"); - background.put("atelier-sulphurpool-dark", "#202746"); - background.put("atelier-sulphurpool-light", "#f5f7ff"); - background.put("atom-one-dark", "#282c34"); - background.put("atom-one-dark-reasonable", "#282c34"); - background.put("codepen-embed", "#222"); - background.put("darcula", "#2b2b2b"); - background.put("dark", "#444"); - background.put("default", "#F0F0F0"); - background.put("docco", "#f8f8ff"); - background.put("dracula", "#282a36"); - background.put("far", "#000080"); - background.put("foundation", "#eee"); - background.put("github", "#f8f8f8"); - background.put("gml", "#222222"); - background.put("gradient-dark", "linear-gradient(166deg, rgba(80,31,122,1) 0%, rgba(40,32,179,1) 80%)"); - background.put("gruvbox-dark", "#282828"); - background.put("gruvbox-light", "#fbf1c7"); - background.put("hopscotch", "#322931"); - background.put("hybrid", "#1d1f21"); - background.put("ir-black", "#000"); - background.put("isbl-editor-dark", "#404040"); - background.put("kimbie.dark", "#221a0f"); - background.put("kimbie.light", "#fbebd4"); - background.put("lioshi", "#303030"); - background.put("magula", "#f4f4f4"); - background.put("mono-blue", "#eaeef3"); - background.put("monokai", "#272822"); - background.put("monokai-sublime", "#23241f"); - background.put("night-owl", "#011627"); - background.put("nnfx-dark", "#333"); - background.put("nord", "#2E3440"); - background.put("obsidian", "#282b2e"); - background.put("ocean", "#2b303b"); - background.put("paraiso-dark", "#2f1e2e"); - background.put("paraiso-light", "#e7e9db"); - background.put("purebasic", "#FFFFDF"); - background.put("qtcreator_dark", "#000000"); - background.put("railscasts", "#232323"); - background.put("rainbow", "#474949"); - background.put("routeros", "#f0f0f0"); - - background.put("shades-of-purple", "#2d2b57"); - background.put("solarized-dark", "#002b36"); - background.put("solarized-light", "#fdf6e3"); - background.put("srcery", "#1C1B19"); - background.put("sunburst", "#000"); - background.put("tomorrow-night", "#1d1f21"); - background.put("tomorrow-night-blue", "#002451"); - background.put("tomorrow-night-bright", "black"); - background.put("tomorrow-night-eighties", "#2d2d2d"); - background.put("xt256", "#000"); - background.put("vs2015", "#1E1E1E"); - background.put("zenburn", "#3f3f3f"); - } - - - /** - * Randomly select a light style - * - * @param random Random - * @return String of random - */ - public static String randomLight(Random random) { - return LIGHT_STYLE.get(random.nextInt(LIGHT_STYLE.size())); - } - - /** - * Randomly select a dark style - * - * @param random Random - * @return String of random - */ - public static String randomDark(Random random) { - return DARK_STYLE.get(random.nextInt(DARK_STYLE.size())); - } - - /** - * Randomly select a style - * - * @param random Random - * @return String of random - */ - public static String randomAll(Random random) { - if (random.nextBoolean()) { - return randomLight(random); - } else { - return randomDark(random); - } - } - - public static String getBackgroundColor(String style) { - String color = background.get(style); - if (StringUtil.isNotEmpty(color)) { - return color; - } - return "#f7f7f8"; - } - - /** - * Does the highlight style exist? - * - * @param style Highlight style - * @return boolean - */ - public static boolean containsStyle(String style) { - return background.containsKey(style); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JAXRSAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JAXRSAnnotations.java deleted file mode 100644 index 9d404c0f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JAXRSAnnotations.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.power.doc.constants; - -/** - * JAX-RS Annotations - * - * @author Zxq - * @see JakartaJaxrsAnnotations - * @deprecated Java EE has been renamed to Jakarta EE, an upgrade is recommended. - */ -@Deprecated -public final class JAXRSAnnotations { - - /** - * JAX-RS@DefaultValue - */ - public static final String JAX_DEFAULT_VALUE_FULLY = "javax.ws.rs.DefaultValue"; - /** - * JAX-RS@HeaderParam - */ - public static final String JAX_HEADER_PARAM_FULLY = "javax.ws.rs.HeaderParam"; - /** - * JAX-RS@PathParam - */ - public static final String JAX_PATH_PARAM_FULLY = "javax.ws.rs.PathParam"; - /** - * JAX-RS@PATH - */ - public static final String JAX_PATH_FULLY = "javax.ws.rs.Path"; - /** - * JAX-RS@Produces - */ - public static final String JAX_PRODUCES_FULLY = "javax.ws.rs.Produces"; - /** - * JAX-RS@Consumes - */ - public static final String JAX_CONSUMES_FULLY = "javax.ws.rs.Consumes"; - /** - * JAX-RS@GET - */ - public static final String JAX_GET_FULLY = "javax.ws.rs.GET"; - /** - * JAX-RS@POST - */ - public static final String JAX_POST_FULLY = "javax.ws.rs.POST"; - /** - * JAX-RS@PUT - */ - public static final String JAX_PUT_FULLY = "javax.ws.rs.PUT"; - /** - * JAX-RS@DELETE - */ - public static final String JAXB_DELETE_FULLY = "javax.ws.rs.DELETE"; - /** - * JAX-RS@PATCH - */ - public static final String JAXB_PATCH_FULLY = "javax.ws.rs.PATCH"; - /** - * JAX-RS@HEAD - */ - public static final String JAXB_HEAD_FULLY = "javax.ws.rs.HEAD"; - - private JAXRSAnnotations() { - throw new IllegalStateException("Utility class"); - } - -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JakartaJaxrsAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JakartaJaxrsAnnotations.java deleted file mode 100644 index de10d723..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/JakartaJaxrsAnnotations.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.power.doc.constants; - -/** - * Java EE has been renamed Jakarta EE, this class is an upgraded replacement for {@link JAXRSAnnotations} - *

- * JAX-RS Annotations - * - * @author youngledo - */ -public final class JakartaJaxrsAnnotations { - - /** - * JAX-RS@DefaultValue - */ - public static final String JAX_DEFAULT_VALUE_FULLY = "jakarta.ws.rs.DefaultValue"; - - public static final String JAX_DEFAULT_VALUE = "DefaultValue"; - /** - * JAX-RS@HeaderParam - */ - public static final String JAX_HEADER_PARAM_FULLY = "jakarta.ws.rs.HeaderParam"; - - public static final String JAX_HEADER_PARAM = "HeaderParam"; - /** - * JAX-RS@PathParam - */ - public static final String JAX_PATH_PARAM_FULLY = "jakarta.ws.rs.PathParam"; - - public static final String JAX_PATH_PARAM = "PathParam"; - /** - * JAX-RS@PATH - */ - public static final String JAX_PATH_FULLY = "jakarta.ws.rs.Path"; - public static final String JAX_PATH = "Path"; - /** - * JAX-RS@Produces - */ - public static final String JAX_PRODUCES_FULLY = "jakarta.ws.rs.Produces"; - public static final String JAX_PRODUCES = "Produces"; - /** - * JAX-RS@Consumes - */ - public static final String JAX_CONSUMES_FULLY = "jakarta.ws.rs.Consumes"; - public static final String JAX_CONSUMES = "Consumes"; - /** - * JAX-RS@GET - */ - public static final String GET = "GET"; - /** - * JAX-RS@POST - */ - public static final String POST = "POST"; - /** - * JAX-RS@PUT - */ - public static final String PUT = "PUT"; - /** - * JAX-RS@DELETE - */ - public static final String DELETE = "DELETE"; - /** - * JAX-RS@GET - */ - public static final String JAX_GET_FULLY = "jakarta.ws.rs.GET"; - /** - * JAX-RS@POST - */ - public static final String JAX_POST_FULLY = "jakarta.ws.rs.POST"; - /** - * JAX-RS@PUT - */ - public static final String JAX_PUT_FULLY = "jakarta.ws.rs.PUT"; - /** - * JAX-RS@DELETE - */ - public static final String JAXB_DELETE_FULLY = "jakarta.ws.rs.DELETE"; - /** - * JAX-RS@RestPath - */ - public static final String JAXB_REST_PATH_FULLY = "org.jboss.resteasy.reactive.RestPath"; - /** - * JAX-RS@PATCH - */ - public static final String JAX_PATCH_FULLY = "jakarta.ws.rs.PATCH"; - /** - * JAX-RS@HEAD - */ - public static final String JAX_HEAD_FULLY = "jakarta.ws.rs.HEAD"; - - private JakartaJaxrsAnnotations() { - throw new IllegalStateException("Utility class"); - } - -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/MediaType.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/MediaType.java deleted file mode 100644 index 1b8429db..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/MediaType.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2002-2022 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.power.doc.constants; - -import java.io.Serializable; -import java.util.Arrays; -import java.util.Map; -import java.util.stream.Collectors; - -/** - * copied from springframework
- * as defined in the HTTP specification. - * - * @author Arjen Poutsma - * @author Juergen Hoeller - * @author Rossen Stoyanchev - * @author Sebastien Deleuze - * @author Kazuki Shimizu - * @author Sam Brannen - * @see - * HTTP 1.1: Semantics and Content, section 3.1.1.1 - * @since 3.0 - */ -public class MediaType implements Serializable { - - public static final String ALL_VALUE = "*/*"; - - public static final String APPLICATION_ATOM_XML_VALUE = "application/atom+xml"; - - public static final String APPLICATION_CBOR_VALUE = "application/cbor"; - - public static final String APPLICATION_FORM_URLENCODED_VALUE = "application/x-www-form-urlencoded"; - - public static final String APPLICATION_GRAPHQL_VALUE = "application/graphql+json"; - - public static final String APPLICATION_JSON_VALUE = "application/json"; - - /** - * Add for JAX-RS - */ - public static final String APPLICATION_JSON = "application/json"; - - public static final String APPLICATION_OCTET_STREAM_VALUE = "application/octet-stream"; - - public static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; - - public static final String APPLICATION_PDF_VALUE = "application/pdf"; - - public static final String APPLICATION_PROBLEM_JSON_VALUE = "application/problem+json"; - - public static final String APPLICATION_PROBLEM_XML_VALUE = "application/problem+xml"; - - public static final String APPLICATION_RSS_XML_VALUE = "application/rss+xml"; - - public static final String APPLICATION_NDJSON_VALUE = "application/x-ndjson"; - - public static final String APPLICATION_XHTML_XML_VALUE = "application/xhtml+xml"; - - public static final String APPLICATION_XML_VALUE = "application/xml"; - - public static final String IMAGE_GIF_VALUE = "image/gif"; - - public static final String IMAGE_JPEG_VALUE = "image/jpeg"; - - public static final String IMAGE_PNG_VALUE = "image/png"; - - public static final String MULTIPART_FORM_DATA_VALUE = "multipart/form-data"; - - public static final String MULTIPART_FORM_DATA = "multipart/form-data"; - - public static final String MULTIPART_MIXED_VALUE = "multipart/mixed"; - - public static final String MULTIPART_RELATED_VALUE = "multipart/related"; - - public static final String TEXT_EVENT_STREAM_VALUE = "text/event-stream"; - - public static final String TEXT_HTML_VALUE = "text/html"; - - public static final String TEXT_HTML = "text/html"; - public static final String TEXT_MARKDOWN_VALUE = "text/markdown"; - - public static final String TEXT_PLAIN_VALUE = "text/plain"; - - public static final String TEXT_PLAIN = "text/plain"; - - public static final String TEXT_XML_VALUE = "text/xml"; - - private static final long serialVersionUID = 2069937152339670231L; - - private static final Map fieldMap; - - static { - fieldMap = Arrays.stream(MediaType.class.getDeclaredFields()) - .filter(it -> it.getType().equals(String.class)) - .map(it -> { - try { - return new String[]{it.getName(), String.valueOf(it.get(null))}; - } catch (IllegalAccessException e) { - throw new RuntimeException(e); - } - }).collect(Collectors.toMap(it -> it[0], it -> it[1])); - } - - public static String valueOf(String name) { - // if not springframework MediaType constant, return original value - if (!name.contains("MediaType.")) return name.replace("\"", ""); - String[] split = name.replace("[", "").replace("]", "").split(","); - return Arrays.stream(split) - .map(it -> it.replace("MediaType.", "").trim()) - .distinct() - .map(fieldMap::get) - .collect(Collectors.joining(";")); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/Methods.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/Methods.java deleted file mode 100644 index 8540a0b3..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/Methods.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * http methods - * - * @author yu 2019/11/21. - */ -public enum Methods { - POST("POST"), - GET("GET"), - PUT("PUT"), - PATCH("PATCH"), - DELETE("DELETE"), - OPTIONS("OPTIONS"); - - private String value; - - Methods(String value) { - this.value = value; - } - - public String getValue() { - return value; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonAnnotations.java deleted file mode 100644 index 1a6b76e8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonAnnotations.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.power.doc.constants; - -/** - * @author noear 2022/2/19 created - */ -public interface SolonAnnotations { - - String REQUEST_MAPPING = "Mapping"; - String REQUEST_MAPPING_FULLY = "org.noear.solon.annotation.Mapping"; - - String GET_MAPPING = "Get"; - String GET_MAPPING_FULLY = "org.noear.solon.annotation.Get"; - - String POST_MAPPING = "Post"; - String POST_MAPPING_FULLY = "org.noear.solon.annotation.Post"; - String PUT_MAPPING = "Put"; - String PUT_MAPPING_FULLY = "org.noear.solon.annotation.Put"; - String PATCH_MAPPING = "Patch"; - String PATCH_MAPPING_FULLY = "org.noear.solon.annotation.Patch"; - String DELETE_MAPPING = "Delete"; - String DELETE_MAPPING_FULLY = "org.noear.solon.annotation.Delete"; - - String REQUEST_PARAM = "Param"; - String REQUEST_PARAM_FULL = "org.noear.solon.annotation.Param"; - - String PATH_VAR = "PathVar"; - String PATH_VAR_FULL = "org.noear.solon.annotation.PathVar"; - - String REQUEST_HERDER = "Header"; - String REQUEST_HERDER_FULL = "org.noear.solon.annotation.Header"; - - String REQUEST_BODY = "Body"; - String REQUEST_BODY_FULLY = "org.noear.solon.annotation.Body"; - - String CONTROLLER = "Controller"; - String CONTROLLER_FULL = "org.noear.solon.annotation.Controller"; - - String COMPONENT = "Component"; - String COMPONENT_FULL = "org.noear.solon.annotation.Component"; - - String REMOTING = "Remoting"; - String REMOTING_FULL = "org.noear.solon.annotation.Remoting"; - - String MODE_AND_VIEW_FULLY = "org.noear.solon.core.handle.ModelAndView"; - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonRequestAnnotationsEnum.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonRequestAnnotationsEnum.java deleted file mode 100644 index b60adafd..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SolonRequestAnnotationsEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author yu 2019/12/20. - */ -public enum SolonRequestAnnotationsEnum { - - PATH_VAR("PathVar"), - PATH_VAR_FULLY("org.noear.solon.annotation.PathVar"), - REQ_PARAM("Param"), - REQ_PARAM_FULLY("org.noear.solon.annotation.Param"), - REQUEST_BODY("Body"), - REQUEST_BODY_FULLY("org.noear.solon.annotation.Body"), - REQUEST_HERDER("Header"), - REQUEST_HERDER_FULLY("org.noear.solon.annotation.Header"), - ; - private final String value; - - SolonRequestAnnotationsEnum(String value) { - this.value = value; - } - - public static List listMvcRequestAnnotations() { - List annotations = new ArrayList<>(); - for (SolonRequestAnnotationsEnum annotation : SolonRequestAnnotationsEnum.values()) { - annotations.add(annotation.value); - } - return annotations; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcAnnotations.java deleted file mode 100644 index 285a6007..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcAnnotations.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * @author yu 2019/12/21. - */ -public interface SpringMvcAnnotations { - - String REQUEST_MAPPING = "RequestMapping"; - - String GET_MAPPING = "GetMapping"; - - String POST_MAPPING = "PostMapping"; - - String PUT_MAPPING = "PutMapping"; - - String PATCH_MAPPING = "PatchMapping"; - - String DELETE_MAPPING = "DeleteMapping"; - - String REQUEST_HERDER = "RequestHeader"; - - String REQUEST_PARAM = "RequestParam"; - - String REQUEST_BODY = "RequestBody"; - - String CONTROLLER = "Controller"; - - String REST_CONTROLLER = "RestController"; - - String PATH_VARIABLE = "PathVariable"; - - String SESSION_ATTRIBUTE = "SessionAttribute"; - - String REQUEST_ATTRIBUTE = "RequestAttribute"; - - String REQUEST_BODY_FULLY = "org.springframework.web.bind.annotation.RequestBody"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcRequestAnnotationsEnum.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcRequestAnnotationsEnum.java deleted file mode 100644 index 0facaee6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/SpringMvcRequestAnnotationsEnum.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author yu 2019/12/20. - */ -public enum SpringMvcRequestAnnotationsEnum { - - PATH_VARIABLE("PathVariable"), - PATH_VARIABLE_FULLY("org.springframework.web.bind.annotation.PathVariable"), - REQ_PARAM("RequestParam"), - REQ_PARAM_FULLY("org.springframework.web.bind.annotation.RequestParam"), - REQUEST_BODY("RequestBody"), - REQUEST_BODY_FULLY("org.springframework.web.bind.annotation.RequestBody"), - REQUEST_HERDER("RequestHeader"), - REQUEST_HERDER_FULLY("org.springframework.web.bind.annotation.RequestHeader"), - ; - private final String value; - - SpringMvcRequestAnnotationsEnum(String value) { - this.value = value; - } - - public static List listSpringMvcRequestAnnotations() { - List annotations = new ArrayList<>(); - for (SpringMvcRequestAnnotationsEnum annotation : SpringMvcRequestAnnotationsEnum.values()) { - annotations.add(annotation.value); - } - return annotations; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TemplateVariable.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TemplateVariable.java deleted file mode 100644 index 170167f8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TemplateVariable.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * @author yu 2019/9/21. - */ -public enum TemplateVariable { - DESC("desc"), - NAME("name"), - LIST("list"), - API_DOC_LIST("apiDocList"), - API_DOC_LIST_ONLY_HAS_DEFAULT_GROUP("apiDocListOnlyHasDefaultGroup"), - ERROR_CODE_LIST("errorCodeList"), - ERROR_CODE_ORDER("errorCodeListOrder"), - VERSION_LIST("revisionLogList"), - DEPENDENCY_LIST("dependencyList"), - HOME_PAGE("homePage"), - HTML("html"), - TITLE("title"), - STYLE("style"), - BACKGROUND("background"), - ERROR_LIST_TITLE("errorListTitle"), - CREATE_TIME("createTime"), - PROJECT_NAME("projectName"), - DICT_LIST("dictList"), - DICT_LIST_TITLE("dictListTitle"), - DICT_ORDER("dictListOrder"), - VERSION("version"), - PROTOCOL("protocol"), - AUTHOR("author"), - URI("uri"), - RPC_CONSUMER_CONFIG("consumerConfigExample"), - REQUEST_EXAMPLE("isRequestExample"), - RESPONSE_EXAMPLE("isResponseExample"), - DISPLAY_REQUEST_PARAMS("displayRequestParams"), - DISPLAY_RESPONSE_PARAMS("displayResponseParams"), - RESPONSE_LIST("respList"), - ORDER("order"), - INDEX_ALIAS("alias"), - DIRECTORY_TREE("directoryTree"), - HIGH_LIGHT_CSS_LINK("highlightCssLink"), - CSS_CND("css_cdn"); - - private String variable; - - TemplateVariable(String variable) { - this.variable = variable; - } - - public String getVariable() { - return this.variable; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TornaConstants.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TornaConstants.java deleted file mode 100644 index f78b6c8b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/TornaConstants.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.power.common.util.DateTimeUtil; -import com.power.doc.model.ApiConfig; -import com.power.doc.utils.StringUtils; - -import java.io.IOException; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.util.*; - -/** - * @author xingzi 2020/2/2 - */ -public class TornaConstants { - - - public static final String ID = "id"; - public static final String CODE = "code"; - public static final String MESSAGE = "msg"; - public static final String DATA = "data"; - public static final String SUCCESS_CODE = "0"; - - public static final String DEFAULT_GROUP_CODE = "default"; - - - public static final String YES = "1"; - public static final String NO = "0"; - public static final String ARRAY = "array"; - - public static final String CATEGORY_CREATE = "doc.category.create"; - public static final String PUSH = "doc.push"; - - public static final String ENUM_PUSH = "enum.batch.push"; - /** - * torna文件数组类型 - */ - public static final String PARAM_TYPE_FILE_ARRAY = "file[]"; - - public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); - - - /** - * build torna params - * - * @param name interface name - * @param data json - * @param config ApiConfig - * @return Map - */ - public static Map buildParams(String name, String data, ApiConfig config) { - Map param = new HashMap<>(8); - try { - if (StringUtils.isNotBlank(data)) { - data = URLEncoder.encode(data, "utf-8"); - } - // Public request parameters for pushing documents to Torna - param.put("name", name); - param.put("app_key", config.getAppKey()); - param.put("data", data); - param.put("timestamp", DateTimeUtil.nowStrTime(DateTimeUtil.DATE_FORMAT_SECOND)); - param.put("version", "1.0"); - param.put("access_token", config.getAppToken()); - String sign = buildSign(param, config.getSecret()); - param.put("sign", sign); - return param; - } catch (IOException e) { - e.printStackTrace(); - } - return param; - } - - /** - * build sign - * - * @param paramsMap param - * @param secret secret - * @return String - */ - public static String buildSign(Map paramsMap, String secret) { - Set keySet = paramsMap.keySet(); - List paramNames = new ArrayList<>(keySet); - - Collections.sort(paramNames); - StringBuilder paramNameValue = new StringBuilder(); - for (String paramName : paramNames) { - Object value = paramsMap.get(paramName); - if (value != null) { - paramNameValue.append(paramName).append(value); - } - } - String source = secret + paramNameValue + secret; - return md5(source); - } - - /** - * Generate md5 and convert to uppercase - * - * @param message message - * @return String - */ - public static String md5(String message) { - try { - MessageDigest md = MessageDigest.getInstance("MD5"); - byte[] input = message.getBytes(); - byte[] buff = md.digest(input); - return byte2hex(buff); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /** - * Convert byte array to hex - * - * @param bytes byte array - * @return String - */ - private static String byte2hex(byte[] bytes) { - StringBuilder sign = new StringBuilder(); - for (byte aByte : bytes) { - String hex = Integer.toHexString(aByte & 0xFF); - if (hex.length() == 1) { - sign.append("0"); - } - sign.append(hex.toUpperCase()); - } - return sign.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ValidatorAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ValidatorAnnotations.java deleted file mode 100644 index 8de58eec..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/constants/ValidatorAnnotations.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.constants; - -/** - * @author yu 2019/12/22. - */ -public interface ValidatorAnnotations { - - String VALID = "Valid"; - - String NULL = "Null"; - - String VALIDATED = "Validated"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/dict/DictionaryValuesResolver.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/dict/DictionaryValuesResolver.java deleted file mode 100644 index 7ad07769..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/dict/DictionaryValuesResolver.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.extension.dict; - -import com.power.common.model.EnumDictionary; - -import javax.annotation.Nonnull; -import java.util.Collection; -import java.util.Collections; - -/** - * @see issues-338 - */ -public interface DictionaryValuesResolver { - - /** - * resolve the dictionary, if an exception occurs, return empty collection instead of null - * default behaviour is the same as {@link #resolve()} - * - * @param clazz dictionary class - * @return the dictionary - */ - @Nonnull - default Collection resolve(@Nonnull Class clazz) { - return resolve(); - } - - /** - * resolve the dictionary, for compatibility, do not return null - * - * @see #resolve(Class) - */ - @Nonnull - default Collection resolve() { - return Collections.emptyList(); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNameHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNameHelper.java deleted file mode 100644 index d39f9b23..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNameHelper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.power.doc.extension.json; - -import java.util.List; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocAnnotationConstants; -import com.thoughtworks.qdox.model.JavaAnnotation; - -/** - * @author xingzi - * Date 2022/9/17 13:32 - */ -public class PropertyNameHelper { - - public static final String JACKSON_LOWER_CAMEL_CASE = "lowercamel"; - public static final String JACKSON_UPPER_CAMEL_CASE = "uppercamel"; - public static final String JACKSON_SNAKE_CASE = "snake"; - public static final String JACKSON_UPPER_SNAKE_CASE = "uppersnake"; - public static final String JACKSON_LOWER_CASE = "lower"; - public static final String JACKSON_KEBAB_CASE = "kebab"; - public static final String JACKSON_LOWER_DOT_CASE = "lowerdot"; - - - private PropertyNameHelper() { - } - - public static PropertyNamingStrategies.NamingBase translate(List javaAnnotations) { - for (JavaAnnotation annotation : javaAnnotations) { - String simpleAnnotationName = annotation.getType().getValue(); - //jackson - if (DocAnnotationConstants.JSON_NAMING.equalsIgnoreCase(simpleAnnotationName)) { - String value = annotation.getProperty("value").getParameterValue().toString().toLowerCase(); - return jackSonTranslate(value); - } - - } - return null; - } - - private static PropertyNamingStrategies.NamingBase jackSonTranslate(String annotationValue) { - if (StringUtil.isEmpty(annotationValue)) { - return null; - } - if (annotationValue.contains(JACKSON_LOWER_CAMEL_CASE)) { - return PropertyNamingStrategies.LOWER_CAMEL_CASE; - } - if (annotationValue.contains(JACKSON_UPPER_CAMEL_CASE)) { - return PropertyNamingStrategies.UPPER_CAMEL_CASE; - } - if (annotationValue.contains(JACKSON_SNAKE_CASE)) { - return PropertyNamingStrategies.SNAKE_CASE; - } - if (annotationValue.contains(JACKSON_UPPER_SNAKE_CASE)) { - return PropertyNamingStrategies.UPPER_SNAKE_CASE; - } - if (annotationValue.contains(JACKSON_LOWER_CASE)) { - return PropertyNamingStrategies.LOWER_CASE; - } - if (annotationValue.contains(JACKSON_KEBAB_CASE)) { - return PropertyNamingStrategies.KEBAB_CASE; - } - if (annotationValue.contains(JACKSON_LOWER_DOT_CASE)) { - return PropertyNamingStrategies.LOWER_DOT_CASE; - } - return null; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNamingStrategies.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNamingStrategies.java deleted file mode 100644 index 1d167ba9..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/json/PropertyNamingStrategies.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.power.doc.extension.json; - - -/** - * copy from jackson - * and singleton instances. - * . - * - * @author xingzi - */ -public abstract class PropertyNamingStrategies - implements java.io.Serializable { - - /** - * Naming convention used in Java, where words other than first are capitalized - * and no separator is used between words. Since this is the native Java naming convention, - * naming strategy will not do any transformation between names in data (JSON) and - * POJOS. - * Example external property names would be "numberValue", "namingStrategy", "theDefiniteProof". - */ - public static final LowerCamelCaseStrategy LOWER_CAMEL_CASE = new LowerCamelCaseStrategy(); - /* - /********************************************************************** - /* Static instances that may be referenced - /********************************************************************** - */ - /** - * Naming convention used in languages like Pascal, where all words are capitalized - * and no separator is used between words. - * See {@link UpperCamelCaseStrategy} for details. - * Example external property names would be "NumberValue", "NamingStrategy", "TheDefiniteProof". - */ - public static final UpperCamelCaseStrategy UPPER_CAMEL_CASE = new UpperCamelCaseStrategy(); - /** - * Naming convention used in languages like C, where words are in lower-case - * letters, separated by underscores. - * See {@link SnakeCaseStrategy} for details. - * Example external property names would be "number_value", "naming_strategy", "the_definite_proof". - */ - public static final SnakeCaseStrategy SNAKE_CASE = new SnakeCaseStrategy(); - /** - * Naming convention in which the words are in upper-case letters, separated by underscores. - * See {@link UpperSnakeCaseStrategy} for details. - * - * @since 2.13 - */ - public static final UpperSnakeCaseStrategy UPPER_SNAKE_CASE = new UpperSnakeCaseStrategy(); - /** - * Naming convention in which all words of the logical name are in lower case, and - * no separator is used between words. - * See {@link LowerCaseStrategy} for details. - * Example external property names would be "numbervalue", "namingstrategy", "thedefiniteproof". - */ - public static final LowerCaseStrategy LOWER_CASE = new LowerCaseStrategy(); - /** - * Naming convention used in languages like Lisp, where words are in lower-case - * letters, separated by hyphens. - * See {@link KebabCaseStrategy} for details. - * Example external property names would be "number-value", "naming-strategy", "the-definite-proof". - */ - public static final KebabCaseStrategy KEBAB_CASE = new KebabCaseStrategy(); - /** - * Naming convention widely used as configuration properties name, where words are in - * lower-case letters, separated by dots. - * See {@link LowerDotCaseStrategy} for details. - * Example external property names would be "number.value", "naming.strategy", "the.definite.proof". - */ - public static final LowerDotCaseStrategy LOWER_DOT_CASE = new LowerDotCaseStrategy(); - private static final long serialVersionUID = 2L; - - /* - /********************************************************************** - /* Public base class for simple implementations - /********************************************************************** - */ - - /** - * Intermediate base class for simple implementations - */ - public abstract static class NamingBase { - - /** - * name convert - * - * @param propertyName propertyName - * @return string - */ - public abstract String translate(String propertyName); - - /** - * Helper method to share implementation between snake and dotted case. - * - * @param input input - * @param separator separator - * @return string - */ - protected String translateLowerCaseWithSeparator(final String input, final char separator) { - if (input == null) { - return null; // garbage in, garbage out - } - final int length = input.length(); - if (length == 0) { - return input; - } - - final StringBuilder result = new StringBuilder(length + (length >> 1)); - int upperCount = 0; - for (int i = 0; i < length; ++i) { - char ch = input.charAt(i); - char lc = Character.toLowerCase(ch); - - if (lc == ch) { // lower-case letter means we can get new word - // but need to check for multi-letter upper-case (acronym), where assumption - // is that the last upper-case char is start of a new word - if (upperCount > 1) { - // so insert hyphen before the last character now - result.insert(result.length() - 1, separator); - } - upperCount = 0; - } else { - // Otherwise starts new word, unless beginning of string - if ((upperCount == 0) && (i > 0)) { - result.append(separator); - } - ++upperCount; - } - result.append(lc); - } - return result.toString(); - } - } - - /* - /********************************************************************** - /* Standard implementations - /********************************************************************** - */ - - /** - * property names to lower case JSON element names, separated by - * underscores. This implementation is somewhat lenient, in that it - * provides some additional translations beyond strictly translating from - * camel case only. In particular, the following translations are applied - * by this PropertyNamingStrategy. - * - *

  • Every upper case letter in the Java property name is translated - * into two characters, an underscore and the lower case equivalent of the - * target character, with three exceptions. - *
    1. For contiguous sequences of upper case letters, characters after - * the first character are replaced only by their lower case equivalent, - * and are not preceded by an underscore. - *
      • This provides for reasonable translations of upper case acronyms, - * e.g., "theWWW" is translated to "the_www".
    2. - *
    3. An upper case character in the first position of the Java property - * name is not preceded by an underscore character, and is translated only - * to its lower case equivalent. - *
      • For example, "Results" is translated to "results", - * and not to "_results".
    4. - *
    5. An upper case character in the Java property name that is already - * preceded by an underscore character is translated only to its lower case - * equivalent, and is not preceded by an additional underscore. - *
      • For example, "user_Name" is translated to - * "user_name", and not to "user__name" (with two - * underscore characters).
  • - *
  • If the Java property name starts with an underscore, then that - * underscore is not included in the translated name, unless the Java - * property name is just one character in length, i.e., it is the - * underscore character. This applies only to the first character of the - * Java property name.
- *

- * These rules result in the following additional example translations from - * Java property names to JSON element names. - *

  • "userName" is translated to "user_name"
  • - *
  • "UserName" is translated to "user_name"
  • - *
  • "USER_NAME" is translated to "user_name"
  • - *
  • "user_name" is translated to "user_name" (unchanged)
  • - *
  • "user" is translated to "user" (unchanged)
  • - *
  • "User" is translated to "user"
  • - *
  • "USER" is translated to "user"
  • - *
  • "_user" is translated to "user"
  • - *
  • "_User" is translated to "user"
  • - *
  • "__user" is translated to "_user" - * (the first of two underscores was removed)
  • - *
  • "user__name" is translated to "user__name" - * (unchanged, with two underscores)
- */ - public static class SnakeCaseStrategy extends NamingBase { - - @Override - public String translate(String input) { - if (input == null) { - return null; - }// garbage in, garbage out - int length = input.length(); - StringBuilder result = new StringBuilder(length * 2); - int resultLength = 0; - boolean wasPrevTranslated = false; - for (int i = 0; i < length; i++) { - char c = input.charAt(i); - if (i > 0 || c != '_') // skip first starting underscore - { - if (Character.isUpperCase(c)) { - if (!wasPrevTranslated && resultLength > 0 && result.charAt(resultLength - 1) != '_') { - result.append('_'); - resultLength++; - } - c = Character.toLowerCase(c); - wasPrevTranslated = true; - } else { - wasPrevTranslated = false; - } - result.append(c); - resultLength++; - } - } - return resultLength > 0 ? result.toString() : input; - } - } - - /** - * at translates an input to the equivalent upper case snake - * case. The class extends {@link PropertyNamingStrategies.SnakeCaseStrategy} to retain the - * snake case conversion functionality offered by the strategy. - * - * @since 2.13 - */ - public static class UpperSnakeCaseStrategy extends SnakeCaseStrategy { - - @Override - public String translate(String input) { - String output = super.translate(input); - if (output == null) { - return null; - } - return super.translate(input).toUpperCase(); - } - } - - /** - * "No-operation" strategy that is equivalent to not specifying any - * strategy: will simply return suggested standard bean naming as-is. - */ - public static class LowerCamelCaseStrategy extends NamingBase { - - @Override - public String translate(String input) { - return input; - } - } - - /** - * property names to PascalCase JSON element names (i.e., with a capital - * first letter). In particular, the following translations are applied by - * this PropertyNamingStrategy. - * - *
  • The first lower-case letter in the Java property name is translated - * into its equivalent upper-case representation.
- *

- * This rules result in the following example translation from - * Java property names to JSON element names. - *

  • "userName" is translated to "UserName"
- */ - public static class UpperCamelCaseStrategy extends NamingBase { - - /** - * Converts camelCase to PascalCase - * For example, "userName" would be converted to - * "UserName". - * - * @param input formatted as camelCase string - * @return input converted to PascalCase format - */ - @Override - public String translate(String input) { - if (input == null || input.isEmpty()) { - return input; // garbage in, garbage out - } - // Replace first lower-case letter with upper-case equivalent - char c = input.charAt(0); - char uc = Character.toUpperCase(c); - if (c == uc) { - return input; - } - StringBuilder sb = new StringBuilder(input); - sb.setCharAt(0, uc); - return sb.toString(); - } - } - - /** - * Simple strategy where external name simply only uses lower-case characters, - * and no separators. - * Conversion from internal name like "someOtherValue" would be into external name - * if "someothervalue". - */ - public static class LowerCaseStrategy extends NamingBase { - - @Override - public String translate(String input) { - return input.toLowerCase(); - } - } - - /** - * Naming strategy similar to {@link PropertyNamingStrategies.SnakeCaseStrategy}, - * but instead of underscores - * as separators, uses hyphens. Naming convention traditionally used for languages - * like Lisp. - */ - public static class KebabCaseStrategy extends NamingBase { - - @Override - public String translate(String input) { - return translateLowerCaseWithSeparator(input, '-'); - } - } - - /** - * Naming strategy similar to {@link PropertyNamingStrategies.KebabCaseStrategy}, - * but instead of hyphens - * as separators, uses dots. Naming convention widely used as configuration properties name. - */ - public static class LowerDotCaseStrategy extends NamingBase { - - @Override - public String translate(String input) { - return translateLowerCaseWithSeparator(input, '.'); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/package-info.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/package-info.java deleted file mode 100644 index d534461e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/extension/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * customized extension point - */ -package com.power.doc.extension; diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/factory/BuildTemplateFactory.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/factory/BuildTemplateFactory.java deleted file mode 100644 index 5142fd47..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/factory/BuildTemplateFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.factory; - -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.template.IDocBuildTemplate; - -/** - * @author yu 2021/6/27. - */ -public class BuildTemplateFactory { - - /** - * Get Doc build template - * - * @param framework framework name - * @param API doc type - * @return Implements of IDocBuildTemplate - */ - public static IDocBuildTemplate getDocBuildTemplate(String framework) { - String className = FrameworkEnum.getClassNameByFramework(framework); - try { - return (IDocBuildTemplate) Class.forName(className).newInstance(); - } catch (InstantiationException e) { - e.printStackTrace(); - } catch (IllegalAccessException e) { - e.printStackTrace(); - } catch (ClassNotFoundException e) { - throw new RuntimeException( - "The class=>" + className + " is not found , smart-doc currently supported framework name can only be set in [dubbo, spring]."); - } - return null; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/BoxReturnFilter.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/BoxReturnFilter.java deleted file mode 100644 index d184d3e8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/BoxReturnFilter.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.filter; - -import java.util.HashSet; -import java.util.Set; - -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.model.ApiReturn; -import com.power.doc.utils.DocClassUtil; - -/** - * @author yu 2020/4/17. - */ -public class BoxReturnFilter implements ReturnTypeFilter { - - private static final Set TYPE_SET = new HashSet<>(); - - static { - TYPE_SET.add("java.util.concurrent.Callable"); - TYPE_SET.add("java.util.concurrent.Future"); - TYPE_SET.add("java.util.concurrent.CompletableFuture"); - TYPE_SET.add("org.springframework.web.context.request.async.DeferredResult"); - TYPE_SET.add("org.springframework.web.context.request.async.WebAsyncTask"); - TYPE_SET.add("reactor.core.publisher.Mono"); - TYPE_SET.add("org.springframework.http.ResponseEntity"); - } - - @Override - public ApiReturn doFilter(String fullyName) { - if (TYPE_SET.stream().anyMatch(fullyName::startsWith)) { - ApiReturn apiReturn = new ApiReturn(); - if (fullyName.contains("<")) { - String[] strings = DocClassUtil.getSimpleGicName(fullyName); - String newFullName = strings[0]; - if (newFullName.contains("<")) { - apiReturn.setGenericCanonicalName(newFullName); - apiReturn.setSimpleName(newFullName.substring(0, newFullName.indexOf("<"))); - } else { - apiReturn.setGenericCanonicalName(newFullName); - apiReturn.setSimpleName(newFullName); - } - } else { - //directly return Java Object - apiReturn.setGenericCanonicalName(DocGlobalConstants.JAVA_OBJECT_FULLY); - apiReturn.setSimpleName(DocGlobalConstants.JAVA_OBJECT_FULLY); - } - return apiReturn; - } - return null; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/DefaultReturnFilter.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/DefaultReturnFilter.java deleted file mode 100644 index f940c87c..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/DefaultReturnFilter.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.filter; - -import com.power.doc.model.ApiReturn; - -/** - * must be put last - * - * @author yu 2020/4/17. - */ -public class DefaultReturnFilter implements ReturnTypeFilter { - - @Override - public ApiReturn doFilter(String fullyName) { - ApiReturn apiReturn = new ApiReturn(); - apiReturn.setGenericCanonicalName(fullyName); - if (fullyName.contains("<")) { - apiReturn.setSimpleName(fullyName.substring(0, fullyName.indexOf("<"))); - } else { - apiReturn.setSimpleName(fullyName); - } - return apiReturn; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeFilter.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeFilter.java deleted file mode 100644 index df3b89fe..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeFilter.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.filter; - -import com.power.doc.model.ApiReturn; - -/** - * Chain Of Responsibility Pattern - * - * @author yu 2020/4/17. - */ -public interface ReturnTypeFilter { - - /** - * filter return Type - * - * @param fullyName full type name - * @return ApiReturn - */ - ApiReturn doFilter(String fullyName); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java deleted file mode 100644 index d4e96839..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/ReturnTypeProcessor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.filter; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -import com.power.doc.model.ApiReturn; - -/** - * @author yu 2020/4/17. - */ -public class ReturnTypeProcessor { - - private List filters = new ArrayList<>(); - - private String typeName; - - public String getTypeName() { - return typeName; - } - - public void setTypeName(String typeName) { - this.typeName = typeName; - } - - public ApiReturn process() { - filters.add(new WebFluxReturnFilter()); - filters.add(new BoxReturnFilter()); - filters.add(new DefaultReturnFilter()); - for (ReturnTypeFilter filter : filters) { - ApiReturn apiReturn = filter.doFilter(typeName); - if (Objects.nonNull(apiReturn)) { - return apiReturn; - } - } - return null; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/WebFluxReturnFilter.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/WebFluxReturnFilter.java deleted file mode 100644 index 3dc1ab32..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/filter/WebFluxReturnFilter.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.filter; - -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.model.ApiReturn; - -/** - * @author yu 2020/4/17. - */ -public class WebFluxReturnFilter implements ReturnTypeFilter { - - private static final String FLUX = "reactor.core.publisher.Flux"; - - @Override - public ApiReturn doFilter(String fullyName) { - //support web flux - if (fullyName.startsWith(FLUX)) { - ApiReturn apiReturn = new ApiReturn(); - // rewrite type name - fullyName = fullyName.replace(FLUX, DocGlobalConstants.JAVA_LIST_FULLY); - apiReturn.setGenericCanonicalName(fullyName); - apiReturn.setSimpleName(DocGlobalConstants.JAVA_LIST_FULLY); - return apiReturn; - } - return null; - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/HtmlEscape.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/HtmlEscape.java deleted file mode 100644 index ddbe9173..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/HtmlEscape.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.function; - -import com.power.doc.utils.DocUtil; - -import org.beetl.core.Context; -import org.beetl.core.Function; - -/** - * beetl template function - * @author yu 2021/6/26. - */ -public class HtmlEscape implements Function { - - @Override - public String call(Object[] paras, Context ctx) { - String str = String.valueOf(paras[0]).replaceAll("&", "&"); - str = str.replaceAll("\"", """); - str = str.replaceAll("

", "").replaceAll("

", " "); - return DocUtil.replaceNewLineToHtmlBr(DocUtil.getEscapeAndCleanComment(str)); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/LineBreaksToBr.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/LineBreaksToBr.java deleted file mode 100644 index 049644a1..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/LineBreaksToBr.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.function; - -import com.power.common.util.HtmlUtil; - -import org.beetl.core.Context; -import org.beetl.core.Function; - -/** - * beetl template function - * @author yu 2022/10/3. - */ -public class LineBreaksToBr implements Function { - - @Override - public String call(Object[] paras, Context ctx) { - String str = String.valueOf(paras[0]); - return HtmlUtil.lineBreaksToBr(str); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RemoveLineBreaks.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RemoveLineBreaks.java deleted file mode 100644 index c038e87d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RemoveLineBreaks.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.function; - -import com.power.doc.utils.DocUtil; - -import org.beetl.core.Context; -import org.beetl.core.Function; - -/** - * beetl template function - * @author yu 2021/7/24. - */ -public class RemoveLineBreaks implements Function { - - @Override - public String call(Object[] paras, Context ctx) { - String str = String.valueOf(paras[0]) - .replaceAll("\n", " ") - .replaceAll("\r", " "); - return DocUtil.getEscapeAndCleanComment(str) - .replaceAll(System.lineSeparator(), ""); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RequestMappingFunc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RequestMappingFunc.java deleted file mode 100644 index d160acd3..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/function/RequestMappingFunc.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.function; - -import com.power.doc.model.request.RequestMapping; -import com.thoughtworks.qdox.model.JavaClass; - -@FunctionalInterface -public interface RequestMappingFunc { - - void process(JavaClass cls, RequestMapping requestMapping); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IHeaderHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IHeaderHandler.java deleted file mode 100644 index edf4113a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IHeaderHandler.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocTags; -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.annotation.HeaderAnnotation; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaFieldUtil; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaParameter; -import com.thoughtworks.qdox.model.JavaType; - -/** - * @author yu3.sun on 2022/8/30 - */ -public interface IHeaderHandler { - - default List handle(JavaMethod method, ProjectDocConfigBuilder projectBuilder) { - Map constantsMap = projectBuilder.getConstantsMap(); - List mappingHeaders = new ArrayList<>(); - List annotations = method.getAnnotations(); - HeaderAnnotation headerAnnotation = getHeaderAnnotation(); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - Object headersObject = annotation.getNamedParameter("headers"); - if (!isMapping(annotationName) || Objects.isNull(headersObject)) { - continue; - } - String mappingHeader = StringUtil.removeQuotes(headersObject.toString()); - if (!mappingHeader.startsWith("[")) { - processMappingHeaders(mappingHeader, mappingHeaders); - continue; - } - List headers = (LinkedList) headersObject; - for (String str : headers) { - String header = StringUtil.removeQuotes(str); - if (header.startsWith("!")) { - continue; - } - processMappingHeaders(header, mappingHeaders); - } - } - List reqHeaders = new ArrayList<>(); - for (JavaParameter javaParameter : method.getParameters()) { - List javaAnnotations = javaParameter.getAnnotations(); - String className = method.getDeclaringClass().getCanonicalName(); - Map paramMap = DocUtil.getCommentsByTag(method, DocTags.PARAM, className); - String paramName = javaParameter.getName(); - JavaType javaType = javaParameter.getType(); - String simpleTypeName = javaType.getValue(); - ApiReqParam apiReqHeader; - for (JavaAnnotation annotation : javaAnnotations) { - String annotationName = annotation.getType().getValue(); - if (headerAnnotation.getAnnotationName().equals(annotationName)) { - apiReqHeader = new ApiReqParam(); - Map requestHeaderMap = annotation.getNamedParameterMap(); - // Obtain header value - if (requestHeaderMap.get(headerAnnotation.getValueProp()) != null) { - String attrValue = DocUtil.handleRequestHeaderValue(annotation); - String constValue = ((String) requestHeaderMap.get(headerAnnotation.getValueProp())).replaceAll("\"", ""); - if (StringUtil.isEmpty(attrValue)) { - Object value = constantsMap.get(constValue); - if (value != null) { - apiReqHeader.setName(value.toString()); - } else { - apiReqHeader.setName(constValue); - } - } else { - apiReqHeader.setName(attrValue); - } - } else { - apiReqHeader.setName(paramName); - } - StringBuilder desc = new StringBuilder(); - String comments = paramMap.get(paramName); - desc.append(DocUtil.paramCommentResolve(comments)); - String mockValue = JavaFieldUtil.createMockValue(paramMap, paramName, javaType.getGenericCanonicalName(), simpleTypeName); - apiReqHeader.setValue(mockValue); - // Obtain header default value - if (requestHeaderMap.get(headerAnnotation.getDefaultValueProp()) != null) { - apiReqHeader.setValue(StringUtil.removeQuotes((String) requestHeaderMap.get(headerAnnotation.getDefaultValueProp()))); - desc.append("(defaultValue: ") - .append(StringUtil.removeQuotes((String) requestHeaderMap.get(headerAnnotation.getDefaultValueProp()))) - .append(")"); - } - apiReqHeader.setDesc(desc.toString()); - if (requestHeaderMap.get(headerAnnotation.getRequiredProp()) != null) { - apiReqHeader.setRequired(!Boolean.FALSE.toString() - .equals(requestHeaderMap.get(headerAnnotation.getRequiredProp()))); - } else { - apiReqHeader.setRequired(true); - } - String typeName = javaParameter.getType().getValue().toLowerCase(); - apiReqHeader.setType(DocClassUtil.processTypeNameForParams(typeName)); - reqHeaders.add(apiReqHeader); - break; - } - } - } - return Stream.of(mappingHeaders, reqHeaders) - .flatMap(Collection::stream) - .distinct() - .collect(Collectors.toList()); - } - - default void processMappingHeaders(String header, List mappingHeaders) { - if (header.contains("!=")) { - String headerName = header.substring(0, header.indexOf("!")); - ApiReqParam apiReqHeader = ApiReqParam.builder() - .setName(headerName) - .setRequired(true) - .setValue(null) - .setDesc("header condition") - .setType("string"); - mappingHeaders.add(apiReqHeader); - } else { - String headerName; - String headerValue = null; - if (header.contains("=")) { - int index = header.indexOf("="); - headerName = header.substring(0, index); - headerValue = header.substring(index + 1); - } else { - headerName = header; - } - ApiReqParam apiReqHeader = ApiReqParam.builder() - .setName(headerName) - .setRequired(true) - .setValue(headerValue) - .setDesc("header condition") - .setType("string"); - mappingHeaders.add(apiReqHeader); - } - } - - /** - * check mapping annotation - * - * @param annotationName annotation name - * @return boolean - */ - boolean isMapping(String annotationName); - - - /** - * Get framework annotation info - * - * @return Header annotation info - */ - HeaderAnnotation getHeaderAnnotation(); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IRequestMappingHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IRequestMappingHandler.java deleted file mode 100644 index d0504dcd..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/IRequestMappingHandler.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.common.util.UrlUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.function.RequestMappingFunc; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.DocUrlUtil; -import com.power.doc.utils.DocUtil; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaMethod; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -/** - * @author yu3.sun on 2022/10/1 - */ -public interface IRequestMappingHandler { - - default RequestMapping formatMappingData(ProjectDocConfigBuilder projectBuilder, String controllerBaseUrl, RequestMapping requestMapping) { - String shortUrl = requestMapping.getShortUrl(); - if (Objects.nonNull(shortUrl)) { - String serverUrl = projectBuilder.getServerUrl(); - String contextPath = projectBuilder.getApiConfig().getPathPrefix(); - shortUrl = StringUtil.removeQuotes(shortUrl); - String url = DocUrlUtil.getMvcUrls(serverUrl, contextPath + "/" + controllerBaseUrl, shortUrl); - shortUrl = DocUrlUtil.getMvcUrls(DocGlobalConstants.EMPTY, contextPath + "/" + controllerBaseUrl, shortUrl); - String urlSuffix = projectBuilder.getApiConfig().getUrlSuffix(); - if (StringUtil.isEmpty(urlSuffix)) { - urlSuffix = StringUtil.EMPTY; - } - url = UrlUtil.simplifyUrl(StringUtil.trim(url)) + urlSuffix; - shortUrl = UrlUtil.simplifyUrl(StringUtil.trim(shortUrl)) + urlSuffix; - url = DocUtil.formatPathUrl(url); - shortUrl = DocUtil.formatPathUrl(shortUrl); - requestMapping.setUrl(url).setShortUrl(shortUrl); - return requestMapping; - } - return requestMapping; - } - - default List getAnnotations(JavaMethod method) { - List annotations = new ArrayList<>(); - // add interface method annotations - List interfaces = method.getDeclaringClass().getInterfaces(); - if (CollectionUtil.isNotEmpty(interfaces)) { - for (JavaClass interfaceClass : interfaces) { - JavaMethod interfaceMethod = interfaceClass.getMethod(method.getName(), method.getParameterTypes(), method.isVarArgs()); - if (interfaceMethod != null) { - // can be overridden by implement class - annotations.addAll(interfaceMethod.getAnnotations()); - } - } - } - annotations.addAll(method.getAnnotations()); - return annotations; - } - - RequestMapping handle(ProjectDocConfigBuilder projectBuilder, String controllerBaseUrl, JavaMethod method, - FrameworkAnnotations frameworkAnnotations, - RequestMappingFunc requestMappingFunc); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsHeaderHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsHeaderHandler.java deleted file mode 100644 index d9e13a2a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsHeaderHandler.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocTags; -import com.power.doc.constants.JAXRSAnnotations; -import com.power.doc.constants.JakartaJaxrsAnnotations; -import com.power.doc.model.ApiReqParam; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.StringUtils; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaParameter; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; - - -/** - * Jaxrs Header Handler - * - * @author Zxq - */ -public class JaxrsHeaderHandler { - - /** - * Handle JAX RS Header - * - * @param method method - * @param projectBuilder ProjectDocConfigBuilder - * @return list of ApiReqParam - */ - public List handle(JavaMethod method, ProjectDocConfigBuilder projectBuilder) { - Map constantsMap = projectBuilder.getConstantsMap(); - - List apiReqHeaders = new ArrayList<>(); - List parameters = method.getParameters(); - for (JavaParameter javaParameter : parameters) { - List annotations = javaParameter.getAnnotations(); - String paramName = javaParameter.getName(); - - // hit target head annotation - ApiReqParam apiReqHeader = new ApiReqParam(); - - String defaultValue = ""; - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - //Obtain header default value - if (JakartaJaxrsAnnotations.JAX_DEFAULT_VALUE_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_DEFAULT_VALUE_FULLY.equals(annotationName)) { - defaultValue = StringUtil.removeQuotes(DocUtil.getRequestHeaderValue(annotation)); - defaultValue = DocUtil.handleConstants(constantsMap, defaultValue); - } - apiReqHeader.setValue(defaultValue); - - // Obtain header value - if (JakartaJaxrsAnnotations.JAX_HEADER_PARAM_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_HEADER_PARAM_FULLY.equals(annotationName)) { - String name = StringUtil.removeQuotes(DocUtil.getRequestHeaderValue(annotation)); - name = DocUtil.handleConstants(constantsMap, name); - apiReqHeader.setName(name); - - String typeName = javaParameter.getType().getValue().toLowerCase(); - apiReqHeader.setType(DocClassUtil.processTypeNameForParams(typeName)); - - String className = method.getDeclaringClass().getCanonicalName(); - Map paramMap = DocUtil.getCommentsByTag(method, DocTags.PARAM, className); - String paramComments = paramMap.get(paramName); - apiReqHeader.setDesc(getComments(defaultValue, paramComments)); - apiReqHeaders.add(apiReqHeader); - } - } - } - return apiReqHeaders; - } - - - private String getComments(String defaultValue, String paramComments) { - if (Objects.nonNull(paramComments)) { - StringBuilder desc = new StringBuilder(); - desc.append(paramComments); - if (StringUtils.isNotBlank(defaultValue)) { - desc.append("(defaultValue: ") - .append(defaultValue) - .append(")"); - } - return desc.toString(); - } - return ""; - } - -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsPathHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsPathHandler.java deleted file mode 100644 index 590e105e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/JaxrsPathHandler.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.common.util.StringUtil; -import com.power.common.util.UrlUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.JAXRSAnnotations; -import com.power.doc.constants.JakartaJaxrsAnnotations; -import com.power.doc.constants.MediaType; -import com.power.doc.model.request.JaxrsPathMapping; -import com.power.doc.utils.DocUrlUtil; -import com.power.doc.utils.DocUtil; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.expression.AnnotationValue; - -import java.util.*; - -import static com.power.doc.constants.DocTags.DEPRECATED; -import static com.power.doc.constants.DocTags.IGNORE; - -/** - * Jaxrs Path Handler - * - * @author Zxq - */ -public class JaxrsPathHandler { - - /** - * ANNOTATION_NAMES - */ - private static final Set ANNOTATION_NAMES = Collections.unmodifiableSet(new HashSet<>( - Arrays.asList( - JakartaJaxrsAnnotations.JAXB_DELETE_FULLY, JakartaJaxrsAnnotations.JAX_PUT_FULLY, - JakartaJaxrsAnnotations.JAX_GET_FULLY, JakartaJaxrsAnnotations.JAX_POST_FULLY, - JakartaJaxrsAnnotations.JAX_PATCH_FULLY, JakartaJaxrsAnnotations.JAX_HEAD_FULLY, - JAXRSAnnotations.JAXB_DELETE_FULLY, JAXRSAnnotations.JAX_PUT_FULLY, - JAXRSAnnotations.JAX_GET_FULLY, JAXRSAnnotations.JAX_POST_FULLY, - JAXRSAnnotations.JAXB_PATCH_FULLY, JAXRSAnnotations.JAXB_HEAD_FULLY - ))); - - Map constantsMap; - - public JaxrsPathMapping handle(ProjectDocConfigBuilder projectBuilder, - String baseUrl, - JavaMethod method, - String mediaType) { - - List annotations = method.getAnnotations(); - this.constantsMap = projectBuilder.getConstantsMap(); - String methodType = null; - String shortUrl = ""; - String serverUrl = projectBuilder.getServerUrl(); - String contextPath = projectBuilder.getApiConfig().getPathPrefix(); - boolean deprecated = false; - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - // method level annotation will override class level annotation - if (annotationName.equals(JakartaJaxrsAnnotations.JAX_CONSUMES) - || annotationName.equals(JAXRSAnnotations.JAX_CONSUMES_FULLY)) { - Object value = annotation.getNamedParameter("value"); - if (Objects.nonNull(value)) { - mediaType = MediaType.valueOf(value.toString()); - } - } - // Deprecated annotation on method - if (DocGlobalConstants.JAVA_DEPRECATED_FULLY.equals(annotationName)) { - deprecated = true; - } - if (JakartaJaxrsAnnotations.JAX_PATH_FULLY.equals(annotationName) - || JakartaJaxrsAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName) - || JakartaJaxrsAnnotations.JAXB_REST_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName)) { - shortUrl = DocUtil.handleMappingValue(annotation); - } - // annotationName like "Get" "Post", not "jakarta.ws.rs.Get" "jakarta.ws.rs.Post" - if (ANNOTATION_NAMES.stream().anyMatch(it -> it.contains(annotationName))) { - methodType = annotation.getType().getName(); - } - } - // @deprecated tag on method - if (Objects.nonNull(method.getTagByName(DEPRECATED))) { - deprecated = true; - } - JaxrsPathMapping jaxrsPathMapping = getJaxbPathMapping(projectBuilder, baseUrl, method, shortUrl, serverUrl, contextPath); - if (jaxrsPathMapping != null) { - return jaxrsPathMapping.setDeprecated(deprecated) - .setMethodType(methodType) - .setMediaType(mediaType); - } - return null; - } - - private JaxrsPathMapping getJaxbPathMapping(ProjectDocConfigBuilder projectBuilder, - String baseUrl, JavaMethod method, - String shortUrl, - String serverUrl, - String contextPath) { - String url; - if (Objects.nonNull(shortUrl)) { - if (Objects.nonNull(method.getTagByName(IGNORE))) { - return null; - } - shortUrl = StringUtil.removeQuotes(shortUrl); - List urls = DocUtil.split(shortUrl); - url = String.join(DocGlobalConstants.PATH_DELIMITER, serverUrl, contextPath, baseUrl, shortUrl); - shortUrl = String.join(DocGlobalConstants.PATH_DELIMITER, DocGlobalConstants.PATH_DELIMITER, contextPath, baseUrl, shortUrl); - if (urls.size() > 1) { - url = DocUrlUtil.getMvcUrls(serverUrl, contextPath + "/" + baseUrl, urls); - shortUrl = DocUrlUtil.getMvcUrls(DocGlobalConstants.EMPTY, contextPath + "/" + baseUrl, urls); - } - for (Map.Entry entry : constantsMap.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - if (url.contains(key)) { - url = url.replace(key, value).replace("+", ""); - } - if (shortUrl.contains(key)) { - shortUrl = shortUrl.replace(key, value).replace("+", ""); - } - } - String urlSuffix = projectBuilder.getApiConfig().getUrlSuffix(); - url = UrlUtil.simplifyUrl(url); - shortUrl = UrlUtil.simplifyUrl(shortUrl); - if (StringUtil.isNotEmpty(urlSuffix)) { - url += urlSuffix; - shortUrl += urlSuffix; - } - return JaxrsPathMapping.builder() - .setUrl(StringUtil.trim(url)) - .setShortUrl(StringUtil.trim(shortUrl)); - } - return null; - } - -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestHeaderHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestHeaderHandler.java deleted file mode 100644 index 84610d99..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestHeaderHandler.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.SolonAnnotations; -import com.power.doc.model.annotation.HeaderAnnotation; - - -/** - * @author noear 2022/2/19 created - */ -public class SolonRequestHeaderHandler implements IHeaderHandler { - - @Override - public boolean isMapping(String annotationName) { - switch (annotationName) { - case "Mapping": - case "Get": - case "Post": - case "Put": - case "Patch": - case "Delete": - return true; - default: - return false; - } - } - - @Override - public HeaderAnnotation getHeaderAnnotation() { - return HeaderAnnotation.builder() - .setAnnotationName(SolonAnnotations.REQUEST_HERDER) - .setValueProp(DocAnnotationConstants.VALUE_PROP) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - } - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestMappingHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestMappingHandler.java deleted file mode 100644 index fd60b6dc..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SolonRequestMappingHandler.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.Methods; -import com.power.doc.constants.SolonAnnotations; -import com.power.doc.function.RequestMappingFunc; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.DocUtil; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaMethod; - -import java.util.List; -import java.util.Objects; - -import static com.power.doc.constants.DocTags.DEPRECATED; -import static com.power.doc.constants.DocTags.IGNORE; - -/** - * @author noear 2022/2/19 created - */ -public class SolonRequestMappingHandler implements IRequestMappingHandler { - - /** - * handle solon request mapping - * - * @param projectBuilder projectBuilder - * @param controllerBaseUrl solon mvc controller base url - * @param method JavaMethod - * @return RequestMapping - */ - public RequestMapping handle(ProjectDocConfigBuilder projectBuilder, - String controllerBaseUrl, - JavaMethod method, FrameworkAnnotations frameworkAnnotations, - RequestMappingFunc requestMappingFunc) { - if (Objects.nonNull(method.getTagByName(IGNORE))) { - return null; - } - List annotations = getAnnotations(method); - String methodType = "GET";//default is get - String shortUrl = null; - String mediaType = null; - boolean deprecated = false; - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getName(); - if (DocAnnotationConstants.DEPRECATED.equals(annotationName)) { - deprecated = true; - } - if (SolonAnnotations.REQUEST_MAPPING.equals(annotationName) || SolonAnnotations.REQUEST_MAPPING_FULLY.equals(annotationName)) { - shortUrl = DocUtil.handleMappingValue(annotation); - Object produces = annotation.getNamedParameter("produces"); - if (Objects.nonNull(produces)) { - mediaType = produces.toString(); - } - } - if (SolonAnnotations.GET_MAPPING.equals(annotationName) || SolonAnnotations.GET_MAPPING_FULLY.equals(annotationName)) { - methodType = Methods.GET.getValue(); - } else if (SolonAnnotations.POST_MAPPING.equals(annotationName) || SolonAnnotations.POST_MAPPING_FULLY.equals(annotationName)) { - methodType = Methods.POST.getValue(); - } else if (SolonAnnotations.PUT_MAPPING.equals(annotationName) || SolonAnnotations.PUT_MAPPING_FULLY.equals(annotationName)) { - methodType = Methods.PUT.getValue(); - } else if (SolonAnnotations.PATCH_MAPPING.equals(annotationName) || SolonAnnotations.PATCH_MAPPING_FULLY.equals(annotationName)) { - methodType = Methods.PATCH.getValue(); - } else if (SolonAnnotations.DELETE_MAPPING.equals(annotationName) || SolonAnnotations.DELETE_MAPPING_FULLY.equals(annotationName)) { - methodType = Methods.DELETE.getValue(); - } - } - if (Objects.nonNull(method.getTagByName(DEPRECATED))) { - deprecated = true; - } - RequestMapping requestMapping = RequestMapping.builder() - .setMediaType(mediaType) - .setMethodType(methodType) - .setDeprecated(deprecated) - .setShortUrl(shortUrl); - requestMapping = formatMappingData(projectBuilder, controllerBaseUrl, requestMapping); - requestMappingFunc.process(method.getDeclaringClass(), requestMapping); - return requestMapping; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestHeaderHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestHeaderHandler.java deleted file mode 100644 index 47a32085..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestHeaderHandler.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.SpringMvcAnnotations; -import com.power.doc.model.annotation.HeaderAnnotation; - -/** - * @author yu 2019/12/22. - */ -public class SpringMVCRequestHeaderHandler implements IHeaderHandler { - - @Override - public boolean isMapping(String annotationName) { - switch (annotationName) { - case "GetMapping": - case "RequestMapping": - case "PostMapping": - case "PutMapping": - case "PatchMapping": - case "DeleteMapping": - return true; - default: - return false; - } - } - - @Override - public HeaderAnnotation getHeaderAnnotation() { - return HeaderAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REQUEST_HERDER) - .setValueProp(DocAnnotationConstants.VALUE_PROP) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestMappingHandler.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestMappingHandler.java deleted file mode 100644 index 18dcf38b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/handler/SpringMVCRequestMappingHandler.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.handler; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.Methods; -import com.power.doc.function.RequestMappingFunc; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.annotation.MappingAnnotation; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassUtil; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaMethod; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import static com.power.doc.constants.DocTags.DEPRECATED; -import static com.power.doc.constants.DocTags.IGNORE; - -/** - * @author yu 2019/12/22. - */ -public class SpringMVCRequestMappingHandler implements IRequestMappingHandler { - - /** - * handle spring request mapping - * - * @param projectBuilder projectBuilder - * @param controllerBaseUrl spring mvc controller base url - * @param method JavaMethod - * @return RequestMapping - */ - @Override - public RequestMapping handle(ProjectDocConfigBuilder projectBuilder, String controllerBaseUrl, - JavaMethod method, FrameworkAnnotations frameworkAnnotations, - RequestMappingFunc requestMappingFunc) { - - if (Objects.nonNull(method.getTagByName(IGNORE))) { - return null; - } - List annotations = getAnnotations(method); - String methodType = null; - String shortUrl = null; - String mediaType = null; - boolean deprecated = Objects.nonNull(method.getTagByName(DEPRECATED)); - Map mappingAnnotationMap = frameworkAnnotations.getMappingAnnotations(); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getName(); - annotationName = JavaClassUtil.getClassSimpleName(annotationName); - if (DocAnnotationConstants.DEPRECATED.equals(annotationName)) { - deprecated = true; - } - MappingAnnotation mappingAnnotation = mappingAnnotationMap.get(annotationName); - if (Objects.isNull(mappingAnnotation)) { - continue; - } - // get consumes of annotation - Object consumes = annotation.getNamedParameter("consumes"); - if (Objects.nonNull(consumes)) { - mediaType = consumes.toString(); - } - if (CollectionUtil.isNotEmpty(mappingAnnotation.getPathProps())) { - shortUrl = DocUtil.getPathUrl(annotation, mappingAnnotation.getPathProps() - .toArray(new String[0])); - } - if (StringUtil.isNotEmpty(mappingAnnotation.getMethodType())) { - methodType = mappingAnnotation.getMethodType(); - } else { - Object nameParam = annotation.getNamedParameter(mappingAnnotation.getMethodProp()); - if (Objects.nonNull(nameParam)) { - methodType = nameParam.toString(); - methodType = DocUtil.handleHttpMethod(methodType); - } else { - methodType = Methods.GET.getValue(); - } - } - } - RequestMapping requestMapping = RequestMapping.builder() - .setMediaType(mediaType) - .setMethodType(methodType) - .setDeprecated(deprecated) - .setShortUrl(shortUrl); - requestMapping = formatMappingData(projectBuilder, controllerBaseUrl, requestMapping); - requestMappingFunc.process(method.getDeclaringClass(), requestMapping); - return requestMapping; - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/BaseHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/BaseHelper.java deleted file mode 100644 index fd367550..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/BaseHelper.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.helper; - -import java.util.Map; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocTags; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassValidateUtil; - -/** - * @author yu3.sun on 2022/10/14 - */ -public abstract class BaseHelper { - - protected static String getFieldValueFromMock(String subTypeName, Map tagsMap, String typeSimpleName) { - String fieldValue = ""; - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - fieldValue = tagsMap.get(DocTags.MOCK); - if (!DocUtil.javaPrimaryType(typeSimpleName) - && !JavaClassValidateUtil.isCollection(subTypeName) - && !JavaClassValidateUtil.isMap(subTypeName) - && !JavaClassValidateUtil.isArray(subTypeName)) { - fieldValue = DocUtil.handleJsonStr(fieldValue); - } - } - return fieldValue; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/FormDataBuildHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/FormDataBuildHelper.java deleted file mode 100644 index 213ca140..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/FormDataBuildHelper.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.helper; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.RandomUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.CustomField; -import com.power.doc.model.DocJavaField; -import com.power.doc.model.FormData; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassUtil; -import com.power.doc.utils.JavaClassValidateUtil; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaField; - -/** - * @author yu 2019/12/25. - */ -public class FormDataBuildHelper { - - /** - * build form data - * - * @param className class name - * @param registryClasses Class container - * @param counter invoked counter - * @param builder ProjectDocConfigBuilder - * @param pre pre - * @return list of FormData - */ - public static List getFormData(String className, Map registryClasses, int counter - , ProjectDocConfigBuilder builder, String pre) { - - if (StringUtil.isEmpty(className)) { - throw new RuntimeException("Class name can't be null or empty."); - } - ApiConfig apiConfig = builder.getApiConfig(); - List formDataList = new ArrayList<>(); - if (counter > apiConfig.getRecursionLimit()) { - return formDataList; - } - // Check circular reference - if (registryClasses.containsKey(className) && counter > registryClasses.size()) { - return formDataList; - } - // Registry class - registryClasses.put(className, className); - counter++; - boolean skipTransientField = apiConfig.isSkipTransientField(); - boolean requestFieldToUnderline = apiConfig.isRequestFieldToUnderline(); - boolean responseFieldToUnderline = apiConfig.isResponseFieldToUnderline(); - String simpleName = DocClassUtil.getSimpleName(className); - String[] globGicName = DocClassUtil.getSimpleGicName(className); - JavaClass cls = builder.getJavaProjectBuilder().getClassByName(simpleName); - List fields = JavaClassUtil.getFields(cls, 0, new LinkedHashMap<>()); - - if (JavaClassValidateUtil.isPrimitive(simpleName)) { - FormData formData = new FormData(); - formData.setKey(pre); - formData.setType("text"); - formData.setValue(StringUtil.removeQuotes(RandomUtil.randomValueByType(className))); - formDataList.add(formData); - return formDataList; - } - if (JavaClassValidateUtil.isCollection(simpleName) || JavaClassValidateUtil.isArray(simpleName)) { - String gicName = globGicName[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - if (JavaClassValidateUtil.isPrimitive(gicName)) { - pre = pre.substring(0, pre.lastIndexOf(".")); - } - formDataList.addAll(getFormData(gicName, registryClasses, counter, builder, pre + "[]")); - } - int n = 0; - for (DocJavaField docField : fields) { - JavaField field = docField.getJavaField(); - String fieldName = field.getName(); - String subTypeName = docField.getFullyQualifiedName(); - String fieldGicName = docField.getGenericCanonicalName(); - JavaClass javaClass = field.getType(); - if (field.isStatic() || "this$0".equals(fieldName) || - JavaClassValidateUtil.isIgnoreFieldTypes(subTypeName)) { - continue; - } - if (field.isTransient() && skipTransientField) { - continue; - } - if (responseFieldToUnderline || requestFieldToUnderline) { - fieldName = StringUtil.camelToUnderline(fieldName); - } - Map tagsMap = DocUtil.getFieldTagsValue(field, docField); - if (tagsMap.containsKey(DocTags.IGNORE)) { - continue; - } - String typeSimpleName = field.getType().getSimpleName(); - if (JavaClassValidateUtil.isMap(subTypeName)) { - continue; - } - String comment = docField.getComment(); - if (JavaClassValidateUtil.isFile(fieldGicName)) { - FormData formData = new FormData(); - formData.setKey(pre + fieldName); - formData.setType("file"); - if (fieldGicName.contains("[]") || fieldGicName.endsWith(">")) { - comment = comment + "(array of file)"; - formData.setType(DocGlobalConstants.PARAM_TYPE_FILE); - } - formData.setDescription(comment); - formData.setValue(""); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isPrimitive(subTypeName)) { - String fieldValue; - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - fieldValue = tagsMap.get(DocTags.MOCK); - } else { - fieldValue = DocUtil.getValByTypeAndFieldName(typeSimpleName, field.getName()); - } - CustomField customRequestField = builder.getCustomReqFieldMap().get(fieldName); - // cover request value - if (Objects.nonNull(customRequestField) && Objects.nonNull(customRequestField.getValue()) - && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName())) { - fieldValue = String.valueOf(customRequestField.getValue()); - } - FormData formData = new FormData(); - formData.setKey(pre + fieldName); - formData.setType("text"); - formData.setValue(StringUtil.removeQuotes(fieldValue)); - formData.setDescription(comment); - formDataList.add(formData); - } else if (javaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - value = tagsMap.get(DocTags.MOCK); - } - FormData formData = new FormData(); - formData.setKey(pre + fieldName); - formData.setType("text"); - formData.setValue(StringUtil.removeQuotes(String.valueOf(value))); - formData.setDescription(comment); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isCollection(subTypeName) || JavaClassValidateUtil.isArray(subTypeName)) { - String gNameTemp = field.getType().getGenericCanonicalName(); - String[] gNameArr = DocClassUtil.getSimpleGicName(gNameTemp); - if (gNameArr.length == 0) { - continue; - } - String gName = DocClassUtil.getSimpleGicName(gNameTemp)[0]; - if (JavaClassValidateUtil.isPrimitive(gName)) { - String fieldValue; - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - fieldValue = tagsMap.get(DocTags.MOCK); - } else { - String val = DocUtil.getValByTypeAndFieldName(gName, field.getName()); - fieldValue = val + "," + val; - } - FormData formData = new FormData(); - formData.setKey(pre + fieldName); - formData.setType("text"); - formData.setValue(fieldValue); - formData.setDescription(comment); - formDataList.add(formData); - } else { - if (!simpleName.equals(gName)) { - if (gName.length() == 1) { - int len = globGicName.length; - if (len > 0) { - String gicName = globGicName[n]; - if (!JavaClassValidateUtil.isPrimitive(gicName) && !simpleName.equals(gicName)) { - formDataList.addAll(getFormData(gicName, registryClasses, counter, builder, pre + fieldName + "[0].")); - } - } - } else { - formDataList.addAll(getFormData(gName, registryClasses, counter, builder, pre + fieldName + "[0].")); - } - } - } - } else if (subTypeName.length() == 1 || DocGlobalConstants.JAVA_OBJECT_FULLY.equals(subTypeName)) { - // For Generics,do nothing, spring mvc not support -// if (n < globGicName.length) { -// String gicName = globGicName[n]; -// formDataList.addAll(getFormData(gicName, registryClasses, counter, builder, pre + fieldName + ".")); -// } -// n++; - } else { - formDataList.addAll(getFormData(fieldGicName, registryClasses, counter, builder, pre + fieldName + ".")); - } - } - return formDataList; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JavaProjectBuilderHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JavaProjectBuilderHelper.java deleted file mode 100644 index 8a3d64a6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JavaProjectBuilderHelper.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.helper; - -import com.thoughtworks.qdox.JavaProjectBuilder; -import com.thoughtworks.qdox.library.ClassLibraryBuilder; - -/** - * the helper to create {@link JavaProjectBuilder} object - * - * @author luchuanbaker@qq.com - */ -public class JavaProjectBuilderHelper { - - public static JavaProjectBuilder create() { - return new JavaProjectBuilder(); - } - - public static JavaProjectBuilder create(ClassLibraryBuilder classLibraryBuilder) { - return new JavaProjectBuilder(classLibraryBuilder); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JsonBuildHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JsonBuildHelper.java deleted file mode 100644 index 2309e0ff..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/JsonBuildHelper.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.helper; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.constants.ValidatorAnnotations; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiReturn; -import com.power.doc.model.CustomField; -import com.power.doc.model.DocJavaField; -import com.power.doc.model.DocJavaMethod; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassUtil; -import com.power.doc.utils.JavaClassValidateUtil; -import com.power.doc.utils.JavaFieldUtil; -import com.power.doc.utils.JsonUtil; -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaField; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaType; - -import static com.power.doc.constants.DocTags.IGNORE_RESPONSE_BODY_ADVICE; - - -/** - * @author yu 2019/12/21. - */ -public class JsonBuildHelper extends BaseHelper { - - /** - * build return json - * - * @param docJavaMethod The JavaMethod object - * @param builder ProjectDocConfigBuilder builder - * @return String - */ - public static String buildReturnJson(DocJavaMethod docJavaMethod, ProjectDocConfigBuilder builder) { - JavaMethod method = docJavaMethod.getJavaMethod(); - String responseBodyAdvice = null; - if (Objects.nonNull(builder.getApiConfig().getResponseBodyAdvice())) { - responseBodyAdvice = builder.getApiConfig().getResponseBodyAdvice().getClassName(); - } - if (method.getReturns().isVoid() && Objects.isNull(responseBodyAdvice)) { - return "Return void."; - } - DocletTag downloadTag = method.getTagByName(DocTags.DOWNLOAD); - if (Objects.nonNull(downloadTag)) { - return "File download."; - } - if (method.getReturns().isEnum() && Objects.isNull(responseBodyAdvice)) { - return StringUtil.removeQuotes(String.valueOf(JavaClassUtil.getEnumValue(method.getReturns(), Boolean.FALSE))); - } - if (method.getReturns().isPrimitive() && Objects.isNull(responseBodyAdvice)) { - String typeName = method.getReturnType().getCanonicalName(); - return StringUtil.removeQuotes(DocUtil.jsonValueByType(typeName)); - } - if (DocGlobalConstants.JAVA_STRING_FULLY.equals(method.getReturnType().getGenericCanonicalName()) - && Objects.isNull(responseBodyAdvice)) { - return "string"; - } - String returnTypeGenericCanonicalName = method.getReturnType().getGenericCanonicalName(); - if (Objects.nonNull(responseBodyAdvice) - && Objects.isNull(method.getTagByName(IGNORE_RESPONSE_BODY_ADVICE))) { - if (!returnTypeGenericCanonicalName.startsWith(responseBodyAdvice)) { - StringBuilder sb = new StringBuilder(); - sb.append(responseBodyAdvice) - .append("<") - .append(returnTypeGenericCanonicalName).append(">"); - returnTypeGenericCanonicalName = sb.toString(); - } - } - ApiReturn apiReturn = DocClassUtil.processReturnType(returnTypeGenericCanonicalName); - String typeName = apiReturn.getSimpleName(); - if (JavaClassValidateUtil.isFileDownloadResource(typeName)) { - docJavaMethod.setDownload(true); - return "File download."; - } - Map actualTypesMap = docJavaMethod.getActualTypesMap(); - String returnType = apiReturn.getGenericCanonicalName(); - if (Objects.nonNull(actualTypesMap)) { - for (Map.Entry entry : actualTypesMap.entrySet()) { - typeName = typeName.replace(entry.getKey(), entry.getValue().getCanonicalName()); - returnType = returnType.replace(entry.getKey(), entry.getValue().getCanonicalName()); - } - } - if (JavaClassValidateUtil.isPrimitive(typeName)) { - if (DocGlobalConstants.JAVA_STRING_FULLY.equals(typeName)) { - return "string"; - } - return StringUtil.removeQuotes(DocUtil.jsonValueByType(typeName)); - } - - return JsonUtil.toPrettyFormat(buildJson(typeName, returnType, Boolean.TRUE, 0, - new HashMap<>(), new HashSet<>(0), builder)); - } - - /** - * @param typeName type name - * @param genericCanonicalName genericCanonicalName - * @param isResp Response flag - * @param counter Recursive counter - * @param registryClasses class container - * @param groupClasses valid group class - * @param builder project config builder - * @return String - */ - public static String buildJson(String typeName, String genericCanonicalName, - boolean isResp, int counter, Map registryClasses, Set groupClasses, ProjectDocConfigBuilder builder) { - - Map genericMap = new HashMap<>(10); - JavaClass javaClass = builder.getJavaProjectBuilder().getClassByName(typeName); - ApiConfig apiConfig = builder.getApiConfig(); - if (counter > apiConfig.getRecursionLimit()) { - return "{\"$ref\":\"...\"}"; - } - if (registryClasses.containsKey(typeName) && counter > registryClasses.size()) { - return "{\"$ref\":\"...\"}"; - } - int nextLevel = counter + 1; - registryClasses.put(typeName, typeName); - if (JavaClassValidateUtil.isMvcIgnoreParams(typeName, builder.getApiConfig().getIgnoreRequestParams())) { - if (DocGlobalConstants.MODE_AND_VIEW_FULLY.equals(typeName)) { - return "Forward or redirect to a page view."; - } else { - return "Error restful return."; - } - } - if (JavaClassValidateUtil.isPrimitive(typeName)) { - return StringUtil.removeQuotes(DocUtil.jsonValueByType(typeName)); - } - if (javaClass.isEnum()) { - return StringUtil.removeQuotes(String.valueOf(JavaClassUtil.getEnumValue(javaClass, Boolean.FALSE))); - } - boolean skipTransientField = apiConfig.isSkipTransientField(); - StringBuilder data0 = new StringBuilder(); - JavaClass cls = builder.getClassByName(typeName); - - data0.append("{"); - String[] globGicName = DocClassUtil.getSimpleGicName(genericCanonicalName); - if (Objects.isNull(globGicName) || globGicName.length < 1) { - // obtain generics from parent class - JavaClass superJavaClass = cls != null ? cls.getSuperJavaClass() : null; - if (Objects.nonNull(superJavaClass) && !"Object".equals(superJavaClass.getSimpleName())) { - globGicName = DocClassUtil.getSimpleGicName(superJavaClass.getGenericFullyQualifiedName()); - } - } - JavaClassUtil.genericParamMap(genericMap, cls, globGicName); - StringBuilder data = new StringBuilder(); - if (JavaClassValidateUtil.isCollection(typeName) || JavaClassValidateUtil.isArray(typeName)) { - data.append("["); - if (globGicName.length == 0) { - data.append("{\"object\":\"any object\"}"); - data.append("]"); - return data.toString(); - } - String gNameTemp = globGicName[0]; - String gName = JavaClassValidateUtil.isArray(gNameTemp) ? gNameTemp.substring(0, gNameTemp.indexOf("[")) : globGicName[0]; - if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(gName)) { - data.append("{\"waring\":\"You may use java.util.Object instead of display generics in the List\"}"); - } else if (JavaClassValidateUtil.isPrimitive(gName)) { - data.append(DocUtil.jsonValueByType(gName)).append(","); - data.append(DocUtil.jsonValueByType(gName)); - } else if (gName.contains("<")) { - String simple = DocClassUtil.getSimpleName(gName); - String json = buildJson(simple, gName, isResp, nextLevel, registryClasses, groupClasses, builder); - data.append(json); - } else if (JavaClassValidateUtil.isCollection(gName)) { - data.append("\"any object\""); - } else { - String json = buildJson(gName, gName, isResp, nextLevel, registryClasses, groupClasses, builder); - data.append(json); - } - data.append("]"); - return data.toString(); - } else if (JavaClassValidateUtil.isMap(typeName)) { - String[] getKeyValType = DocClassUtil.getMapKeyValueType(genericCanonicalName); - if (getKeyValType.length == 0) { - data.append("{\"mapKey\":{}}"); - return data.toString(); - } - if ((!DocGlobalConstants.JAVA_STRING_FULLY.equals(getKeyValType[0])) && apiConfig.isStrict()) { - throw new RuntimeException("Map's key can only use String for json,but you use " + getKeyValType[0]); - } - String gicName = genericCanonicalName.substring(genericCanonicalName.indexOf(",") + 1, genericCanonicalName.lastIndexOf(">")); - if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(gicName)) { - data.append("{").append("\"mapKey\":") - .append("{\"waring\":\"You may use java.util.Object for Map value; smart-doc can't be handle.\"}") - .append("}"); - } else if (JavaClassValidateUtil.isPrimitive(gicName)) { - data.append("{").append("\"mapKey1\":").append(DocUtil.jsonValueByType(gicName)).append(","); - data.append("\"mapKey2\":").append(DocUtil.jsonValueByType(gicName)).append("}"); - } else if (gicName.contains("<")) { - String simple = DocClassUtil.getSimpleName(gicName); - String json = buildJson(simple, gicName, isResp, nextLevel, registryClasses, groupClasses, builder); - data.append("{").append("\"mapKey\":").append(json).append("}"); - } else { - data.append("{").append("\"mapKey\":") - .append(buildJson(gicName, genericCanonicalName, isResp, counter + 1, registryClasses, groupClasses, builder)).append("}"); - } - return data.toString(); - } else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(typeName)) { - data.append("{\"object\":\" any object\"},"); - // throw new RuntimeException("Please do not return java.lang.Object directly in api interface."); - } else if (JavaClassValidateUtil.isReactor(typeName)) { - data.append(buildJson(globGicName[0], typeName, isResp, nextLevel, registryClasses, groupClasses, builder)); - return data.toString(); - } else { - boolean requestFieldToUnderline = builder.getApiConfig().isRequestFieldToUnderline(); - boolean responseFieldToUnderline = builder.getApiConfig().isResponseFieldToUnderline(); - List fields = JavaClassUtil.getFields(cls, 0, new LinkedHashMap<>()); - Map ignoreFields = JavaClassUtil.getClassJsonIgnoreFields(cls); - out: - for (DocJavaField docField : fields) { - JavaField field = docField.getJavaField(); - if (field.isTransient() && skipTransientField) { - continue; - } - String fieldName = docField.getFieldName(); - if (ignoreFields.containsKey(fieldName)) { - continue; - } - String subTypeName = docField.getFullyQualifiedName(); - if ((responseFieldToUnderline && isResp) || (requestFieldToUnderline && !isResp)) { - fieldName = StringUtil.camelToUnderline(fieldName); - } - Map tagsMap = DocUtil.getFieldTagsValue(field, docField); - if (!isResp) { - if (tagsMap.containsKey(DocTags.IGNORE)) { - continue; - } - } - List annotations = docField.getAnnotations(); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - if (ValidatorAnnotations.NULL.equals(annotationName) && !isResp) { - Set groupClassList = JavaClassUtil.getParamGroupJavaClass(annotation); - for (String groupClass : groupClassList) { - if (groupClasses.contains(groupClass)) { - continue out; - } - } - } - if (JavaClassValidateUtil.isIgnoreFieldJson(annotation, isResp)) { - continue out; - } - if (DocAnnotationConstants.SHORT_JSON_FIELD.equals(annotationName)) { - if (null != annotation.getProperty(DocAnnotationConstants.NAME_PROP)) { - fieldName = StringUtil.removeQuotes(annotation.getProperty(DocAnnotationConstants.NAME_PROP).toString()); - } - } else if (DocAnnotationConstants.SHORT_JSON_PROPERTY.equals(annotationName)) { - if (null != annotation.getProperty(DocAnnotationConstants.VALUE_PROP)) { - fieldName = StringUtil.removeQuotes(annotation.getProperty(DocAnnotationConstants.VALUE_PROP).toString()); - } - } - } - String typeSimpleName = field.getType().getSimpleName(); - String fieldGicName = docField.getGenericCanonicalName(); - CustomField.Key key = CustomField.Key.create(docField.getDeclaringClassName(), fieldName); - - CustomField customResponseField = CustomField.nameEquals(key, builder.getCustomRespFieldMap()); - CustomField customRequestField = CustomField.nameEquals(key, builder.getCustomReqFieldMap()); - if (customRequestField != null) { - if (JavaClassUtil.isTargetChildClass(typeName, customRequestField.getOwnerClassName()) && (customRequestField.isIgnore()) - && !isResp) { - continue; - } else { - fieldName = StringUtil.isEmpty(customRequestField.getReplaceName()) ? fieldName : customRequestField.getReplaceName(); - } - } - if (customResponseField != null) { - if (JavaClassUtil.isTargetChildClass(typeName, customResponseField.getOwnerClassName()) && (customResponseField.isIgnore()) - && isResp) { - continue; - } else { - fieldName = StringUtil.isEmpty(customResponseField.getReplaceName()) ? fieldName : customResponseField.getReplaceName(); - } - } - data0.append("\"").append(fieldName).append("\":"); - String fieldValue = getFieldValueFromMock(subTypeName, tagsMap, typeSimpleName); - if (JavaClassValidateUtil.isPrimitive(subTypeName)) { - int data0Length = data0.length(); - if (StringUtil.isEmpty(fieldValue)) { - fieldValue = DocUtil.getValByTypeAndFieldName(typeSimpleName, field.getName()); - } - if (Objects.nonNull(customRequestField) && !isResp && typeName.equals(customRequestField.getOwnerClassName())) { - JavaFieldUtil.buildCustomField(data0, typeSimpleName, customRequestField); - } - if (Objects.nonNull(customResponseField) && isResp && typeName.equals(customResponseField.getOwnerClassName())) { - JavaFieldUtil.buildCustomField(data0, typeSimpleName, customResponseField); - } - if (data0.length() == data0Length) { - data0.append(fieldValue).append(","); - } - } else { - if (JavaClassValidateUtil.isCollection(subTypeName) || JavaClassValidateUtil.isArray(subTypeName)) { - if (StringUtil.isNotEmpty(fieldValue)) { - data0.append(fieldValue).append(","); - continue; - } - if (globGicName.length > 0 && "java.util.List".equals(fieldGicName)) { - fieldGicName = fieldGicName + ""; - } - if (JavaClassValidateUtil.isArray(subTypeName)) { - fieldGicName = fieldGicName.substring(0, fieldGicName.lastIndexOf("[")); - fieldGicName = "java.util.List<" + fieldGicName + ">"; - } - String gicName = DocClassUtil.getSimpleGicName(fieldGicName)[0]; - if (DocGlobalConstants.JAVA_STRING_FULLY.equals(gicName)) { - data0.append("[").append(DocUtil.jsonValueByType(gicName)).append("]").append(","); - } else if (DocGlobalConstants.JAVA_LIST_FULLY.equals(gicName)) { - data0.append("[{\"object\":\"any object\"}],"); - } else if (gicName.length() == 1) { - if (globGicName.length == 0) { - data0.append("[{\"object\":\"any object\"}],"); - continue; - } - String gicName1 = genericMap.get(gicName) == null ? globGicName[0] : genericMap.get(gicName); - if (DocGlobalConstants.JAVA_STRING_FULLY.equals(gicName1)) { - data0.append("[").append(DocUtil.jsonValueByType(gicName1)).append("]").append(","); - } else { - if (!typeName.equals(gicName1)) { - data0.append("[").append( - buildJson(DocClassUtil.getSimpleName(gicName1), gicName1, isResp, nextLevel, registryClasses, groupClasses, - builder)) - .append("]").append(","); - } else { - data0.append("[{\"$ref\":\"..\"}]").append(","); - } - } - } else { - if (!typeName.equals(gicName)) { - if (JavaClassValidateUtil.isMap(gicName)) { - data0.append("[{\"mapKey\":{}}],"); - continue; - } - JavaClass arraySubClass = builder.getJavaProjectBuilder().getClassByName(gicName); - if (arraySubClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(arraySubClass, Boolean.FALSE); - data0.append("[").append(value).append("],"); - continue; - } - data0.append("[").append(buildJson(gicName, fieldGicName, isResp, nextLevel, registryClasses, groupClasses, builder)) - .append("]").append(","); - } else { - data0.append("[{\"$ref\":\"..\"}]").append(","); - } - } - } else if (JavaClassValidateUtil.isMap(subTypeName)) { - if (StringUtil.isNotEmpty(fieldValue)) { - data0.append(fieldValue).append(","); - continue; - } - if (JavaClassValidateUtil.isMap(fieldGicName)) { - data0.append("{").append("\"mapKey\":{}},"); - continue; - } - String gicName = fieldGicName.substring(fieldGicName.indexOf(",") + 1, fieldGicName.indexOf(">")); - if (gicName.length() == 1) { - String gicName1 = ""; - if (Objects.nonNull(genericMap.get(gicName))) { - gicName1 = genericMap.get(gicName); - } else { - if (Objects.nonNull(globGicName) && globGicName.length > 0) { - gicName1 = globGicName[0]; - } - } - if (DocGlobalConstants.JAVA_STRING_FULLY.equals(gicName1)) { - data0.append("{").append("\"mapKey\":").append(DocUtil.jsonValueByType(gicName1)).append("},"); - } else { - if (!typeName.equals(gicName1)) { - data0.append("{").append("\"mapKey\":") - .append(buildJson(DocClassUtil.getSimpleName(gicName1), gicName1, isResp, nextLevel, registryClasses, - groupClasses, builder)).append("},"); - } else { - data0.append("{\"mapKey\":{}},"); - } - } - } else { - data0.append("{").append("\"mapKey\":") - .append(buildJson(gicName, fieldGicName, isResp, nextLevel, registryClasses, groupClasses, builder)) - .append("},"); - } - } else if (subTypeName.length() == 1) { - if (!typeName.equals(genericCanonicalName)) { - String gicName = genericMap.get(subTypeName) == null ? globGicName[0] : genericMap.get(subTypeName); - if (JavaClassValidateUtil.isPrimitive(gicName)) { - data0.append(DocUtil.jsonValueByType(gicName)).append(","); - } else { - String simple = DocClassUtil.getSimpleName(gicName); - data0.append(buildJson(simple, gicName, isResp, nextLevel, registryClasses, groupClasses, builder)).append(","); - } - } else { - data0.append("{},"); - } - } else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(subTypeName)) { - if (StringUtil.isNotEmpty(field.getComment())) { - // from source code - data0.append("{\"object\":\"any object\"},"); - } else { - data0.append("{},"); - } - } else if (typeName.equals(subTypeName)) { - data0.append("{\"$ref\":\"...\"}").append(","); - } else { - javaClass = field.getType(); - if (javaClass.isEnum()) { - // Override old value - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - data0.append(tagsMap.get(DocTags.MOCK)).append(","); - } else { - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.FALSE); - data0.append(value).append(","); - } - } else { - fieldGicName = DocUtil.formatFieldTypeGicName(genericMap, globGicName, fieldGicName); - data0.append(buildJson(subTypeName, fieldGicName, isResp, nextLevel, registryClasses, groupClasses, builder)).append(","); - } - } - } - } - } - if (data0.toString().contains(",")) { - data0.deleteCharAt(data0.lastIndexOf(",")); - } - data0.append("}"); - return data0.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/ParamsBuildHelper.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/ParamsBuildHelper.java deleted file mode 100644 index 6db32b92..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/helper/ParamsBuildHelper.java +++ /dev/null @@ -1,633 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.helper; - -import com.power.common.model.EnumDictionary; -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.constants.ValidatorAnnotations; -import com.power.doc.extension.json.PropertyNameHelper; -import com.power.doc.extension.json.PropertyNamingStrategies; -import com.power.doc.model.*; -import com.power.doc.utils.*; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaField; - -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import static com.power.doc.constants.DocGlobalConstants.*; - -/** - * @author yu 2019/12/21. - */ -public class ParamsBuildHelper extends BaseHelper { - - public static List buildParams(String className, String pre, int level, String isRequired, boolean isResp - , Map registryClasses, ProjectDocConfigBuilder projectBuilder, Set groupClasses - , int pid, boolean jsonRequest, AtomicInteger atomicInteger) { - Map genericMap = new HashMap<>(10); - - if (StringUtil.isEmpty(className)) { - throw new RuntimeException("Class name can't be null or empty."); - } - - ApiConfig apiConfig = projectBuilder.getApiConfig(); - int nextLevel = level + 1; - - // Check circular reference - List paramList = new ArrayList<>(); - if (level > apiConfig.getRecursionLimit()) { - return paramList; - } - if (registryClasses.containsKey(className) && level > registryClasses.size()) { - return paramList; - } - boolean skipTransientField = apiConfig.isSkipTransientField(); - boolean isShowJavaType = projectBuilder.getApiConfig().getShowJavaType(); - boolean requestFieldToUnderline = projectBuilder.getApiConfig().isRequestFieldToUnderline(); - boolean responseFieldToUnderline = projectBuilder.getApiConfig().isResponseFieldToUnderline(); - boolean displayActualType = projectBuilder.getApiConfig().isDisplayActualType(); - // Registry class - registryClasses.put(className, className); - String simpleName = DocClassUtil.getSimpleName(className); - String[] globGicName = DocClassUtil.getSimpleGicName(className); - JavaClass cls = projectBuilder.getClassByName(simpleName); - if (Objects.isNull(globGicName) || globGicName.length < 1) { - // obtain generics from parent class - JavaClass superJavaClass = cls != null ? cls.getSuperJavaClass() : null; - if (superJavaClass != null && !"Object".equals(superJavaClass.getSimpleName())) { - globGicName = DocClassUtil.getSimpleGicName(superJavaClass.getGenericFullyQualifiedName()); - } - } - PropertyNamingStrategies.NamingBase fieldNameConvert = null; - if (Objects.nonNull(cls)) { - List clsAnnotation = cls.getAnnotations(); - fieldNameConvert = PropertyNameHelper.translate(clsAnnotation); - } - JavaClassUtil.genericParamMap(genericMap, cls, globGicName); - List fields = JavaClassUtil.getFields(cls, 0, new LinkedHashMap<>()); - if (JavaClassValidateUtil.isPrimitive(simpleName)) { - String processedType = isShowJavaType ? simpleName : DocClassUtil.processTypeNameForParams(simpleName.toLowerCase()); - paramList.addAll(primitiveReturnRespComment(processedType, atomicInteger, pid)); - } else if (JavaClassValidateUtil.isCollection(simpleName) || JavaClassValidateUtil.isArray(simpleName)) { - if (!JavaClassValidateUtil.isCollection(globGicName[0])) { - String gNameTemp = globGicName[0]; - String gName = JavaClassValidateUtil.isArray(gNameTemp) ? gNameTemp.substring(0, gNameTemp.indexOf("[")) : globGicName[0]; - if (JavaClassValidateUtil.isPrimitive(gName)) { - String processedType = isShowJavaType ? simpleName : DocClassUtil.processTypeNameForParams(gName); - ApiParam param = ApiParam.of() - .setId(atomicOrDefault(atomicInteger, pid + 1)) - .setField(pre + " -") - .setType("array[" + processedType + "]") - .setPid(pid) - .setDesc("array of " + processedType) - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setRequired(Boolean.parseBoolean(isRequired)); - paramList.add(param); - } else { - if (JavaClassValidateUtil.isArray(gNameTemp)) { - gNameTemp = gNameTemp.substring(0, gNameTemp.indexOf("[")); - } - paramList.addAll(buildParams(gNameTemp, pre, nextLevel, isRequired, isResp - , registryClasses, projectBuilder, groupClasses, pid, jsonRequest, atomicInteger)); - } - } - } else if (JavaClassValidateUtil.isMap(simpleName)) { - paramList.addAll(buildMapParam(globGicName, pre, level, isRequired, isResp, - registryClasses, projectBuilder, groupClasses, pid, jsonRequest, nextLevel, atomicInteger)); - } else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(className)) { - ApiParam param = ApiParam.of() - .setClassName(className) - .setId(atomicOrDefault(atomicInteger, pid + 1)) - .setField(pre + "any object") - .setType("object") - .setPid(pid) - .setDesc(DocGlobalConstants.ANY_OBJECT_MSG) - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setRequired(Boolean.parseBoolean(isRequired)); - paramList.add(param); - } else if (JavaClassValidateUtil.isReactor(simpleName)) { - if (globGicName.length > 0) { - paramList.addAll(buildParams(globGicName[0], pre, nextLevel, isRequired, isResp - , registryClasses, projectBuilder, groupClasses, pid, jsonRequest, atomicInteger)); - } - } else { - Map ignoreFields = JavaClassUtil.getClassJsonIgnoreFields(cls); - - out: - for (DocJavaField docField : fields) { - JavaField field = docField.getJavaField(); - String maxLength = JavaFieldUtil.getParamMaxLength(field.getAnnotations()); - StringBuilder comment = new StringBuilder(); - comment.append(docField.getComment()); - if (field.isTransient() && skipTransientField) { - continue; - } - String fieldName = docField.getFieldName(); - if (Objects.nonNull(fieldNameConvert)) { - fieldName = fieldNameConvert.translate(fieldName); - } - if (ignoreFields.containsKey(fieldName)) { - continue; - } - - String subTypeName = docField.getFullyQualifiedName(); - if ((responseFieldToUnderline && isResp) || (requestFieldToUnderline && !isResp)) { - fieldName = StringUtil.camelToUnderline(fieldName); - } - String typeSimpleName = field.getType().getSimpleName(); - String fieldGicName = docField.getGenericCanonicalName(); - List javaAnnotations = docField.getAnnotations(); - - Map tagsMap = DocUtil.getFieldTagsValue(field, docField); - //since tag value - String since = DocGlobalConstants.DEFAULT_VERSION; - - if (tagsMap.containsKey(DocTags.IGNORE)) { - continue; - } else if (tagsMap.containsKey(DocTags.SINCE)) { - since = tagsMap.get(DocTags.SINCE); - } - - boolean strRequired = false; - int annotationCounter = 0; - CustomField.Key key = CustomField.Key.create(docField.getDeclaringClassName(), fieldName); - - CustomField customResponseField = CustomField.nameEquals(key, projectBuilder.getCustomRespFieldMap()); - CustomField customRequestField = CustomField.nameEquals(key, projectBuilder.getCustomReqFieldMap()); - if (customResponseField != null && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName()) - && (customResponseField.isIgnore()) && isResp) { - continue; - } - if (customRequestField != null && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName()) - && (customRequestField.isIgnore()) && !isResp) { - continue; - } - for (JavaAnnotation annotation : javaAnnotations) { - if (JavaClassValidateUtil.isIgnoreFieldJson(annotation, isResp)) { - continue out; - } - String simpleAnnotationName = annotation.getType().getValue(); - if (DocAnnotationConstants.SHORT_JSON_FIELD.equals(simpleAnnotationName)) { - if (null != annotation.getProperty(DocAnnotationConstants.NAME_PROP)) { - fieldName = StringUtil.removeQuotes(annotation.getProperty(DocAnnotationConstants.NAME_PROP).toString()); - } - } else if (DocAnnotationConstants.SHORT_JSON_PROPERTY.equals(simpleAnnotationName)) { - if (null != annotation.getProperty(DocAnnotationConstants.VALUE_PROP)) { - fieldName = StringUtil.removeQuotes(annotation.getProperty(DocAnnotationConstants.VALUE_PROP).toString()); - } - } else if (ValidatorAnnotations.NULL.equals(simpleAnnotationName) && !isResp) { - Set groupClassList = JavaClassUtil.getParamGroupJavaClass(annotation); - for (String javaClass : groupClassList) { - if (groupClasses.contains(javaClass)) { - continue out; - } - } - } else if (JavaClassValidateUtil.isJSR303Required(simpleAnnotationName) && !isResp) { - - annotationCounter++; - boolean hasGroup = false; - Set groupClassList = JavaClassUtil.getParamGroupJavaClass(annotation); - for (String javaClass : groupClassList) { - if (groupClasses.contains(javaClass)) { - hasGroup = true; - break; - } - } - if (hasGroup) { - strRequired = true; - } else if (CollectionUtil.isEmpty(groupClasses)) { - strRequired = true; - } - } - } - comment.append(JavaFieldUtil.getJsrComment(javaAnnotations)); - String fieldValue = BaseHelper.getFieldValueFromMock(subTypeName, tagsMap, typeSimpleName); - if (annotationCounter < 1) { - if (tagsMap.containsKey(DocTags.REQUIRED)) { - strRequired = true; - } - } - - // cover response value - if (Objects.nonNull(customResponseField) && isResp && Objects.nonNull(customResponseField.getValue()) - && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName())) { - fieldValue = String.valueOf(customResponseField.getValue()); - } - // cover request value - if (Objects.nonNull(customRequestField) && !isResp && Objects.nonNull(customRequestField.getValue()) - && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName())) { - fieldValue = String.valueOf(customRequestField.getValue()); - } - //cover required - if (customRequestField != null && !isResp && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName()) - && customRequestField.isRequire()) { - strRequired = true; - } - //cover comment - if (null != customRequestField && StringUtil.isNotEmpty(customRequestField.getDesc()) - && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName()) && !isResp) { - comment = new StringBuilder(customRequestField.getDesc()); - } - if (null != customResponseField && StringUtil.isNotEmpty(customResponseField.getDesc()) - && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName()) && isResp) { - comment = new StringBuilder(customResponseField.getDesc()); - } - //cover fieldName - if (null != customRequestField && StringUtil.isNotEmpty(customRequestField.getReplaceName()) - && JavaClassUtil.isTargetChildClass(simpleName, customRequestField.getOwnerClassName()) && !isResp) { - fieldName = customRequestField.getReplaceName(); - } - if (null != customResponseField && StringUtil.isNotEmpty(customResponseField.getReplaceName()) - && JavaClassUtil.isTargetChildClass(simpleName, customResponseField.getOwnerClassName()) && isResp) { - fieldName = customResponseField.getReplaceName(); - } - // file - if (JavaClassValidateUtil.isFile(fieldGicName)) { - ApiParam param = ApiParam.of().setField(pre + fieldName).setType("file") - .setClassName(className) - .setPid(pid) - .setId(atomicOrDefault(atomicInteger, paramList.size() + pid + 1)) - .setMaxLength(maxLength) - .setDesc(comment.toString()) - .setRequired(Boolean.parseBoolean(isRequired)) - .setVersion(since); - if (fieldGicName.contains("[]") || fieldGicName.endsWith(">")) { - param.setType(DocGlobalConstants.PARAM_TYPE_FILE); - param.setDesc(comment.append("(array of file)").toString()); - param.setHasItems(true); - } - paramList.add(param); - continue; - } - if (JavaClassValidateUtil.isPrimitive(subTypeName)) { - if (StringUtil.isEmpty(fieldValue)) { - fieldValue = DocUtil.getValByTypeAndFieldName(subTypeName, field.getName()); - } - ApiParam param = ApiParam.of().setClassName(className).setField(pre + fieldName); - param.setPid(pid).setMaxLength(maxLength).setValue(fieldValue); - param.setId(atomicOrDefault(atomicInteger, paramList.size() + param.getPid() + 1)); - String processedType = isShowJavaType ? subTypeName : DocClassUtil.processTypeNameForParams(subTypeName.toLowerCase()); - param.setType(processedType); - // handle param - commonHandleParam(paramList, param, isRequired, comment.toString(), since, strRequired); - - JavaClass enumClass = ParamUtil.handleSeeEnum(param, field, projectBuilder, jsonRequest, tagsMap); - if (Objects.nonNull(enumClass)) { - String enumClassComment = EMPTY; - if (StringUtil.isNotEmpty(enumClass.getComment())) { - enumClassComment = enumClass.getComment(); - } - comment = new StringBuilder(StringUtils.isEmpty(comment.toString()) ? enumClassComment : comment.toString()); - String enumComment = handleEnumComment(enumClass, projectBuilder); - param.setDesc(comment + enumComment); - } - } else { - String appendComment = ""; - if (displayActualType) { - if (globGicName.length > 0) { - String gicName = genericMap.get(subTypeName) != null ? genericMap.get(subTypeName) : globGicName[0]; - if (!simpleName.equals(gicName)) { - appendComment = " (类: " + JavaClassUtil.getClassSimpleName(gicName) + ")"; - } - } - if (Objects.nonNull(docField.getActualJavaType())) { - appendComment = " (类: " + JavaClassUtil.getClassSimpleName(docField.getActualJavaType()) + ")"; - } - } - - StringBuilder preBuilder = new StringBuilder(); - for (int j = 0; j < level; j++) { - preBuilder.append(DocGlobalConstants.FIELD_SPACE); - } - preBuilder.append("└─ "); - int fieldPid; - ApiParam param = ApiParam.of().setField(pre + fieldName).setClassName(className).setPid(pid).setMaxLength(maxLength); - param.setId(atomicOrDefault(atomicInteger, paramList.size() + param.getPid() + 1)); - String processedType; - if (typeSimpleName.length() == 1) { - String gicName = DocGlobalConstants.JAVA_OBJECT_FULLY; - if (Objects.nonNull(genericMap.get(typeSimpleName))) { - gicName = genericMap.get(subTypeName); - } else { - if (globGicName.length > 0) { - gicName = globGicName[0]; - } - } - if (JavaClassValidateUtil.isPrimitive(gicName)) { - processedType = DocClassUtil.processTypeNameForParams(gicName); - } else { - processedType = DocClassUtil.processTypeNameForParams(typeSimpleName.toLowerCase()); - } - } else { - processedType = isShowJavaType ? typeSimpleName : DocClassUtil.processTypeNameForParams(typeSimpleName.toLowerCase()); - } - param.setType(processedType); - JavaClass javaClass = field.getType(); - if (javaClass.isEnum()) { - comment.append(handleEnumComment(javaClass, projectBuilder)); - ParamUtil.handleSeeEnum(param, field, projectBuilder, jsonRequest, tagsMap); - // hand Param - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - } else if (JavaClassValidateUtil.isCollection(subTypeName) || JavaClassValidateUtil.isArray(subTypeName)) { - if (isShowJavaType) { - // rpc - param.setType(subTypeName); - } else { - param.setType("array"); - } - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - param.setValue(fieldValue); - } - if (globGicName.length > 0 && "java.util.List".equals(fieldGicName)) { - // no generic, just object - fieldGicName = fieldGicName + "<" + DocGlobalConstants.JAVA_OBJECT_FULLY + ">"; - } - if (JavaClassValidateUtil.isArray(subTypeName)) { - fieldGicName = fieldGicName.substring(0, fieldGicName.lastIndexOf("[")); - fieldGicName = "java.util.List<" + fieldGicName + ">"; - } - String[] gNameArr = DocClassUtil.getSimpleGicName(fieldGicName); - if (gNameArr.length == 0) { - continue; - } - if (gNameArr.length > 0) { - String gName = DocClassUtil.getSimpleGicName(fieldGicName)[0]; - JavaClass javaClass1 = projectBuilder.getJavaProjectBuilder().getClassByName(gName); - comment.append(handleEnumComment(javaClass1, projectBuilder)); - } - String gName = gNameArr[0]; - if (JavaClassValidateUtil.isPrimitive(gName)) { - String builder = DocUtil.jsonValueByType(gName) + "," + DocUtil.jsonValueByType(gName); - - if (StringUtil.isEmpty(fieldValue)) { - param.setValue(DocUtil.handleJsonStr(builder)); - } else { - param.setValue(fieldValue); - } - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - } else { - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - fieldPid = Optional.ofNullable(atomicInteger).isPresent() ? param.getId() : paramList.size() + pid; - if (!simpleName.equals(gName)) { - JavaClass arraySubClass = projectBuilder.getJavaProjectBuilder().getClassByName(gName); - if (arraySubClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(arraySubClass, Boolean.FALSE); - param.setValue("[\"" + value + "\"]") - .setEnumInfo(JavaClassUtil.getEnumInfo(arraySubClass, projectBuilder)) - .setEnumValues(JavaClassUtil.getEnumValues(arraySubClass)); - } else if (gName.length() == 1) { - // handle generic - int len = globGicName.length; - if (len < 1) { - continue; - } - String gicName = genericMap.get(gName) != null ? genericMap.get(gName) : globGicName[0]; - - if (!JavaClassValidateUtil.isPrimitive(gicName) && !simpleName.equals(gicName)) { - paramList.addAll(buildParams(gicName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - paramList.addAll(buildParams(gName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - param.setSelfReferenceLoop(true); - } - } - - } else if (JavaClassValidateUtil.isMap(subTypeName)) { - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - param.setType("map"); - param.setValue(fieldValue); - } - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - fieldPid = Optional.ofNullable(atomicInteger).isPresent() ? param.getId() : paramList.size() + pid; - String valType = DocClassUtil.getMapKeyValueType(fieldGicName).length == 0 ? fieldGicName - : DocClassUtil.getMapKeyValueType(fieldGicName)[1]; - if (JavaClassValidateUtil.isMap(fieldGicName) || JAVA_OBJECT_FULLY.equals(valType)) { - ApiParam param1 = ApiParam.of() - .setField(preBuilder.toString() + "any object") - .setId(atomicOrDefault(atomicInteger, fieldPid + 1)).setPid(fieldPid) - .setClassName(className) - .setMaxLength(maxLength) - .setType("object") - .setDesc(DocGlobalConstants.ANY_OBJECT_MSG) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param1); - continue; - } - if (!JavaClassValidateUtil.isPrimitive(valType)) { - if (valType.length() == 1) { - String gicName = genericMap.get(valType); - if (!JavaClassValidateUtil.isPrimitive(gicName) && !simpleName.equals(gicName)) { - paramList.addAll(buildParams(gicName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - paramList.addAll(buildParams(valType, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } - } else if (DocGlobalConstants.JAVA_OBJECT_FULLY.equals(subTypeName)) { - if (StringUtil.isEmpty(param.getDesc())) { - param.setDesc(DocGlobalConstants.ANY_OBJECT_MSG); - } - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - } else if (subTypeName.length() == 1) { - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - fieldPid = Optional.ofNullable(atomicInteger).isPresent() ? param.getId() : paramList.size() + pid; - // handle java generic or object - if (!simpleName.equals(className)) { - if (globGicName.length > 0) { - String gicName = genericMap.get(subTypeName) != null ? genericMap.get(subTypeName) : globGicName[0]; - String simple = DocClassUtil.getSimpleName(gicName); - // set type array - if (JavaClassValidateUtil.isArray(gicName)) { - param.setType(ARRAY); - } - if (JavaClassValidateUtil.isPrimitive(simple)) { - //do nothing - } else if (gicName.contains("<")) { - if (JavaClassValidateUtil.isCollection(simple)) { - param.setType(ARRAY); - String gName = DocClassUtil.getSimpleGicName(gicName)[0]; - if (!JavaClassValidateUtil.isPrimitive(gName)) { - paramList.addAll(buildParams(gName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - paramList.addAll(buildParams(gicName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - paramList.addAll(buildParams(gicName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } else { - paramList.addAll(buildParams(subTypeName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - } - } - } else if (simpleName.equals(subTypeName)) { - // reference self - ApiParam param1 = ApiParam.of() - .setField(pre + fieldName) - .setPid(pid) - .setId(atomicOrDefault(atomicInteger, paramList.size() + pid + 1)) - .setClassName(subTypeName) - .setMaxLength(maxLength) - .setType("object") - .setDesc(comment.append(" $ref... self").toString()) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param1); - } else { - commonHandleParam(paramList, param, isRequired, comment + appendComment, since, strRequired); - fieldGicName = DocUtil.formatFieldTypeGicName(genericMap, globGicName, fieldGicName); - fieldPid = Optional.ofNullable(atomicInteger).isPresent() ? param.getId() : paramList.size() + pid; - paramList.addAll(buildParams(fieldGicName, preBuilder.toString(), nextLevel, isRequired - , isResp, registryClasses, projectBuilder, groupClasses, fieldPid, jsonRequest, atomicInteger)); - - } - } - }//end field - } - return paramList; - } - - private static List buildMapParam(String[] globGicName, String pre, int level, String isRequired, boolean isResp, - Map registryClasses, - ProjectDocConfigBuilder projectBuilder, Set groupClasses, int pid, boolean jsonRequest, - int nextLevel, AtomicInteger atomicInteger) { - if (globGicName.length != 2) { - return Collections.emptyList(); - } - - // mock map key param - String mapKeySimpleName = DocClassUtil.getSimpleName(globGicName[0]); - String valueSimpleName = DocClassUtil.getSimpleName(globGicName[1]); - - List paramList = new ArrayList<>(); - if (JavaClassValidateUtil.isPrimitive(mapKeySimpleName)) { - boolean isShowJavaType = projectBuilder.getApiConfig().getShowJavaType(); - String valueSimpleNameType = isShowJavaType ? valueSimpleName : DocClassUtil.processTypeNameForParams(valueSimpleName.toLowerCase()); - ApiParam apiParam = ApiParam.of().setField(pre + "mapKey") - .setType(valueSimpleNameType) - .setClassName(valueSimpleName) - .setDesc(Optional.ofNullable(projectBuilder.getClassByName(valueSimpleName)).map(JavaClass::getComment).orElse("A map key.")) - .setVersion(DEFAULT_VERSION) - .setPid(pid) - .setId(atomicOrDefault(atomicInteger, ++pid)); - paramList.add(apiParam); - } - // build param when map value is not primitive - if (JavaClassValidateUtil.isPrimitive(valueSimpleName)) { - return paramList; - } - StringBuilder preBuilder = new StringBuilder(); - for (int j = 0; j < level; j++) { - preBuilder.append(DocGlobalConstants.FIELD_SPACE); - } - preBuilder.append("└─ "); - paramList.addAll(buildParams(globGicName[1], preBuilder.toString(), ++nextLevel, isRequired, isResp - , registryClasses, projectBuilder, groupClasses, pid, jsonRequest, atomicInteger)); - return paramList; - } - - public static String dictionaryListComment(List enumDataDict) { - return enumDataDict.stream().map(apiDataDictionary -> - apiDataDictionary.getName() + "-(\"" + apiDataDictionary.getValue() + "\",\"" + apiDataDictionary.getDesc() + "\")" - ).collect(Collectors.joining(",")); - } - - public static List primitiveReturnRespComment(String typeName, AtomicInteger atomicInteger, int pid) { - String comments = "Return " + typeName + "."; - ApiParam apiParam = ApiParam.of().setClassName(typeName) - .setId(atomicOrDefault(atomicInteger, pid + 1)) - .setField("-") - .setPid(pid) - .setType(typeName) - .setDesc(comments) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - - List paramList = new ArrayList<>(); - paramList.add(apiParam); - return paramList; - } - - private static void commonHandleParam(List paramList, ApiParam param, String isRequired - , String comment, String since, boolean strRequired) { - if (StringUtil.isEmpty(isRequired)) { - param.setDesc(comment).setVersion(since); - } else { - param.setDesc(comment).setVersion(since).setRequired(strRequired); - } - paramList.add(param); - } - - private static String handleEnumComment(JavaClass javaClass, ProjectDocConfigBuilder projectBuilder) { - String comment = ""; - if (!javaClass.isEnum()) { - return comment; - } - String enumComments = javaClass.getComment(); - if (Boolean.TRUE.equals(projectBuilder.getApiConfig().getInlineEnum())) { - ApiDataDictionary dataDictionary = projectBuilder.getApiConfig().getDataDictionary(javaClass.getCanonicalName()); - if (Objects.isNull(dataDictionary)) { - comment = comment + "
[Enum values:
" + JavaClassUtil.getEnumParams(javaClass) + "]"; - } else { - Class enumClass = dataDictionary.getEnumClass(); - if (enumClass.isInterface()) { - ClassLoader classLoader = projectBuilder.getApiConfig().getClassLoader(); - try { - enumClass = classLoader.loadClass(javaClass.getFullyQualifiedName()); - } catch (ClassNotFoundException e) { - return comment; - } - } - comment = comment + "
[Enum:" + dictionaryListComment(dataDictionary.getEnumDataDict(enumClass)) + "]"; - } - } else { - if (StringUtil.isNotEmpty(enumComments)) { - comment = comment + "
(See: " + enumComments + ")"; - } - comment = StringUtil.removeQuotes(comment); - } - return comment; - } - - private static int atomicOrDefault(AtomicInteger atomicInteger, int defaultVal) { - if (null != atomicInteger) { - return atomicInteger.incrementAndGet(); - } - return defaultVal; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiAllData.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiAllData.java deleted file mode 100644 index 20b4b9d8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiAllData.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -/** - * @author yu 2019/12/7. - * @since 1.7.9 - */ -public class ApiAllData { - - /** - * project name - */ - private String projectName; - - /** - * project id - */ - private String projectId; - - /** - * docLanguage - */ - private String language; - - /** - * doc list - */ - private List apiDocList; - - /** - * - */ - private List apiDocDictList; - - /** - * error code list - */ - private List errorCodeList; - - /** - * List of change log - */ - private List revisionLogs; - - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - public List getApiDocList() { - return apiDocList; - } - - public void setApiDocList(List apiDocList) { - this.apiDocList = apiDocList; - } - - public List getErrorCodeList() { - return errorCodeList; - } - - public void setErrorCodeList(List errorCodeList) { - this.errorCodeList = errorCodeList; - } - - public List getRevisionLogs() { - return revisionLogs; - } - - public void setRevisionLogs(List revisionLogs) { - this.revisionLogs = revisionLogs; - } - - public List getApiDocDictList() { - return apiDocDictList; - } - - public void setApiDocDictList(List apiDocDictList) { - this.apiDocDictList = apiDocDictList; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConfig.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConfig.java deleted file mode 100644 index 540504e2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConfig.java +++ /dev/null @@ -1,940 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.common.util.CollectionUtil; -import com.power.doc.constants.DocLanguage; -import com.power.doc.model.rpc.RpcApiDependency; - -import java.util.List; -import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; - -/** - * Description: - * api config info - * - * @author yu 2018/06/18. - */ -public class ApiConfig { - - /** - * Web server base url - */ - private String serverUrl; - - /** - * Web server base url for postman - */ - private String serverEnv; - - /** - * Path Prefix, eg: Servlet ContextPath - */ - private String pathPrefix = ""; - - /** - * Set comments check mode - */ - private boolean isStrict; - - /** - * Merge all api doc into one document - */ - private boolean allInOne; - - /** - * output path - */ - private String outPath; - - - /** - * source path - */ - private List sourceCodePaths; - - /** - * list of Request headers - */ - private List requestHeaders; - - /** - * @since 2.2.2 - * list of Request params - */ - private List requestParams; - - /** - * @since 1.7.5 - * cover old all in one markdown - */ - private boolean coverOld; - - /** - * list of custom response filed - */ - private List customResponseFields; - /** - * list of custom request field - */ - private List customRequestFields; - - /** - * List of error code - * - * @return - */ - - private List errorCodes; - - /** - * controller package filters - */ - private String packageFilters; - - /** - * controller package exclude filters - */ - private String packageExcludeFilters; - - /** - * List of change log - */ - private List revisionLogs; - - /** - * @since 1.7+ - */ - private boolean md5EncryptedHtmlName; - - /** - * language support - * - * @since 1.7+ - */ - private DocLanguage language; - - /** - * adoc flag - */ - private boolean adoc; - /** - * default /src/main/java - */ - private String codePath; - /** - * api data dictionary - */ - private List dataDictionaries; - private List dataDictionariesDynamic; - private transient ClassLoader classLoader; - /** - * @since 1.7.9 - * api error code dictionary - */ - private List errorCodeDictionaries; - /** - * list of custom response filed - */ - private List apiObjectReplacements; - /** - * list of rpc api dependencies - */ - private List rpcApiDependencies; - /** - * list of api constant - */ - private List apiConstants; - /** - * @since 2.0.7 - * project group - */ - private String group; - /** - * @since 1.7.5 - * project name - */ - private String projectName; - /** - * @since 2.0.7 - * project cn name - */ - private String projectCName; - /** - * Skip Transient Field - */ - private boolean skipTransientField = true; - /** - * @since 1.7.10 - * default show author - */ - private boolean showAuthor = true; - /** - * convert request field to underline - * - * @since 1.8.7 - */ - private boolean requestFieldToUnderline; - /** - * convert response field to underline - * - * @since 1.8.7 - */ - private boolean responseFieldToUnderline; - /** - * sort by title - * - * @since 1.8.7 - */ - private boolean sortByTitle; - /** - * is rest api doc - * - * @since 1.8.7 - */ - private Boolean showJavaType = Boolean.FALSE; - /** - * is inline enum field comment - * - * @since 1.8.8 - */ - private Boolean inlineEnum = Boolean.FALSE; - /** - * rpc consumer config example - * - * @since 1.8.7 - */ - private String rpcConsumerConfig; - /** - * recursion limit - * - * @since 1.8.8 - */ - private int recursionLimit = 7; - /** - * request example - * - * @since 1.9.0 - */ - private boolean requestExample = Boolean.TRUE; - /** - * response example - * - * @since 1.9.0 - */ - private boolean responseExample = Boolean.TRUE; - /** - * custom setting api document name - * - * @since 1.9.0 - */ - private String allInOneDocFileName; - /** - * convert param data to tree - */ - private boolean paramsDataToTree; - /** - * request ignore param - * - * @return - * @since 1.9.2 - */ - private List ignoreRequestParams; - /** - * display actual type of generic - * - * @since 1.9.6 - */ - private boolean displayActualType; - /** - * Support Spring MVC ResponseBodyAdvice - * - * @since 1.9.8 - */ - private BodyAdvice responseBodyAdvice; - /** - * @since 2.1.4 - */ - private BodyAdvice requestBodyAdvice; - private String style; - private String highlightStyleLink; - /** - * create debug page - */ - private boolean createDebugPage; - /** - * Spring MVC url suffix - * - * @since 2.1.0 - */ - private String urlSuffix; - /** - * Torna appKey - */ - private String appKey; - /** - * Torna Secret - */ - private String secret; - /** - * Torna appToken - */ - private String appToken; - /** - * Torna openUrl - */ - private String openUrl; - - /** - * public static final String APP_KEY = "20201216788835306945118208"; - * public static final String SECRET = "W.ZyGMOB9Q0UqujVxnfi@.I#V&tUUYZR"; - * public static final String APP_TOKEN = "2f9a7d3858a147b7845ebb48785d4dc7"; - * public static final String OPEN_URL = "http://torna.opensphere.cn/api/"; - * @return - */ - /** - * Debugging environment name - */ - private String debugEnvName; - /** - * Url of the debugging environment - */ - private String debugEnvUrl; - /** - * Show log when pushing document to torna - */ - private boolean tornaDebug = true; - /** - * The operator who pushes the document to Torna - */ - private String author; - /** - * smart-doc supported framework, if not set default is spring, - */ - private String framework; - private List groups; - /** - * replace old document while push to torna - * - * @since 2.2.4 - */ - private Boolean replace; - /** - * @since 2.2.5 - */ - private boolean requestParamsTable = Boolean.TRUE; - /** - * @since 2.2.5 - */ - private boolean responseParamsTable = Boolean.TRUE; - - public String getCodePath() { - return codePath; - } - - public ApiConfig setCodePath(String codePath) { - this.codePath = codePath; - return this; - } - - public ClassLoader getClassLoader() { - return classLoader; - } - - public ApiConfig setClassLoader(ClassLoader classLoader) { - this.classLoader = classLoader; - return this; - } - - public String getPackageExcludeFilters() { - return packageExcludeFilters; - } - - public ApiConfig setPackageExcludeFilters(String packageExcludeFilters) { - this.packageExcludeFilters = packageExcludeFilters; - return this; - } - - public String getPathPrefix() { - return pathPrefix; - } - - public void setPathPrefix(String pathPrefix) { - this.pathPrefix = pathPrefix; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public boolean isTornaDebug() { - return tornaDebug; - } - - public void setTornaDebug(boolean tornaDebug) { - this.tornaDebug = tornaDebug; - } - - public String getAppKey() { - return appKey; - } - - public void setAppKey(String appKey) { - this.appKey = appKey; - } - - public String getSecret() { - return secret; - } - - public void setSecret(String secret) { - this.secret = secret; - } - - public String getAppToken() { - return appToken; - } - - public void setAppToken(String appToken) { - this.appToken = appToken; - } - - public String getOpenUrl() { - return openUrl; - } - - public void setOpenUrl(String openUrl) { - this.openUrl = openUrl; - } - - public String getServerUrl() { - return serverUrl; - } - - public void setServerUrl(String serverUrl) { - this.serverUrl = serverUrl; - } - - public boolean isStrict() { - return isStrict; - } - - public void setStrict(boolean strict) { - isStrict = strict; - } - - public String getOutPath() { - return outPath; - } - - public void setOutPath(String outPath) { - this.outPath = outPath; - } - - public List getRequestHeaders() { - return requestHeaders; - } - - public void setRequestHeaders(List requestHeaders) { - this.requestHeaders = requestHeaders; - } - - public void setRequestHeaders(ApiReqParam... requestHeaders) { - this.requestHeaders = CollectionUtil.asList(requestHeaders); - this.requestHeaders.forEach(header -> header.setDesc(header.getDesc() + "(Global)")); - } - - public List getGroups() { - return groups; - } - - public ApiConfig setGroups(List groups) { - this.groups = groups; - return this; - } - - public ApiConfig setGroups(ApiGroup... groups) { - this.groups = CollectionUtil.asList(groups); - return this; - } - - - public List getRequestParams() { - return requestParams; - } - - public ApiConfig setRequestParams(List requestParams) { - this.requestParams = requestParams; - return this; - } - - public void setRequestParams(ApiReqParam... requestParams) { - this.requestParams = CollectionUtil.asList(requestParams); - this.requestParams.forEach(param -> param.setDesc(param.getDesc() + "(Global)")); - } - - public List getCustomResponseFields() { - return customResponseFields; - } - - public void setCustomResponseFields(List customResponseFields) { - this.customResponseFields = customResponseFields; - } - - public void setCustomResponseFields(CustomField... customResponseFields) { - this.customResponseFields = CollectionUtil.asList(customResponseFields); - } - - public List getErrorCodes() { - return errorCodes; - } - - public void setErrorCodes(List errorCodes) { - this.errorCodes = errorCodes; - } - - public List getSourceCodePaths() { - return sourceCodePaths; - } - - public void setSourceCodePaths(List sourceCodePaths) { - this.sourceCodePaths = sourceCodePaths; - } - - public void setSourceCodePaths(SourceCodePath... sourcePaths) { - this.sourceCodePaths = CollectionUtil.asList(sourcePaths); - } - - public boolean isAllInOne() { - return allInOne; - } - - public void setAllInOne(boolean allInOne) { - this.allInOne = allInOne; - } - - public String getPackageFilters() { - return packageFilters; - } - - public void setPackageFilters(String packageFilters) { - this.packageFilters = packageFilters; - } - - public List getRevisionLogs() { - return revisionLogs; - } - - public void setRevisionLogs(List revisionLogs) { - this.revisionLogs = revisionLogs; - } - - public void setRevisionLogs(RevisionLog... revisionLogs) { - this.revisionLogs = CollectionUtil.asList(revisionLogs); - } - - public boolean isMd5EncryptedHtmlName() { - return md5EncryptedHtmlName; - } - - public void setMd5EncryptedHtmlName(boolean md5EncryptedHtmlName) { - this.md5EncryptedHtmlName = md5EncryptedHtmlName; - } - - public DocLanguage getLanguage() { - return language; - } - - public void setLanguage(DocLanguage language) { - this.language = language; - } - - public boolean isAdoc() { - return adoc; - } - - public void setAdoc(boolean adoc) { - this.adoc = adoc; - } - - public List getDataDictionaries() { - return dataDictionaries; - } - - public void setDataDictionaries(List dataDictionaries) { - this.dataDictionaries = dataDictionaries; - } - - public void setDataDictionaries(ApiDataDictionary... dataDictConfigs) { - this.dataDictionaries = CollectionUtil.asList(dataDictConfigs); - } - - public ApiDataDictionary getDataDictionary(String enumClassName) { - if (Objects.isNull(this.dataDictionaries)) { - return null; - } - return this.dataDictionaries.stream().filter((apiDataDictionary -> - { - boolean equalsName = enumClassName.equalsIgnoreCase(apiDataDictionary.getEnumClassName()); - - Set> enumImplementSet = apiDataDictionary.getEnumImplementSet(); - if (CollectionUtil.isEmpty(enumImplementSet)) { - return equalsName; - } - Set collect = enumImplementSet.stream().map(Class::getName).collect(Collectors.toSet()); - return equalsName || collect.contains(enumClassName); - })) - .findFirst().orElse(null); - } - - public List getDataDictionariesDynamic() { - return dataDictionariesDynamic; - } - - public void setDataDictionariesDynamic(List dataDictionariesDynamic) { - this.dataDictionariesDynamic = dataDictionariesDynamic; - } - - public List getErrorCodeDictionaries() { - return errorCodeDictionaries; - } - - public void setErrorCodeDictionaries(List errorCodeDictionaries) { - this.errorCodeDictionaries = errorCodeDictionaries; - } - - public void setErrorCodeDictionaries(ApiErrorCodeDictionary... errorCodeDictConfigs) { - this.errorCodeDictionaries = CollectionUtil.asList(errorCodeDictConfigs); - } - - public List getApiObjectReplacements() { - return apiObjectReplacements; - } - - public void setApiObjectReplacements(List apiObjectReplacements) { - this.apiObjectReplacements = apiObjectReplacements; - } - - public void setApiObjectReplacements(ApiObjectReplacement... apiObjectReplaces) { - this.apiObjectReplacements = CollectionUtil.asList(apiObjectReplaces); - } - - public List getRpcApiDependencies() { - return rpcApiDependencies; - } - - public void setRpcApiDependencies(List rpcApiDependencies) { - this.rpcApiDependencies = rpcApiDependencies; - } - - public void setRpcApiDependencies(RpcApiDependency... rpcApiDependencies) { - this.rpcApiDependencies = CollectionUtil.asList(rpcApiDependencies); - } - - public List getApiConstants() { - return apiConstants; - } - - public void setApiConstants(List apiConstants) { - this.apiConstants = apiConstants; - } - - public void setApiConstants(ApiConstant... apiConstants) { - this.apiConstants = CollectionUtil.asList(apiConstants); - } - - public boolean isCoverOld() { - return coverOld; - } - - public void setCoverOld(boolean coverOld) { - this.coverOld = coverOld; - } - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getProjectCName() { - return projectCName; - } - - public void setProjectCName(String projectCName) { - this.projectCName = projectCName; - } - - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public boolean isSkipTransientField() { - return skipTransientField; - } - - public void setSkipTransientField(boolean skipTransientField) { - this.skipTransientField = skipTransientField; - } - - public boolean isShowAuthor() { - return showAuthor; - } - - public void setShowAuthor(boolean showAuthor) { - this.showAuthor = showAuthor; - } - - public boolean isRequestFieldToUnderline() { - return requestFieldToUnderline; - } - - public void setRequestFieldToUnderline(boolean requestFieldToUnderline) { - this.requestFieldToUnderline = requestFieldToUnderline; - } - - public boolean isResponseFieldToUnderline() { - return responseFieldToUnderline; - } - - public void setResponseFieldToUnderline(boolean responseFieldToUnderline) { - this.responseFieldToUnderline = responseFieldToUnderline; - } - - public boolean isSortByTitle() { - return sortByTitle; - } - - public void setSortByTitle(boolean sortByTitle) { - this.sortByTitle = sortByTitle; - } - - public Boolean getShowJavaType() { - return showJavaType; - } - - public void setShowJavaType(Boolean showJavaType) { - this.showJavaType = showJavaType; - } - - public String getRpcConsumerConfig() { - return rpcConsumerConfig; - } - - public void setRpcConsumerConfig(String rpcConsumerConfig) { - this.rpcConsumerConfig = rpcConsumerConfig; - } - - public Boolean getInlineEnum() { - return inlineEnum; - } - - public void setInlineEnum(Boolean inlineEnum) { - this.inlineEnum = inlineEnum; - } - - public int getRecursionLimit() { - return recursionLimit; - } - - public void setRecursionLimit(int recursionLimit) { - this.recursionLimit = recursionLimit; - } - - public boolean isRequestExample() { - return requestExample; - } - - public void setRequestExample(boolean requestExample) { - this.requestExample = requestExample; - } - - public boolean isResponseExample() { - return responseExample; - } - - public void setResponseExample(boolean responseExample) { - this.responseExample = responseExample; - } - - public String getAllInOneDocFileName() { - return allInOneDocFileName; - } - - public void setAllInOneDocFileName(String allInOneDocFileName) { - this.allInOneDocFileName = allInOneDocFileName; - } - - public boolean isParamsDataToTree() { - return paramsDataToTree; - } - - public void setParamsDataToTree(boolean paramsDataToTree) { - this.paramsDataToTree = paramsDataToTree; - } - - public List getIgnoreRequestParams() { - return ignoreRequestParams; - } - - public void setIgnoreRequestParams(List ignoreRequestParams) { - this.ignoreRequestParams = ignoreRequestParams; - } - - public boolean isDisplayActualType() { - return displayActualType; - } - - public void setDisplayActualType(boolean displayActualType) { - this.displayActualType = displayActualType; - } - - public BodyAdvice getResponseBodyAdvice() { - return responseBodyAdvice; - } - - public void setResponseBodyAdvice(BodyAdvice responseBodyAdvice) { - this.responseBodyAdvice = responseBodyAdvice; - } - - public BodyAdvice getRequestBodyAdvice() { - return requestBodyAdvice; - } - - public void setRequestBodyAdvice(BodyAdvice requestBodyAdvice) { - this.requestBodyAdvice = requestBodyAdvice; - } - - public String getStyle() { - return style; - } - - public void setStyle(String style) { - this.style = style; - } - - public boolean isCreateDebugPage() { - return createDebugPage; - } - - public void setCreateDebugPage(boolean createDebugPage) { - this.createDebugPage = createDebugPage; - } - - public String getDebugEnvName() { - return debugEnvName; - } - - public void setDebugEnvName(String debugEnvName) { - this.debugEnvName = debugEnvName; - } - - public String getDebugEnvUrl() { - return debugEnvUrl; - } - - public void setDebugEnvUrl(String debugEnvUrl) { - this.debugEnvUrl = debugEnvUrl; - } - - public String getUrlSuffix() { - return urlSuffix; - } - - public void setUrlSuffix(String urlSuffix) { - this.urlSuffix = urlSuffix; - } - - public List getCustomRequestFields() { - return customRequestFields; - } - - public ApiConfig setCustomRequestFields(List customRequestFields) { - this.customRequestFields = customRequestFields; - return this; - } - - public void setCustomRequestFields(CustomField... customRequestFields) { - this.customRequestFields = CollectionUtil.asList(customRequestFields); - } - - public String getFramework() { - return framework; - } - - public void setFramework(String framework) { - this.framework = framework; - } - - public Boolean getReplace() { - return replace; - } - - public void setReplace(Boolean replace) { - this.replace = replace; - } - - public boolean isRequestParamsTable() { - return requestParamsTable; - } - - public void setRequestParamsTable(boolean requestParamsTable) { - this.requestParamsTable = requestParamsTable; - } - - public boolean isResponseParamsTable() { - return responseParamsTable; - } - - public void setResponseParamsTable(boolean responseParamsTable) { - this.responseParamsTable = responseParamsTable; - } - - public String getHighlightStyleLink() { - return highlightStyleLink; - } - - public void setHighlightStyleLink(String highlightStyleLink) { - this.highlightStyleLink = highlightStyleLink; - } - - public String getServerEnv() { - return serverEnv; - } - - public void setServerEnv(String serverEnv) { - this.serverEnv = serverEnv; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConstant.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConstant.java deleted file mode 100644 index b8edac56..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiConstant.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * @author yu 2020/7/2. - */ -public class ApiConstant { - - /** - * Constants class - */ - private Class constantsClass; - - /** - * Constants class name - */ - private String constantsClassName; - - /** - * Description - */ - private String description; - - public static ApiConstant builder() { - return new ApiConstant(); - } - - public Class getConstantsClass() { - return constantsClass; - } - - public ApiConstant setConstantsClass(Class constantsClass) { - this.constantsClass = constantsClass; - return this; - } - - public String getConstantsClassName() { - return constantsClassName; - } - - public ApiConstant setConstantsClassName(String constantsClassName) { - this.constantsClassName = constantsClassName; - return this; - } - - public String getDescription() { - return description; - } - - public ApiConstant setDescription(String description) { - this.description = description; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"constantsClass\":") - .append(constantsClass); - sb.append(",\"constantsClassName\":\"") - .append(constantsClassName).append('\"'); - sb.append(",\"description\":\"") - .append(description).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDataDictionary.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDataDictionary.java deleted file mode 100644 index caf272f7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDataDictionary.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.common.model.EnumDictionary; -import com.power.common.util.EnumUtil; -import com.power.doc.utils.StringUtils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Set; - - -/** - * @author yu 2019/10/31. - */ -public class ApiDataDictionary { - - /** - * Dictionary - */ - private String title; - - /** - * enumClass - */ - private Class enumClass; - - /** - * enum implements - * when enumClass is interface - */ - private Set> enumImplementSet; - - /** - * enum class name - */ - private String enumClassName; - - /** - * code field - */ - private String codeField; - - /** - * description field - */ - private String descField; - - public static ApiDataDictionary builder() { - return new ApiDataDictionary(); - } - - - public String getTitle() { - return title; - } - - public ApiDataDictionary setTitle(String title) { - this.title = title; - return this; - } - - public Class getEnumClass() { - return enumClass; - } - - public ApiDataDictionary setEnumClass(Class enumClass) { - this.enumClass = enumClass; - if (StringUtils.isBlank(this.enumClassName) && Objects.nonNull(enumClass)) { - this.enumClassName = enumClass.getSimpleName(); - } - return this; - } - - public Set> getEnumImplementSet() { - return enumImplementSet; - } - - public ApiDataDictionary setEnumImplementSet(Set> enumImplementSet) { - this.enumImplementSet = enumImplementSet; - return this; - } - - public String getCodeField() { - return codeField; - } - - public ApiDataDictionary setCodeField(String codeField) { - this.codeField = codeField; - return this; - } - - public String getDescField() { - return descField; - } - - public ApiDataDictionary setDescField(String descField) { - this.descField = descField; - return this; - } - - public String getEnumClassName() { - return enumClassName; - } - - public ApiDataDictionary setEnumClassName(String enumClassName) { - this.enumClassName = enumClassName; - return this; - } - - public List getEnumDataDict(Class enumClass) { - if (Objects.nonNull(enumClass)) { - return EnumUtil.getEnumInformation(enumClass, this.getCodeField(), - this.getDescField()); - } else { - return new ArrayList<>(); - } - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"title\":\"") - .append(title).append('\"'); - sb.append(",\"enumClass\":") - .append(enumClass); - sb.append(",\"enumClassName\":\"") - .append(enumClassName).append('\"'); - sb.append(",\"codeField\":\"") - .append(codeField).append('\"'); - sb.append(",\"descField\":\"") - .append(descField).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDoc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDoc.java deleted file mode 100644 index ba00317f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDoc.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - - -import java.util.*; - -import com.power.common.util.StringUtil; - -public class ApiDoc implements Comparable { - - /** - * Order of controller - * - * @since 1.7+ - */ - public Integer order; - - /** - * controller name - */ - private String name; - - /** - * controller alias handled by md5 - * - * @since 1.7+ - */ - private String alias; - - /** - * tags - * - * @author cqmike - */ - private String[] tags; - - private final Set tagRefs = Collections.synchronizedSet(new LinkedHashSet<>()); - /** - * group - * - * @author cqmike - */ - private String group; - - /** - * class in package name - */ - private String packageName; - - /** - * List of method doc - */ - private List list; - - /** - * method description - */ - private String desc; - - /** - * link - */ - private String link; - - private String author; - - /** - * if this is group, then is true - */ - private boolean isFolder; - - /** - * children - */ - private List childrenApiDocs = new ArrayList<>(); - - public static ApiDoc buildTagApiDoc(ApiDoc source, String tag, ApiMethodDoc methodDoc) { - ApiDoc apiDoc = new ApiDoc(); - apiDoc.setAlias(source.getAlias()); - apiDoc.setLink(source.getLink()); - apiDoc.setDesc(tag); - apiDoc.setAuthor(source.getAuthor()); - apiDoc.setPackageName(source.getPackageName()); - apiDoc.setName(tag); - apiDoc.setList(new ArrayList<>()); - ApiMethodDoc clone = methodDoc.clone(); - clone.setOrder(apiDoc.getList().size() + 1); - apiDoc.getList().add(clone); - return apiDoc; - } - - public static ApiDoc buildGroupApiDoc(String group) { - ApiDoc apiDoc = new ApiDoc(); - apiDoc.setFolder(true); - apiDoc.setGroup(group); - apiDoc.setName(group); - apiDoc.setDesc(group); - apiDoc.setChildrenApiDocs(new ArrayList<>()); - return apiDoc; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public Integer getOrder() { - return order; - } - - public void setOrder(Integer order) { - this.order = order; - } - - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public String[] getTags() { - return tags; - } - - public void setTags(String[] tags) { - this.tags = tags; - } - - public String getLink() { - if (StringUtil.isNotEmpty(link)) { - return link; - } - return desc.replace(" ", "_").toLowerCase(); - } - - public void setLink(String link) { - this.link = link; - } - - public String getPackageName() { - return packageName; - } - - public void setPackageName(String packageName) { - this.packageName = packageName; - } - - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public boolean isFolder() { - return isFolder; - } - - public void setFolder(boolean folder) { - isFolder = folder; - } - - public List getChildrenApiDocs() { - return childrenApiDocs; - } - - public void setChildrenApiDocs(List childrenApiDocs) { - this.childrenApiDocs = childrenApiDocs; - } - - public Set getTagRefs() { - return tagRefs; - } - - @Override - public int compareTo(ApiDoc o) { - if (Objects.nonNull(o.getDesc())) { - return desc.compareTo(o.getDesc()); - } - return name.compareTo(o.getName()); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"order\":") - .append(order); - sb.append(",\"name\":\"") - .append(name).append('\"'); - sb.append(",\"alias\":\"") - .append(alias).append('\"'); - sb.append(",\"list\":") - .append(list); - sb.append(",\"desc\":\"") - .append(desc).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDocDict.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDocDict.java deleted file mode 100644 index 84a5015b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiDocDict.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -/** - * @author yu 2019/10/31. - */ - -public class ApiDocDict { - - /** - * order - */ - private int order; - - /** - * dict title - */ - private String title; - - /** - * dict description - */ - private String description; - - /** - * data dict - */ - private List dataDictList; - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public List getDataDictList() { - return dataDictList; - } - - public void setDataDictList(List dataDictList) { - this.dataDictList = dataDictList; - } - - public String getDescription() { - return description; - } - - public ApiDocDict setDescription(String description) { - this.description = description; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"order\":") - .append(order); - sb.append(",\"title\":\"") - .append(title).append('\"'); - sb.append(",\"dataDictList\":") - .append(dataDictList); - sb.append('}'); - return sb.toString(); - } -} - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCode.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCode.java deleted file mode 100644 index dcfd1462..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCode.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.common.model.EnumDictionary; - -import java.util.Objects; - -/** - * Description: - * restful api error code - * - * @author yu 2018/06/25. - */ -public class ApiErrorCode extends EnumDictionary { - - @Override - public int hashCode() { - return Objects.hash(getValue(), getType(), getDesc(), getOrdinal(), getName()); - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ApiErrorCode)) { - return false; - } - ApiErrorCode other = (ApiErrorCode) obj; - return Objects.equals(getValue(), other.getValue()) && - Objects.equals(getType(), other.getType()) && - Objects.equals(getDesc(), other.getDesc()) && - Objects.equals(getOrdinal(), other.getOrdinal()) && - Objects.equals(getName(), other.getName()); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCodeDictionary.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCodeDictionary.java deleted file mode 100644 index ee362fcd..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiErrorCodeDictionary.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.Set; - -/** - * @author yu 2019/12/7. - * @since 1.7.9 - */ -public class ApiErrorCodeDictionary { - - /** - * enumClass - */ - private Class enumClass; - - /** - * enum implements - * when enumClass is interface - */ - private Set> enumImplementSet; - - /** - * enum class name - */ - private String enumClassName; - - /** - * customized enum values resolver, - * class implement com.power.doc.extension.dict.DictionaryValuesResolver - */ - private String valuesResolverClass; - /** - * code field - */ - private String codeField; - - /** - * description field - */ - private String descField; - - @Deprecated - public static ApiErrorCodeDictionary dict() { - return new ApiErrorCodeDictionary(); - } - - public static ApiErrorCodeDictionary builder() { - return new ApiErrorCodeDictionary(); - } - - public Class getEnumClass() { - return enumClass; - } - - public ApiErrorCodeDictionary setEnumClass(Class enumClass) { - this.enumClass = enumClass; - return this; - } - - public Set> getEnumImplementSet() { - return enumImplementSet; - } - - public ApiErrorCodeDictionary setEnumImplementSet(Set> enumImplementSet) { - this.enumImplementSet = enumImplementSet; - return this; - } - - public String getCodeField() { - return codeField; - } - - public ApiErrorCodeDictionary setCodeField(String codeField) { - this.codeField = codeField; - return this; - } - - public String getDescField() { - return descField; - } - - public ApiErrorCodeDictionary setDescField(String descField) { - this.descField = descField; - return this; - } - - public String getEnumClassName() { - return enumClassName; - } - - public ApiErrorCodeDictionary setEnumClassName(String enumClassName) { - this.enumClassName = enumClassName; - return this; - } - - public String getValuesResolverClass() { - return this.valuesResolverClass; - } - - public ApiErrorCodeDictionary setValuesResolverClass(String valuesResolverClass) { - this.valuesResolverClass = valuesResolverClass; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"enumClass\":") - .append(enumClass); - sb.append(",\"enumClassName\":\"") - .append(enumClassName).append('\"'); - sb.append(",\"codeField\":\"") - .append(codeField).append('\"'); - sb.append(",\"descField\":\"") - .append(descField).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiGroup.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiGroup.java deleted file mode 100644 index 17b71aa9..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiGroup.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * api group - * - * @author cqmike - * @version 1.0.0 - * @since 2021/07/31 16:39:00 - */ -public class ApiGroup { - - /** - * group name - */ - private String name; - /** - * package name - * support patten - */ - private String apis; - /** - * url path - * support patten - */ - private String paths; - - public static ApiGroup builder() { - return new ApiGroup(); - } - - public String getName() { - return name; - } - - public ApiGroup setName(String name) { - this.name = name; - return this; - } - - public String getApis() { - return apis; - } - - public ApiGroup setApis(String apis) { - this.apis = apis; - return this; - } - - public String getPaths() { - return paths; - } - - public ApiGroup setPaths(String paths) { - this.paths = paths; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodDoc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodDoc.java deleted file mode 100644 index 577d512b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodDoc.java +++ /dev/null @@ -1,540 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.io.Serializable; -import java.util.*; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.model.request.ApiRequestExample; - -/** - * java api method info model. - */ -public class ApiMethodDoc implements Serializable, Cloneable { - - - private static final long serialVersionUID = 7211922919532562867L; - - private ApiDoc clazzDoc; - - /** - * methodId handled by md5 - * - * @since 1.7.3 + - */ - private String methodId; - - /** - * method name - * - * @since 1.7.3 + - */ - private String name; - - /** - * method order - * - * @since 1.7+ - */ - private int order; - - - /** - * method description - */ - private String desc; - - /** - * detailed introduction of the method - */ - private String detail; - - /** - * server url - */ - private String serverUrl; - - /** - * controller method url contains server - */ - private String url; - - /** - * controller path - */ - private String path; - - /** - * http request type - */ - private String type; - - /** - * http request author - */ - private String author; - - /** - * only used for generate markdown and adoc - * http readers - */ - private String headers; - - /** - * http contentType - */ - private String contentType = DocGlobalConstants.URL_CONTENT_TYPE; - - /** - * http request headers - */ - private List requestHeaders; - - /** - * path params - */ - private List pathParams; - - /** - * query params - */ - private List queryParams; - - /** - * http request params - */ - private List requestParams; - - - /** - * http request-example usage(requestUrlParam + requestBody) - */ - private String requestUsage; - - /** - * request example detail - */ - private ApiRequestExample requestExample; - - /** - * http response usage - */ - private String responseUsage; - - /** - * http response params - */ - private List responseParams; - - /** - * method deprecated - */ - private boolean deprecated; - - /** - * return schema - */ - private Map returnSchema; - - /** - * request schema - */ - private Map requestSchema; - - /** - * api group - */ - private String group; - - /** - * marking download - */ - private boolean download; - - /** - * link - */ - private String link; - - /** - * mark page - */ - private String page = ""; - /** - * torna request is array - */ - private Integer isRequestArray; - /** - * torna request is array-type - */ - private String requestArrayType; - /** - * torna response is array - */ - private Integer isResponseArray; - /** - * torna request is array - */ - private String responseArrayType; - - /** - * tags - */ - private String[] tags; - - private final Set tagRefs = Collections.synchronizedSet(new LinkedHashSet<>()); - - public Integer getIsRequestArray() { - return isRequestArray; - } - - public void setIsRequestArray(Integer isRequestArray) { - this.isRequestArray = isRequestArray; - } - - public String getRequestArrayType() { - return requestArrayType; - } - - public void setRequestArrayType(String requestArrayType) { - this.requestArrayType = requestArrayType; - } - - public Integer getIsResponseArray() { - return isResponseArray; - } - - public void setIsResponseArray(Integer isResponseArray) { - this.isResponseArray = isResponseArray; - } - - public String getResponseArrayType() { - return responseArrayType; - } - - public void setResponseArrayType(String responseArrayType) { - this.responseArrayType = responseArrayType; - } - - - public String getMethodId() { - return methodId; - } - - public void setMethodId(String methodId) { - this.methodId = methodId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getResponseUsage() { - return responseUsage; - } - - public void setResponseUsage(String responseUsage) { - this.responseUsage = responseUsage; - } - - public String getRequestUsage() { - return requestUsage; - } - - public void setRequestUsage(String requestUsage) { - this.requestUsage = requestUsage; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getHeaders() { - return headers; - } - - public void setHeaders(String headers) { - this.headers = headers; - } - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public List getRequestParams() { - return requestParams; - } - - public void setRequestParams(List requestParams) { - this.requestParams = requestParams; - } - - public List getResponseParams() { - return responseParams; - } - - public void setResponseParams(List responseParams) { - this.responseParams = responseParams; - } - - public List getRequestHeaders() { - return requestHeaders; - } - - public void setRequestHeaders(List requestHeaders) { - this.requestHeaders = requestHeaders; - } - - public String getDetail() { - return detail; - } - - public void setDetail(String detail) { - this.detail = detail; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getServerUrl() { - return serverUrl; - } - - public void setServerUrl(String serverUrl) { - this.serverUrl = serverUrl; - } - - public ApiRequestExample getRequestExample() { - return requestExample; - } - - public void setRequestExample(ApiRequestExample requestExample) { - this.requestExample = requestExample; - } - - public boolean isDeprecated() { - return deprecated; - } - - public void setDeprecated(boolean deprecated) { - this.deprecated = deprecated; - } - - public List getPathParams() { - return pathParams; - } - - public void setPathParams(List pathParams) { - this.pathParams = pathParams; - } - - public List getQueryParams() { - return queryParams; - } - - public void setQueryParams(List queryParams) { - this.queryParams = queryParams; - } - - - public Map getReturnSchema() { - return returnSchema; - } - - public void setReturnSchema(Map returnSchema) { - this.returnSchema = returnSchema; - } - - public Map getRequestSchema() { - return requestSchema; - } - - public void setRequestSchema(Map requestSchema) { - this.requestSchema = requestSchema; - } - - public String getGroup() { - return group; - } - - public void setGroup(String group) { - this.group = group; - } - - public boolean isDownload() { - return download; - } - - public void setDownload(boolean download) { - this.download = download; - } - - public String getLink() { - if (StringUtil.isNotEmpty(link)) { - return link; - } - return desc.replace(" ", "_").toLowerCase(); - } - - public void setLink(String link) { - this.link = link; - } - - public String getPage() { - return page; - } - - public void setPage(String page) { - this.page = page; - } - - public String[] getTags() { - return tags; - } - - public ApiMethodDoc setTags(String[] tags) { - this.tags = tags; - return this; - } - - public Set getTagRefs() { - return tagRefs; - } - - public ApiDoc getClazzDoc() { - return clazzDoc; - } - - public void setClazzDoc(ApiDoc clazzDoc) { - this.clazzDoc = clazzDoc; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"methodId\":\"") - .append(methodId).append('\"'); - sb.append(",\"name\":\"") - .append(name).append('\"'); - sb.append(",\"order\":") - .append(order); - sb.append(",\"desc\":\"") - .append(desc).append('\"'); - sb.append(",\"detail\":\"") - .append(detail).append('\"'); - sb.append(",\"serverUrl\":\"") - .append(serverUrl).append('\"'); - sb.append(",\"url\":\"") - .append(url).append('\"'); - sb.append(",\"path\":\"") - .append(path).append('\"'); - sb.append(",\"type\":\"") - .append(type).append('\"'); - sb.append(",\"author\":\"") - .append(author).append('\"'); - sb.append(",\"headers\":\"") - .append(headers).append('\"'); - sb.append(",\"contentType\":\"") - .append(contentType).append('\"'); - sb.append(",\"requestHeaders\":") - .append(requestHeaders); - sb.append(",\"pathParams\":") - .append(pathParams); - sb.append(",\"queryParams\":") - .append(queryParams); - sb.append(",\"requestParams\":") - .append(requestParams); - sb.append(",\"requestUsage\":\"") - .append(requestUsage).append('\"'); - sb.append(",\"requestExample\":") - .append(requestExample); - sb.append(",\"responseUsage\":\"") - .append(responseUsage).append('\"'); - sb.append(",\"responseParams\":") - .append(responseParams); - sb.append(",\"deprecated\":") - .append(deprecated); - sb.append('}'); - return sb.toString(); - } - - @Override - public ApiMethodDoc clone() { - try { - return (ApiMethodDoc) super.clone(); - } catch (CloneNotSupportedException e) { - throw new RuntimeException("clone apiMethodDoc is error", e); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodReqParam.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodReqParam.java deleted file mode 100644 index 9981f2be..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiMethodReqParam.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -/** - * @author yu 2020/11/26. - */ -public class ApiMethodReqParam { - - /** - * path params - */ - private List pathParams; - - /** - * query params - */ - private List queryParams; - - /** - * http request params - */ - private List requestParams; - - public static ApiMethodReqParam builder() { - return new ApiMethodReqParam(); - } - - public List getPathParams() { - return pathParams; - } - - public ApiMethodReqParam setPathParams(List pathParams) { - this.pathParams = pathParams; - return this; - } - - public List getQueryParams() { - return queryParams; - } - - public ApiMethodReqParam setQueryParams(List queryParams) { - this.queryParams = queryParams; - return this; - } - - public List getRequestParams() { - return requestParams; - } - - public ApiMethodReqParam setRequestParams(List requestParams) { - this.requestParams = requestParams; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiObjectReplacement.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiObjectReplacement.java deleted file mode 100644 index 3f6f9350..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiObjectReplacement.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * @author yu 2020/4/18. - */ -public class ApiObjectReplacement { - - private String className; - - private String replacementClassName; - - public static ApiObjectReplacement builder() { - return new ApiObjectReplacement(); - } - - public String getClassName() { - return className; - } - - public ApiObjectReplacement setClassName(String className) { - this.className = className; - return this; - } - - public String getReplacementClassName() { - return replacementClassName; - } - - public ApiObjectReplacement setReplacementClassName(String replacementClassName) { - this.replacementClassName = replacementClassName; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"className\":\"") - .append(className).append('\"'); - sb.append(",\"replacementClassName\":\"") - .append(replacementClassName).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiParam.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiParam.java deleted file mode 100644 index 7e5b404c..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiParam.java +++ /dev/null @@ -1,318 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.doc.model.torna.EnumInfo; -import com.power.doc.utils.StringUtils; - -import java.util.List; - -import static com.power.doc.constants.DocGlobalConstants.PARAM_PREFIX; - -/** - * @author yu 2019/9/27. - */ -public class ApiParam { - - /** - * param class name - */ - private String className; - /** - * field id - */ - private int id = 1; - - /** - * field - */ - private String field; - - /** - * field type - */ - private String type; - - /** - * description - */ - private String desc; - - /** - * require flag - */ - private boolean required; - - /** - * version - */ - private String version; - - /** - * field pid - */ - private int pid; - - /** - * PathVariableParams flag - */ - private boolean pathParam; - - /** - * query params flag - */ - private boolean queryParam; - - /** - * param mock value - */ - private String value; - - /** - * children params - */ - private List children; - - /** - * openapi items - */ - private boolean hasItems; - - /** - * enum values - */ - private List enumValues; - /** - * enum - */ - private EnumInfo enumInfo; - /** - * Valid @Max - */ - private String maxLength; - - /** - * is config.json config param - * default false - */ - private boolean configParam; - /** - * 自循环引用 - */ - private boolean selfReferenceLoop; - - public static ApiParam of() { - return new ApiParam(); - } - - public EnumInfo getEnumInfo() { - return enumInfo; - } - - public ApiParam setEnumInfo(EnumInfo enumInfo) { - this.enumInfo = enumInfo; - return this; - } - - public String getField() { - return field; - } - - public ApiParam setField(String field) { - this.field = field; - return this; - } - - public String getSourceField() { - if (StringUtils.isEmpty(field)) { - return StringUtils.EMPTY; - } - return field.replaceAll(PARAM_PREFIX, "").replaceAll(" ", ""); - } - - public String getType() { - return type; - } - - public ApiParam setType(String type) { - this.type = type; - return this; - } - - public String getDesc() { - return desc; - } - - public ApiParam setDesc(String desc) { - this.desc = desc; - return this; - } - - public boolean isRequired() { - return required; - } - - public ApiParam setRequired(boolean required) { - this.required = required; - return this; - } - - public String getVersion() { - return version; - } - - public ApiParam setVersion(String version) { - this.version = version; - return this; - } - - public int getId() { - return id; - } - - public ApiParam setId(int id) { - this.id = id; - return this; - } - - public int getPid() { - return pid; - } - - public ApiParam setPid(int pid) { - this.pid = pid; - return this; - } - - public List getChildren() { - return children; - } - - public ApiParam setChildren(List children) { - this.children = children; - return this; - } - - public boolean isPathParam() { - return pathParam; - } - - public ApiParam setPathParam(boolean pathParam) { - this.pathParam = pathParam; - return this; - } - - public boolean isQueryParam() { - return queryParam; - } - - public ApiParam setQueryParam(boolean queryParam) { - this.queryParam = queryParam; - return this; - } - - public String getValue() { - return value; - } - - public ApiParam setValue(String value) { - this.value = value; - return this; - } - - public boolean isHasItems() { - return hasItems; - } - - public ApiParam setHasItems(boolean hasItems) { - this.hasItems = hasItems; - return this; - } - - public List getEnumValues() { - return enumValues; - } - - public ApiParam setEnumValues(List enumValues) { - this.enumValues = enumValues; - return this; - } - - public String getMaxLength() { - return maxLength; - } - - public ApiParam setMaxLength(String maxLength) { - this.maxLength = maxLength; - return this; - } - - public boolean isConfigParam() { - return configParam; - } - - public ApiParam setConfigParam(boolean configParam) { - this.configParam = configParam; - return this; - } - - public String getClassName() { - return className; - } - - public ApiParam setClassName(String className) { - this.className = className; - return this; - } - - public boolean isSelfReferenceLoop() { - return selfReferenceLoop; - } - - public void setSelfReferenceLoop(boolean selfReferenceLoop) { - this.selfReferenceLoop = selfReferenceLoop; - } - - @Override - public String toString() { - return "ApiParam{" + - "id=" + id + - ", field='" + field + '\'' + - ", type='" + type + '\'' + - ", desc='" + desc + '\'' + - ", required=" + required + - ", version='" + version + '\'' + - ", pid=" + pid + - ", pathParam=" + pathParam + - ", queryParam=" + queryParam + - ", value='" + value + '\'' + - ", children=" + children + - ", hasItems=" + hasItems + - ", enumValues=" + enumValues + - ", enumInfo=" + enumInfo + - ", maxLength='" + maxLength + '\'' + - ", configParam=" + configParam + - ", selfReferenceLoop=" + selfReferenceLoop + - '}'; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReqParam.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReqParam.java deleted file mode 100644 index ec493dfb..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReqParam.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.doc.constants.ApiReqParamInTypeEnum; -import com.power.doc.utils.StringUtils; - -import java.util.Objects; - - -/** - * Description: - * http request param info model - * - * @author yu 2018/06/18. - * @author chenqi 2021/07/15 - */ -public class ApiReqParam { - - /** - * Request param name - */ - private String name; - - /** - * Request param type - */ - private String type; - - /** - * request param defaultValue - */ - private String value; - - /** - * Request param description - */ - private String desc; - - /** - * where is param location - * default header - * - * @see ApiReqParamInTypeEnum value - */ - private String paramIn; - - /** - * required flag - * - * @since 1.7.0 - */ - private boolean required; - - /** - * Starting version number - * - * @since 1.7.0 - */ - private String since = "-"; - - /** - * @since 2.2.2 - * Regular expression match request param - */ - private String pathPatterns; - - /** - * @since 2.2.2 - * Regular expression ignore request param - */ - private String excludePathPatterns; - - public static ApiReqParam builder() { - return new ApiReqParam(); - } - - public static ApiParam convertToApiParam(ApiReqParam param) { - return ApiParam.of().setField(param.getName()).setValue(param.getValue()) - .setRequired(param.isRequired()).setDesc(param.getDesc()).setConfigParam(true) - .setVersion("-").setType(param.getType()); - } - - public String getName() { - return name; - } - - public ApiReqParam setName(String name) { - this.name = name; - return this; - } - - public String getType() { - return type; - } - - public ApiReqParam setType(String type) { - this.type = type; - return this; - } - - public String getDesc() { - return desc; - } - - public ApiReqParam setDesc(String desc) { - this.desc = desc; - return this; - } - - public boolean isRequired() { - return required; - } - - public ApiReqParam setRequired(boolean required) { - this.required = required; - return this; - } - - public String getSince() { - return since; - } - - public ApiReqParam setSince(String since) { - this.since = since; - return this; - } - - public String getValue() { - return value; - } - - public ApiReqParam setValue(String value) { - this.value = value; - return this; - } - - public String getPathPatterns() { - return pathPatterns; - } - - public ApiReqParam setPathPatterns(String pathPatterns) { - this.pathPatterns = pathPatterns; - return this; - } - - public String getExcludePathPatterns() { - return excludePathPatterns; - } - - public ApiReqParam setExcludePathPatterns(String excludePathPatterns) { - this.excludePathPatterns = excludePathPatterns; - return this; - } - - public String getParamIn() { - if (StringUtils.isEmpty(paramIn)) { - return ApiReqParamInTypeEnum.HEADER.getValue(); - } - return paramIn; - } - - public ApiReqParam setParamIn(String paramIn) { - this.paramIn = paramIn; - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiReqParam that = (ApiReqParam) o; - return Objects.equals(name, that.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"name\":\"") - .append(name).append('\"'); - sb.append(",\"type\":\"") - .append(type).append('\"'); - sb.append(",\"value\":\"") - .append(value).append('\"'); - sb.append(",\"desc\":\"") - .append(desc).append('\"'); - sb.append(",\"paramIn\":") - .append(paramIn); - sb.append(",\"required\":") - .append(required); - sb.append(",\"since\":\"") - .append(since).append('\"'); - sb.append(",\"pathPatterns\":\"") - .append(pathPatterns).append('\"'); - sb.append(",\"excludePathPatterns\":\"") - .append(excludePathPatterns).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReturn.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReturn.java deleted file mode 100644 index 4d33e591..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/ApiReturn.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * @author yu 2019/9/22. - * @since 1.7 + - */ -public class ApiReturn { - - /** - * return type generic name - */ - private String genericCanonicalName; - - /** - * return type simple name - */ - private String simpleName; - - public String getGenericCanonicalName() { - return genericCanonicalName; - } - - public void setGenericCanonicalName(String genericCanonicalName) { - this.genericCanonicalName = genericCanonicalName; - } - - public String getSimpleName() { - return simpleName; - } - - public void setSimpleName(String simpleName) { - this.simpleName = simpleName; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/BodyAdvice.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/BodyAdvice.java deleted file mode 100644 index 8f7bd2d4..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/BodyAdvice.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * @author yu 2020/11/5. - * @since 1.9.8 - */ -public class BodyAdvice { - - private String className; - - private Class wrapperClass; - - private String dataField; - - public static BodyAdvice builder() { - return new BodyAdvice(); - } - - public String getClassName() { - return className; - } - - public BodyAdvice setClassName(String className) { - this.className = className; - return this; - } - - public String getDataField() { - return dataField; - } - - public BodyAdvice setDataField(String dataField) { - this.dataField = dataField; - return this; - } - - public Class getWrapperClass() { - return wrapperClass; - } - - public BodyAdvice setWrapperClass(Class wrapperClass) { - this.wrapperClass = wrapperClass; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"className\":\"") - .append(className).append('\"'); - sb.append(",\"dataField\":\"") - .append(dataField).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/CustomField.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/CustomField.java deleted file mode 100644 index 71d14655..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/CustomField.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.Map; -import java.util.Objects; - -/** - * @author xingzi - **/ -public class CustomField { - - /** - * field name - */ - private String name; - /** - * field description - */ - private String desc; - /** - * owner class - */ - private String ownerClassName; - /** - * default value - */ - private Object value; - /** - * required - */ - private boolean require; - - private boolean ignore; - - private String replaceName; - - public static CustomField builder() { - return new CustomField(); - } - - public static CustomField nameEquals(Key key, Map customFieldMap) { - for (Map.Entry c : customFieldMap.entrySet()) { - if (key.equals(c.getKey())) { - return c.getValue(); - } - } - return null; - } - - public String getReplaceName() { - return replaceName; - } - - public CustomField setReplaceName(String replaceName) { - this.replaceName = replaceName; - return this; - } - - public boolean isRequire() { - return require; - } - - public CustomField setRequire(boolean require) { - this.require = require; - return this; - } - - public String getName() { - return name; - } - - public CustomField setName(String name) { - this.name = name; - return this; - } - - public String getDesc() { - return desc; - } - - public CustomField setDesc(String desc) { - this.desc = desc; - return this; - } - - public String getOwnerClassName() { - return ownerClassName; - } - - public CustomField setOwnerClassName(String ownerClassName) { - this.ownerClassName = ownerClassName; - return this; - } - - public Object getValue() { - return value; - } - - public CustomField setValue(Object value) { - this.value = value; - return this; - } - - public boolean isIgnore() { - return ignore; - } - - public CustomField setIgnore(boolean ignore) { - this.ignore = ignore; - return this; - } - - public static final class Key { - - /** - * owner class - */ - private String ownerClassName; - - /** - * field name - */ - private String name; - - private Key(String ownerClassName, String name) { - this.ownerClassName = ownerClassName; - this.name = name; - } - - public static Key create(String className, String fieldName) { - return new Key(className, fieldName); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Key key = (Key) o; - return Objects.equals(ownerClassName, key.ownerClassName) && Objects.equals(name, key.name); - } - - @Override - public int hashCode() { - return Objects.hash(ownerClassName, name); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DataDict.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DataDict.java deleted file mode 100644 index 71cc1be0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DataDict.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.power.common.model.EnumDictionary; - -/** - * @author yu 2019/10/31. - */ -public class DataDict extends EnumDictionary { - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaField.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaField.java deleted file mode 100644 index 5e6db227..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaField.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.ArrayList; -import java.util.List; - -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaField; - -/** - * @author yu 2020/3/19. - */ -public class DocJavaField { - - /** - * field info - */ - private JavaField javaField; - - /** - * comment - */ - private String Comment; - - /** - * tags - */ - private List docletTags; - - /** - * annotations - */ - private List annotations; - - /** - * field fullyQualifiedName - */ - private String fullyQualifiedName; - - /** - * field genericCanonicalName - */ - private String genericCanonicalName; - - /** - * field generic actualJavaType; - */ - private String actualJavaType; - - /** - * field name - */ - private String fieldName; - - private boolean array; - - private boolean primitive; - - private boolean collection; - - private boolean file; - - private boolean isEnum; - - /** - * owner class - */ - private String declaringClassName; - - - public static DocJavaField builder() { - return new DocJavaField(); - } - - public JavaField getJavaField() { - return javaField; - } - - public DocJavaField setJavaField(JavaField javaField) { - this.javaField = javaField; - return this; - } - - public String getComment() { - return Comment; - } - - public DocJavaField setComment(String comment) { - Comment = comment; - return this; - } - - public String getFullyQualifiedName() { - return fullyQualifiedName; - } - - public DocJavaField setFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - return this; - } - - public String getGenericCanonicalName() { - return genericCanonicalName; - } - - public DocJavaField setGenericCanonicalName(String genericCanonicalName) { - this.genericCanonicalName = genericCanonicalName; - return this; - } - - public String getActualJavaType() { - return actualJavaType; - } - - public DocJavaField setActualJavaType(String actualJavaType) { - this.actualJavaType = actualJavaType; - return this; - } - - public List getDocletTags() { - if (docletTags == null) { - return new ArrayList<>(); - } - return docletTags; - } - - public DocJavaField setDocletTags(List docletTags) { - this.docletTags = docletTags; - return this; - } - - public List getAnnotations() { - List fieldAnnotations = javaField.getAnnotations(); - if (fieldAnnotations != null && !fieldAnnotations.isEmpty()) { - return fieldAnnotations; - } - if (annotations == null) { - return new ArrayList<>(); - } - return this.annotations; - } - - public DocJavaField setAnnotations(List annotations) { - this.annotations = annotations; - return this; - } - - public boolean isArray() { - return array; - } - - public DocJavaField setArray(boolean array) { - this.array = array; - return this; - } - - public boolean isPrimitive() { - return primitive; - } - - public DocJavaField setPrimitive(boolean primitive) { - this.primitive = primitive; - return this; - } - - public boolean isCollection() { - return collection; - } - - public DocJavaField setCollection(boolean collection) { - this.collection = collection; - return this; - } - - public boolean isFile() { - return file; - } - - public DocJavaField setFile(boolean file) { - this.file = file; - return this; - } - - public boolean isEnum() { - return isEnum; - } - - public void setEnum(boolean anEnum) { - isEnum = anEnum; - } - - public String getFieldName() { - return fieldName; - } - - public DocJavaField setFieldName(String fieldName) { - this.fieldName = fieldName; - return this; - } - - public String getDeclaringClassName() { - return declaringClassName; - } - - public DocJavaField setDeclaringClassName(String declaringClassName) { - this.declaringClassName = declaringClassName; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaMethod.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaMethod.java deleted file mode 100644 index 6c54ccb5..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaMethod.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaType; - -import java.util.Map; - -/** - * @author yu 2020/10/30. - * @since 1.9.8 - */ -public class DocJavaMethod { - - private JavaMethod javaMethod; - - private Map returnSchema; - - private Map requestSchema; - - private Map actualTypesMap; - - private boolean download; - - /** - * mark page - */ - private String page = ""; - - /** - * api group - */ - private String group; - - private String author; - - /** - * method description - */ - private String desc; - - /** - * detailed introduction of the method - */ - private String detail; - - Map paramTagMap; - - Map paramsComments; - - public static DocJavaMethod builder() { - return new DocJavaMethod(); - } - - public JavaMethod getJavaMethod() { - return javaMethod; - } - - public DocJavaMethod setJavaMethod(JavaMethod javaMethod) { - this.javaMethod = javaMethod; - return this; - } - - public Map getActualTypesMap() { - return actualTypesMap; - } - - public DocJavaMethod setActualTypesMap(Map actualTypesMap) { - this.actualTypesMap = actualTypesMap; - return this; - } - - public Map getReturnSchema() { - return returnSchema; - } - - public DocJavaMethod setReturnSchema(Map returnSchema) { - this.returnSchema = returnSchema; - return this; - } - - public Map getRequestSchema() { - return requestSchema; - } - - public DocJavaMethod setRequestSchema(Map requestSchema) { - this.requestSchema = requestSchema; - return this; - } - - public boolean isDownload() { - return download; - } - - public DocJavaMethod setDownload(boolean download) { - this.download = download; - return this; - } - - public Map getParamTagMap() { - return paramTagMap; - } - - public DocJavaMethod setParamTagMap(Map paramTagMap) { - this.paramTagMap = paramTagMap; - return this; - } - - public Map getParamsComments() { - return paramsComments; - } - - public DocJavaMethod setParamsComments(Map paramsComments) { - this.paramsComments = paramsComments; - return this; - } - - public String getPage() { - return page; - } - - public DocJavaMethod setPage(String page) { - this.page = page; - return this; - } - - public String getGroup() { - return group; - } - - public DocJavaMethod setGroup(String group) { - this.group = group; - return this; - } - - public String getAuthor() { - return author; - } - - public DocJavaMethod setAuthor(String author) { - this.author = author; - return this; - } - - public String getDesc() { - return desc; - } - - public DocJavaMethod setDesc(String desc) { - this.desc = desc; - return this; - } - - public String getDetail() { - return detail; - } - - public DocJavaMethod setDetail(String detail) { - this.detail = detail; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaParameter.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaParameter.java deleted file mode 100644 index 409feee6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocJavaParameter.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaParameter; - -/** - * @author yu3.sun on 2022/10/15 - */ -public class DocJavaParameter { - - private JavaParameter javaParameter; - - private String genericCanonicalName; - - private String fullyQualifiedName; - - private String typeValue; - - - List annotations; - - - public JavaParameter getJavaParameter() { - return javaParameter; - } - - public void setJavaParameter(JavaParameter javaParameter) { - this.javaParameter = javaParameter; - } - - public String getGenericCanonicalName() { - return genericCanonicalName; - } - - public void setGenericCanonicalName(String genericCanonicalName) { - this.genericCanonicalName = genericCanonicalName; - } - - public String getFullyQualifiedName() { - return fullyQualifiedName; - } - - public void setFullyQualifiedName(String fullyQualifiedName) { - this.fullyQualifiedName = fullyQualifiedName; - } - - public String getTypeValue() { - return typeValue; - } - - public void setTypeValue(String typeValue) { - this.typeValue = typeValue; - } - - public List getAnnotations() { - return annotations; - } - - public void setAnnotations(List annotations) { - this.annotations = annotations; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocMapping.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocMapping.java deleted file mode 100644 index c68eb5a2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/DocMapping.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - - -import com.power.doc.utils.StringUtils; - -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author CKM - * Relational Mapping 2023/03/20 10:13:00 - */ -public class DocMapping { - - public static final Map TAG_DOC = new ConcurrentHashMap<>(64); - - public static final Set CLAZZ_DOCS = Collections.synchronizedSet(new LinkedHashSet<>(64)); - - public static final Set METHOD_DOCS = Collections.synchronizedSet(new LinkedHashSet<>(1024)); - - public static void tagDocPut(String tag, ApiDoc apiDoc, ApiMethodDoc methodDoc) { - if (StringUtils.isBlank(tag)) { - return; - } -// tag = StringUtils.trim(tag); - TagDoc tagDoc = TAG_DOC.computeIfAbsent(tag, TagDoc::new); - if (Objects.nonNull(apiDoc)) { - apiDoc.getTagRefs().add(tagDoc); - tagDoc.getClazzDocs().add(apiDoc); - CLAZZ_DOCS.add(apiDoc); - } - if (Objects.nonNull(methodDoc)) { - methodDoc.getTagRefs().add(tagDoc); - tagDoc.getMethodDocs().add(methodDoc); - METHOD_DOCS.add(methodDoc); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/FormData.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/FormData.java deleted file mode 100644 index e58eda33..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/FormData.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * @author xingzi 2019/12/21 20:20 - */ -public class FormData { - - private String key; - private String type; - private String description; - private String src; - private String value; - /** - * openapi items - */ - private boolean hasItems; - - public boolean isHasItems() { - return hasItems; - } - - public FormData setHasItems(boolean hasItems) { - this.hasItems = hasItems; - return this; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getSrc() { - return src; - } - - public void setSrc(String src) { - this.src = src; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public String toString() { - return "FormData{" + - "key='" + key + '\'' + - ", type='" + type + '\'' + - ", description='" + description + '\'' + - ", src='" + src + '\'' + - ", value='" + value + '\'' + - '}'; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RevisionLog.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RevisionLog.java deleted file mode 100644 index a6cc47d6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RevisionLog.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * document revision log - * - * @author yolanda0608 2018/12/15 - */ -public class RevisionLog { - - /** - * version - */ - private String version; - - /** - * status - */ - private String status; - - /** - * author - */ - private String author; - - /** - * update time - */ - private String revisionTime; - - /** - * description - */ - private String remarks; - - public static RevisionLog builder() { - return new RevisionLog(); - } - - public String getVersion() { - return version; - } - - public RevisionLog setVersion(String version) { - this.version = version; - return this; - } - - public String getStatus() { - return status; - } - - public RevisionLog setStatus(String status) { - this.status = status; - return this; - } - - public String getAuthor() { - return author; - } - - public RevisionLog setAuthor(String author) { - this.author = author; - return this; - } - - public String getRevisionTime() { - return revisionTime; - } - - public RevisionLog setRevisionTime(String revisionTime) { - this.revisionTime = revisionTime; - return this; - } - - public String getRemarks() { - return remarks; - } - - public RevisionLog setRemarks(String remarks) { - this.remarks = remarks; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"version\":\"") - .append(version).append('\"'); - sb.append(",\"status\":\"") - .append(status).append('\"'); - sb.append(",\"author\":\"") - .append(author).append('\"'); - sb.append(",\"revisionTime\":\"") - .append(revisionTime).append('\"'); - sb.append(",\"remarks\":\"") - .append(remarks).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaApiDoc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaApiDoc.java deleted file mode 100644 index 67ef3d33..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaApiDoc.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -/** - * @author yu 2020/1/29. - */ -public class RpcJavaApiDoc { - - /** - * Order of controller - * - * @since 1.7+ - */ - public int order; - - /** - * controller name - */ - private String name; - - /** - * controller alias handled by md5 - * - * @since 1.7+ - */ - private String alias; - - /** - * List of method doc - */ - private List list; - - /** - * method description - */ - private String desc; - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaMethod.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaMethod.java deleted file mode 100644 index 2dd04fbd..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/RpcJavaMethod.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.List; - -/** - * for rpc - * @author yu 2020/1/29. - */ -public class RpcJavaMethod { - - /** - * methodId handled by md5 - */ - private String methodId; - - /** - * method name - */ - private String name; - - /** - * method order - */ - private int order; - - - /** - * method description - */ - private String desc; - - /** - * method definition - */ - private String methodDefinition; - - /** - * escape method definition - */ - private String escapeMethodDefinition; - - /** - * detailed introduction of the method - */ - private String detail; - - /** - * method describe - */ - private String throwsInfo; - - /** - * return class Info - */ - private String returnClassInfo; - - /** - * http request params - */ - private List requestParams; - - /** - * http request author - */ - private String author; - - /** - * http response params - */ - private List responseParams; - - /** - * method deprecated - */ - private boolean deprecated; - - public String getMethodId() { - return methodId; - } - - public void setMethodId(String methodId) { - this.methodId = methodId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getDetail() { - return detail; - } - - public void setDetail(String detail) { - this.detail = detail; - } - - public String getThrowsInfo() { - return throwsInfo; - } - - public void setThrowsInfo(String throwsInfo) { - this.throwsInfo = throwsInfo; - } - - public String getReturnClassInfo() { - return returnClassInfo; - } - - public void setReturnClassInfo(String returnClassInfo) { - this.returnClassInfo = returnClassInfo; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public List getResponseParams() { - return responseParams; - } - - public void setResponseParams(List responseParams) { - this.responseParams = responseParams; - } - - public boolean isDeprecated() { - return deprecated; - } - - public void setDeprecated(boolean deprecated) { - this.deprecated = deprecated; - } - - public List getRequestParams() { - return requestParams; - } - - public void setRequestParams(List requestParams) { - this.requestParams = requestParams; - } - - public String getMethodDefinition() { - return methodDefinition; - } - - public void setMethodDefinition(String methodDefinition) { - this.methodDefinition = methodDefinition; - } - - public String getEscapeMethodDefinition() { - return escapeMethodDefinition; - } - - public void setEscapeMethodDefinition(String escapeMethodDefinition) { - this.escapeMethodDefinition = escapeMethodDefinition; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SourceCodePath.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SourceCodePath.java deleted file mode 100644 index 5e04b3bf..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SourceCodePath.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -/** - * Source code path - * - * @author yu 2018/7/14. - */ -public class SourceCodePath { - - /** - * Source code path - */ - private String path; - - /** - * path description - */ - private String desc; - - public static SourceCodePath builder() { - return new SourceCodePath(); - } - - public String getPath() { - return path; - } - - public SourceCodePath setPath(String path) { - this.path = path; - return this; - } - - public String getDesc() { - return desc; - } - - public SourceCodePath setDesc(String desc) { - this.desc = desc; - return this; - } - - @Override - public String toString() { - final StringBuilder sb = new StringBuilder("{"); - sb.append("\"path\":\"").append(path).append('\"'); - sb.append(",\"desc\":\"").append(desc).append('\"'); - sb.append('}'); - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SystemPlaceholders.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SystemPlaceholders.java deleted file mode 100644 index f8334ba4..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/SystemPlaceholders.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.power.doc.model; - - -import com.power.doc.utils.StringUtils; - -/** - * @author xingzi - * Date 2022/9/25 14:52 - */ -public class SystemPlaceholders { - - public static final String PLACEHOLDER_PREFIX = "${"; - /** - * Suffix for system property placeholders: "}". - */ - public static final String PLACEHOLDER_SUFFIX = "}"; - /** - * Value separator for system property placeholders: ":". - */ - public static final String VALUE_SEPARATOR = ":"; - public static final String SIMPLE_PREFIX = "{"; - - private SystemPlaceholders() { - - } - - public static boolean hasSystemProperties(String url) { - return !StringUtils.isBlank(url) && url.contains(PLACEHOLDER_PREFIX) && - url.contains(PLACEHOLDER_SUFFIX) - && url.contains(VALUE_SEPARATOR); - } - - public static String replaceSystemProperties(String url) { - return null; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/TagDoc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/TagDoc.java deleted file mode 100644 index 3ef3b026..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/TagDoc.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model; - -import java.util.*; - -/** - * @author CKM - * - * tag relationship 2023/03/20 10:13:00 - */ -public class TagDoc { - private String tag; - - private final Set clazzDocs = Collections.synchronizedSet(new LinkedHashSet<>()); - - private final Set methodDocs = Collections.synchronizedSet(new LinkedHashSet<>(64)); - - private TagDoc() { - } - - public TagDoc(String tag) { - super(); - this.tag = tag; - } - - public String getTag() { - return tag; - } - - public void setTag(String tag) { - this.tag = tag; - } - - public Set getClazzDocs() { - return clazzDocs; - } - - public Set getMethodDocs() { - return methodDocs; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/EntryAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/EntryAnnotation.java deleted file mode 100644 index 89c63578..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/EntryAnnotation.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.power.doc.model.annotation; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class EntryAnnotation { - - private String annotationName; - - private String annotationFullyName; - - public static EntryAnnotation builder() { - return new EntryAnnotation(); - } - - public String getAnnotationName() { - return annotationName; - } - - public EntryAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public String getAnnotationFullyName() { - return annotationFullyName; - } - - public EntryAnnotation setAnnotationFullyName(String annotationFullyName) { - this.annotationFullyName = annotationFullyName; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/FrameworkAnnotations.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/FrameworkAnnotations.java deleted file mode 100644 index e02bcb8b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/FrameworkAnnotations.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.power.doc.model.annotation; - -import java.util.Map; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class FrameworkAnnotations { - - private Map entryAnnotations; - - private HeaderAnnotation headerAnnotation; - - private Map mappingAnnotations; - - private PathVariableAnnotation pathVariableAnnotation; - - private RequestParamAnnotation requestParamAnnotation; - - private RequestBodyAnnotation requestBodyAnnotation; - - public static FrameworkAnnotations builder() { - return new FrameworkAnnotations(); - } - - public Map getEntryAnnotations() { - return entryAnnotations; - } - - public FrameworkAnnotations setEntryAnnotations(Map entryAnnotations) { - this.entryAnnotations = entryAnnotations; - return this; - } - - public HeaderAnnotation getHeaderAnnotation() { - return headerAnnotation; - } - - public FrameworkAnnotations setHeaderAnnotation(HeaderAnnotation headerAnnotation) { - this.headerAnnotation = headerAnnotation; - return this; - } - - public Map getMappingAnnotations() { - return mappingAnnotations; - } - - public FrameworkAnnotations setMappingAnnotations(Map mappingAnnotation) { - this.mappingAnnotations = mappingAnnotation; - return this; - } - - public PathVariableAnnotation getPathVariableAnnotation() { - return pathVariableAnnotation; - } - - public FrameworkAnnotations setPathVariableAnnotation(PathVariableAnnotation pathVariableAnnotation) { - this.pathVariableAnnotation = pathVariableAnnotation; - return this; - } - - public RequestParamAnnotation getRequestParamAnnotation() { - return requestParamAnnotation; - } - - public FrameworkAnnotations setRequestParamAnnotation(RequestParamAnnotation requestParamAnnotation) { - this.requestParamAnnotation = requestParamAnnotation; - return this; - } - - public RequestBodyAnnotation getRequestBodyAnnotation() { - return requestBodyAnnotation; - } - - public FrameworkAnnotations setRequestBodyAnnotation(RequestBodyAnnotation requestBodyAnnotation) { - this.requestBodyAnnotation = requestBodyAnnotation; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/HeaderAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/HeaderAnnotation.java deleted file mode 100644 index 608de711..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/HeaderAnnotation.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.power.doc.model.annotation; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class HeaderAnnotation { - - private String annotationName; - - private String valueProp; - - private String defaultValueProp; - - private String requiredProp; - - - public static HeaderAnnotation builder() { - return new HeaderAnnotation(); - } - - public String getAnnotationName() { - return annotationName; - } - - public HeaderAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public String getValueProp() { - return valueProp; - } - - public HeaderAnnotation setValueProp(String valueProp) { - this.valueProp = valueProp; - return this; - } - - public String getDefaultValueProp() { - return defaultValueProp; - } - - public HeaderAnnotation setDefaultValueProp(String defaultValueProp) { - this.defaultValueProp = defaultValueProp; - return this; - } - - public String getRequiredProp() { - return requiredProp; - } - - public HeaderAnnotation setRequiredProp(String requiredProp) { - this.requiredProp = requiredProp; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/MappingAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/MappingAnnotation.java deleted file mode 100644 index ccfb8e66..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/MappingAnnotation.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.power.doc.model.annotation; - -import java.util.Arrays; -import java.util.List; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class MappingAnnotation { - - private String annotationName; - - private String annotationFullyName; - - private List pathProps; - - private String producesProp; - - - private String consumesProp; - - private String methodProp; - - private String methodType; - - private String paramsProp; - - private List scope; - - - public static MappingAnnotation builder() { - return new MappingAnnotation(); - } - - public String getAnnotationName() { - return annotationName; - } - - public MappingAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public List getPathProps() { - return pathProps; - } - - public MappingAnnotation setPathProps(String... pathProp) { - this.pathProps = Arrays.asList(pathProp); - return this; - } - - public String getAnnotationFullyName() { - return annotationFullyName; - } - - public MappingAnnotation setAnnotationFullyName(String annotationFullyName) { - this.annotationFullyName = annotationFullyName; - return this; - } - - public String getConsumesProp() { - return consumesProp; - } - - public MappingAnnotation setConsumesProp(String consumesProp) { - this.consumesProp = consumesProp; - return this; - } - - public String getProducesProp() { - return producesProp; - } - - public MappingAnnotation setProducesProp(String producesProp) { - this.producesProp = producesProp; - return this; - } - - public String getMethodProp() { - return methodProp; - } - - public MappingAnnotation setMethodProp(String methodProp) { - this.methodProp = methodProp; - return this; - } - - public String getMethodType() { - return methodType; - } - - public MappingAnnotation setMethodType(String methodType) { - this.methodType = methodType; - return this; - } - - public String getParamsProp() { - return paramsProp; - } - - public MappingAnnotation setParamsProp(String paramsProp) { - this.paramsProp = paramsProp; - return this; - } - - public List getScope() { - return scope; - } - - public MappingAnnotation setScope(String... scope) { - this.scope = Arrays.asList(scope); - return this; - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/PathVariableAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/PathVariableAnnotation.java deleted file mode 100644 index d353cd6a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/PathVariableAnnotation.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.power.doc.model.annotation; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class PathVariableAnnotation { - - private String annotationName; - - private String annotationFullyName; - - private String defaultValueProp; - - private String requiredProp; - - - public static PathVariableAnnotation builder() { - return new PathVariableAnnotation(); - } - - - public String getAnnotationName() { - return annotationName; - } - - public PathVariableAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public String getAnnotationFullyName() { - return annotationFullyName; - } - - public PathVariableAnnotation setAnnotationFullyName(String annotationFullyName) { - this.annotationFullyName = annotationFullyName; - return this; - } - - public String getDefaultValueProp() { - return defaultValueProp; - } - - public PathVariableAnnotation setDefaultValueProp(String defaultValueProp) { - this.defaultValueProp = defaultValueProp; - return this; - } - - public String getRequiredProp() { - return requiredProp; - } - - public PathVariableAnnotation setRequiredProp(String requiredProp) { - this.requiredProp = requiredProp; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestBodyAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestBodyAnnotation.java deleted file mode 100644 index 855a1e7a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestBodyAnnotation.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.power.doc.model.annotation; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class RequestBodyAnnotation { - - private String annotationName; - - private String annotationFullyName; - - public static RequestBodyAnnotation builder() { - return new RequestBodyAnnotation(); - } - - public String getAnnotationName() { - return annotationName; - } - - public RequestBodyAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public String getAnnotationFullyName() { - return annotationFullyName; - } - - public RequestBodyAnnotation setAnnotationFullyName(String annotationFullyName) { - this.annotationFullyName = annotationFullyName; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestParamAnnotation.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestParamAnnotation.java deleted file mode 100644 index 88cf1cb2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/annotation/RequestParamAnnotation.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.power.doc.model.annotation; - -/** - * @author yu3.sun on 2022/10/1 - */ -public class RequestParamAnnotation { - - private String annotationName; - - private String annotationFullyName; - - private String defaultValueProp; - - private String requiredProp; - - public static RequestParamAnnotation builder() { - return new RequestParamAnnotation(); - } - - public String getAnnotationName() { - return annotationName; - } - - public RequestParamAnnotation setAnnotationName(String annotationName) { - this.annotationName = annotationName; - return this; - } - - public String getAnnotationFullyName() { - return annotationFullyName; - } - - public RequestParamAnnotation setAnnotationFullyName(String annotationFullyName) { - this.annotationFullyName = annotationFullyName; - return this; - } - - public String getDefaultValueProp() { - return defaultValueProp; - } - - public RequestParamAnnotation setDefaultValueProp(String defaultValueProp) { - this.defaultValueProp = defaultValueProp; - return this; - } - - public String getRequiredProp() { - return requiredProp; - } - - public RequestParamAnnotation setRequiredProp(String requiredProp) { - this.requiredProp = requiredProp; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/framework/PageableAsQueryParam.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/framework/PageableAsQueryParam.java deleted file mode 100644 index 3327a5c0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/framework/PageableAsQueryParam.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.framework; - -public class PageableAsQueryParam { - - /** - * Page you want to retrieve (0..N) - */ - private Integer page; - - /** - * Number of records per page - */ - private Integer size; - - /** - * Sorting criteria in the format: property(,asc|desc),Default sort order is ascending. - * Multiple sort criteria are supported. - */ - private String sort; - - public Integer getPage() { - return page; - } - - public void setPage(Integer page) { - this.page = page; - } - - public Integer getSize() { - return size; - } - - public void setSize(Integer size) { - this.size = size; - } - - public String getSort() { - return sort; - } - - public void setSort(String sort) { - this.sort = sort; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/openapi/OpenApiTag.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/openapi/OpenApiTag.java deleted file mode 100644 index e04ad686..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/openapi/OpenApiTag.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.power.doc.model.openapi; - -import java.util.Objects; - -/** - * open api tag - * - * @author chenqi - * @version 1.0 - */ -public class OpenApiTag { - - /** - * the tag name - */ - private String name; - - /** - * the tag description - */ - private String description; - - public OpenApiTag() { - } - - public OpenApiTag(String name, String description) { - this.name = name; - this.description = description; - } - - public static OpenApiTag of(String name, String description) { - return new OpenApiTag(name, description); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - OpenApiTag that = (OpenApiTag) o; - return Objects.equals(getName(), that.getName()) && Objects.equals(getDescription(), that.getDescription()); - } - - @Override - public int hashCode() { - return Objects.hash(getName(), getDescription()); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/InfoBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/InfoBean.java deleted file mode 100644 index 41bf81fd..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/InfoBean.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman; - -import com.power.common.util.DateTimeUtil; -import com.power.doc.utils.StringUtils; - -import java.util.UUID; - - -/** - * @author xingzi - */ -public class InfoBean { - - String schema; - private String _postman_id = UUID.randomUUID().toString(); - private String name; - - public InfoBean(String name) { - if (StringUtils.isBlank(name)) { - this.name = "smart-doc " + DateTimeUtil.long2Str(System.currentTimeMillis(), DateTimeUtil.DATE_FORMAT_SECOND); - } else { - this.name = name; - } - this.schema = "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/ItemBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/ItemBean.java deleted file mode 100644 index b31106e0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/ItemBean.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman; - -import java.util.List; - -import com.power.doc.model.postman.request.RequestBean; - -/** - * @author xingzi - */ -public class ItemBean { - - private String name; - private RequestBean request; - private List item; - private String description; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public RequestBean getRequest() { - return request; - } - - public void setRequest(RequestBean request) { - this.request = request; - } - - public List getItem() { - return item; - } - - public void setItem(List item) { - this.item = item; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/RequestItem.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/RequestItem.java deleted file mode 100644 index 9e0c2898..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/RequestItem.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman; - -import java.util.List; - -/** - * @author xingzi - */ -public class RequestItem { - - private InfoBean info; - private List item; - - public InfoBean getInfo() { - return info; - } - - public void setInfo(InfoBean info) { - this.info = info; - } - - public List getItem() { - return item; - } - - public void setItem(List item) { - this.item = item; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/UrlBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/UrlBean.java deleted file mode 100644 index b6b6add4..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/UrlBean.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.power.common.util.StringUtil; -import com.power.doc.model.postman.request.ParamBean; - -/** - * post - * - * @author yu 2020/11/28. - */ -public class UrlBean { - - private String raw; - - private String protocol; - - private List path; - - private List host; - - private String port; - - private List query; - - private List variable; - - public UrlBean() { - - } - - public UrlBean(String serverUrl) { - if (StringUtil.isEmpty(serverUrl)) { - return; - } - Pattern pattern = Pattern.compile("(https?://)?([^:^/]*)?(:[a-zA-Z-z0-9|^{{\\}}$]*)?(.*)?"); - Matcher matcher = pattern.matcher(serverUrl); - if (matcher.find()) { - String protocol = matcher.group(1); - if (StringUtil.isNotEmpty(protocol)) { - protocol = protocol.substring(0, protocol.indexOf(":")); - } - - String domain = matcher.group(2); - List hosts = new ArrayList<>(); - hosts.add(domain); - // port - String port = matcher.group(3); - if (StringUtil.isNotEmpty(port)) { - port = port.replace(":", ""); - } - - String uri = matcher.group(4); - List paths = new ArrayList<>(); - paths.add(uri); - - this.protocol = protocol; - this.host = hosts; - this.port = port; - this.path = paths; - } else { - throw new RuntimeException("ServerUrl must contain http or https protocol."); - } - } - - public String getRaw() { - return raw; - } - - public void setRaw(String raw) { - this.raw = raw; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public List getPath() { - return path; - } - - public void setPath(List path) { - this.path = path; - } - - public List getQuery() { - return query; - } - - public void setQuery(List query) { - this.query = query; - } - - public List getVariable() { - return variable; - } - - public void setVariable(List variable) { - this.variable = variable; - } - - public List getHost() { - return host; - } - - public void setHost(List host) { - this.host = host; - } - - public String getPort() { - return port; - } - - public void setPort(String port) { - this.port = port; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/ParamBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/ParamBean.java deleted file mode 100644 index 98ea356a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/ParamBean.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.power.doc.model.postman.request; - -/** - * @author yu 2020/11/28. - */ -public class ParamBean { - - private String key; - private String value; - private String description; - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/RequestBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/RequestBean.java deleted file mode 100644 index 1ad20117..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/RequestBean.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman.request; - -import java.util.List; - -import com.power.doc.model.postman.UrlBean; -import com.power.doc.model.postman.request.body.BodyBean; -import com.power.doc.model.postman.request.header.HeaderBean; - -/** - * @author xingzi - */ -public class RequestBean { - - private String method; - private BodyBean body; - private UrlBean url; - private String description; - private List header; - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method; - } - - public BodyBean getBody() { - return body; - } - - public void setBody(BodyBean body) { - this.body = body; - } - - public UrlBean getUrl() { - return url; - } - - public void setUrl(UrlBean url) { - this.url = url; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getHeader() { - return header; - } - - public void setHeader(List header) { - this.header = header; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/body/BodyBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/body/BodyBean.java deleted file mode 100644 index 1767a252..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/body/BodyBean.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman.request.body; - - -import java.util.List; - -import com.power.doc.model.FormData; - -/** - * @author xingzi - */ -public class BodyBean { - - private String mode; - private String raw; - private List formdata; - private BodyOptions options; - - public BodyBean(boolean isFormData) { - if (!isFormData) { - this.options = new BodyOptions(); - } - } - - public List getFormdata() { - return formdata; - } - - public void setFormdata(List formdata) { - this.formdata = formdata; - } - - public String getMode() { - return mode; - } - - public void setMode(String mode) { - this.mode = mode; - } - - public String getRaw() { - return raw; - } - - public void setRaw(String raw) { - this.raw = raw; - } - - private class BodyOptions { - - private Raw raw; - - public BodyOptions() { - this.raw = new Raw(); - } - - private class Raw { - - private String language; - - Raw() { - this.language = "json"; - } - } - } - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/header/HeaderBean.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/header/HeaderBean.java deleted file mode 100644 index e49912e0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/postman/request/header/HeaderBean.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.postman.request.header; - -/** - * @author xingzi - */ -public class HeaderBean { - - private String key; - private String value; - private String type; - private boolean disabled; - private String name; - private String description; - - public HeaderBean() { - this.type = "text"; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public boolean isDisabled() { - return disabled; - } - - public void setDisabled(boolean disabled) { - this.disabled = disabled; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/ApiRequestExample.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/ApiRequestExample.java deleted file mode 100644 index 1703c6ce..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/ApiRequestExample.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.request; - -import com.power.common.util.StringUtil; -import com.power.doc.model.FormData; -import com.power.doc.utils.StringUtils; - -import java.util.List; - -/** - * @author yu 2019/12/22. - */ - -public class ApiRequestExample { - - /** - * json body - */ - private String jsonBody; - - /** - * example body - */ - private String exampleBody; - - /** - * url - */ - private String url; - - /** - * list of form data - */ - private List formDataList; - - private boolean json; - - public static ApiRequestExample builder() { - return new ApiRequestExample(); - } - - public String getJsonBody() { - return jsonBody; - } - - public ApiRequestExample setJsonBody(String jsonBody) { - this.jsonBody = jsonBody; - return this; - } - - public ApiRequestExample addJsonBody(String jsonBody) { - if (StringUtil.isNotEmpty(jsonBody)) { - this.jsonBody = StringUtils.join("&", this.jsonBody, jsonBody); - } else { - this.jsonBody = jsonBody; - } - return this; - } - - public String getUrl() { - return url; - } - - public ApiRequestExample setUrl(String url) { - this.url = url; - return this; - } - - public List getFormDataList() { - return formDataList; - } - - public ApiRequestExample setFormDataList(List formDataList) { - this.formDataList = formDataList; - return this; - } - - public boolean isJson() { - return json; - } - - public ApiRequestExample setJson(boolean json) { - this.json = json; - return this; - } - - public String getExampleBody() { - return exampleBody; - } - - public ApiRequestExample setExampleBody(String exampleBody) { - this.exampleBody = exampleBody; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/CurlRequest.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/CurlRequest.java deleted file mode 100644 index fa7d1628..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/CurlRequest.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.request; - -import java.util.List; - -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.FormData; - -/** - * @author yu 2020/12/21. - */ -public class CurlRequest { - - private String type; - - private List reqHeaders; - private List fileFormDataList; - - private String url; - - private String body; - - private String contentType; - - public static CurlRequest builder() { - return new CurlRequest(); - } - - public List getFileFormDataList() { - return fileFormDataList; - } - - public CurlRequest setFileFormDataList(List fileFormDataList) { - this.fileFormDataList = fileFormDataList; - return this; - } - - public String getType() { - return type; - } - - public CurlRequest setType(String type) { - this.type = type; - return this; - } - - public List getReqHeaders() { - return reqHeaders; - } - - public CurlRequest setReqHeaders(List reqHeaders) { - this.reqHeaders = reqHeaders; - return this; - } - - public String getUrl() { - return url; - } - - public CurlRequest setUrl(String url) { - this.url = url; - return this; - } - - public String getBody() { - return body; - } - - public CurlRequest setBody(String body) { - this.body = body; - return this; - } - - public String getContentType() { - return contentType; - } - - public CurlRequest setContentType(String contentType) { - this.contentType = contentType; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/JaxrsPathMapping.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/JaxrsPathMapping.java deleted file mode 100644 index f774d978..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/JaxrsPathMapping.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.power.doc.model.request; - -/** - * @author yu 2021/8/28. - */ -public class JaxrsPathMapping extends RequestMapping { - - /** - * url - */ - private String url; - - /** - * path - */ - private String shortUrl; - /** - * methodType - */ - private String methodType; - /** - * media type - */ - private String mediaType; - - /** - * method deprecated - */ - private boolean deprecated; - - public static JaxrsPathMapping builder() { - return new JaxrsPathMapping(); - } - - public String getUrl() { - return url; - } - - public JaxrsPathMapping setUrl(String url) { - this.url = url; - return this; - } - - public String getShortUrl() { - return shortUrl; - } - - public JaxrsPathMapping setShortUrl(String shortUrl) { - this.shortUrl = shortUrl; - return this; - } - - public String getMethodType() { - return methodType; - } - - public JaxrsPathMapping setMethodType(String methodType) { - this.methodType = methodType; - return this; - } - - public String getMediaType() { - return mediaType; - } - - public JaxrsPathMapping setMediaType(String mediaType) { - this.mediaType = mediaType; - return this; - } - - public boolean isDeprecated() { - return deprecated; - } - - public JaxrsPathMapping setDeprecated(boolean deprecated) { - this.deprecated = deprecated; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/RequestMapping.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/RequestMapping.java deleted file mode 100644 index 90ac41c9..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/request/RequestMapping.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.request; - -/** - * @author yu 2019/12/22. - */ -public class RequestMapping { - - /** - * url - */ - private String url; - - /** - * path - */ - private String shortUrl; - /** - * method type - */ - private String methodType; - - /** - * media type - */ - private String mediaType; - - /** - * method deprecated - */ - private boolean deprecated; - - public static RequestMapping builder() { - return new RequestMapping(); - } - - public String getUrl() { - return url; - } - - public RequestMapping setUrl(String url) { - this.url = url; - return this; - } - - public String getShortUrl() { - return shortUrl; - } - - public RequestMapping setShortUrl(String shortUrl) { - this.shortUrl = shortUrl; - return this; - } - - public String getMethodType() { - return methodType; - } - - public RequestMapping setMethodType(String methodType) { - this.methodType = methodType; - return this; - } - - public String getMediaType() { - return mediaType; - } - - public RequestMapping setMediaType(String mediaType) { - this.mediaType = mediaType; - return this; - } - - public boolean isDeprecated() { - return deprecated; - } - - public RequestMapping setDeprecated(boolean deprecated) { - this.deprecated = deprecated; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiAllData.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiAllData.java deleted file mode 100644 index 7b74d39e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiAllData.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.rpc; - -import java.util.List; - -import com.power.doc.model.ApiDocDict; -import com.power.doc.model.ApiErrorCode; -import com.power.doc.model.RevisionLog; - -/** - * @author yu 2020/5/24. - */ -public class RpcApiAllData { - - /** - * project name - */ - private String projectName; - - /** - * project id - */ - private String projectId; - - /** - * docLanguage - */ - private String language; - - /** - * doc list - */ - private List apiDocList; - - /** - * - */ - private List apiDocDictList; - - /** - * error code list - */ - private List errorCodeList; - - /** - * List of change log - */ - private List revisionLogs; - - /** - * list of dependency - */ - private List dependencyList; - - - public String getProjectName() { - return projectName; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language; - } - - public List getApiDocList() { - return apiDocList; - } - - public void setApiDocList(List apiDocList) { - this.apiDocList = apiDocList; - } - - public List getApiDocDictList() { - return apiDocDictList; - } - - public void setApiDocDictList(List apiDocDictList) { - this.apiDocDictList = apiDocDictList; - } - - public List getErrorCodeList() { - return errorCodeList; - } - - public void setErrorCodeList(List errorCodeList) { - this.errorCodeList = errorCodeList; - } - - public List getRevisionLogs() { - return revisionLogs; - } - - public void setRevisionLogs(List revisionLogs) { - this.revisionLogs = revisionLogs; - } - - public List getDependencyList() { - return dependencyList; - } - - public void setDependencyList(List dependencyList) { - this.dependencyList = dependencyList; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDependency.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDependency.java deleted file mode 100644 index 2dd4caa6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDependency.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.rpc; - -/** - * @author yu 2020/5/17. - */ -public class RpcApiDependency { - - private String groupId; - - private String artifactId; - - private String version; - - public static RpcApiDependency builder() { - return new RpcApiDependency(); - } - - public String getGroupId() { - return groupId; - } - - public RpcApiDependency setGroupId(String groupId) { - this.groupId = groupId; - return this; - } - - public String getArtifactId() { - return artifactId; - } - - public RpcApiDependency setArtifactId(String artifactId) { - this.artifactId = artifactId; - return this; - } - - public String getVersion() { - return version; - } - - public RpcApiDependency setVersion(String version) { - this.version = version; - return this; - } - - @Override - public String toString() { - return "" + "\r" + - "\t" + "" + groupId + "" + "\n" + - "\t" + "" + artifactId + "" + "\n" + - "\t" + "" + version + "" + "" + - "\r" + ""; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDoc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDoc.java deleted file mode 100644 index c2b86e2a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiDoc.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.rpc; - -import java.util.List; -import java.util.Objects; - -import com.power.doc.model.RpcJavaMethod; - -/** - * @author yu 2020/5/16. - */ -public class RpcApiDoc implements Comparable { - - /** - * Order of controller - * - * @since 1.7+ - */ - public int order; - - /** - * interface title - */ - public String title; - - /** - * interface name - */ - private String name; - - /** - * interface short name - */ - private String shortName; - - /** - * controller alias handled by md5 - * - * @since 1.7+ - */ - private String alias; - - /** - * method description - */ - private String desc; - - /** - * interface protocol - */ - private String protocol; - - /** - * interface author - */ - private String author; - - /** - * interface uri - */ - private String uri; - - /** - * interface version - */ - private String version; - - /** - * link - */ - private String link; - - /** - * List of method doc - */ - private List list; - - public int getOrder() { - return order; - } - - public void setOrder(int order) { - this.order = order; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public String getDesc() { - return desc; - } - - public void setDesc(String desc) { - this.desc = desc; - } - - public String getProtocol() { - return protocol; - } - - public void setProtocol(String protocol) { - this.protocol = protocol; - } - - public String getUri() { - return uri; - } - - public void setUri(String uri) { - this.uri = uri; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - public String getShortName() { - return shortName; - } - - public void setShortName(String shortName) { - this.shortName = shortName; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public String getLink() { - return desc.replace(" ", "_").toLowerCase(); - } - - public void setLink(String link) { - this.link = link; - } - - @Override - public int compareTo(RpcApiDoc o) { - if (Objects.nonNull(o.getDesc())) { - return desc.compareTo(o.getDesc()); - } - return name.compareTo(o.getName()); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiMethodRpc.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiMethodRpc.java deleted file mode 100644 index b2846af6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/rpc/RpcApiMethodRpc.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.rpc; - -import com.power.doc.model.RpcJavaMethod; - -/** - * @author yu 2020/5/16. - */ -public class RpcApiMethodRpc extends RpcJavaMethod { - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Apis.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Apis.java deleted file mode 100644 index 5131a662..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Apis.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.util.List; - -/** - * @author xingzi 2021/2/8 10:07 - **/ -public class Apis { - - private String name; - private String description; - private String url; - private String httpMethod; - private String contentType; - private String isFolder; - private String parentId; - private String isShow; - private String author; - private Integer orderIndex; - private DubboInfo dubboInfo; - private List headerParams; - private List pathParams; - private List queryParams; - private List requestParams; - private List responseParams; - private String errorCodeParams; - private List items; - private Integer isRequestArray; - private String requestArrayType; - private Integer isResponseArray; - private String responseArrayType; - private String deprecated; - - public Integer getIsRequestArray() { - return isRequestArray; - } - - public void setIsRequestArray(Integer isRequestArray) { - this.isRequestArray = isRequestArray; - } - - public String getRequestArrayType() { - return requestArrayType; - } - - public void setRequestArrayType(String requestArrayType) { - this.requestArrayType = requestArrayType; - } - - public Integer getIsResponseArray() { - return isResponseArray; - } - - public void setIsResponseArray(Integer isResponseArray) { - this.isResponseArray = isResponseArray; - } - - public String getResponseArrayType() { - return responseArrayType; - } - - public void setResponseArrayType(String responseArrayType) { - this.responseArrayType = responseArrayType; - } - - public Integer getOrderIndex() { - return orderIndex; - } - - public void setOrderIndex(Integer orderIndex) { - this.orderIndex = orderIndex; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getHttpMethod() { - return httpMethod; - } - - public void setHttpMethod(String httpMethod) { - this.httpMethod = httpMethod; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public String getIsFolder() { - return isFolder; - } - - public void setIsFolder(String isFolder) { - this.isFolder = isFolder; - } - - public String getParentId() { - return parentId; - } - - public void setParentId(String parentId) { - this.parentId = parentId; - } - - public String getIsShow() { - return isShow; - } - - public void setIsShow(String isShow) { - this.isShow = isShow; - } - - public List getQueryParams() { - return queryParams; - } - - public void setQueryParams(List queryParams) { - this.queryParams = queryParams; - } - - public List getRequestParams() { - return requestParams; - } - - public void setRequestParams(List requestParams) { - this.requestParams = requestParams; - } - - public List getHeaderParams() { - return headerParams; - } - - public void setHeaderParams(List headerParams) { - this.headerParams = headerParams; - } - - public List getPathParams() { - return pathParams; - } - - public Apis setPathParams(List pathParams) { - this.pathParams = pathParams; - return this; - } - - public List getResponseParams() { - return responseParams; - } - - public void setResponseParams(List responseParams) { - this.responseParams = responseParams; - } - - public String getErrorCodeParams() { - return errorCodeParams; - } - - public void setErrorCodeParams(String errorCodeParams) { - this.errorCodeParams = errorCodeParams; - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } - - public DubboInfo getDubboInfo() { - return dubboInfo; - } - - public void setDubboInfo(DubboInfo dubboInfo) { - this.dubboInfo = dubboInfo; - } - - public String getDeprecated() { - return deprecated; - } - - public void setDeprecated(String deprecated) { - this.deprecated = deprecated; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/CommonErrorCode.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/CommonErrorCode.java deleted file mode 100644 index 48265c97..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/CommonErrorCode.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -/** - * @author xingzi 2021/5/18 14:51 - **/ -public class CommonErrorCode { - - private String code; - - private String msg; - - private String solution; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } - - public String getSolution() { - return solution; - } - - public void setSolution(String solution) { - this.solution = solution; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DebugEnv.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DebugEnv.java deleted file mode 100644 index 00dfaba8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DebugEnv.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -/** - * @author Lixin 2021/2/25 1:18 - **/ -public class DebugEnv { - - private String name; - private String url; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DubboInfo.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DubboInfo.java deleted file mode 100644 index c75d565e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/DubboInfo.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.power.doc.model.torna; - -/** - * @author xingzi 2021/4/28 12:54 - **/ -public class DubboInfo { - - private String interfaceName; - private String author; - private String version; - private String protocol; - private String dependency; - - public DubboInfo builder() { - return new DubboInfo(); - } - - public String getInterfaceName() { - return interfaceName; - } - - public DubboInfo setInterfaceName(String interfaceName) { - this.interfaceName = interfaceName; - return this; - } - - public String getAuthor() { - return author; - } - - public DubboInfo setAuthor(String author) { - this.author = author; - return this; - } - - public String getVersion() { - return version; - } - - public DubboInfo setVersion(String version) { - this.version = version; - return this; - } - - public String getProtocol() { - return protocol; - } - - public DubboInfo setProtocol(String protocol) { - this.protocol = protocol; - return this; - } - - public String getDependency() { - return dependency; - } - - public DubboInfo setDependency(String dependency) { - this.dependency = dependency; - return this; - } - - @Override - public String toString() { - return "DubboInfo{" + - "interfaceName='" + interfaceName + '\'' + - ", author='" + author + '\'' + - ", version='" + version + '\'' + - ", protocol='" + protocol + '\'' + - ", dependency='" + dependency + '\'' + - '}'; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/EnumInfo.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/EnumInfo.java deleted file mode 100644 index defa45b8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/EnumInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.util.List; - -/** - * @author xingzi 2021/2/25 12:13 - **/ -public class EnumInfo { - - private String name; - - private String description; - - private List items; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getItems() { - return items; - } - - public void setItems(List items) { - this.items = items; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/HttpParam.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/HttpParam.java deleted file mode 100644 index bc9bf90b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/HttpParam.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.util.List; - -/** - * @author xingzi 2021/2/8 22:40 - **/ -public class HttpParam { - - private String name; - private String type; - private String value; - private String required; - private String maxLength; - private String example; - private String description; - private String parentId; - private EnumInfo enumInfo; - private String code; - private String msg; - private String solution; - private List children; - - private Integer orderIndex; - - public EnumInfo getEnumInfo() { - return enumInfo; - } - - public HttpParam setEnumInfo(EnumInfo enumInfo) { - this.enumInfo = enumInfo; - return this; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getRequired() { - return required; - } - - public void setRequired(String required) { - this.required = required; - } - - public String getMaxLength() { - return maxLength; - } - - public void setMaxLength(String maxLength) { - this.maxLength = maxLength; - } - - public String getExample() { - return example; - } - - public void setExample(String example) { - this.example = example; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getParentId() { - return parentId; - } - - public void setParentId(String parentId) { - this.parentId = parentId; - } - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getMsg() { - return msg; - } - - public void setMsg(String msg) { - this.msg = msg; - } - - public String getSolution() { - return solution; - } - - public void setSolution(String solution) { - this.solution = solution; - } - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - public Integer getOrderIndex() { - return orderIndex; - } - - public HttpParam setOrderIndex(Integer orderIndex) { - this.orderIndex = orderIndex; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Item.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Item.java deleted file mode 100644 index de84325f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/Item.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -/** - * @author xingzi 2021/2/25 12:29 - **/ -public class Item { - - /** - * { - * * "name": "WAIT_PAY", - * * "type": "string", - * * "value": "0", - * * "description": "未支付" - * * } - */ - private String name; - private String type; - private String value; - private String description; - - public Item() { - } - - public Item(String name, String type, String value, String description) { - this.name = name; - this.type = type; - this.value = value; - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaApi.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaApi.java deleted file mode 100644 index 61af098d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaApi.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.util.List; - -/** - * @author xingzi 2021/2/25 1:09 - **/ -public class TornaApi { - - /** - * "debugEnvs": [ - * { - * "name": "测试环境", - * "url": "http://10.1.30.165:2222" - * } - * ], - * "apis": [ - */ - List debugEnvs; - List apis; - String author; - List commonErrorCodes; - /** - * 是否替换文档,1:替换,0:不替换(追加)。缺省:1 - */ - Integer isReplace; - - public Integer getIsReplace() { - return isReplace; - } - - public void setIsReplace(Integer isReplace) { - this.isReplace = isReplace; - } - - public String getAuthor() { - return author; - } - - public void setAuthor(String author) { - this.author = author; - } - - public List getDebugEnvs() { - return debugEnvs; - } - - public void setDebugEnvs(List debugEnvs) { - this.debugEnvs = debugEnvs; - } - - public List getApis() { - return apis; - } - - public void setApis(List apis) { - this.apis = apis; - } - - public List getCommonErrorCodes() { - return commonErrorCodes; - } - - public void setCommonErrorCodes(List commonErrorCodes) { - this.commonErrorCodes = commonErrorCodes; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaDic.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaDic.java deleted file mode 100644 index cb836956..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaDic.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.util.List; - -/** - * @author xingzi 2021/5/19 19:57 - **/ -public class TornaDic { - - private String name; - private String description; - private List items; - - public String getDescription() { - return description; - } - - public TornaDic setDescription(String description) { - this.description = description; - return this; - } - - public List getItems() { - return items; - } - - public TornaDic setItems(List items) { - this.items = items; - return this; - } - - public String getName() { - return name; - } - - public TornaDic setName(String name) { - this.name = name; - return this; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaRequestInfo.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaRequestInfo.java deleted file mode 100644 index bd858dbc..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/model/torna/TornaRequestInfo.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.model.torna; - -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.util.HashMap; - -import com.power.doc.constants.TornaConstants; - -/** - * Print the log of pushing documents to Torna - * - * @author xingzi 2021/3/20 22:11 - **/ -public class TornaRequestInfo { - - private String code; - private String message; - private Object requestInfo; - private String responseInfo; - private String category; - - public String getCategory() { - return category; - } - - public TornaRequestInfo setCategory(String category) { - this.category = category; - return this; - } - - public TornaRequestInfo of() { - return this; - } - - public String getCode() { - return code; - } - - public TornaRequestInfo setCode(String code) { - this.code = code; - return this; - } - - public String getMessage() { - return message; - } - - public TornaRequestInfo setMessage(String message) { - this.message = message; - return this; - } - - public Object getRequestInfo() { - return requestInfo; - } - - public TornaRequestInfo setRequestInfo(Object requestInfo) { - this.requestInfo = requestInfo; - return this; - } - - public Object getResponseInfo() { - return responseInfo; - } - - public TornaRequestInfo setResponseInfo(String responseInfo) { - this.responseInfo = responseInfo; - return this; - } - - public String buildInfo() { - StringBuilder sb = new StringBuilder(); - sb.append("---------------------------PUSH START---------------------------\n") - .append("API: ") - .append(category) - .append("\n") - .append("Request Param: \n") - .append(TornaConstants.GSON.toJson(requestInfo)) - .append("\n") - .append("Response: \n") - .append(TornaConstants.GSON.fromJson(responseInfo, HashMap.class)) - .append("\n") - .append("---------------------------PUSH END---------------------------\n"); - try { - return URLDecoder.decode(sb.toString(), "utf-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - return ""; - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IBaseDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IBaseDocBuildTemplate.java deleted file mode 100644 index 05ee1787..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IBaseDocBuildTemplate.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; - -import com.power.common.util.StringUtil; -import com.power.common.util.UrlUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.helper.ParamsBuildHelper; -import com.power.doc.model.*; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.utils.*; -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaParameter; -import com.thoughtworks.qdox.model.JavaType; - -import static com.power.doc.constants.DocGlobalConstants.NO_COMMENTS_FOUND; -import static com.power.doc.constants.DocTags.*; - -/** - * @author yu3.sun on 2022/10/2 - */ -public interface IBaseDocBuildTemplate { - - default String paramCommentResolve(String comment) { - if (StringUtil.isEmpty(comment)) { - comment = NO_COMMENTS_FOUND; - } else { - if (comment.contains("|")) { - comment = comment.substring(0, comment.indexOf("|")); - } - } - return comment; - } - - default List buildReturnApiParams(DocJavaMethod docJavaMethod, ProjectDocConfigBuilder projectBuilder) { - JavaMethod method = docJavaMethod.getJavaMethod(); - if (method.getReturns().isVoid() && Objects.isNull(projectBuilder.getApiConfig().getResponseBodyAdvice())) { - return new ArrayList<>(0); - } - DocletTag downloadTag = method.getTagByName(DocTags.DOWNLOAD); - if (Objects.nonNull(downloadTag)) { - return new ArrayList<>(0); - } - String returnTypeGenericCanonicalName = method.getReturnType().getGenericCanonicalName(); - if (Objects.nonNull(projectBuilder.getApiConfig().getResponseBodyAdvice()) - && Objects.isNull(method.getTagByName(IGNORE_RESPONSE_BODY_ADVICE))) { - String responseBodyAdvice = projectBuilder.getApiConfig().getResponseBodyAdvice().getClassName(); - if (!returnTypeGenericCanonicalName.startsWith(responseBodyAdvice)) { - returnTypeGenericCanonicalName = new StringBuffer() - .append(responseBodyAdvice) - .append("<") - .append(returnTypeGenericCanonicalName).append(">").toString(); - } - } - Map actualTypesMap = docJavaMethod.getActualTypesMap(); - ApiReturn apiReturn = DocClassUtil.processReturnType(returnTypeGenericCanonicalName); - String returnType = apiReturn.getGenericCanonicalName(); - if (Objects.nonNull(actualTypesMap)) { - for (Map.Entry entry : actualTypesMap.entrySet()) { - returnType = returnType.replace(entry.getKey(), entry.getValue().getCanonicalName()); - } - } - - String typeName = apiReturn.getSimpleName(); - if (this.ignoreReturnObject(typeName, projectBuilder.getApiConfig().getIgnoreRequestParams())) { - return new ArrayList<>(0); - } - if (JavaClassValidateUtil.isPrimitive(typeName)) { - docJavaMethod.setReturnSchema(OpenApiSchemaUtil.primaryTypeSchema(typeName)); - return new ArrayList<>(0); - } - if (JavaClassValidateUtil.isCollection(typeName)) { - if (returnType.contains("<")) { - String gicName = returnType.substring(returnType.indexOf("<") + 1, returnType.lastIndexOf(">")); - if (JavaClassValidateUtil.isPrimitive(gicName)) { - docJavaMethod.setReturnSchema(OpenApiSchemaUtil.arrayTypeSchema(gicName)); - return new ArrayList<>(0); - } - return ParamsBuildHelper.buildParams(gicName, "", 0, null, Boolean.TRUE, - new HashMap<>(), projectBuilder, null, 0, Boolean.FALSE, null); - } else { - return new ArrayList<>(0); - } - } - if (JavaClassValidateUtil.isMap(typeName)) { - String[] keyValue = DocClassUtil.getMapKeyValueType(returnType); - if (keyValue.length == 0) { - return new ArrayList<>(0); - } - return ParamsBuildHelper.buildParams(returnType, "", 0, null, Boolean.TRUE, - new HashMap<>(), projectBuilder, null, 0, Boolean.FALSE, null); - } - if (StringUtil.isNotEmpty(returnType)) { - return ParamsBuildHelper.buildParams(returnType, "", 0, null, Boolean.TRUE, - new HashMap<>(), projectBuilder, null, 0, Boolean.FALSE, null); - } - return new ArrayList<>(0); - } - - default void convertParamsDataToTree(ApiMethodDoc apiMethodDoc) { - apiMethodDoc.setPathParams(ApiParamTreeUtil.apiParamToTree(apiMethodDoc.getPathParams())); - apiMethodDoc.setQueryParams(ApiParamTreeUtil.apiParamToTree(apiMethodDoc.getQueryParams())); - apiMethodDoc.setRequestParams(ApiParamTreeUtil.apiParamToTree(apiMethodDoc.getRequestParams())); - } - - - default String formatRequestUrl(Map pathParamsMap, Map queryParamsMap, - String serverUrl, String path) { - path = DocUtil.formatAndRemove(path, pathParamsMap); - String url = UrlUtil.urlJoin(path, queryParamsMap); - url = StringUtil.removeQuotes(url); - url = serverUrl + "/" + url; - url = UrlUtil.simplifyUrl(url); - return url; - } - - default List getJavaParameterList(ProjectDocConfigBuilder builder, final DocJavaMethod docJavaMethod, - FrameworkAnnotations frameworkAnnotations) { - JavaMethod javaMethod = docJavaMethod.getJavaMethod(); - Map replacementMap = builder.getReplaceClassMap(); - Map paramTagMap = docJavaMethod.getParamTagMap(); - List parameterList = javaMethod.getParameters(); - if (parameterList.isEmpty()) { - return new ArrayList<>(0); - } - Set ignoreSets = ignoreParamsSets(javaMethod); - List apiJavaParameterList = new ArrayList<>(parameterList.size()); - Map actualTypesMap = docJavaMethod.getActualTypesMap(); - for (JavaParameter parameter : parameterList) { - String paramName = parameter.getName(); - if (ignoreSets.contains(paramName)) { - continue; - } - DocJavaParameter apiJavaParameter = new DocJavaParameter(); - apiJavaParameter.setJavaParameter(parameter); - JavaType javaType = parameter.getType(); - if (Objects.nonNull(actualTypesMap) && Objects.nonNull(actualTypesMap.get(javaType.getCanonicalName()))) { - javaType = actualTypesMap.get(javaType.getCanonicalName()); - } - apiJavaParameter.setTypeValue(javaType.getValue()); - String genericCanonicalName = javaType.getGenericCanonicalName(); - String fullTypeName = javaType.getFullyQualifiedName(); - String commentClass = paramTagMap.get(paramName); - //ignore request params - if (Objects.nonNull(commentClass) && commentClass.contains(IGNORE)) { - continue; - } - String rewriteClassName = getRewriteClassName(replacementMap, fullTypeName, commentClass); - // rewrite class - if (JavaClassValidateUtil.isClassName(rewriteClassName)) { - genericCanonicalName = rewriteClassName; - fullTypeName = DocClassUtil.getSimpleName(rewriteClassName); - } - if (JavaClassValidateUtil.isMvcIgnoreParams(genericCanonicalName, builder.getApiConfig().getIgnoreRequestParams())) { - continue; - } - fullTypeName = DocClassUtil.rewriteRequestParam(fullTypeName); - genericCanonicalName = DocClassUtil.rewriteRequestParam(genericCanonicalName); - List annotations = parameter.getAnnotations(); - apiJavaParameter.setAnnotations(annotations); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - if (Objects.nonNull(frameworkAnnotations) && frameworkAnnotations.getRequestBodyAnnotation().getAnnotationName() - .equals(annotationName)) { - if (Objects.nonNull(builder.getApiConfig().getRequestBodyAdvice()) - && Objects.isNull(javaMethod.getTagByName(IGNORE_REQUEST_BODY_ADVICE))) { - String requestBodyAdvice = builder.getApiConfig().getRequestBodyAdvice().getClassName(); - fullTypeName = requestBodyAdvice; - genericCanonicalName = requestBodyAdvice + "<" + genericCanonicalName + ">"; - } - } - } - if (JavaClassValidateUtil.isCollection(fullTypeName) || JavaClassValidateUtil.isArray(fullTypeName)) { - if (JavaClassValidateUtil.isCollection(genericCanonicalName)) { - genericCanonicalName = genericCanonicalName + ""; - } - } - apiJavaParameter.setGenericCanonicalName(genericCanonicalName); - apiJavaParameter.setFullyQualifiedName(fullTypeName); - apiJavaParameterList.add(apiJavaParameter); - } - return apiJavaParameterList; - } - - default String getRewriteClassName(Map replacementMap, String fullTypeName, String commentClass) { - String rewriteClassName; - if (Objects.nonNull(commentClass) && !DocGlobalConstants.NO_COMMENTS_FOUND.equals(commentClass)) { - String[] comments = commentClass.split("\\|"); - if (comments.length < 1) { - return replacementMap.get(fullTypeName); - } - rewriteClassName = comments[comments.length - 1]; - if (JavaClassValidateUtil.isClassName(rewriteClassName)) { - return rewriteClassName; - } - } - return replacementMap.get(fullTypeName); - } - - default Set ignoreParamsSets(JavaMethod method) { - Set ignoreSets = new HashSet<>(); - DocletTag ignoreParam = method.getTagByName(DocTags.IGNORE_PARAMS); - if (Objects.nonNull(ignoreParam)) { - String[] igParams = ignoreParam.getValue().split(" "); - Collections.addAll(ignoreSets, igParams); - } - return ignoreSets; - } - - boolean ignoreReturnObject(String typeName, List ignoreParams); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IDocBuildTemplate.java deleted file mode 100644 index 9af0e802..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IDocBuildTemplate.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.TornaConstants; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.ApiGroup; -import com.power.doc.model.ApiMethodDoc; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.utils.DocPathUtil; -import com.power.doc.utils.DocUtil; - -/** - * @author yu 2019/12/21. - */ -public interface IDocBuildTemplate { - - List getApiData(ProjectDocConfigBuilder projectBuilder); - - FrameworkAnnotations registeredAnnotations(); - - - /** - * handle group api docs - * - * @param apiDocList list of apiDocList - * @param apiConfig ApiConfig apiConfig - * @return List of ApiDoc - * @author cqmike - */ - default List handleApiGroup(List apiDocList, ApiConfig apiConfig) { - if (CollectionUtil.isEmpty(apiDocList) || apiConfig == null) { - return apiDocList; - } - List groups = apiConfig.getGroups(); - List finalApiDocs = new ArrayList<>(); - - ApiDoc defaultGroup = ApiDoc.buildGroupApiDoc(TornaConstants.DEFAULT_GROUP_CODE); - // show default group - AtomicInteger order = new AtomicInteger(1); - finalApiDocs.add(defaultGroup); - - if (CollectionUtil.isEmpty(groups)) { - defaultGroup.setOrder(order.getAndIncrement()); - defaultGroup.getChildrenApiDocs().addAll(apiDocList); - return finalApiDocs; - } - Map hasInsert = new HashMap<>(); - for (ApiGroup group : groups) { - ApiDoc groupApiDoc = ApiDoc.buildGroupApiDoc(group.getName()); - finalApiDocs.add(groupApiDoc); - for (ApiDoc doc : apiDocList) { - if (hasInsert.containsKey(doc.getAlias())) { - continue; - } - if (!DocUtil.isMatch(group.getApis(), doc.getPackageName() + "." + doc.getName())) { - continue; - } - hasInsert.put(doc.getAlias(), null); - groupApiDoc.getChildrenApiDocs().add(doc); - doc.setOrder(groupApiDoc.getChildrenApiDocs().size()); - doc.setGroup(group.getName()); - if (StringUtil.isEmpty(group.getPaths())) { - continue; - } - List methodDocs = doc.getList().stream() - .filter(l -> DocPathUtil.matches(l.getPath(), group.getPaths(), null)) - .collect(Collectors.toList()); - doc.setList(methodDocs); - } - } - // Ungrouped join the default group - for (ApiDoc doc : apiDocList) { - String key = doc.getAlias(); - if (!hasInsert.containsKey(key)) { - defaultGroup.getChildrenApiDocs().add(doc); - doc.setOrder(defaultGroup.getChildrenApiDocs().size()); - hasInsert.put(doc.getAlias(), null); - } - } - if (CollectionUtil.isEmpty(defaultGroup.getChildrenApiDocs())) { - finalApiDocs.remove(defaultGroup); - } - finalApiDocs.forEach(group -> group.setOrder(order.getAndIncrement())); - return finalApiDocs; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRestDocTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRestDocTemplate.java deleted file mode 100644 index cb6213b8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRestDocTemplate.java +++ /dev/null @@ -1,1114 +0,0 @@ -package com.power.doc.template; - -import com.power.common.util.*; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.*; -import com.power.doc.handler.IHeaderHandler; -import com.power.doc.handler.IRequestMappingHandler; -import com.power.doc.helper.FormDataBuildHelper; -import com.power.doc.helper.JsonBuildHelper; -import com.power.doc.helper.ParamsBuildHelper; -import com.power.doc.model.*; -import com.power.doc.model.annotation.EntryAnnotation; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.annotation.MappingAnnotation; -import com.power.doc.model.request.ApiRequestExample; -import com.power.doc.model.request.CurlRequest; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.*; -import com.thoughtworks.qdox.model.*; -import com.thoughtworks.qdox.model.expression.AnnotationValue; -import org.beetl.core.util.ArrayUtils; - -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.logging.Logger; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.power.doc.constants.DocGlobalConstants.FILE_CONTENT_TYPE; -import static com.power.doc.constants.DocGlobalConstants.JSON_CONTENT_TYPE; -import static com.power.doc.constants.DocTags.IGNORE; - -public interface IRestDocTemplate extends IBaseDocBuildTemplate { - - Logger log = Logger.getLogger(IRestDocTemplate.class.getName()); - AtomicInteger atomicInteger = new AtomicInteger(1); - - default List processApiData(ProjectDocConfigBuilder projectBuilder, FrameworkAnnotations frameworkAnnotations, - List configApiReqParams, IRequestMappingHandler baseMappingHandler, IHeaderHandler headerHandler) { - ApiConfig apiConfig = projectBuilder.getApiConfig(); - List apiDocList = new ArrayList<>(); - int order = 0; - boolean setCustomOrder = false; - Collection classes = projectBuilder.getJavaProjectBuilder().getClasses(); - // exclude class is ignore - for (JavaClass cls : classes) { - if (StringUtil.isNotEmpty(apiConfig.getPackageFilters())) { - // from smart config - if (!DocUtil.isMatch(apiConfig.getPackageFilters(), cls.getCanonicalName())) { - continue; - } - } - // from tag - DocletTag ignoreTag = cls.getTagByName(DocTags.IGNORE); - if (!defaultEntryPoint(cls, frameworkAnnotations) || Objects.nonNull(ignoreTag)) { - continue; - } - String strOrder = JavaClassUtil.getClassTagsValue(cls, DocTags.ORDER, Boolean.TRUE); - order++; - if (ValidateUtil.isNonNegativeInteger(strOrder)) { - setCustomOrder = true; - order = Integer.parseInt(strOrder); - } - List apiMethodDocs = buildEntryPointMethod(cls, apiConfig, projectBuilder, - frameworkAnnotations, configApiReqParams, baseMappingHandler, headerHandler); - this.handleApiDoc(cls, apiDocList, apiMethodDocs, order, apiConfig.isMd5EncryptedHtmlName()); - } - apiDocList = handleTagsApiDoc(apiDocList); - if (apiConfig.isSortByTitle()) { - Collections.sort(apiDocList); - } else if (setCustomOrder) { - // while set custom oder - return apiDocList.stream() - .sorted(Comparator.comparing(ApiDoc::getOrder)) - .peek(p -> p.setOrder(atomicInteger.getAndAdd(1))).collect(Collectors.toList()); - } - return apiDocList; - } - - default String createDocRenderHeaders(List headers, boolean isAdoc) { - StringBuilder builder = new StringBuilder(); - if (CollectionUtil.isEmpty(headers)) { - headers = new ArrayList<>(0); - } - for (ApiReqParam header : headers) { - builder.append("|") - .append(header.getName()).append("|") - .append(header.getType()).append("|") - .append(header.isRequired()).append("|") - .append(header.getDesc()).append("|") - .append(header.getSince()).append("|\n"); - } - return builder.toString(); - } - - - default void handleApiDoc(JavaClass cls, List apiDocList, List apiMethodDocs, int order, boolean isUseMD5) { - String controllerName = cls.getName(); - ApiDoc apiDoc = new ApiDoc(); - String classAuthor = JavaClassUtil.getClassTagsValue(cls, DocTags.AUTHOR, Boolean.TRUE); - apiDoc.setOrder(order); - apiDoc.setName(controllerName); - apiDoc.setAuthor(classAuthor); - apiDoc.setAlias(controllerName); - apiDoc.setFolder(true); - apiDoc.setPackageName(cls.getPackage().getName()); - // apiDoc.setAuthor(); - - // handle class tags - List classTags = cls.getTagsByName(DocTags.TAG); - Set tagSet = classTags.stream().map(DocletTag::getValue) - .map(StringUtils::trim) - .collect(Collectors.toCollection(LinkedHashSet::new)); - String[] tags = tagSet.toArray(new String[]{}); - apiDoc.setTags(tags); - - if (isUseMD5) { - String name = DocUtil.generateId(apiDoc.getName()); - apiDoc.setAlias(name); - } - String desc = DocUtil.getEscapeAndCleanComment(cls.getComment()); - apiDoc.setDesc(desc); - apiDoc.setList(apiMethodDocs); - apiDocList.add(apiDoc); - - tagSet.add(StringUtils.trim(desc)); - for (String tag : tagSet) { - DocMapping.tagDocPut(tag, apiDoc, null); - for (ApiMethodDoc methodDoc : apiMethodDocs) { - DocMapping.tagDocPut(tag, null, methodDoc); - } - } - for (ApiMethodDoc methodDoc : apiMethodDocs) { - String[] docTags = methodDoc.getTags(); - methodDoc.setClazzDoc(apiDoc); - if (ArrayUtils.isEmpty(docTags)) continue; - for (String tag : docTags) { - DocMapping.tagDocPut(tag, null, methodDoc); - } - } - } - - - default void mappingParamToApiParam(String str, List paramList, Map mappingParams) { - String param = StringUtil.removeQuotes(str); - String paramName; - String paramValue; - String description = "Parameter condition."; - if (param.contains("=")) { - int index = param.indexOf("="); - paramName = param.substring(0, index); - paramValue = param.substring(index + 1); - description = description + " [" + paramName + "=" + paramValue + "]"; - } else { - paramName = param; - paramValue = DocUtil.getValByTypeAndFieldName("string", paramName, Boolean.TRUE); - } - String type = ValidateUtil.isPositiveInteger(paramValue) ? "int32" : "string"; - ApiParam apiParam = ApiParam.of().setField(paramName) - .setId(paramList.size() + 1) - .setQueryParam(true) - .setValue(paramValue) - .setType(type).setDesc(description) - .setRequired(true) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - mappingParams.put(paramName, null); - } - - default void mappingParamProcess(String str, Map pathParamsMap) { - String param = StringUtil.removeQuotes(str); - String paramName; - String paramValue; - if (param.contains("=")) { - int index = param.indexOf("="); - paramName = param.substring(0, index); - paramValue = param.substring(index + 1); - pathParamsMap.put(paramName, paramValue); - } else { - paramName = param; - pathParamsMap.put(paramName, DocUtil.getValByTypeAndFieldName("string", paramName, Boolean.TRUE)); - } - } - - - default String getParamName(String paramName, JavaAnnotation annotation) { - String resolvedParamName = DocUtil.resolveAnnotationValue(annotation.getProperty(DocAnnotationConstants.VALUE_PROP)); - if (StringUtils.isBlank(resolvedParamName)) { - resolvedParamName = DocUtil.resolveAnnotationValue(annotation.getProperty(DocAnnotationConstants.NAME_PROP)); - } - if (!StringUtils.isBlank(resolvedParamName)) { - paramName = StringUtil.removeQuotes(resolvedParamName); - } - return StringUtil.removeQuotes(paramName); - } - - default List handleTagsApiDoc(List apiDocList) { - if (CollectionUtil.isEmpty(apiDocList)) { - return Collections.emptyList(); - } - - // all class tag copy - Map copyMap = new HashMap<>(); - apiDocList.forEach(doc -> { - String[] tags = doc.getTags(); - if (ArrayUtils.isEmpty(tags)) { - tags = new String[]{doc.getName()}; - } - - for (String tag : tags) { - tag = StringUtil.trim(tag); - copyMap.computeIfPresent(tag, (k, v) -> { - List list = CollectionUtil.isEmpty(v.getList()) ? new ArrayList<>() : v.getList(); - list.addAll(doc.getList()); - v.setList(list); - return v; - }); - copyMap.putIfAbsent(tag, doc); - } - }); - - // handle method tag - Map allMap = new HashMap<>(copyMap); - allMap.forEach((k, v) -> { - List methodDocList = v.getList(); - methodDocList.forEach(method -> { - String[] tags = method.getTags(); - if (ArrayUtils.isEmpty(tags)) { - return; - } - for (String tag : tags) { - tag = StringUtil.trim(tag); - copyMap.computeIfPresent(tag, (k1, v2) -> { - method.setOrder(v2.getList().size() + 1); - v2.getList().add(method); - return v2; - }); - copyMap.putIfAbsent(tag, ApiDoc.buildTagApiDoc(v, tag, method)); - } - }); - }); - - List apiDocs = new ArrayList<>(copyMap.values()); - int index = apiDocs.size() - 1; - for (ApiDoc apiDoc : apiDocs) { - if (apiDoc.getOrder() == null) { - apiDoc.setOrder(index++); - } - } - apiDocs.sort(Comparator.comparing(ApiDoc::getOrder)); - return apiDocs; - } - - default List getClassAnnotations(JavaClass cls, FrameworkAnnotations frameworkAnnotations) { - List annotationsList = new ArrayList<>(cls.getAnnotations()); - Map mappingAnnotationMap = frameworkAnnotations.getEntryAnnotations(); - boolean flag = annotationsList.stream().anyMatch(item -> { - String annotationName = item.getType().getValue(); - String fullyName = item.getType().getFullyQualifiedName(); - return mappingAnnotationMap.containsKey(annotationName) || mappingAnnotationMap.containsKey(fullyName); - }); - // child override parent set - if (flag) { - return annotationsList; - } - JavaClass superJavaClass = cls.getSuperJavaClass(); - if (Objects.nonNull(superJavaClass) && !"Object".equals(superJavaClass.getSimpleName())) { - annotationsList.addAll(getClassAnnotations(superJavaClass, frameworkAnnotations)); - } - return annotationsList; - } - - default List buildEntryPointMethod( - final JavaClass cls, ApiConfig apiConfig, - ProjectDocConfigBuilder projectBuilder, - FrameworkAnnotations frameworkAnnotations, - List configApiReqParams, - IRequestMappingHandler baseMappingHandler, - IHeaderHandler headerHandler - ) { - String clazName = cls.getCanonicalName(); - boolean paramsDataToTree = projectBuilder.getApiConfig().isParamsDataToTree(); - String group = JavaClassUtil.getClassTagsValue(cls, DocTags.GROUP, Boolean.TRUE); - List classAnnotations = this.getClassAnnotations(cls, frameworkAnnotations); - String baseUrl = ""; - // the requestMapping annotation's consumes value on class - String classMediaType = null; - Map mappingAnnotationMap = frameworkAnnotations.getMappingAnnotations(); - for (JavaAnnotation annotation : classAnnotations) { - String annotationName = annotation.getType().getValue(); - MappingAnnotation mappingAnnotation = mappingAnnotationMap.get(annotationName); - if (Objects.isNull(mappingAnnotation)) { - continue; - } - if (CollectionUtil.isNotEmpty(mappingAnnotation.getPathProps())) { - baseUrl = StringUtil.removeQuotes(DocUtil.getPathUrl(annotation, mappingAnnotation.getPathProps() - .toArray(new String[0]))); - } - // use first annotation's value - if (classMediaType == null) { - Object consumes = annotation.getNamedParameter(mappingAnnotation.getConsumesProp()); - if (consumes != null) { - classMediaType = consumes.toString(); - } - } - } - - List methods = cls.getMethods(); - List docJavaMethods = new ArrayList<>(methods.size()); - for (JavaMethod method : methods) { - if (method.isPrivate() || DocUtil.isMatch(apiConfig.getPackageExcludeFilters(), clazName + "." + method.getName())) { - continue; - } - if (Objects.nonNull(method.getTagByName(IGNORE))) { - continue; - } - docJavaMethods.add(convertToDocJavaMethod(apiConfig, projectBuilder, method, null)); - } - // add parent class methods - docJavaMethods.addAll(getParenClassMethods(apiConfig, projectBuilder, cls)); - List implClasses = cls.getImplements(); - for (JavaType type : implClasses) { - JavaClass javaClass = (JavaClass) type; - Map actualTypesMap = JavaClassUtil.getActualTypesMap(javaClass); - for (JavaMethod method : javaClass.getMethods()) { - if (method.isDefault()) { - docJavaMethods.add(convertToDocJavaMethod(apiConfig, projectBuilder, method, actualTypesMap)); - } - } - } - List methodDocList = new ArrayList<>(methods.size()); - int methodOrder = 0; - for (DocJavaMethod docJavaMethod : docJavaMethods) { - JavaMethod method = docJavaMethod.getJavaMethod(); - // handle request mapping - RequestMapping requestMapping = baseMappingHandler.handle(projectBuilder, baseUrl, - method, frameworkAnnotations, - (javaClass, mapping) -> this.requestMappingPostProcess(javaClass, method, mapping)); - if (Objects.isNull(requestMapping)) { - continue; - } - if (Objects.isNull(requestMapping.getShortUrl())) { - continue; - } - ApiMethodDoc apiMethodDoc = new ApiMethodDoc(); - // fill contentType by annotation's consumes parameter - String mediaType = requestMapping.getMediaType(); - if (Objects.nonNull(mediaType)) { - apiMethodDoc.setContentType(MediaType.valueOf(mediaType)); - } else if (Objects.nonNull(classMediaType)) { - // if method does not contain consumes parameter, then use the value of class - apiMethodDoc.setContentType(MediaType.valueOf(classMediaType)); - } - apiMethodDoc.setDownload(docJavaMethod.isDownload()); - apiMethodDoc.setPage(docJavaMethod.getPage()); - apiMethodDoc.setGroup(group); - if (Objects.nonNull(docJavaMethod.getGroup())) { - apiMethodDoc.setGroup(docJavaMethod.getGroup()); - } - - // handle tags - List tags = method.getTagsByName(DocTags.TAG); - apiMethodDoc.setTags(tags.stream().map(DocletTag::getValue).toArray(String[]::new)); - - methodOrder++; - apiMethodDoc.setOrder(methodOrder); - apiMethodDoc.setName(method.getName()); - apiMethodDoc.setDesc(method.getComment()); - apiMethodDoc.setAuthor(docJavaMethod.getAuthor()); - apiMethodDoc.setDetail(docJavaMethod.getDetail()); - String methodUid = DocUtil.generateId(clazName + method.getName() + methodOrder); - apiMethodDoc.setMethodId(methodUid); - // handle headers - List apiReqHeaders = headerHandler.handle(method, projectBuilder); - apiReqHeaders = apiReqHeaders.stream().filter(param -> DocUtil.filterPath(requestMapping, param)).collect(Collectors.toList()); - - apiMethodDoc.setType(requestMapping.getMethodType()); - apiMethodDoc.setUrl(requestMapping.getUrl()); - apiMethodDoc.setServerUrl(projectBuilder.getServerUrl()); - apiMethodDoc.setPath(requestMapping.getShortUrl()); - apiMethodDoc.setDeprecated(requestMapping.isDeprecated()); - - final List apiReqParamList = configApiReqParams.stream() - .filter(param -> DocUtil.filterPath(requestMapping, param)).collect(Collectors.toList()); - - // build request params - ApiMethodReqParam apiMethodReqParam = requestParams(docJavaMethod, projectBuilder, apiReqParamList, frameworkAnnotations); - apiMethodDoc.setPathParams(apiMethodReqParam.getPathParams()); - apiMethodDoc.setQueryParams(apiMethodReqParam.getQueryParams()); - apiMethodDoc.setRequestParams(apiMethodReqParam.getRequestParams()); - - if (paramsDataToTree) { - // convert to tree - this.convertParamsDataToTree(apiMethodDoc); - } - List allApiReqHeaders; - final Map> reqParamMap = configApiReqParams.stream().collect(Collectors.groupingBy(ApiReqParam::getParamIn)); - final List headerParamList = reqParamMap.getOrDefault(ApiReqParamInTypeEnum.HEADER.getValue(), Collections.emptyList()); - allApiReqHeaders = Stream.of(headerParamList, apiReqHeaders).filter(Objects::nonNull) - .flatMap(Collection::stream).distinct().filter(param -> DocUtil.filterPath(requestMapping, param)).collect(Collectors.toList()); - - // reduce create in template - apiMethodDoc.setHeaders(this.createDocRenderHeaders(allApiReqHeaders, apiConfig.isAdoc())); - apiMethodDoc.setRequestHeaders(allApiReqHeaders); - String path = apiMethodDoc.getPath().split(";")[0]; - String pathUrl = DocUtil.formatPathUrl(path); - List pathParams = apiMethodDoc.getPathParams(); - Iterator pathIterator = pathParams.iterator(); - while (pathIterator.hasNext()) { - ApiParam next = pathIterator.next(); - String pathKey = "{" + next.getField() + "}"; - if (!pathUrl.contains(pathKey)) { - pathIterator.remove(); - } - } - - // build request json - ApiRequestExample requestExample = buildReqJson(docJavaMethod, apiMethodDoc, requestMapping.getMethodType(), - projectBuilder, frameworkAnnotations); - String requestJson = requestExample.getExampleBody(); - // set request example detail - apiMethodDoc.setRequestExample(requestExample); - apiMethodDoc.setRequestUsage(requestJson == null ? requestExample.getUrl() : requestJson); - // build response usage - String responseValue = DocUtil.getNormalTagComments(method, DocTags.API_RESPONSE, cls.getName()); - if (StringUtil.isNotEmpty(responseValue)) { - responseValue = responseValue.replaceAll("
", ""); - apiMethodDoc.setResponseUsage(JsonUtil.toPrettyFormat(responseValue)); - } else { - apiMethodDoc.setResponseUsage(JsonBuildHelper.buildReturnJson(docJavaMethod, projectBuilder)); - } - // build response params - List responseParams = buildReturnApiParams(docJavaMethod, projectBuilder); - if (paramsDataToTree) { - responseParams = ApiParamTreeUtil.apiParamToTree(responseParams); - } - apiMethodDoc.setReturnSchema(docJavaMethod.getReturnSchema()); - apiMethodDoc.setRequestSchema(docJavaMethod.getRequestSchema()); - apiMethodDoc.setResponseParams(responseParams); - - TornaUtil.setTornaArrayTags(docJavaMethod.getJavaMethod(), apiMethodDoc); - methodDocList.add(apiMethodDoc); - } - - return methodDocList; - } - - default ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, ProjectDocConfigBuilder builder, - List configApiReqParams, FrameworkAnnotations frameworkAnnotations) { - JavaMethod javaMethod = docJavaMethod.getJavaMethod(); - boolean isStrict = builder.getApiConfig().isStrict(); - String className = javaMethod.getDeclaringClass().getCanonicalName(); - Map paramTagMap = docJavaMethod.getParamTagMap(); - Map paramsComments = docJavaMethod.getParamsComments(); - List paramList = new ArrayList<>(); - Map mappingParams = new HashMap<>(); - List methodAnnotations = javaMethod.getAnnotations(); - Map mappingAnnotationMap = frameworkAnnotations.getMappingAnnotations(); - for (JavaAnnotation annotation : methodAnnotations) { - String annotationName = annotation.getType().getName(); - MappingAnnotation mappingAnnotation = mappingAnnotationMap.get(annotationName); - if (Objects.nonNull(mappingAnnotation) && StringUtil.isNotEmpty(mappingAnnotation.getParamsProp())) { - Object paramsObjects = annotation.getNamedParameter(mappingAnnotation.getParamsProp()); - if (Objects.isNull(paramsObjects)) { - continue; - } - String params = StringUtil.removeQuotes(paramsObjects.toString()); - if (!params.startsWith("[")) { - mappingParamToApiParam(paramsObjects.toString(), paramList, mappingParams); - continue; - } - List headers = (LinkedList) paramsObjects; - for (String str : headers) { - mappingParamToApiParam(str, paramList, mappingParams); - } - } - } - final Map> collect = configApiReqParams.stream().collect(Collectors.groupingBy(ApiReqParam::getParamIn, - Collectors.toMap(ApiReqParam::getName, m -> m, (k1, k2) -> k1))); - final Map pathReqParamMap = collect.getOrDefault(ApiReqParamInTypeEnum.PATH.getValue(), Collections.emptyMap()); - final Map queryReqParamMap = collect.getOrDefault(ApiReqParamInTypeEnum.QUERY.getValue(), Collections.emptyMap()); - List parameterList = getJavaParameterList(builder, docJavaMethod, frameworkAnnotations); - if (parameterList.isEmpty()) { - AtomicInteger querySize = new AtomicInteger(paramList.size() + 1); - paramList.addAll(queryReqParamMap.values().stream() - .map(p -> ApiReqParam.convertToApiParam(p).setQueryParam(true).setId(querySize.getAndIncrement())) - .collect(Collectors.toList())); - AtomicInteger pathSize = new AtomicInteger(1); - return ApiMethodReqParam.builder() - .setPathParams(new ArrayList<>(pathReqParamMap.values().stream() - .map(p -> ApiReqParam.convertToApiParam(p).setPathParam(true).setId(pathSize.getAndIncrement())) - .collect(Collectors.toList()))) - .setQueryParams(paramList) - .setRequestParams(new ArrayList<>(0)); - } - boolean requestFieldToUnderline = builder.getApiConfig().isRequestFieldToUnderline(); - int requestBodyCounter = 0; - out: - for (DocJavaParameter apiParameter : parameterList) { - JavaParameter parameter = apiParameter.getJavaParameter(); - String paramName = parameter.getName(); - if (mappingParams.containsKey(paramName)) { - continue; - } - String typeName = apiParameter.getGenericCanonicalName(); - String simpleTypeName = apiParameter.getTypeValue(); - String simpleName = simpleTypeName.toLowerCase(); - String fullTypeName = apiParameter.getFullyQualifiedName(); - if (!paramTagMap.containsKey(paramName) && JavaClassValidateUtil.isPrimitive(fullTypeName) && isStrict) { - throw new RuntimeException("ERROR: Unable to find javadoc @param for actual param \"" - + paramName + "\" in method " + javaMethod.getName() + " from " + className); - } - StringBuilder comment = new StringBuilder(this.paramCommentResolve(paramTagMap.get(paramName))); - - JavaClass javaClass = builder.getJavaProjectBuilder().getClassByName(fullTypeName); - String mockValue = JavaFieldUtil.createMockValue(paramsComments, paramName, typeName, simpleTypeName); - List annotations = parameter.getAnnotations(); - Set groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, builder.getJavaProjectBuilder()); - String strRequired = "false"; - boolean isPathVariable = false; - boolean isRequestBody = false; - boolean required = false; - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - if (ignoreMvcParamWithAnnotation(annotationName)) { - continue out; - } - if (frameworkAnnotations.getRequestParamAnnotation().getAnnotationName().equals(annotationName) || - frameworkAnnotations.getPathVariableAnnotation().getAnnotationName().equals(annotationName)) { - String defaultValueProp = DocAnnotationConstants.DEFAULT_VALUE_PROP; - String requiredProp = DocAnnotationConstants.REQUIRED_PROP; - if (frameworkAnnotations.getRequestParamAnnotation().getAnnotationName().equals(annotationName)) { - defaultValueProp = frameworkAnnotations.getRequestParamAnnotation().getDefaultValueProp(); - requiredProp = frameworkAnnotations.getRequestParamAnnotation().getRequiredProp(); - } - if (frameworkAnnotations.getPathVariableAnnotation().getAnnotationName().equals(annotationName)) { - defaultValueProp = frameworkAnnotations.getPathVariableAnnotation().getDefaultValueProp(); - requiredProp = frameworkAnnotations.getPathVariableAnnotation().getRequiredProp(); - isPathVariable = true; - } - AnnotationValue annotationDefaultVal = annotation.getProperty(defaultValueProp); - if (Objects.nonNull(annotationDefaultVal)) { - mockValue = DocUtil.resolveAnnotationValue(annotationDefaultVal); - } - paramName = getParamName(paramName, annotation); - AnnotationValue annotationRequired = annotation.getProperty(requiredProp); - if (Objects.nonNull(annotationRequired)) { - strRequired = annotationRequired.toString(); - } else { - strRequired = "true"; - } - } - if (JavaClassValidateUtil.isJSR303Required(annotationName)) { - strRequired = "true"; - } - if (frameworkAnnotations.getRequestBodyAnnotation().getAnnotationName().equals(annotationName)) { - if (requestBodyCounter > 0) { - throw new RuntimeException("You have use @RequestBody Passing multiple variables for method " - + javaMethod.getName() + " in " + className + ",@RequestBody annotation could only bind one variables."); - } - mockValue = JsonBuildHelper.buildJson(fullTypeName, typeName, Boolean.FALSE, 0, new HashMap<>(), groupClasses, builder); - requestBodyCounter++; - isRequestBody = true; - } - required = Boolean.parseBoolean(strRequired); - } - comment.append(JavaFieldUtil.getJsrComment(annotations)); - if (requestFieldToUnderline && !isPathVariable) { - paramName = StringUtil.camelToUnderline(paramName); - } - // file upload - if (JavaClassValidateUtil.isFile(typeName)) { - ApiParam param = ApiParam.of().setField(paramName).setType(DocGlobalConstants.PARAM_TYPE_FILE) - .setId(paramList.size() + 1).setQueryParam(true) - .setRequired(required).setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setDesc(comment.toString()); - if (typeName.contains("[]") || typeName.endsWith(">")) { - comment.append("(array of file)"); - param.setType(DocGlobalConstants.PARAM_TYPE_FILE); - param.setDesc(comment.toString()); - param.setHasItems(true); - } - paramList.add(param); - continue; - } - - boolean queryParam = !isRequestBody && !isPathVariable; - if (JavaClassValidateUtil.isCollection(fullTypeName) || JavaClassValidateUtil.isArray(fullTypeName)) { - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - String gicName = gicNameArr[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - // handle array and list mock value - mockValue = JavaFieldUtil.createMockValue(paramsComments, paramName, gicName, gicName); - if (StringUtil.isNotEmpty(mockValue) && !mockValue.contains(",")) { - mockValue = StringUtils.join(mockValue, ",", JavaFieldUtil.createMockValue(paramsComments, paramName, gicName, gicName)); - } - JavaClass gicJavaClass = builder.getJavaProjectBuilder().getClassByName(gicName); - if (gicJavaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(gicJavaClass, Boolean.TRUE); - ApiParam param = ApiParam.of().setField(paramName).setDesc(comment + ",[array of enum]") - .setRequired(required) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setId(paramList.size() + 1) - .setEnumValues(JavaClassUtil.getEnumValues(gicJavaClass)) - .setEnumInfo(JavaClassUtil.getEnumInfo(gicJavaClass, builder)) - .setType("array").setValue(String.valueOf(value)); - paramList.add(param); - if (requestBodyCounter > 0) { - Map map = OpenApiSchemaUtil.arrayTypeSchema(gicName); - docJavaMethod.setRequestSchema(map); - } - } else if (JavaClassValidateUtil.isPrimitive(gicName)) { - String shortSimple = DocClassUtil.processTypeNameForParams(gicName); - ApiParam param = ApiParam.of() - .setField(paramName) - .setDesc(comment + ",[array of " + shortSimple + "]") - .setRequired(required) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setId(paramList.size() + 1) - .setType("array") - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setValue(mockValue); - paramList.add(param); - if (requestBodyCounter > 0) { - Map map = OpenApiSchemaUtil.arrayTypeSchema(gicName); - docJavaMethod.setRequestSchema(map); - } - } else if (JavaClassValidateUtil.isFile(gicName)) { - // file upload - ApiParam param = ApiParam.of().setField(paramName) - .setType(DocGlobalConstants.PARAM_TYPE_FILE) - .setId(paramList.size() + 1) - .setQueryParam(true) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setHasItems(true) - .setDesc(comment + "(array of file)"); - paramList.add(param); - } else { - if (requestBodyCounter > 0) { - // for json - paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[0], DocGlobalConstants.EMPTY, 0, - String.valueOf(required), Boolean.FALSE, new HashMap<>(), builder, - groupClasses, 0, Boolean.TRUE, null)); - } - } - } else if (JavaClassValidateUtil.isPrimitive(fullTypeName)) { - ApiParam param = ApiParam.of() - .setField(paramName) - .setType(DocClassUtil.processTypeNameForParams(simpleName)) - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setValue(mockValue) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param); - if (requestBodyCounter > 0) { - Map map = OpenApiSchemaUtil.primaryTypeSchema(simpleName); - docJavaMethod.setRequestSchema(map); - } - } else if (JavaClassValidateUtil.isMap(fullTypeName)) { - log.warning("When using smart-doc, it is not recommended to use Map to receive parameters, Check it in " - + javaMethod.getDeclaringClass().getCanonicalName() + "#" + javaMethod.getName()); - // is map without Gic - if (JavaClassValidateUtil.isMap(typeName)) { - ApiParam apiParam = ApiParam.of() - .setField(paramName) - .setType("map") - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - if (requestBodyCounter > 0) { - Map map = OpenApiSchemaUtil.mapTypeSchema("object"); - docJavaMethod.setRequestSchema(map); - } - continue; - } - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - if (JavaClassValidateUtil.isPrimitive(gicNameArr[1])) { - ApiParam apiParam = ApiParam.of() - .setField(paramName) - .setType("map") - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - if (requestBodyCounter > 0) { - Map map = OpenApiSchemaUtil.mapTypeSchema(gicNameArr[1]); - docJavaMethod.setRequestSchema(map); - } - } else { - paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[1], DocGlobalConstants.EMPTY, 0, - String.valueOf(required), Boolean.FALSE, new HashMap<>(), - builder, groupClasses, 0, Boolean.FALSE, null)); - } - - } - // param is enum - else if (javaClass.isEnum()) { - String o = JavaClassUtil.getEnumParams(javaClass); - Object value = JavaClassUtil.getEnumValue(javaClass, isPathVariable || queryParam); - ApiParam param = ApiParam.of().setField(paramName) - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setValue(String.valueOf(value)) - .setType("enum").setDesc(StringUtil.removeQuotes(o)) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setEnumInfo(JavaClassUtil.getEnumInfo(javaClass, builder)) - .setEnumValues(JavaClassUtil.getEnumValues(javaClass)); - paramList.add(param); - } else { - paramList.addAll(ParamsBuildHelper.buildParams(typeName, DocGlobalConstants.EMPTY, 0, - String.valueOf(required), Boolean.FALSE, new HashMap<>(), builder, groupClasses, 0, Boolean.FALSE, null)); - } - } - return ApiParamTreeUtil.buildMethodReqParam(paramList, queryReqParamMap, pathReqParamMap, requestBodyCounter); - } - - default ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc apiMethodDoc, String methodType, - ProjectDocConfigBuilder configBuilder, FrameworkAnnotations frameworkAnnotations) { - JavaMethod method = javaMethod.getJavaMethod(); - Map pathParamsMap = new LinkedHashMap<>(); - Map queryParamsMap = new LinkedHashMap<>(); - - apiMethodDoc.getPathParams().stream().filter(Objects::nonNull).filter(p -> StringUtil.isNotEmpty(p.getValue()) || p.isConfigParam()) - .forEach(param -> pathParamsMap.put(param.getSourceField(), param.getValue())); - apiMethodDoc.getQueryParams().stream().filter(Objects::nonNull).filter(p -> StringUtil.isNotEmpty(p.getValue()) || p.isConfigParam()) - .forEach(param -> queryParamsMap.put(param.getSourceField(), param.getValue())); - List methodAnnotations = method.getAnnotations(); - Map mappingAnnotationMap = frameworkAnnotations.getMappingAnnotations(); - for (JavaAnnotation annotation : methodAnnotations) { - String annotationName = annotation.getType().getName(); - MappingAnnotation mappingAnnotation = mappingAnnotationMap.get(annotationName); - if (Objects.nonNull(mappingAnnotation) && StringUtil.isNotEmpty(mappingAnnotation.getParamsProp())) { - Object paramsObjects = annotation.getNamedParameter(mappingAnnotation.getParamsProp()); - if (Objects.isNull(paramsObjects)) { - continue; - } - String params = StringUtil.removeQuotes(paramsObjects.toString()); - if (!params.startsWith("[")) { - mappingParamProcess(paramsObjects.toString(), queryParamsMap); - continue; - } - List headers = (LinkedList) paramsObjects; - for (String str : headers) { - mappingParamProcess(str, queryParamsMap); - } - } - } - List parameterList = getJavaParameterList(configBuilder, javaMethod, frameworkAnnotations); - List reqHeaderList = apiMethodDoc.getRequestHeaders(); - if (parameterList.size() < 1) { - String path = apiMethodDoc.getPath().split(";")[0]; - path = DocUtil.formatAndRemove(path, pathParamsMap); - String url = UrlUtil.urlJoin(path, queryParamsMap); - url = StringUtil.removeQuotes(url); - url = apiMethodDoc.getServerUrl() + "/" + url; - url = UrlUtil.simplifyUrl(url); - CurlRequest curlRequest = CurlRequest.builder() - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - String format = CurlUtil.toCurl(curlRequest); - return ApiRequestExample.builder().setUrl(apiMethodDoc.getUrl()).setExampleBody(format); - } - boolean requestFieldToUnderline = configBuilder.getApiConfig().isRequestFieldToUnderline(); - Map paramsComments = DocUtil.getCommentsByTag(method, DocTags.PARAM, null); - List mvcRequestAnnotations = this.listMvcRequestAnnotations(); - List formDataList = new ArrayList<>(); - ApiRequestExample requestExample = ApiRequestExample.builder(); - out: - for (DocJavaParameter apiParameter : parameterList) { - JavaParameter parameter = apiParameter.getJavaParameter(); - String paramName = parameter.getName(); - String typeName = apiParameter.getFullyQualifiedName(); - String gicTypeName = apiParameter.getGenericCanonicalName(); - String simpleTypeName = apiParameter.getTypeValue(); - JavaClass javaClass = configBuilder.getJavaProjectBuilder().getClassByName(typeName); - String[] globGicName = DocClassUtil.getSimpleGicName(gicTypeName); - String comment = this.paramCommentResolve(paramsComments.get(paramName)); - String mockValue = JavaFieldUtil.createMockValue(paramsComments, paramName, gicTypeName, simpleTypeName); - if (queryParamsMap.containsKey(paramName)) { - mockValue = queryParamsMap.get(paramName); - } - if (requestFieldToUnderline) { - paramName = StringUtil.camelToUnderline(paramName); - } - List annotations = parameter.getAnnotations(); - Set groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, configBuilder.getJavaProjectBuilder()); - boolean paramAdded = false; - boolean requestParam = false; - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - String fullName = annotation.getType().getSimpleName(); - if (!mvcRequestAnnotations.contains(fullName) || paramAdded) { - continue; - } - if (ignoreMvcParamWithAnnotation(annotationName)) { - continue out; - } - - AnnotationValue annotationDefaultVal = annotation.getProperty(DocAnnotationConstants.DEFAULT_VALUE_PROP); - - if (Objects.nonNull(annotationDefaultVal)) { - mockValue = DocUtil.resolveAnnotationValue(annotationDefaultVal); - } - paramName = getParamName(paramName, annotation); - if (frameworkAnnotations.getRequestBodyAnnotation().getAnnotationName().equals(annotationName)) { - // priority use mapping annotation's consumer value - if (apiMethodDoc.getContentType().equals(DocGlobalConstants.URL_CONTENT_TYPE)) { - apiMethodDoc.setContentType(JSON_CONTENT_TYPE); - } - boolean isArrayOrCollection = false; - if (JavaClassValidateUtil.isArray(typeName) || JavaClassValidateUtil.isCollection(typeName)) { - simpleTypeName = globGicName[0]; - isArrayOrCollection = true; - } - - if (JavaClassValidateUtil.isPrimitive(simpleTypeName)) { - if (isArrayOrCollection) { - if (StringUtil.isNotEmpty(mockValue)) { - mockValue = "[" + mockValue + "]"; - } else { - mockValue = "[" + DocUtil.getValByTypeAndFieldName(simpleTypeName, paramName) + "]"; - } - mockValue = JsonUtil.toPrettyFormat(mockValue); - } - requestExample.setJsonBody(mockValue).setJson(true); - } else { - String json = JsonBuildHelper.buildJson(typeName, gicTypeName, Boolean.FALSE, 0, new HashMap<>(), groupClasses, - configBuilder); - requestExample.setJsonBody(JsonUtil.toPrettyFormat(json)).setJson(true); - } - queryParamsMap.remove(paramName); - paramAdded = true; - } else if (frameworkAnnotations.getPathVariableAnnotation().getAnnotationName().contains(annotationName)) { - if (javaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - mockValue = StringUtil.removeQuotes(String.valueOf(value)); - } - if (pathParamsMap.containsKey(paramName)) { - mockValue = pathParamsMap.get(paramName); - } - pathParamsMap.put(paramName, mockValue); - paramAdded = true; - } else if (frameworkAnnotations.getRequestParamAnnotation().getAnnotationName().contains(annotationName)) { - if (javaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - mockValue = StringUtil.removeQuotes(String.valueOf(value)); - } - if (queryParamsMap.containsKey(paramName)) { - mockValue = queryParamsMap.get(paramName); - } - if (JavaClassValidateUtil.isPrimitive(simpleTypeName)) { - requestExample.addJsonBody(mockValue); - } - if (JavaClassValidateUtil.isFile(typeName)) { - break; - } - // array and list - queryParamsMap.put(paramName, mockValue); - requestParam = true; - paramAdded = true; - } - } - if (paramAdded) { - continue; - } - // file upload - if (JavaClassValidateUtil.isFile(gicTypeName)) { - apiMethodDoc.setContentType(FILE_CONTENT_TYPE); - FormData formData = new FormData(); - formData.setKey(paramName); - formData.setType("file"); - if (typeName.contains("[]") || typeName.endsWith(">")) { - comment = comment + "(array of file)"; - formData.setType(DocGlobalConstants.PARAM_TYPE_FILE); - formData.setHasItems(true); - } - formData.setDescription(comment); - formData.setValue(mockValue); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isPrimitive(typeName) && !requestParam) { - FormData formData = new FormData(); - formData.setKey(paramName); - formData.setDescription(comment); - formData.setType("text"); - formData.setValue(mockValue); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isArray(typeName) || JavaClassValidateUtil.isCollection(typeName)) { - String gicName = globGicName[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - if (!JavaClassValidateUtil.isPrimitive(gicName) - && !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()) { - throw new RuntimeException("can't support binding Collection on method " - + method.getName() + "Check it in " + method.getDeclaringClass().getCanonicalName()); - } - String value; - JavaClass javaClass1 = configBuilder.getClassByName(gicName); - if (Objects.nonNull(javaClass1) && javaClass1.isEnum()) { - value = String.valueOf(JavaClassUtil.getEnumValue(javaClass1, Boolean.TRUE)); - } else { - value = RandomUtil.randomValueByType(gicName); - } - FormData formData = new FormData(); - formData.setKey(paramName); - if (!paramName.contains("[]")) { - formData.setKey(paramName + "[]"); - } - formData.setDescription(comment); - formData.setType("text"); - formData.setValue(value); - formDataList.add(formData); - } else if (javaClass.isEnum()) { - // do nothing - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - String strVal = StringUtil.removeQuotes(String.valueOf(value)); - FormData formData = new FormData(); - formData.setKey(paramName); - formData.setType("text"); - formData.setDescription(comment); - formData.setValue(strVal); - formDataList.add(formData); - } else { - formDataList.addAll(FormDataBuildHelper.getFormData(gicTypeName, new HashMap<>(), 0, configBuilder, DocGlobalConstants.EMPTY)); - } - } - - // set content-type to fromData - boolean hasFormDataUploadFile = formDataList.stream().anyMatch(form -> Objects.equals(form.getType(), DocGlobalConstants.PARAM_TYPE_FILE)); - Map> formDataGroupMap = formDataList.stream() - .collect(Collectors.groupingBy(e -> Objects.equals(e.getType(), DocGlobalConstants.PARAM_TYPE_FILE))); - List fileFormDataList = formDataGroupMap.getOrDefault(Boolean.TRUE, new ArrayList<>()); - if (hasFormDataUploadFile) { - formDataList = formDataGroupMap.getOrDefault(Boolean.FALSE, new ArrayList<>()); - apiMethodDoc.setContentType(FILE_CONTENT_TYPE); - } - - requestExample.setFormDataList(formDataList); - String[] paths = apiMethodDoc.getPath().split(";"); - String path = paths[0]; - String body; - String exampleBody; - String url; - // curl send file to convert - final Map formDataToMap = DocUtil.formDataToMap(formDataList); - // formData add to params '--data' - queryParamsMap.putAll(formDataToMap); - if (Methods.POST.getValue().equals(methodType) || Methods.PUT.getValue().equals(methodType)) { - // for post put - path = DocUtil.formatAndRemove(path, pathParamsMap); - body = UrlUtil.urlJoin(DocGlobalConstants.EMPTY, queryParamsMap) - .replace("?", DocGlobalConstants.EMPTY); - body = StringUtil.removeQuotes(body); - url = apiMethodDoc.getServerUrl() + "/" + path; - url = UrlUtil.simplifyUrl(url); - - if (requestExample.isJson()) { - if (StringUtil.isNotEmpty(body)) { - url = url + "?" + body; - } - CurlRequest curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - exampleBody = CurlUtil.toCurl(curlRequest); - } else { - CurlRequest curlRequest; - if (StringUtil.isNotEmpty(body)) { - curlRequest = CurlRequest.builder() - .setBody(body) - .setContentType(apiMethodDoc.getContentType()) - .setFileFormDataList(fileFormDataList) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - } else { - curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setFileFormDataList(fileFormDataList) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - } - exampleBody = CurlUtil.toCurl(curlRequest); - } - requestExample.setExampleBody(exampleBody).setUrl(url); - } else { - // for get delete - url = formatRequestUrl(pathParamsMap, queryParamsMap, apiMethodDoc.getServerUrl(), path); - CurlRequest curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - exampleBody = CurlUtil.toCurl(curlRequest); - - requestExample.setExampleBody(exampleBody) - .setJsonBody(requestExample.isJson() ? requestExample.getJsonBody() : DocGlobalConstants.EMPTY) - .setUrl(url); - } - return requestExample; - } - - default boolean defaultEntryPoint(JavaClass cls, FrameworkAnnotations frameworkAnnotations) { - if (cls.isAnnotation() || cls.isEnum()) { - return false; - } - if (Objects.isNull(frameworkAnnotations)) { - return false; - } - List classAnnotations = DocClassUtil.getAnnotations(cls); - Map entryAnnotationMap = frameworkAnnotations.getEntryAnnotations(); - for (JavaAnnotation annotation : classAnnotations) { - String name = annotation.getType().getValue(); - if (entryAnnotationMap.containsKey(name)) { - return true; - } - if (isEntryPoint(cls, frameworkAnnotations)) { - return true; - } - } - return false; - } - - default List getParenClassMethods(ApiConfig apiConfig, ProjectDocConfigBuilder projectBuilder, JavaClass cls) { - List docJavaMethods = new ArrayList<>(); - JavaClass parentClass = cls.getSuperJavaClass(); - if (Objects.nonNull(parentClass) && !"Object".equals(parentClass.getSimpleName())) { - Map actualTypesMap = JavaClassUtil.getActualTypesMap(parentClass); - List parentMethodList = parentClass.getMethods(); - for (JavaMethod method : parentMethodList) { - docJavaMethods.add(convertToDocJavaMethod(apiConfig, projectBuilder, method, actualTypesMap)); - } - } - return docJavaMethods; - } - - default DocJavaMethod convertToDocJavaMethod(ApiConfig apiConfig, ProjectDocConfigBuilder projectBuilder, - JavaMethod method, Map actualTypesMap) { - JavaClass cls = method.getDeclaringClass(); - String clzName = cls.getCanonicalName(); - if (StringUtil.isEmpty(method.getComment()) && apiConfig.isStrict()) { - throw new RuntimeException("Unable to find comment for method " + method.getName() + " in " + cls.getCanonicalName()); - } - String classAuthor = JavaClassUtil.getClassTagsValue(cls, DocTags.AUTHOR, Boolean.TRUE); - DocJavaMethod docJavaMethod = DocJavaMethod.builder().setJavaMethod(method).setActualTypesMap(actualTypesMap); - if (Objects.nonNull(method.getTagByName(DocTags.DOWNLOAD))) { - docJavaMethod.setDownload(true); - } - DocletTag pageTag = method.getTagByName(DocTags.PAGE); - if (Objects.nonNull(method.getTagByName(DocTags.PAGE))) { - String pageUrl = projectBuilder.getServerUrl() + "/" + pageTag.getValue(); - docJavaMethod.setPage(UrlUtil.simplifyUrl(pageUrl)); - } - - DocletTag docletTag = method.getTagByName(DocTags.GROUP); - if (Objects.nonNull(docletTag)) { - docJavaMethod.setGroup(docletTag.getValue()); - } - docJavaMethod.setParamTagMap(DocUtil.getCommentsByTag(method, DocTags.PARAM, clzName)); - docJavaMethod.setParamsComments(DocUtil.getCommentsByTag(method, DocTags.PARAM, null)); - - Map authorMap = DocUtil.getCommentsByTag(method, DocTags.AUTHOR, cls.getName()); - String authorValue = String.join(", ", new ArrayList<>(authorMap.keySet())); - if (apiConfig.isShowAuthor() && StringUtil.isNotEmpty(authorValue)) { - docJavaMethod.setAuthor(JsonUtil.toPrettyFormat(authorValue)); - } - if (apiConfig.isShowAuthor() && StringUtil.isEmpty(authorValue)) { - docJavaMethod.setAuthor(classAuthor); - } - - String comment = DocUtil.getEscapeAndCleanComment(method.getComment()); - docJavaMethod.setDesc(comment); - - String apiNoteValue = DocUtil.getNormalTagComments(method, DocTags.API_NOTE, cls.getName()); - if (StringUtil.isEmpty(apiNoteValue)) { - apiNoteValue = method.getComment(); - } - docJavaMethod.setDetail(apiNoteValue != null ? apiNoteValue : ""); - return docJavaMethod; - } - - boolean isEntryPoint(JavaClass javaClass, FrameworkAnnotations frameworkAnnotations); - - List listMvcRequestAnnotations(); - - void requestMappingPostProcess(JavaClass javaClass, JavaMethod method, RequestMapping requestMapping); - - boolean ignoreMvcParamWithAnnotation(String annotation); - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRpcDocTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRpcDocTemplate.java deleted file mode 100644 index 04b0610b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/IRpcDocTemplate.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.RpcJavaMethod; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassUtil; -import com.thoughtworks.qdox.model.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -import static com.power.doc.constants.DocTags.DEPRECATED; - -/** - * @author yu 2022/10/16. - */ -public interface IRpcDocTemplate extends IBaseDocBuildTemplate{ - - default RpcJavaMethod convertToRpcJavaMethod(ApiConfig apiConfig, JavaMethod method) { - JavaClass cls = method.getDeclaringClass(); - - RpcJavaMethod rpcJavaMethod = new RpcJavaMethod(); - rpcJavaMethod.setName(method.getName()); - String methodDefine = methodDefinition(method); - String scapeMethod = methodDefine.replaceAll("<", "<"); - scapeMethod = scapeMethod.replaceAll(">", ">"); - - rpcJavaMethod.setMethodDefinition(methodDefine); - rpcJavaMethod.setEscapeMethodDefinition(scapeMethod); - rpcJavaMethod.setDesc(DocUtil.getEscapeAndCleanComment(method.getComment())); - // set detail - String apiNoteValue = DocUtil.getNormalTagComments(method, DocTags.API_NOTE, cls.getName()); - if (StringUtil.isEmpty(apiNoteValue)) { - apiNoteValue = method.getComment(); - } - rpcJavaMethod.setDetail(apiNoteValue != null ? apiNoteValue : ""); - // set author - String authorValue = DocUtil.getNormalTagComments(method, DocTags.AUTHOR, cls.getName()); - if (apiConfig.isShowAuthor() && StringUtil.isNotEmpty(authorValue)) { - rpcJavaMethod.setAuthor(authorValue); - } - - //Deprecated - List annotations = method.getAnnotations(); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getName(); - if (DocAnnotationConstants.DEPRECATED.equals(annotationName)) { - rpcJavaMethod.setDeprecated(true); - } - } - if (Objects.nonNull(method.getTagByName(DEPRECATED))) { - rpcJavaMethod.setDeprecated(true); - } - return rpcJavaMethod; - } - - default String methodDefinition(JavaMethod method) { - StringBuilder methodBuilder = new StringBuilder(); - JavaType returnType = method.getReturnType(); - String simpleReturn = returnType.getCanonicalName(); - String returnClass = returnType.getGenericCanonicalName(); - returnClass = returnClass.replace(simpleReturn, JavaClassUtil.getClassSimpleName(simpleReturn)); - String[] arrays = DocClassUtil.getSimpleGicName(returnClass); - for (String str : arrays) { - if (str.contains("[")) { - str = str.substring(0, str.indexOf("[")); - } - String[] generics = str.split("[<,]"); - for (String generic : generics) { - if (generic.contains("extends")) { - String className = generic.substring(generic.lastIndexOf(" ") + 1); - returnClass = returnClass.replace(className, JavaClassUtil.getClassSimpleName(className)); - } - if (generic.length() != 1 && !generic.contains("extends")) { - returnClass = returnClass.replaceAll(generic, JavaClassUtil.getClassSimpleName(generic)); - } - - } - } - methodBuilder.append(returnClass).append(" "); - List params = new ArrayList<>(); - List parameters = method.getParameters(); - for (JavaParameter parameter : parameters) { - params.add(parameter.getType().getGenericValue() + " " + parameter.getName()); - } - methodBuilder.append(method.getName()).append("(") - .append(String.join(", ", params)).append(")"); - return methodBuilder.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/JaxrsDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/JaxrsDocBuildTemplate.java deleted file mode 100644 index 52302a8f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/JaxrsDocBuildTemplate.java +++ /dev/null @@ -1,739 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import com.power.common.util.*; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.*; -import com.power.doc.handler.JaxrsHeaderHandler; -import com.power.doc.handler.JaxrsPathHandler; -import com.power.doc.helper.FormDataBuildHelper; -import com.power.doc.helper.JsonBuildHelper; -import com.power.doc.helper.ParamsBuildHelper; -import com.power.doc.model.*; -import com.power.doc.model.annotation.EntryAnnotation; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.annotation.HeaderAnnotation; -import com.power.doc.model.request.ApiRequestExample; -import com.power.doc.model.request.CurlRequest; -import com.power.doc.model.request.JaxrsPathMapping; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.*; -import com.thoughtworks.qdox.model.*; - -import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.logging.Logger; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static com.power.doc.constants.DocGlobalConstants.FILE_CONTENT_TYPE; -import static com.power.doc.constants.DocGlobalConstants.URL_CONTENT_TYPE; -import static com.power.doc.constants.DocTags.IGNORE; - -/** - * Build documents for JAX RS - * - * @author Zxq - * @since 2021/7/15 - */ -public class JaxrsDocBuildTemplate implements IDocBuildTemplate, IRestDocTemplate { - - private static final Logger log = Logger.getLogger(JaxrsDocBuildTemplate.class.getName()); - - /** - * api index - */ - private final AtomicInteger atomicInteger = new AtomicInteger(1); - /** - * headers - */ - private List headers; - - - @Override - public List getApiData(ProjectDocConfigBuilder projectBuilder) { - ApiConfig apiConfig = projectBuilder.getApiConfig(); - FrameworkAnnotations frameworkAnnotations = registeredAnnotations(); - this.headers = apiConfig.getRequestHeaders(); - List apiDocList = new ArrayList<>(); - int order = 0; - Collection classes = projectBuilder.getJavaProjectBuilder().getClasses(); - boolean setCustomOrder = false; - // exclude class is ignore - for (JavaClass cls : classes) { - if (StringUtil.isNotEmpty(apiConfig.getPackageFilters())) { - // from smart config - if (!DocUtil.isMatch(apiConfig.getPackageFilters(), cls.getCanonicalName())) { - continue; - } - } - // from tag - DocletTag ignoreTag = cls.getTagByName(DocTags.IGNORE); - if (!isEntryPoint(cls, frameworkAnnotations) || Objects.nonNull(ignoreTag)) { - continue; - } - String strOrder = JavaClassUtil.getClassTagsValue(cls, DocTags.ORDER, Boolean.TRUE); - order++; - if (ValidateUtil.isNonNegativeInteger(strOrder)) { - setCustomOrder = true; - order = Integer.parseInt(strOrder); - } - List apiMethodDocs = buildControllerMethod(cls, apiConfig, projectBuilder, frameworkAnnotations); - this.handleApiDoc(cls, apiDocList, apiMethodDocs, order, apiConfig.isMd5EncryptedHtmlName()); - } - // sort - if (apiConfig.isSortByTitle()) { - Collections.sort(apiDocList); - } else if (setCustomOrder) { - // while set custom oder - return apiDocList.stream() - .sorted(Comparator.comparing(ApiDoc::getOrder)) - .peek(p -> p.setOrder(atomicInteger.getAndAdd(1))).collect(Collectors.toList()); - } - return apiDocList; - } - - /** - * Analyze resource method - * - * @param cls cls - * @param apiConfig apiConfig - * @param projectBuilder projectBuilder - * @return List - */ - private List buildControllerMethod(final JavaClass cls, ApiConfig apiConfig, - ProjectDocConfigBuilder projectBuilder, - FrameworkAnnotations frameworkAnnotations) { - String clzName = cls.getCanonicalName(); - boolean paramsDataToTree = projectBuilder.getApiConfig().isParamsDataToTree(); - String group = JavaClassUtil.getClassTagsValue(cls, DocTags.GROUP, Boolean.TRUE); - String baseUrl = ""; - String mediaType = URL_CONTENT_TYPE; - List classAnnotations = this.getClassAnnotations(cls, frameworkAnnotations); - for (JavaAnnotation annotation : classAnnotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - if (JakartaJaxrsAnnotations.JAX_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_FULLY.equals(annotationName)) { - baseUrl = StringUtil.removeQuotes(DocUtil.getRequestHeaderValue(annotation)); - } - // use first annotation's value - if (annotationName.equals(JakartaJaxrsAnnotations.JAX_CONSUMES) - || annotationName.equals(JAXRSAnnotations.JAX_CONSUMES_FULLY)) { - Object value = annotation.getNamedParameter("value"); - if (Objects.nonNull(value)) { - mediaType = MediaType.valueOf(value.toString()); - } - } - } - - List methods = cls.getMethods(); - List docJavaMethods = new ArrayList<>(methods.size()); - // filter private method - for (JavaMethod method : methods) { - if (method.isPrivate()) { - continue; - } - docJavaMethods.add(convertToDocJavaMethod(apiConfig, projectBuilder, method, null)); - } - // add parent class methods - docJavaMethods.addAll(getParenClassMethods(apiConfig, projectBuilder, cls)); - List methodDocList = new ArrayList<>(methods.size()); - int methodOrder = 0; - for (DocJavaMethod docJavaMethod : docJavaMethods) { - JavaMethod method = docJavaMethod.getJavaMethod(); - if (checkCondition(method)) { - continue; - } - // new api doc - //handle request mapping - JaxrsPathMapping jaxPathMapping = new JaxrsPathHandler() - .handle(projectBuilder, baseUrl, method, mediaType); - if (Objects.isNull(jaxPathMapping)) { - continue; - } - ApiMethodDoc apiMethodDoc = new ApiMethodDoc(); - apiMethodDoc.setDownload(docJavaMethod.isDownload()); - apiMethodDoc.setPage(docJavaMethod.getPage()); - apiMethodDoc.setGroup(group); - if (Objects.nonNull(docJavaMethod.getGroup())) { - apiMethodDoc.setGroup(docJavaMethod.getGroup()); - } - - methodOrder++; - apiMethodDoc.setName(method.getName()); - apiMethodDoc.setOrder(methodOrder); - apiMethodDoc.setDesc(docJavaMethod.getDesc()); - String methodUid = DocUtil.generateId(clzName + method.getName() + methodOrder); - apiMethodDoc.setMethodId(methodUid); - apiMethodDoc.setAuthor(docJavaMethod.getAuthor()); - apiMethodDoc.setDetail(docJavaMethod.getDetail()); - List ApiReqParams = new JaxrsHeaderHandler().handle(method, projectBuilder); - apiMethodDoc.setType(jaxPathMapping.getMethodType()); - apiMethodDoc.setUrl(jaxPathMapping.getUrl()); - apiMethodDoc.setServerUrl(projectBuilder.getServerUrl()); - apiMethodDoc.setPath(jaxPathMapping.getShortUrl()); - apiMethodDoc.setDeprecated(jaxPathMapping.isDeprecated()); - apiMethodDoc.setContentType(jaxPathMapping.getMediaType()); - - // build request params - ApiMethodReqParam apiMethodReqParam = requestParams(docJavaMethod, projectBuilder); - apiMethodDoc.setPathParams(apiMethodReqParam.getPathParams()); - apiMethodDoc.setQueryParams(apiMethodReqParam.getQueryParams()); - apiMethodDoc.setRequestParams(apiMethodReqParam.getRequestParams()); - if (paramsDataToTree) { - // convert to tree - this.convertParamsDataToTree(apiMethodDoc); - } - List allApiReqParams; - allApiReqParams = ApiReqParams; - if (this.headers != null) { - allApiReqParams = Stream.of(this.headers, ApiReqParams) - .flatMap(Collection::stream).distinct().collect(Collectors.toList()); - } - allApiReqParams.removeIf(ApiReqParam -> { - if (StringUtil.isEmpty(ApiReqParam.getPathPatterns()) - && StringUtil.isEmpty(ApiReqParam.getExcludePathPatterns())) { - return false; - } else { - boolean flag = DocPathUtil.matches(jaxPathMapping.getShortUrl(), ApiReqParam.getPathPatterns() - , ApiReqParam.getExcludePathPatterns()); - return !flag; - } - }); - //reduce create in template - apiMethodDoc.setHeaders(this.createDocRenderHeaders(allApiReqParams, apiConfig.isAdoc())); - apiMethodDoc.setRequestHeaders(allApiReqParams); - - // build request json - ApiRequestExample requestExample = buildReqJson(docJavaMethod, apiMethodDoc, jaxPathMapping.getMethodType(), - projectBuilder); - String requestJson = requestExample.getExampleBody(); - // set request example detail - apiMethodDoc.setRequestExample(requestExample); - apiMethodDoc.setRequestUsage(requestJson == null ? requestExample.getUrl() : requestJson); - // build response usage - String responseValue = DocUtil.getNormalTagComments(method, DocTags.API_RESPONSE, cls.getName()); - if (StringUtil.isNotEmpty(responseValue)) { - apiMethodDoc.setResponseUsage(responseValue); - } else { - apiMethodDoc.setResponseUsage(JsonBuildHelper.buildReturnJson(docJavaMethod, projectBuilder)); - } - // build response params - List responseParams = buildReturnApiParams(docJavaMethod, projectBuilder); - if (paramsDataToTree) { - responseParams = ApiParamTreeUtil.apiParamToTree(responseParams); - } - apiMethodDoc.setReturnSchema(docJavaMethod.getReturnSchema()); - apiMethodDoc.setRequestSchema(docJavaMethod.getRequestSchema()); - apiMethodDoc.setResponseParams(responseParams); - methodDocList.add(apiMethodDoc); - TornaUtil.setTornaArrayTags(docJavaMethod.getJavaMethod(), apiMethodDoc); - } - return methodDocList; - } - - - @Override - public FrameworkAnnotations registeredAnnotations() { - FrameworkAnnotations annotations = FrameworkAnnotations.builder(); - HeaderAnnotation headerAnnotation = HeaderAnnotation.builder() - .setAnnotationName(JAXRSAnnotations.JAX_HEADER_PARAM_FULLY) - .setValueProp(DocAnnotationConstants.VALUE_PROP) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - // add header annotation - annotations.setHeaderAnnotation(headerAnnotation); - - // add entry annotation - Map entryAnnotations = new HashMap<>(); - EntryAnnotation jakartaPathAnnotation = EntryAnnotation.builder() - .setAnnotationName(JakartaJaxrsAnnotations.JAX_PATH_FULLY) - .setAnnotationFullyName(JakartaJaxrsAnnotations.JAX_PATH_FULLY); - entryAnnotations.put(jakartaPathAnnotation.getAnnotationName(), jakartaPathAnnotation); - - EntryAnnotation jaxPathAnnotation = EntryAnnotation.builder() - .setAnnotationName(JAXRSAnnotations.JAX_PATH_FULLY) - .setAnnotationFullyName(JAXRSAnnotations.JAX_PATH_FULLY); - entryAnnotations.put(jaxPathAnnotation.getAnnotationName(), jaxPathAnnotation); - annotations.setEntryAnnotations(entryAnnotations); - return annotations; - } - - @Override - public boolean isEntryPoint(JavaClass cls, FrameworkAnnotations frameworkAnnotations) { - if (cls.isAnnotation() || cls.isEnum()) { - return false; - } - List classAnnotations = DocClassUtil.getAnnotations(cls); - for (JavaAnnotation annotation : classAnnotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - if (JakartaJaxrsAnnotations.JAX_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_FULLY.equals(annotationName)) { - return true; - } - } - // use custom doc tag to support Feign. - List docletTags = cls.getTags(); - for (DocletTag docletTag : docletTags) { - String value = docletTag.getName(); - if (DocTags.DUBBO_REST.equals(value)) { - return true; - } - } - return false; - } - - @Override - public List listMvcRequestAnnotations() { - return null; - } - - /** - * build request params - * - * @param docJavaMethod docJavaMethod - * @param builder builder - * @return ApiMethodReqParam - */ - private ApiMethodReqParam requestParams(final DocJavaMethod docJavaMethod, ProjectDocConfigBuilder builder) { - List paramList = new ArrayList<>(); - List parameterList = getJavaParameterList(builder, docJavaMethod, null); - if (parameterList.isEmpty()) { - return ApiMethodReqParam.builder() - .setPathParams(new ArrayList<>(0)) - .setQueryParams(paramList) - .setRequestParams(new ArrayList<>(0)); - } - boolean isStrict = builder.getApiConfig().isStrict(); - JavaMethod javaMethod = docJavaMethod.getJavaMethod(); - String className = javaMethod.getDeclaringClass().getCanonicalName(); - Map paramTagMap = docJavaMethod.getParamTagMap(); - Map paramsComments = docJavaMethod.getParamsComments(); - Map constantsMap = builder.getConstantsMap(); - boolean requestFieldToUnderline = builder.getApiConfig().isRequestFieldToUnderline(); - Set ignoreSets = ignoreParamsSets(javaMethod); - out: - for (DocJavaParameter apiParameter : parameterList) { - JavaParameter parameter = apiParameter.getJavaParameter(); - String paramName = parameter.getName(); - if (ignoreSets.contains(paramName)) { - continue; - } - - String typeName = apiParameter.getGenericCanonicalName(); - String simpleName = apiParameter.getTypeValue().toLowerCase(); - String fullTypeName = apiParameter.getFullyQualifiedName(); - String simpleTypeName = apiParameter.getTypeValue(); - if (!paramTagMap.containsKey(paramName) && JavaClassValidateUtil.isPrimitive(fullTypeName) && isStrict) { - throw new RuntimeException("ERROR: Unable to find javadoc @QueryParam for actual param \"" - + paramName + "\" in method " + javaMethod.getName() + " from " + className); - } - - if (requestFieldToUnderline) { - paramName = StringUtil.camelToUnderline(paramName); - } - String mockValue = JavaFieldUtil.createMockValue(paramsComments, paramName, typeName, simpleTypeName); - JavaClass javaClass = builder.getJavaProjectBuilder().getClassByName(fullTypeName); - List annotations = parameter.getAnnotations(); - Set groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, builder.getJavaProjectBuilder()); - - StringBuilder comment = new StringBuilder(this.paramCommentResolve(paramTagMap.get(paramName))); - boolean isPathVariable = false; - boolean isRequestBody = false; - String strRequired = "false"; - if (CollectionUtil.isNotEmpty(annotations)) { - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - if (JakartaJaxrsAnnotations.JAX_HEADER_PARAM_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_HEADER_PARAM_FULLY.equals(annotationName)) { - continue out; - } - //default value - if (JakartaJaxrsAnnotations.JAX_DEFAULT_VALUE_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_DEFAULT_VALUE_FULLY.equals(annotationName)) { - mockValue = StringUtil.removeQuotes(DocUtil.getRequestHeaderValue(annotation)); - mockValue = DocUtil.handleConstants(constantsMap, mockValue); - } - // path param - if (JakartaJaxrsAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName) - || JakartaJaxrsAnnotations.JAXB_REST_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName)) { - isPathVariable = true; - strRequired = "true"; - } - if (JavaClassValidateUtil.isJSR303Required(annotation.getType().getValue())) { - strRequired = "true"; - } - } - comment.append(JavaFieldUtil.getJsrComment(annotations)); - } else { - isRequestBody = true; - } - - boolean required = Boolean.parseBoolean(strRequired); - boolean queryParam = !isRequestBody && !isPathVariable; - if (JavaClassValidateUtil.isCollection(fullTypeName) || JavaClassValidateUtil.isArray(fullTypeName)) { - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - String gicName = gicNameArr[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - JavaClass gicJavaClass = builder.getJavaProjectBuilder().getClassByName(gicName); - if (gicJavaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(gicJavaClass, Boolean.TRUE); - ApiParam param = ApiParam.of().setField(paramName).setDesc(comment + ",[array of enum]") - .setRequired(required) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setId(paramList.size() + 1) - .setType("array").setValue(String.valueOf(value)); - paramList.add(param); - } else if (JavaClassValidateUtil.isPrimitive(gicName)) { - String shortSimple = DocClassUtil.processTypeNameForParams(gicName); - ApiParam param = ApiParam.of() - .setField(paramName) - .setDesc(comment + ",[array of " + shortSimple + "]") - .setRequired(required) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setId(paramList.size() + 1) - .setType("array") - .setValue(DocUtil.getValByTypeAndFieldName(gicName, paramName)); - paramList.add(param); - } else { - int id = paramList.size() + 1; - ApiParam param = ApiParam.of() - .setField(paramName) - .setDesc(comment + ",[array of object]") - .setRequired(required) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setId(id) - .setType("array"); - paramList.add(param); - List apiParamList = ParamsBuildHelper.buildParams(typeName, "└─", 1, - "true", Boolean.FALSE, new HashMap<>(), builder, groupClasses, id, Boolean.FALSE, null); - paramList.addAll(apiParamList); - } - } else if (JavaClassValidateUtil.isPrimitive(fullTypeName)) { - ApiParam param = ApiParam.of() - .setField(paramName) - .setType(DocClassUtil.processTypeNameForParams(simpleName)) - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setValue(mockValue) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param); - } else if (JavaClassValidateUtil.isMap(fullTypeName)) { - log.warning("When using smart-doc, it is not recommended to use Map to receive parameters, Check it in " - + javaMethod.getDeclaringClass().getCanonicalName() + "#" + javaMethod.getName()); - if (JavaClassValidateUtil.isMap(typeName)) { - ApiParam apiParam = ApiParam.of() - .setField(paramName) - .setType("map") - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - continue; - } - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - if (JavaClassValidateUtil.isPrimitive(gicNameArr[1])) { - ApiParam apiParam = ApiParam.of() - .setField(paramName) - .setType("map") - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setDesc(comment.toString()) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - } else { - paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[1], DocGlobalConstants.EMPTY, 0, - "true", Boolean.FALSE, new HashMap<>(), - builder, groupClasses, 0, Boolean.FALSE, null)); - } - - } else if (JavaClassValidateUtil.isFile(typeName)) { - //file upload - ApiParam param = ApiParam.of().setField(paramName).setType("file") - .setId(paramList.size() + 1).setQueryParam(true) - .setRequired(required).setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setDesc(comment.toString()); - if (typeName.contains("[]") || typeName.endsWith(">")) { - comment.append("(array of file)"); - param.setDesc(comment.toString()); - param.setHasItems(true); - } - paramList.add(param); - } - // param is enum - else if (javaClass.isEnum()) { - String o = JavaClassUtil.getEnumParams(javaClass); - Object value = JavaClassUtil.getEnumValue(javaClass, true); - ApiParam param = ApiParam.of().setField(paramName) - .setId(paramList.size() + 1) - .setPathParam(isPathVariable) - .setQueryParam(queryParam) - .setValue(String.valueOf(value)) - .setType("enum").setDesc(StringUtil.removeQuotes(o)) - .setRequired(required) - .setVersion(DocGlobalConstants.DEFAULT_VERSION) - .setEnumValues(JavaClassUtil.getEnumValues(javaClass)); - paramList.add(param); - } else { - paramList.addAll(ParamsBuildHelper.buildParams(typeName, DocGlobalConstants.EMPTY, 0, - "true", Boolean.FALSE, new HashMap<>(), builder, groupClasses, 0, Boolean.FALSE, null)); - } - } - List pathParams = new ArrayList<>(); - List queryParams = new ArrayList<>(); - List bodyParams = new ArrayList<>(); - for (ApiParam param : paramList) { - param.setValue(StringUtil.removeDoubleQuotes(param.getValue())); - if (param.isPathParam()) { - param.setId(pathParams.size() + 1); - pathParams.add(param); - } else if (param.isQueryParam()) { - param.setId(queryParams.size() + 1); - queryParams.add(param); - } else { - param.setId(bodyParams.size() + 1); - bodyParams.add(param); - } - } - return ApiMethodReqParam.builder() - .setRequestParams(bodyParams) - .setPathParams(pathParams) - .setQueryParams(queryParams); - } - - private ApiRequestExample buildReqJson(DocJavaMethod javaMethod, ApiMethodDoc apiMethodDoc, String methodType, - ProjectDocConfigBuilder configBuilder) { - JavaMethod method = javaMethod.getJavaMethod(); - Map pathParamsMap = new LinkedHashMap<>(); - List parameterList = getJavaParameterList(configBuilder, javaMethod, null); - List reqHeaderList = apiMethodDoc.getRequestHeaders(); - if (parameterList.isEmpty()) { - CurlRequest curlRequest = CurlRequest.builder() - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(apiMethodDoc.getUrl()); - String format = CurlUtil.toCurl(curlRequest); - return ApiRequestExample.builder().setUrl(apiMethodDoc.getUrl()).setExampleBody(format); - } - boolean requestFieldToUnderline = configBuilder.getApiConfig().isRequestFieldToUnderline(); - Map paramsComments = javaMethod.getParamsComments(); - List formDataList = new ArrayList<>(); - ApiRequestExample requestExample = ApiRequestExample.builder(); - for (DocJavaParameter apiParameter : parameterList) { - JavaParameter parameter = apiParameter.getJavaParameter(); - String paramName = parameter.getName(); - String typeName = apiParameter.getFullyQualifiedName(); - String gicTypeName = apiParameter.getGenericCanonicalName(); - String simpleTypeName = apiParameter.getTypeValue(); - gicTypeName = DocClassUtil.rewriteRequestParam(gicTypeName); - JavaClass javaClass = configBuilder.getJavaProjectBuilder().getClassByName(typeName); - String[] globGicName = DocClassUtil.getSimpleGicName(gicTypeName); - String comment = this.paramCommentResolve(paramsComments.get(paramName)); - String mockValue = JavaFieldUtil.createMockValue(paramsComments, paramName, gicTypeName, simpleTypeName); - if (requestFieldToUnderline) { - paramName = StringUtil.camelToUnderline(paramName); - } - List annotations = parameter.getAnnotations(); - Set groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, configBuilder.getJavaProjectBuilder()); - boolean paramAdded = false; - if (CollectionUtil.isNotEmpty(annotations)) { - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getFullyQualifiedName(); - if (JakartaJaxrsAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName) - || JakartaJaxrsAnnotations.JAXB_REST_PATH_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PATH_PARAM_FULLY.equals(annotationName)) { - if (javaClass.isEnum()) { - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - mockValue = StringUtil.removeQuotes(String.valueOf(value)); - } - pathParamsMap.put(paramName, mockValue); - paramAdded = true; - } - if (paramAdded) { - continue; - } - //file upload - if (JavaClassValidateUtil.isFile(gicTypeName)) { - apiMethodDoc.setContentType(FILE_CONTENT_TYPE); - FormData formData = new FormData(); - formData.setKey(paramName); - formData.setType("file"); - formData.setDescription(comment); - formData.setValue(mockValue); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isPrimitive(typeName)) { - FormData formData = new FormData(); - formData.setKey(paramName); - formData.setDescription(comment); - formData.setType("text"); - formData.setValue(mockValue); - formDataList.add(formData); - } else if (JavaClassValidateUtil.isArray(typeName) || JavaClassValidateUtil.isCollection(typeName)) { - String gicName = globGicName[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - if (!JavaClassValidateUtil.isPrimitive(gicName) - && !configBuilder.getJavaProjectBuilder().getClassByName(gicName).isEnum()) { - throw new RuntimeException("Jaxrs rest can't support binding Collection on method " - + method.getName() + "Check it in " + method.getDeclaringClass().getCanonicalName()); - } - FormData formData = new FormData(); - formData.setKey(paramName); - if (!paramName.contains("[]")) { - formData.setKey(paramName + "[]"); - } - formData.setDescription(comment); - formData.setType("text"); - formData.setValue(RandomUtil.randomValueByType(gicName)); - formDataList.add(formData); - } else if (javaClass.isEnum()) { - // do nothing - Object value = JavaClassUtil.getEnumValue(javaClass, Boolean.TRUE); - String strVal = StringUtil.removeQuotes(String.valueOf(value)); - FormData formData = new FormData(); - formData.setDescription(comment); - formData.setKey(paramName); - formData.setType("text"); - formData.setValue(strVal); - formDataList.add(formData); - } else { - formDataList.addAll( - FormDataBuildHelper.getFormData(gicTypeName, new HashMap<>(), 0, configBuilder, DocGlobalConstants.EMPTY)); - } - } - } else { - if (JavaClassValidateUtil.isPrimitive(simpleTypeName)) { - requestExample.setJsonBody(mockValue).setJson(true); - } else { - String json = JsonBuildHelper.buildJson(typeName, gicTypeName, Boolean.FALSE, 0, new HashMap<>(), groupClasses, configBuilder); - requestExample.setJsonBody(JsonUtil.toPrettyFormat(json)).setJson(true); - } - } - - - } - requestExample.setFormDataList(formDataList); - String[] paths = apiMethodDoc.getPath().split(";"); - String path = paths[0]; - String body; - String exampleBody; - String url; - if (JakartaJaxrsAnnotations.POST.equals(methodType) || JakartaJaxrsAnnotations.PUT.equals(methodType)) { - //for post put - path = DocUtil.formatAndRemove(path, pathParamsMap); - body = UrlUtil.urlJoin(DocGlobalConstants.EMPTY, DocUtil.formDataToMap(formDataList)) - .replace("?", DocGlobalConstants.EMPTY); - body = StringUtil.removeQuotes(body); - url = apiMethodDoc.getServerUrl() + "/" + path; - url = UrlUtil.simplifyUrl(url); - - if (requestExample.isJson()) { - if (StringUtil.isNotEmpty(body)) { - url = url + "?" + body; - } - CurlRequest curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - exampleBody = CurlUtil.toCurl(curlRequest); - } else { - CurlRequest curlRequest; - if (StringUtil.isNotEmpty(body)) { - curlRequest = CurlRequest.builder() - .setBody(body) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - } else { - curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - } - exampleBody = CurlUtil.toCurl(curlRequest); - } - requestExample.setExampleBody(exampleBody).setUrl(url); - } else { - // for get delete - url = formatRequestUrl(pathParamsMap, pathParamsMap, apiMethodDoc.getServerUrl(), path); - CurlRequest curlRequest = CurlRequest.builder() - .setBody(requestExample.getJsonBody()) - .setContentType(apiMethodDoc.getContentType()) - .setType(methodType) - .setReqHeaders(reqHeaderList) - .setUrl(url); - exampleBody = CurlUtil.toCurl(curlRequest); - requestExample.setExampleBody(exampleBody) - .setJsonBody(DocGlobalConstants.EMPTY) - .setUrl(url); - } - return requestExample; - } - - /** - * @param method method - * @return boolean - */ - private boolean checkCondition(JavaMethod method) { - return method.isPrivate() || Objects.nonNull(method.getTagByName(IGNORE)); - } - - - @Override - public void requestMappingPostProcess(JavaClass javaClass, JavaMethod method, RequestMapping requestMapping) { - - } - - @Override - public boolean ignoreMvcParamWithAnnotation(String annotation) { - return false; - } - - - @Override - public boolean ignoreReturnObject(String typeName, List ignoreParams) { - return false; - } -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/RpcDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/RpcDocBuildTemplate.java deleted file mode 100644 index 6f592bb0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/RpcDocBuildTemplate.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -import com.power.common.util.StringUtil; -import com.power.common.util.ValidateUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.constants.DubboAnnotationConstants; -import com.power.doc.helper.ParamsBuildHelper; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiParam; -import com.power.doc.model.DocJavaMethod; -import com.power.doc.model.RpcJavaMethod; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.rpc.RpcApiDoc; -import com.power.doc.utils.ApiParamTreeUtil; -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.DocUtil; -import com.power.doc.utils.JavaClassUtil; -import com.power.doc.utils.JavaClassValidateUtil; -import com.power.doc.utils.JavaFieldUtil; -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaParameter; -import com.thoughtworks.qdox.model.JavaType; - -import static com.power.doc.constants.DocTags.DEPRECATED; -import static com.power.doc.constants.DocTags.IGNORE; - -/** - * @author yu 2020/1/29. - */ -public class RpcDocBuildTemplate implements IDocBuildTemplate, IRpcDocTemplate { - - /** - * api index - */ - private final AtomicInteger atomicInteger = new AtomicInteger(1); - - @Override - public List getApiData(ProjectDocConfigBuilder projectBuilder) { - ApiConfig apiConfig = projectBuilder.getApiConfig(); - List apiDocList = new ArrayList<>(); - int order = 0; - boolean setCustomOrder = false; - for (JavaClass cls : projectBuilder.getJavaProjectBuilder().getClasses()) { - if (StringUtil.isNotEmpty(apiConfig.getPackageFilters())) { - // check package - if (!DocUtil.isMatch(apiConfig.getPackageFilters(), cls.getCanonicalName())) { - continue; - } - } - DocletTag ignoreTag = cls.getTagByName(DocTags.IGNORE); - if (!isEntryPoint(cls, null) || Objects.nonNull(ignoreTag)) { - continue; - } - String strOrder = JavaClassUtil.getClassTagsValue(cls, DocTags.ORDER, Boolean.TRUE); - order++; - if (ValidateUtil.isNonNegativeInteger(strOrder)) { - order = Integer.parseInt(strOrder); - setCustomOrder = true; - } - List apiMethodDocs = buildServiceMethod(cls, apiConfig, projectBuilder); - this.handleJavaApiDoc(cls, apiDocList, apiMethodDocs, order, projectBuilder); - } - // sort - if (apiConfig.isSortByTitle()) { - Collections.sort(apiDocList); - } else if (setCustomOrder) { - // while set custom oder - return apiDocList.stream() - .sorted(Comparator.comparing(RpcApiDoc::getOrder)) - .peek(p -> p.setOrder(atomicInteger.getAndAdd(1))).collect(Collectors.toList()); - } - return apiDocList; - } - - public boolean ignoreReturnObject(String typeName, List ignoreParams) { - return false; - } - - private List buildServiceMethod(final JavaClass cls, ApiConfig apiConfig, ProjectDocConfigBuilder projectBuilder) { - String clazName = cls.getCanonicalName(); - List methods = cls.getMethods(); - List methodDocList = new ArrayList<>(methods.size()); - int methodOrder = 0; - for (JavaMethod method : methods) { - if (method.isPrivate()) { - continue; - } - if (Objects.nonNull(method.getTagByName(IGNORE))) { - continue; - } - if (StringUtil.isEmpty(method.getComment()) && apiConfig.isStrict()) { - throw new RuntimeException("Unable to find comment for method " + method.getName() + " in " + cls.getCanonicalName()); - } - methodOrder++; - RpcJavaMethod apiMethodDoc = convertToRpcJavaMethod(apiConfig,method); - apiMethodDoc.setOrder(methodOrder); - String methodUid = DocUtil.generateId(clazName + method.getName() + methodOrder); - apiMethodDoc.setMethodId(methodUid); - // build request params - List requestParams = requestParams(method, projectBuilder, new AtomicInteger(0)); - // build response params - List responseParams = buildReturnApiParams(DocJavaMethod.builder().setJavaMethod(method), projectBuilder); - if (apiConfig.isParamsDataToTree()) { - apiMethodDoc.setRequestParams(ApiParamTreeUtil.apiParamToTree(requestParams)); - apiMethodDoc.setResponseParams(ApiParamTreeUtil.apiParamToTree(responseParams)); - } else { - apiMethodDoc.setRequestParams(requestParams); - apiMethodDoc.setResponseParams(responseParams); - } - methodDocList.add(apiMethodDoc); - - } - return methodDocList; - } - - private List requestParams(final JavaMethod javaMethod, ProjectDocConfigBuilder builder, AtomicInteger atomicInteger) { - boolean isStrict = builder.getApiConfig().isStrict(); - boolean isShowJavaType = builder.getApiConfig().getShowJavaType(); - String className = javaMethod.getDeclaringClass().getCanonicalName(); - Map paramTagMap = DocUtil.getCommentsByTag(javaMethod, DocTags.PARAM, className); - List parameterList = javaMethod.getParameters(); - if (parameterList.size() < 1) { - return null; - } - List paramList = new ArrayList<>(); - for (JavaParameter parameter : parameterList) { - boolean required = false; - String paramName = parameter.getName(); - String typeName = parameter.getType().getGenericCanonicalName(); - String simpleName = parameter.getType().getValue().toLowerCase(); - String fullTypeName = parameter.getType().getFullyQualifiedName(); - String paramPre = paramName + "."; - if (!paramTagMap.containsKey(paramName) && JavaClassValidateUtil.isPrimitive(fullTypeName) && isStrict) { - throw new RuntimeException("ERROR: Unable to find javadoc @param for actual param \"" - + paramName + "\" in method " + javaMethod.getName() + " from " + className); - } - StringBuilder comment = new StringBuilder(this.paramCommentResolve(paramTagMap.get(paramName))); - String mockValue = JavaFieldUtil.createMockValue(paramTagMap, paramName, typeName, typeName); - JavaClass javaClass = builder.getJavaProjectBuilder().getClassByName(fullTypeName); - List annotations = parameter.getAnnotations(); - for (JavaAnnotation a : annotations) { - if (JavaClassValidateUtil.isJSR303Required(a.getType().getValue())) { - required = true; - } - } - comment.append(JavaFieldUtil.getJsrComment(annotations)); - Set groupClasses = JavaClassUtil.getParamGroupJavaClass(annotations, builder.getJavaProjectBuilder()); - if (JavaClassValidateUtil.isCollection(fullTypeName) || JavaClassValidateUtil.isArray(fullTypeName)) { - if (JavaClassValidateUtil.isCollection(typeName)) { - typeName = typeName + ""; - } - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - String gicName = gicNameArr[0]; - if (JavaClassValidateUtil.isArray(gicName)) { - gicName = gicName.substring(0, gicName.indexOf("[")); - } - if (JavaClassValidateUtil.isPrimitive(gicName)) { - String processedType = isShowJavaType ? - JavaClassUtil.getClassSimpleName(typeName) : DocClassUtil.processTypeNameForParams(simpleName); - ApiParam param = ApiParam.of().setId(atomicInteger.incrementAndGet()).setField(paramName) - .setDesc(comment + " (children type : " + gicName + ")") - .setRequired(required) - .setType(processedType); - paramList.add(param); - } else { - paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[0], paramPre, 0, "true", - Boolean.FALSE, new HashMap<>(), builder, groupClasses, 0, Boolean.FALSE, atomicInteger)); - } - } else if (JavaClassValidateUtil.isPrimitive(fullTypeName)) { - ApiParam param = ApiParam.of().setId(atomicInteger.incrementAndGet()).setField(paramName) - .setType(JavaClassUtil.getClassSimpleName(typeName)) - .setDesc(comment.toString()) - .setRequired(required) - .setMaxLength(JavaFieldUtil.getParamMaxLength(parameter.getAnnotations())) - .setValue(mockValue) - .setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param); - } else if (JavaClassValidateUtil.isMap(fullTypeName)) { - if (JavaClassValidateUtil.isMap(typeName)) { - ApiParam apiParam = ApiParam.of().setId(atomicInteger.incrementAndGet()).setField(paramName).setType(typeName) - .setDesc(comment.toString()).setRequired(required).setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(apiParam); - continue; - } - String[] gicNameArr = DocClassUtil.getSimpleGicName(typeName); - paramList.addAll(ParamsBuildHelper.buildParams(gicNameArr[1], paramPre, 0, "true", - Boolean.FALSE, new HashMap<>(), builder, groupClasses, 0, Boolean.FALSE, atomicInteger)); - } else if (javaClass.isEnum()) { - ApiParam param = ApiParam.of().setId(atomicInteger.incrementAndGet()).setField(paramName) - .setType("Enum").setRequired(required).setDesc(comment.toString()).setVersion(DocGlobalConstants.DEFAULT_VERSION); - paramList.add(param); - } else { - paramList.addAll(ParamsBuildHelper.buildParams(typeName, paramPre, 0, "true", - Boolean.FALSE, new HashMap<>(), builder, groupClasses, 0, Boolean.FALSE, atomicInteger)); - } - } - return paramList; - } - - public boolean isEntryPoint(JavaClass cls, FrameworkAnnotations frameworkAnnotations) { - // Exclude DubboSwaggerService from dubbo 2.7.x - if (DocGlobalConstants.DUBBO_SWAGGER.equals(cls.getCanonicalName())) { - return false; - } - List classAnnotations = cls.getAnnotations(); - for (JavaAnnotation annotation : classAnnotations) { - String name = annotation.getType().getCanonicalName(); - if (DubboAnnotationConstants.SERVICE.equals(name) - || DubboAnnotationConstants.DUBBO_SERVICE.equals(name) - || DubboAnnotationConstants.ALI_DUBBO_SERVICE.equals(name)) { - return true; - } - } - List docletTags = cls.getTags(); - for (DocletTag docletTag : docletTags) { - String value = docletTag.getName(); - if (DocTags.DUBBO.equals(value)) { - return true; - } - } - return false; - } - - @Override - public FrameworkAnnotations registeredAnnotations() { - return null; - } - - private void handleJavaApiDoc(JavaClass cls, List apiDocList, List apiMethodDocs, - int order, ProjectDocConfigBuilder builder) { - String className = cls.getCanonicalName(); - String shortName = cls.getName(); - String comment = cls.getComment(); - List javaTypes = cls.getImplements(); - if (javaTypes.size() >= 1 && !cls.isInterface()) { - JavaType javaType = javaTypes.get(0); - className = javaType.getCanonicalName(); - shortName = className; - JavaClass javaClass = builder.getClassByName(className); - if (StringUtil.isEmpty(comment) && Objects.nonNull(javaClass)) { - comment = javaClass.getComment(); - } - } - RpcApiDoc apiDoc = new RpcApiDoc(); - apiDoc.setOrder(order); - apiDoc.setName(className); - apiDoc.setShortName(shortName); - apiDoc.setAlias(className); - apiDoc.setUri(builder.getServerUrl() + "/" + className); - apiDoc.setProtocol("dubbo"); - if (builder.getApiConfig().isMd5EncryptedHtmlName()) { - String name = DocUtil.generateId(apiDoc.getName()); - apiDoc.setAlias(name); - } - apiDoc.setDesc(DocUtil.getEscapeAndCleanComment(comment)); - apiDoc.setList(apiMethodDocs); - List docletTags = cls.getTags(); - List authorList = new ArrayList<>(); - for (DocletTag docletTag : docletTags) { - String name = docletTag.getName(); - if (DocTags.VERSION.equals(name)) { - apiDoc.setVersion(docletTag.getValue()); - } - if (DocTags.AUTHOR.equals(name)) { - authorList.add(docletTag.getValue()); - } - } - apiDoc.setAuthor(String.join(", ", authorList)); - apiDocList.add(apiDoc); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SolonDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SolonDocBuildTemplate.java deleted file mode 100644 index 8ea6bb4d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SolonDocBuildTemplate.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.constants.Methods; -import com.power.doc.constants.SolonAnnotations; -import com.power.doc.constants.SolonRequestAnnotationsEnum; -import com.power.doc.handler.SolonRequestHeaderHandler; -import com.power.doc.handler.SolonRequestMappingHandler; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.annotation.EntryAnnotation; -import com.power.doc.model.annotation.FrameworkAnnotations; -import com.power.doc.model.annotation.HeaderAnnotation; -import com.power.doc.model.annotation.MappingAnnotation; -import com.power.doc.model.annotation.PathVariableAnnotation; -import com.power.doc.model.annotation.RequestBodyAnnotation; -import com.power.doc.model.annotation.RequestParamAnnotation; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.JavaClassValidateUtil; -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaMethod; - -/** - * @author noear 2022/2/19 created - */ -public class SolonDocBuildTemplate implements IDocBuildTemplate, IRestDocTemplate { - - @Override - public List getApiData(ProjectDocConfigBuilder projectBuilder) { - ApiConfig apiConfig = projectBuilder.getApiConfig(); - List configApiReqParams = Stream.of(apiConfig.getRequestHeaders(), apiConfig.getRequestParams()).filter(Objects::nonNull) - .flatMap(Collection::stream).collect(Collectors.toList()); - FrameworkAnnotations frameworkAnnotations = registeredAnnotations(); - List apiDocList = processApiData(projectBuilder, frameworkAnnotations, configApiReqParams, - new SolonRequestMappingHandler(), new SolonRequestHeaderHandler()); - // sort - if (apiConfig.isSortByTitle()) { - Collections.sort(apiDocList); - } - return apiDocList; - } - - - @Override - public boolean ignoreReturnObject(String typeName, List ignoreParams) { - return JavaClassValidateUtil.isMvcIgnoreParams(typeName, ignoreParams); - } - - @Override - public boolean isEntryPoint(JavaClass cls, FrameworkAnnotations frameworkAnnotations) { - for (JavaAnnotation annotation : cls.getAnnotations()) { - String name = annotation.getType().getValue(); - if (SolonAnnotations.REMOTING.equals(name)) { - return true; - } - } - // use custom doc tag to support Feign. - List docletTags = cls.getTags(); - for (DocletTag docletTag : docletTags) { - String value = docletTag.getName(); - if (DocTags.REST_API.equals(value)) { - return true; - } - } - return false; - } - - @Override - public List listMvcRequestAnnotations() { - return SolonRequestAnnotationsEnum.listMvcRequestAnnotations(); - } - - @Override - public void requestMappingPostProcess(JavaClass javaClass, JavaMethod method, RequestMapping requestMapping) { - if (Objects.isNull(requestMapping)) { - return; - } - if (javaClass.isAnnotation() || javaClass.isEnum()) { - return; - } - boolean isRemote = false; - for (JavaAnnotation annotation : javaClass.getAnnotations()) { - String name = annotation.getType().getValue(); - if (SolonAnnotations.REMOTING.equals(name)) { - isRemote = true; - } - } - if (isRemote) { - requestMapping.setMethodType(Methods.POST.getValue()); - String shortUrl = requestMapping.getShortUrl(); - String mediaType = requestMapping.getMediaType(); - if (shortUrl == null) { - requestMapping.setShortUrl(method.getName()); - } - if (mediaType == null) { - requestMapping.setMediaType("text/json"); - } - } - } - - @Override - public boolean ignoreMvcParamWithAnnotation(String annotation) { - return JavaClassValidateUtil.ignoreSolonMvcParamWithAnnotation(annotation); - } - - - @Override - public FrameworkAnnotations registeredAnnotations() { - FrameworkAnnotations annotations = FrameworkAnnotations.builder(); - HeaderAnnotation headerAnnotation = HeaderAnnotation.builder() - .setAnnotationName(SolonAnnotations.REQUEST_HERDER) - .setValueProp(DocAnnotationConstants.VALUE_PROP) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - // add header annotation - annotations.setHeaderAnnotation(headerAnnotation); - - // add entry annotation - Map entryAnnotations = new HashMap<>(); - EntryAnnotation controllerAnnotation = EntryAnnotation.builder() - .setAnnotationName(SolonAnnotations.CONTROLLER) - .setAnnotationFullyName(SolonAnnotations.CONTROLLER); - entryAnnotations.put(controllerAnnotation.getAnnotationName(), controllerAnnotation); - - EntryAnnotation remoteController = EntryAnnotation.builder() - .setAnnotationName(SolonAnnotations.REMOTING); - entryAnnotations.put(remoteController.getAnnotationName(), remoteController); - - EntryAnnotation componentController = EntryAnnotation.builder() - .setAnnotationName(SolonAnnotations.COMPONENT); - entryAnnotations.put(componentController.getAnnotationName(), componentController); - - annotations.setEntryAnnotations(entryAnnotations); - - // add request body annotation - RequestBodyAnnotation bodyAnnotation = RequestBodyAnnotation.builder() - .setAnnotationName(SolonAnnotations.REQUEST_BODY) - .setAnnotationFullyName(SolonAnnotations.REQUEST_BODY_FULLY); - annotations.setRequestBodyAnnotation(bodyAnnotation); - - // request param annotation - RequestParamAnnotation requestAnnotation = RequestParamAnnotation.builder() - .setAnnotationName(SolonAnnotations.REQUEST_PARAM) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - annotations.setRequestParamAnnotation(requestAnnotation); - - // add path variable annotation - PathVariableAnnotation pathVariableAnnotation = PathVariableAnnotation.builder() - .setAnnotationName(SolonAnnotations.PATH_VAR) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - annotations.setPathVariableAnnotation(pathVariableAnnotation); - - // add mapping annotations - Map mappingAnnotations = new HashMap<>(); - - MappingAnnotation requestMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.REQUEST_MAPPING) - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setScope("class", "method") - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(requestMappingAnnotation.getAnnotationName(), requestMappingAnnotation); - - MappingAnnotation postMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.POST_MAPPING) - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.POST.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(postMappingAnnotation.getAnnotationName(), postMappingAnnotation); - - MappingAnnotation getMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.GET_MAPPING) - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.GET.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(getMappingAnnotation.getAnnotationName(), getMappingAnnotation); - - MappingAnnotation putMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.PUT_MAPPING) - .setProducesProp("produces") - .setParamsProp("params") - .setMethodProp("method") - .setMethodType(Methods.PUT.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(putMappingAnnotation.getAnnotationName(), putMappingAnnotation); - - MappingAnnotation patchMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.PATCH_MAPPING) - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.PATCH.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(patchMappingAnnotation.getAnnotationName(), patchMappingAnnotation); - - MappingAnnotation deleteMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SolonAnnotations.DELETE_MAPPING) - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.DELETE.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(deleteMappingAnnotation.getAnnotationName(), deleteMappingAnnotation); - - MappingAnnotation feignClientAnnotation = MappingAnnotation.builder() - .setAnnotationName(DocGlobalConstants.FEIGN_CLIENT) - .setAnnotationFullyName(DocGlobalConstants.FEIGN_CLIENT_FULLY); - mappingAnnotations.put(feignClientAnnotation.getAnnotationName(), feignClientAnnotation); - - annotations.setMappingAnnotations(mappingAnnotations); - return annotations; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java deleted file mode 100644 index 936513b6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/template/SpringBootDocBuildTemplate.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.template; - -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.*; -import com.power.doc.handler.SpringMVCRequestHeaderHandler; -import com.power.doc.handler.SpringMVCRequestMappingHandler; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDoc; -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.annotation.*; -import com.power.doc.model.request.RequestMapping; -import com.power.doc.utils.JavaClassValidateUtil; -import com.thoughtworks.qdox.model.DocletTag; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaMethod; - -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -/** - * @author yu 2019/12/21. - */ -public class SpringBootDocBuildTemplate implements IDocBuildTemplate, IRestDocTemplate { - - @Override - public List getApiData(ProjectDocConfigBuilder projectBuilder) { - ApiConfig apiConfig = projectBuilder.getApiConfig(); - List configApiReqParams = Stream.of(apiConfig.getRequestHeaders(), apiConfig.getRequestParams()).filter(Objects::nonNull) - .flatMap(Collection::stream).collect(Collectors.toList()); - FrameworkAnnotations frameworkAnnotations = registeredAnnotations(); - List apiDocList = this.processApiData(projectBuilder, frameworkAnnotations, - configApiReqParams, new SpringMVCRequestMappingHandler(), new SpringMVCRequestHeaderHandler()); - // sort - if (apiConfig.isSortByTitle()) { - Collections.sort(apiDocList); - } - return apiDocList; - } - - - @Override - public boolean ignoreReturnObject(String typeName, List ignoreParams) { - return JavaClassValidateUtil.isMvcIgnoreParams(typeName, ignoreParams); - } - - - @Override - public FrameworkAnnotations registeredAnnotations() { - FrameworkAnnotations annotations = FrameworkAnnotations.builder(); - HeaderAnnotation headerAnnotation = HeaderAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REQUEST_HERDER) - .setValueProp(DocAnnotationConstants.VALUE_PROP) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - // add header annotation - annotations.setHeaderAnnotation(headerAnnotation); - - // add entry annotation - Map entryAnnotations = new HashMap<>(); - EntryAnnotation controllerAnnotation = EntryAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.CONTROLLER) - .setAnnotationFullyName(SpringMvcAnnotations.CONTROLLER); - entryAnnotations.put(controllerAnnotation.getAnnotationName(), controllerAnnotation); - - EntryAnnotation restController = EntryAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REST_CONTROLLER); - entryAnnotations.put(restController.getAnnotationName(), restController); - annotations.setEntryAnnotations(entryAnnotations); - - // add request body annotation - RequestBodyAnnotation bodyAnnotation = RequestBodyAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REQUEST_BODY) - .setAnnotationFullyName(SpringMvcAnnotations.REQUEST_BODY_FULLY); - annotations.setRequestBodyAnnotation(bodyAnnotation); - - // request param annotation - RequestParamAnnotation requestAnnotation = RequestParamAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REQUEST_PARAM) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - annotations.setRequestParamAnnotation(requestAnnotation); - - // add path variable annotation - PathVariableAnnotation pathVariableAnnotation = PathVariableAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.PATH_VARIABLE) - .setDefaultValueProp(DocAnnotationConstants.DEFAULT_VALUE_PROP) - .setRequiredProp(DocAnnotationConstants.REQUIRED_PROP); - annotations.setPathVariableAnnotation(pathVariableAnnotation); - - // add mapping annotations - Map mappingAnnotations = new HashMap<>(); - - MappingAnnotation requestMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.REQUEST_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setScope("class", "method") - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(requestMappingAnnotation.getAnnotationName(), requestMappingAnnotation); - - MappingAnnotation postMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.POST_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.POST.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(postMappingAnnotation.getAnnotationName(), postMappingAnnotation); - - MappingAnnotation getMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.GET_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.GET.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(getMappingAnnotation.getAnnotationName(), getMappingAnnotation); - - MappingAnnotation putMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.PUT_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setParamsProp("params") - .setMethodProp("method") - .setMethodType(Methods.PUT.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(putMappingAnnotation.getAnnotationName(), putMappingAnnotation); - - MappingAnnotation patchMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.PATCH_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.PATCH.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(patchMappingAnnotation.getAnnotationName(), patchMappingAnnotation); - - MappingAnnotation deleteMappingAnnotation = MappingAnnotation.builder() - .setAnnotationName(SpringMvcAnnotations.DELETE_MAPPING) - .setConsumesProp("consumes") - .setProducesProp("produces") - .setMethodProp("method") - .setParamsProp("params") - .setMethodType(Methods.DELETE.getValue()) - .setPathProps(DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - mappingAnnotations.put(deleteMappingAnnotation.getAnnotationName(), deleteMappingAnnotation); - - MappingAnnotation feignClientAnnotation = MappingAnnotation.builder() - .setAnnotationName(DocGlobalConstants.FEIGN_CLIENT) - .setAnnotationFullyName(DocGlobalConstants.FEIGN_CLIENT_FULLY); - mappingAnnotations.put(feignClientAnnotation.getAnnotationName(), feignClientAnnotation); - - annotations.setMappingAnnotations(mappingAnnotations); - return annotations; - } - - @Override - public boolean isEntryPoint(JavaClass javaClass, FrameworkAnnotations frameworkAnnotations) { - if (javaClass.isAnnotation() || javaClass.isEnum()) { - return false; - } - // use custom doc tag to support Feign. - List docletTags = javaClass.getTags(); - for (DocletTag docletTag : docletTags) { - String value = docletTag.getName(); - if (DocTags.REST_API.equals(value)) { - return true; - } - } - return false; - } - - @Override - public List listMvcRequestAnnotations() { - return SpringMvcRequestAnnotationsEnum.listSpringMvcRequestAnnotations(); - } - - @Override - public void requestMappingPostProcess(JavaClass javaClass, JavaMethod method, RequestMapping requestMapping) { - // do nothing - } - - @Override - public boolean ignoreMvcParamWithAnnotation(String annotation) { - return JavaClassValidateUtil.ignoreSpringMvcParamWithAnnotation(annotation); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ApiParamTreeUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ApiParamTreeUtil.java deleted file mode 100644 index a79cb509..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ApiParamTreeUtil.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.model.ApiMethodReqParam; -import com.power.doc.model.ApiParam; -import com.power.doc.model.ApiReqParam; - -/** - * @author yu 2020/8/8. - */ -public class ApiParamTreeUtil { - - public static List apiParamToTree(List apiParamList) { - if (CollectionUtil.isEmpty(apiParamList)) { - return new ArrayList<>(0); - } - List params = new ArrayList<>(); - // find root - for (ApiParam apiParam : apiParamList) { - // remove pre of field - apiParam.setField(apiParam.getField().replaceAll(DocGlobalConstants.PARAM_PREFIX, "").replaceAll(" ", "")); - // pid == 0 - if (apiParam.getPid() == 0) { - params.add(apiParam); - } - } - for (ApiParam apiParam : params) { - // remove pre of field - apiParam.setChildren(getChild(apiParam.getId(), apiParamList, 0)); - } - return params; - } - - /** - * find child - * - * @param id param id - * @param apiParamList List of ApiParam - * @param counter invoked counter - * @return List of ApiParam - */ - private static List getChild(int id, List apiParamList, int counter) { - List childList = new ArrayList<>(); - if (counter > 7) { - return childList; - } - for (ApiParam param : apiParamList) { - if (param.getPid() == id) { - childList.add(param); - } - } - counter++; - for (ApiParam param : childList) { - param.setChildren(getChild(param.getId(), apiParamList, counter)); - } - if (childList.size() == 0) { - return new ArrayList<>(0); - } - return childList; - } - - /** - * buildMethodReqParam handle configParam - * - * @param paramList unConfigParam - * @param queryReqParamMap configQueryParam - * @param pathReqParamMap configPathParam - * @param requestBodyCounter hasRequestBody - * @return ApiMethodReqParam - */ - public static ApiMethodReqParam buildMethodReqParam(List paramList, final Map queryReqParamMap, - final Map pathReqParamMap, int requestBodyCounter) { - List pathParams = new ArrayList<>(); - List queryParams = new ArrayList<>(); - List bodyParams = new ArrayList<>(); - for (ApiParam param : paramList) { - param.setValue(StringUtil.removeDoubleQuotes(param.getValue())); - if (param.isPathParam()) { - if (pathReqParamMap.containsKey(param.getField())) { - param.setConfigParam(true).setValue(pathReqParamMap.get(param.getField()).getValue()); - } - param.setId(pathParams.size() + 1); - pathParams.add(param); - } else if (param.isQueryParam() || requestBodyCounter < 1) { - if (queryReqParamMap.containsKey(param.getField())) { - param.setConfigParam(true).setValue(queryReqParamMap.get(param.getField()).getValue()); - } - param.setId(queryParams.size() + 1); - queryParams.add(param); - } else { - param.setId(bodyParams.size() + 1); - bodyParams.add(param); - } - } - - final Set queryParamSet = queryParams.stream().map(ApiParam::getField).collect(Collectors.toSet()); - for (ApiReqParam value : queryReqParamMap.values()) { - if (queryParamSet.contains(value.getName())) { - continue; - } - final ApiParam apiParam = ApiReqParam.convertToApiParam(value) - .setQueryParam(true).setId(queryParams.size() + 1); - queryParams.add(apiParam); - } - - final Set pathParamSet = pathParams.stream().map(ApiParam::getField).collect(Collectors.toSet()); - for (ApiReqParam value : pathReqParamMap.values()) { - if (pathParamSet.contains(value.getName())) { - continue; - } - final ApiParam apiParam = ApiReqParam.convertToApiParam(value) - .setPathParam(true).setId(pathParams.size() + 1); - pathParams.add(apiParam); - } - - return ApiMethodReqParam.builder() - .setRequestParams(bodyParams) - .setPathParams(pathParams) - .setQueryParams(queryParams); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/BeetlTemplateUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/BeetlTemplateUtil.java deleted file mode 100644 index b7d50a31..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/BeetlTemplateUtil.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2016-2021 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.FileUtil; - -import org.beetl.core.Configuration; -import org.beetl.core.GroupTemplate; -import org.beetl.core.Template; -import org.beetl.core.resource.ClasspathResourceLoader; - -/** - * Beetl template handle util - * - * @author sunyu on 2016/12/6. - */ -public class BeetlTemplateUtil { - - - /** - * Get Beetl template by file name - * - * @param templateName template name - * @return Beetl Template Object - */ - public static Template getByName(String templateName) { - try { - ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("/template/"); - Configuration cfg = Configuration.defaultConfiguration(); - cfg.add("/smart-doc-beetl.properties"); - GroupTemplate gt = new GroupTemplate(resourceLoader, cfg); - return gt.getTemplate(templateName); - } catch (IOException e) { - throw new RuntimeException("Can't get Beetl template."); - } - } - - /** - * Batch bind binding value to Beetl templates and return all file rendered, - * Map key is file name,value is file content - * - * @param path path - * @param params params - * @return map - */ - public static Map getTemplatesRendered(String path, Map params) { - Map templateMap = new HashMap<>(); - File[] files = FileUtil.getResourceFolderFiles(path); - GroupTemplate gt = getGroupTemplate(path); - for (File f : files) { - if (f.isFile()) { - String fileName = f.getName(); - Template tp = gt.getTemplate(fileName); - if (Objects.nonNull(params)) { - tp.binding(params); - } - templateMap.put(fileName, tp.render()); - } - } - return templateMap; - } - - /** - * @param path file path - * @return group template - */ - private static GroupTemplate getGroupTemplate(String path) { - try { - ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader("/" + path + "/"); - Configuration cfg = Configuration.defaultConfiguration(); - return new GroupTemplate(resourceLoader, cfg); - } catch (IOException e) { - throw new RuntimeException("Can't found Beetl template."); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/CurlUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/CurlUtil.java deleted file mode 100644 index d535fc4d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/CurlUtil.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.List; -import java.util.Objects; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.model.ApiReqParam; -import com.power.doc.model.FormData; -import com.power.doc.model.request.CurlRequest; - -/** - * @author yu 2020/12/21. - */ -public class CurlUtil { - - public static String toCurl(CurlRequest request) { - if (Objects.isNull(request)) { - return ""; - } - String methodType = request.getType(); - if (Objects.nonNull(methodType) && methodType.contains(".")) { - methodType = methodType.substring(methodType.indexOf(".") + 1); - } - StringBuilder sb = new StringBuilder(); - sb.append("curl"); - sb.append(" -X"); - sb.append(" ").append(methodType); - if (request.getUrl().indexOf("https") == 0) { - sb.append(" -k"); - } - if (StringUtil.isNotEmpty(request.getContentType()) && - !DocGlobalConstants.URL_CONTENT_TYPE.equals(request.getContentType())) { - sb.append(" -H"); - sb.append(" 'Content-Type: ").append(request.getContentType()).append("'"); - } - if (CollectionUtil.isNotEmpty(request.getReqHeaders())) { - for (ApiReqParam reqHeader : request.getReqHeaders()) { - sb.append(" -H"); - if (StringUtil.isEmpty(reqHeader.getValue())) { - sb.append(" '").append(reqHeader.getName()).append("'"); - } else { - sb.append(" '").append(reqHeader.getName()).append(':') - .append(reqHeader.getValue()).append("'"); - } - } - } - - List fileFormDataList = request.getFileFormDataList(); - if (CollectionUtil.isNotEmpty(fileFormDataList)) { - fileFormDataList.forEach(file -> sb.append(" -F '").append(file.getKey()).append("='")); - } - - sb.append(" -i"); - // append request url - sb.append(" ").append(request.getUrl()); - if (StringUtil.isNotEmpty(request.getBody())) { - sb.append(" --data"); - sb.append(" '").append(request.getBody()).append("'"); - } - return sb.toString(); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocClassUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocClassUtil.java deleted file mode 100644 index 265a393d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocClassUtil.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.Stack; - -import javax.annotation.Nonnull; - -import com.power.common.util.StringUtil; -import com.power.doc.filter.ReturnTypeProcessor; -import com.power.doc.model.ApiReturn; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.JavaClass; - -/** - * Description: - * Doc class handle util - * - * @author yu 2018//14. - */ -public class DocClassUtil { - - - /** - * get class names by generic class name - * - * @param typeName generic class name - * @return array of string - */ - public static String[] getSimpleGicName(String typeName) { - if (JavaClassValidateUtil.isCollection(typeName)) { - typeName = typeName + ""; - } else if (JavaClassValidateUtil.isArray(typeName)) { - typeName = typeName.substring(0, typeName.lastIndexOf("[")); - typeName = "java.util.List<" + typeName + ">"; - } else if (JavaClassValidateUtil.isMap(typeName)) { - typeName = typeName + ""; - } - if (typeName.contains("<")) { - String pre = typeName.substring(0, typeName.indexOf("<")); - if (JavaClassValidateUtil.isMap(pre)) { - return getMapKeyValueType(typeName); - } - String type = typeName.substring(typeName.indexOf("<") + 1, typeName.lastIndexOf(">")); - if (JavaClassValidateUtil.isCollection(pre)) { - return type.split(" "); - } - String[] arr = type.split(","); - return classNameFix(arr); - } else { - return new String[0]; - } - } - - /** - * Get a simple type name from a generic class name - * - * @param gicName Generic class name - * @return String - */ - public static String getSimpleName(String gicName) { - if (gicName.contains("<")) { - return gicName.substring(0, gicName.indexOf("<")); - } else { - return gicName; - } - } - - /** - * Automatic repair of generic split class names - * - * @param arr arr of class name - * @return array of String - */ - private static String[] classNameFix(String[] arr) { - List classes = new ArrayList<>(); - List indexList = new ArrayList<>(); - int globIndex = 0; - int length = arr.length; - for (int i = 0; i < length; i++) { - if (classes.size() > 0) { - int index = classes.size() - 1; - if (!isClassName(classes.get(index))) { - globIndex = globIndex + 1; - if (globIndex < length) { - indexList.add(globIndex); - String className = classes.get(index) + "," + arr[globIndex]; - classes.set(index, className); - } - } else { - globIndex = globIndex + 1; - if (globIndex < length) { - if (isClassName(arr[globIndex])) { - indexList.add(globIndex); - classes.add(arr[globIndex]); - } else { - if (!indexList.contains(globIndex) && !indexList.contains(globIndex + 1)) { - indexList.add(globIndex); - classes.add(arr[globIndex] + "," + arr[globIndex + 1]); - globIndex = globIndex + 1; - indexList.add(globIndex); - } - } - } - } - } else { - if (isClassName(arr[i])) { - indexList.add(i); - classes.add(arr[i]); - } else { - if (!indexList.contains(i) && !indexList.contains(i + 1)) { - globIndex = i + 1; - classes.add(arr[i] + "," + arr[globIndex]); - indexList.add(i); - indexList.add(i + 1); - } - } - } - } - return classes.toArray(new String[0]); - } - - /** - * get map key and value type name populate into array. - * - * @param gName generic class name - * @return array of string - */ - public static String[] getMapKeyValueType(String gName) { - if (StringUtil.isEmpty(gName)) { - return new String[0]; - } - if (gName.contains("<")) { - String[] arr = new String[2]; - String key = gName.substring(gName.indexOf("<") + 1, gName.indexOf(",")); - String value = gName.substring(gName.indexOf(",") + 1, gName.lastIndexOf(">")); - arr[0] = key; - arr[1] = value; - return arr; - } else { - return new String[0]; - } - - } - - /** - * Convert the parameter types exported to the api document - * - * @param javaTypeName java simple typeName - * @return String - */ - public static String processTypeNameForParams(String javaTypeName) { - if (StringUtil.isEmpty(javaTypeName)) { - return "object"; - } - if (javaTypeName.length() == 1) { - return "object"; - } - if (javaTypeName.contains("[]")) { - return "array"; - } - javaTypeName = javaTypeName.toLowerCase(); - switch (javaTypeName) { - case "java.lang.string": - case "string": - case "char": - case "java.util.date": - case "date": - case "java.util.uuid": - case "uuid": - case "localdatetime": - case "java.time.localdatetime": - case "java.time.localdate": - case "java.time.localtime": - case "java.time.year": - case "java.time.yearmonth": - case "java.time.monthday": - case "java.time.period": - case "localdate": - case "offsetdatetime": - case "localtime": - case "timestamp": - case "zoneddatetime": - case "period": - case "java.time.zoneddatetime": - case "java.time.offsetdatetime": - case "java.sql.timestamp": - case "java.lang.character": - case "character": - case "org.bson.types.objectid": - return "string"; - case "java.util.list": - case "list": - case "java.util.set": - case "set": - case "java.util.linkedlist": - case "linkedlist": - case "java.util.arraylist": - case "arraylist": - case "java.util.treeset": - case "treeset": - return "array"; - case "java.lang.byte": - case "byte": - return "int8"; - case "java.lang.integer": - case "integer": - case "int": - return "int32"; - case "short": - case "java.lang.short": - return "int16"; - case "double": - case "java.lang.double": - return "double"; - case "java.lang.long": - case "long": - return "int64"; - case "java.lang.float": - case "float": - return "float"; - case "java.math.bigdecimal": - case "bigdecimal": - case "biginteger": - return "number"; - case "java.lang.boolean": - case "boolean": - return "boolean"; - case "map": - return "map"; - case "multipartfile": - return "file"; - default: - return "object"; - } - - } - - /** - * process return type - * - * @param fullyName fully name - * @return ApiReturn - */ - public static ApiReturn processReturnType(String fullyName) { - ReturnTypeProcessor processor = new ReturnTypeProcessor(); - processor.setTypeName(fullyName); - return processor.process(); - } - - /** - * rewrite request param - * - * @param typeName param type name - * @return String - */ - public static String rewriteRequestParam(String typeName) { - switch (typeName) { - case "org.springframework.data.domain.Pageable": - return "com.power.doc.model.framework.PageableAsQueryParam"; - default: - return typeName; - } - } - - private static boolean isClassName(String className) { - className = className.replaceAll("[^<>]", ""); - Stack stack = new Stack<>(); - for (char c : className.toCharArray()) { - if (c == '<') { - stack.push('>'); - } else if (stack.isEmpty() || c != stack.pop()) { - return false; - } - } - return stack.isEmpty(); - } - - /** - * Get class annotations - * - * @param cls JavaClass - * @return List of JavaAnnotation - */ - public static List getAnnotations(JavaClass cls) { - JavaClass superClass = cls.getSuperJavaClass(); - List classAnnotations = new ArrayList<>(); - try { - if (Objects.nonNull(superClass)) { - classAnnotations.addAll(superClass.getAnnotations()); - } - } catch (Throwable e) { - throw new RuntimeException("Could not obtain annotations for class: "+cls.getFullyQualifiedName()+"\n"+e); - } - classAnnotations.addAll(cls.getAnnotations()); - return classAnnotations; - } - - public static T newInstance(@Nonnull Class classWithNoArgsConstructor) { - try { - return classWithNoArgsConstructor.getConstructor().newInstance(); - } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException | - InstantiationException e) { - throw new IllegalArgumentException("Class must have the NoArgsConstructor"); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocPathUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocPathUtil.java deleted file mode 100644 index 6e59a99c..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocPathUtil.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import com.power.common.util.PathUtil; - -import java.io.File; -import java.util.Arrays; -import java.util.List; - -public class DocPathUtil { - - /** - * Get the java class name - * - * @param parentDir parent dir - * @param className class name - * @return java file name - */ - public static String javaFilePath(String parentDir, String className) { - if (StringUtils.isEmpty(parentDir)) { - parentDir = "java.io.tmpdir"; - } - if (!StringUtils.endWith(parentDir, File.separator)) { - parentDir += File.separator; - } - className = className.replaceAll("\\.", "\\" + File.separator); - return parentDir + className + ".java"; - } - - /** - * to postman path - * - * @param path path - * @return String - */ - public static String toPostmanPath(String path) { - if (StringUtils.isNotEmpty(path)) { - path = path.replace("{", ":"); - path = path.replace("}", ""); - return path; - } - return null; - } - - /** - * Determine a match for the given lookup path. - * - * @param lookupPath the request path - * @param includePatterns the path patterns to map (empty for matching to all paths) - * @param excludePatterns the path patterns to exclude (empty for no specific excludes) - * @return {@code true} if matched the request path - */ - public static boolean matches(String lookupPath, String includePatterns, String excludePatterns) { - List includePatternList = null; - if (StringUtils.isNotEmpty(includePatterns)) { - includePatternList = Arrays.asList(includePatterns.split(",", 0)); - } - List excludePatternList = null; - if (StringUtils.isNotEmpty(excludePatterns)) { - excludePatternList = Arrays.asList(excludePatterns.split(",", 0)); - } - return PathUtil.matches(lookupPath, includePatternList, excludePatternList); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUrlUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUrlUtil.java deleted file mode 100644 index 823f2a61..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUrlUtil.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.List; -import java.util.Optional; - -import com.power.common.util.StringUtil; -import com.power.common.util.UrlUtil; -import com.power.doc.constants.DocGlobalConstants; - -/** - * @author yu 2019/12/22. - */ -public class DocUrlUtil { - - public static String getMvcUrls(String baseServer, String baseUrl, List urls) { - StringBuilder sb = new StringBuilder(); - List baseUrls = DocUtil.split(baseUrl); - int size = urls.size(); - int baseSize = baseUrls.size(); - for (int j = 0; j < baseSize; j++) { - String base = baseUrls.get(j); - String trimBase = Optional.ofNullable(StringUtil.trimBlank(base)).orElse(StringUtil.EMPTY); - trimBase = trimBase.replace("[", "").replace("]", ""); - for (int i = 0; i < size; i++) { - String trimUrl = Optional.ofNullable(StringUtil.trimBlank(urls.get(i))).orElse(StringUtil.EMPTY); - String url = baseServer; - if (StringUtil.isNotEmpty(trimBase)) { - url = url + "/" + trimBase; - } - if (StringUtil.isNotEmpty(trimUrl)) { - url = url + "/" + trimUrl; - } - sb.append(UrlUtil.simplifyUrl(url)); - if (i < size - 1) { - sb.append(DocGlobalConstants.MULTI_URL_SEPARATOR); - } - } - if (j < baseSize - 1) { - sb.append(DocGlobalConstants.MULTI_URL_SEPARATOR); - } - } - - return sb.toString(); - } - - public static String getMvcUrls(String baseServer, String baseUrl, String shortUrl) { - List urls = DocUtil.split(shortUrl); - return getMvcUrls(baseServer, baseUrl, urls); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUtil.java deleted file mode 100644 index 5dffbad7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/DocUtil.java +++ /dev/null @@ -1,1020 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import com.mifmif.common.regex.Generex; -import com.power.common.util.*; -import com.power.doc.constants.*; -import com.power.doc.extension.dict.DictionaryValuesResolver; -import com.power.doc.model.*; -import com.power.doc.model.request.RequestMapping; -import com.thoughtworks.qdox.JavaProjectBuilder; -import com.thoughtworks.qdox.model.*; -import com.thoughtworks.qdox.model.expression.Add; -import com.thoughtworks.qdox.model.expression.AnnotationValue; -import com.thoughtworks.qdox.model.expression.Expression; -import com.thoughtworks.qdox.model.expression.FieldRef; -import net.datafaker.Faker; -import org.apache.commons.codec.digest.DigestUtils; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.*; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - -import static com.power.doc.constants.DocGlobalConstants.JSON_CONTENT_TYPE; -import static com.power.doc.constants.DocGlobalConstants.NO_COMMENTS_FOUND; -import static com.power.doc.model.SystemPlaceholders.*; - -/** - * Description: - * DocUtil - * - * @author yu 2018/06/11. - */ -public class DocUtil { - - private static Faker faker = new Faker(new Locale("en-US")); - private static Faker enFaker = new Faker(new Locale("en-US")); - - private static Map fieldValue = new LinkedHashMap<>(); - - static { - fieldValue.put("uuid-string", UUID.randomUUID().toString()); - fieldValue.put("traceid-string", UUID.randomUUID().toString()); - fieldValue.put("id-string", String.valueOf(RandomUtil.randomInt(1, 200))); - fieldValue.put("ids-string", String.valueOf(RandomUtil.randomInt(1, 200))); - fieldValue.put("nickname-string", enFaker.name().username()); - fieldValue.put("hostname-string", faker.internet().ipV4Address()); - fieldValue.put("name-string", faker.name().username()); - fieldValue.put("author-string", faker.book().author()); - fieldValue.put("url-string", faker.internet().url()); - fieldValue.put("username-string", faker.name().username()); - fieldValue.put("index-int", "1"); - fieldValue.put("index-integer", "1"); - fieldValue.put("page-int", "1"); - fieldValue.put("page-integer", "1"); - fieldValue.put("age-int", String.valueOf(RandomUtil.randomInt(0, 70))); - fieldValue.put("age-integer", String.valueOf(RandomUtil.randomInt(0, 70))); - fieldValue.put("email-string", faker.internet().emailAddress()); - fieldValue.put("domain-string", faker.internet().domainName()); - fieldValue.put("phone-string", faker.phoneNumber().cellPhone()); - fieldValue.put("mobile-string", faker.phoneNumber().cellPhone()); - fieldValue.put("telephone-string", faker.phoneNumber().phoneNumber()); - fieldValue.put("address-string", faker.address().fullAddress().replace(",", ",")); - fieldValue.put("ip-string", faker.internet().ipV4Address()); - fieldValue.put("ipv4-string", faker.internet().ipV4Address()); - fieldValue.put("ipv6-string", faker.internet().ipV6Address()); - fieldValue.put("company-string", faker.company().name()); - fieldValue.put("timestamp-long", String.valueOf(System.currentTimeMillis())); - fieldValue.put("timestamp-string", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_SECOND)); - fieldValue.put("time-long", String.valueOf(System.currentTimeMillis())); - fieldValue.put("time-string", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_SECOND)); - fieldValue.put("birthday-string", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_DAY)); - fieldValue.put("birthday-long", String.valueOf(System.currentTimeMillis())); - fieldValue.put("code-string", String.valueOf(RandomUtil.randomInt(100, 99999))); - fieldValue.put("message-string", "success,fail".split(",")[RandomUtil.randomInt(0, 1)]); - fieldValue.put("date-string", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_DAY)); - fieldValue.put("date-date", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_DAY)); - fieldValue.put("begintime-date", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_DAY)); - fieldValue.put("endtime-date", DateTimeUtil.dateToStr(new Date(), DateTimeUtil.DATE_FORMAT_DAY)); - fieldValue.put("time-localtime", LocalDateTime.now().toLocalTime().format(DateTimeFormatter.ofPattern("HH:mm:ss"))); - fieldValue.put("state-int", String.valueOf(RandomUtil.randomInt(0, 10))); - fieldValue.put("state-integer", String.valueOf(RandomUtil.randomInt(0, 10))); - fieldValue.put("flag-int", String.valueOf(RandomUtil.randomInt(0, 10))); - fieldValue.put("flag-integer", String.valueOf(RandomUtil.randomInt(0, 10))); - fieldValue.put("flag-boolean", "true"); - fieldValue.put("flag-Boolean", "false"); - fieldValue.put("idcard-string", IDCardUtil.getIdCard()); - fieldValue.put("sex-int", String.valueOf(RandomUtil.randomInt(0, 2))); - fieldValue.put("sex-integer", String.valueOf(RandomUtil.randomInt(0, 2))); - fieldValue.put("gender-int", String.valueOf(RandomUtil.randomInt(0, 2))); - fieldValue.put("gender-integer", String.valueOf(RandomUtil.randomInt(0, 2))); - fieldValue.put("limit-int", "10"); - fieldValue.put("limit-integer", "10"); - fieldValue.put("size-int", "10"); - fieldValue.put("size-integer", "10"); - - fieldValue.put("offset-int", "1"); - fieldValue.put("offset-integer", "1"); - fieldValue.put("offset-long", "1"); - fieldValue.put("version-string", enFaker.app().version()); - } - - /** - * Generate a random value based on java type name. - * - * @param typeName field type name - * @return random value - */ - public static String jsonValueByType(String typeName) { - String type = typeName.contains(".") ? typeName.substring(typeName.lastIndexOf(".") + 1) : typeName; - String value = RandomUtil.randomValueByType(type); - if (javaPrimaryType(type)) { - return value; - } else if ("Void".equals(type)) { - return "null"; - } else { - StringBuilder builder = new StringBuilder(); - builder.append("\"").append(value).append("\""); - return builder.toString(); - } - } - - - /** - * Generate random field values based on field field names and type. - * - * @param typeName field type name - * @param filedName field name - * @return random value - */ - public static String getValByTypeAndFieldName(String typeName, String filedName) { - boolean isArray = true; - String type = typeName.contains("java.lang") ? typeName.substring(typeName.lastIndexOf(".") + 1) : typeName; - String key = filedName.toLowerCase() + "-" + type.toLowerCase(); - StringBuilder value = null; - if (!type.contains("[")) { - isArray = false; - } - for (Map.Entry entry : fieldValue.entrySet()) { - if (key.contains(entry.getKey())) { - value = new StringBuilder(entry.getValue()); - if (isArray) { - for (int i = 0; i < 2; i++) { - value.append(",").append(entry.getValue()); - } - } - break; - } - } - if (Objects.isNull(value)) { - return jsonValueByType(typeName); - } else { - if (javaPrimaryType(type)) { - return value.toString(); - } else { - return handleJsonStr(value.toString()); - } - } - } - - /** - * 移除字符串的双引号 - * - * @param type0 类型 - * @param filedName 字段名称 - * @param removeDoubleQuotation 移除标志 - * @return String - */ - public static String getValByTypeAndFieldName(String type0, String filedName, boolean removeDoubleQuotation) { - if (removeDoubleQuotation) { - return getValByTypeAndFieldName(type0, filedName).replace("\"", ""); - } else { - return getValByTypeAndFieldName(type0, filedName); - } - } - - - /** - * match controller package - * - * @param packageFilters package filter - * @param controllerName controller name - * @return boolean - */ - public static boolean isMatch(String packageFilters, String controllerName) { - if (StringUtil.isEmpty(packageFilters)) { - return false; - } - String[] patterns = packageFilters.split(","); - for (String str : patterns) { - if (str.contains("*")) { - Pattern pattern = Pattern.compile(str); - if (pattern.matcher(controllerName).matches()) { - return true; - } - } else if (controllerName.startsWith(str)) { - return true; - } - } - return false; - } - - - /** - * An interpreter for strings with named placeholders. - * - * @param str string to format - * @param values to replace - * @return formatted string - */ - public static String formatAndRemove(String str, Map values) { - if (hasSystemProperties(str)) { - str = DocUtil.delPropertiesUrl(str, new HashSet<>()); - } - if (str.contains(":")) { - String[] strArr = str.split("/"); - for (int i = 0; i < strArr.length; i++) { - String pathParam = strArr[i]; - if (pathParam.contains(":")) { - int length = pathParam.length(); - String reg = pathParam.substring(pathParam.indexOf(":") + 1, length - 1); - Generex generex = new Generex(reg); - // Generate random String - String randomStr = generex.random(); - String key = pathParam.substring(1, pathParam.indexOf(":")); - values.computeIfPresent(key, (k, v) -> v = randomStr); - strArr[i] = pathParam.substring(0, pathParam.indexOf(":")) + "}"; - } - } - str = StringUtils.join("/", Arrays.asList(strArr)); - } - StringBuilder builder = new StringBuilder(str); - Set> entries = values.entrySet(); - Iterator> iteratorMap = entries.iterator(); - while (iteratorMap.hasNext()) { - Map.Entry next = iteratorMap.next(); - int start; - String pattern = "{" + next.getKey() + "}"; - String value = next.getValue(); - // values.remove(next.getKey()); - // Replace every occurence of {key} with value - while ((start = builder.indexOf(pattern)) != -1) { - builder.replace(start, start + pattern.length(), value); - } - iteratorMap.remove(); - values.remove(next.getKey()); - - } - return builder.toString(); - } - - /** - * // /detail/{id:[a-zA-Z0-9]{3}}/{name:[a-zA-Z0-9]{3}} - * remove pattern - * - * @param str path - * @return String - */ - public static String formatPathUrl(String str) { - if (hasSystemProperties(str)) { - str = DocUtil.delPropertiesUrl(str, new HashSet<>()); - } - if (!str.contains(":")) { - return str; - } - String[] strArr = str.split("/"); - for (int i = 0; i < strArr.length; i++) { - String pathParam = strArr[i]; - if (pathParam.startsWith("http:") || pathParam.startsWith("https:")) { - continue; - } - if (pathParam.startsWith("{") && pathParam.contains(":")) { - strArr[i] = pathParam.substring(0, pathParam.indexOf(":")) + "}"; - } - } - str = StringUtils.join("/", Arrays.asList(strArr)); - return str; - } - - /** - * handle spring mvc method - * - * @param method method name - * @return String - */ - public static String handleHttpMethod(String method) { - switch (method) { - case "RequestMethod.GET": //for spring - case "MethodType.GET": //for solon - return "GET"; - case "RequestMethod.POST": - case "MethodType.POST": - return "POST"; - case "RequestMethod.PUT": - case "MethodType.PUT": - return "PUT"; - case "RequestMethod.DELETE": - case "MethodType.DELETE": - return "DELETE"; - case "RequestMethod.PATCH": - case "MethodType.PATCH": - return "PATCH"; - default: - return "GET"; - } - } - - /** - * handle spring mvc mapping value - * - * @param annotation JavaAnnotation - * @return String - */ - public static String handleMappingValue(JavaAnnotation annotation) { - String url = getRequestMappingUrl(annotation); - if (StringUtil.isEmpty(url)) { - return "/"; - } else { - return StringUtil.trimBlank(url); - } - } - - - /** - * Split url - * - * @param url URL to be divided - * @return list of url - */ - public static List split(String url) { - char[] chars = url.toCharArray(); - List result = new ArrayList<>(); - StringBuilder sb = new StringBuilder(); - Stack stack = new Stack<>(); - for (char s : chars) { - if ('{' == s) { - stack.push(s); - } - if ('}' == s) { - if (stack.isEmpty()) { - throw new RuntimeException("Invalid mapping pattern detected: " + url); - } else { - stack.pop(); - } - } - if (',' == s && stack.isEmpty()) { - result.add(sb.toString()); - sb.delete(0, sb.length()); - continue; - } - sb.append(s); - } - result.add(sb.toString()); - return result; - } - - /** - * obtain params comments - * - * @param javaMethod JavaMethod - * @param tagName java comments tag - * @param className class name - * @return Map - */ - public static Map getCommentsByTag(final JavaMethod javaMethod, final String tagName, final String className) { - List paramTags = javaMethod.getTagsByName(tagName); - Map paramTagMap = new HashMap<>(); - for (DocletTag docletTag : paramTags) { - String value = docletTag.getValue(); - if (StringUtil.isEmpty(value) && StringUtil.isNotEmpty(className)) { - throw new RuntimeException("ERROR: #" + javaMethod.getName() - + "() - bad @" + tagName + " javadoc from " + javaMethod.getDeclaringClass() - .getCanonicalName() + ", This is an invalid comment."); - } - if (DocTags.PARAM.equals(tagName)) { - String pName = value; - String pValue = DocGlobalConstants.NO_COMMENTS_FOUND; - int idx = value.indexOf(" "); - //existed \n - if (idx > -1) { - pName = value.substring(0, idx); - pValue = value.substring(idx + 1); - } - if ("|".equals(StringUtil.trim(pValue)) && StringUtil.isNotEmpty(className)) { - throw new RuntimeException("ERROR: An invalid comment was written [@" + tagName + " |]," + - "Please @see " + javaMethod.getDeclaringClass().getCanonicalName() + "." + javaMethod.getName() + "()"); - } - paramTagMap.put(pName, pValue); - } else { - paramTagMap.put(value, DocGlobalConstants.EMPTY); - } - } - return paramTagMap; - } - - /** - * obtain java doc tags comments,like apiNote - * - * @param javaMethod JavaMethod - * @param tagName java comments tag - * @param className class name - * @return Map - */ - public static String getNormalTagComments(final JavaMethod javaMethod, final String tagName, final String className) { - Map map = getCommentsByTag(javaMethod, tagName, className); - return getFirstKeyAndValue(map); - } - - /** - * Get field tags - * - * @param field JavaField - * @param docJavaField DocJavaField - * @return map - */ - public static Map getFieldTagsValue(final JavaField field, DocJavaField docJavaField) { - List paramTags = field.getTags(); - if (CollectionUtil.isEmpty(paramTags) && Objects.nonNull(docJavaField)) { - paramTags = docJavaField.getDocletTags(); - } - return paramTags.stream().collect(Collectors.toMap(DocletTag::getName, DocletTag::getValue, - (key1, key2) -> key1 + "," + key2)); - } - - /** - * Get the first element of a map. - * - * @param map map - * @return String - */ - public static String getFirstKeyAndValue(Map map) { - String value = null; - if (map != null && map.size() > 0) { - Map.Entry entry = map.entrySet().iterator().next(); - if (entry != null) { - if (DocGlobalConstants.NO_COMMENTS_FOUND.equals(entry.getValue())) { - value = entry.getKey(); - } else { - value = entry.getKey() + entry.getValue(); - } -// value = replaceNewLineToHtmlBr(value); - } - } - return value; - } - - /** - * Use md5 generate id number - * - * @param value value - * @return String - */ - public static String generateId(String value) { - if (StringUtil.isEmpty(value)) { - return null; - } - String valueId = DigestUtils.md5Hex(value); - int length = valueId.length(); - if (valueId.length() < 32) { - return valueId; - } else { - return valueId.substring(length - 32, length); - } - } - - public static String replaceNewLineToHtmlBr(String content) { - if (StringUtil.isNotEmpty(content)) { - return content.replaceAll("(\r\n|\r|\n|\n\r)", "
"); - } - return StringUtils.EMPTY; - } - - public static String handleJsonStr(String content) { - StringBuilder builder = new StringBuilder(); - builder.append("\"").append(content).append("\""); - return builder.toString(); - } - - public static Map formDataToMap(List formDataList) { - Map formDataMap = new IdentityHashMap<>(); - for (FormData formData : formDataList) { - if ("file".equals(formData.getType())) { - continue; - } - if (formData.getKey().contains("[]")) { - String key = formData.getKey().substring(0, formData.getKey().indexOf("[")); - formDataMap.put(key, formData.getValue() + "&" + key + "=" + formData.getValue()); - continue; - } - formDataMap.put(formData.getKey(), formData.getValue()); - } - return formDataMap; - } - - - public static boolean javaPrimaryType(String type) { - switch (type) { - case "Integer": - case "int": - case "Long": - case "long": - case "Double": - case "double": - case "Float": - case "Number": - case "float": - case "Boolean": - case "boolean": - case "Short": - case "short": - case "BigDecimal": - case "BigInteger": - case "Byte": - case "Character": - case "character": - return true; - default: - return false; - } - } - - public static String javaTypeToOpenApiTypeConvert(String javaTypeName) { - if (StringUtil.isEmpty(javaTypeName)) { - return "object"; - } - if (javaTypeName.length() == 1) { - return "object"; - } - if (javaTypeName.contains("[]")) { - return "array"; - } - javaTypeName = javaTypeName.toLowerCase(); - switch (javaTypeName) { - case "java.lang.string": - case "string": - case "char": - case "date": - case "java.util.uuid": - case "uuid": - case "enum": - case "java.util.date": - case "localdatetime": - case "java.time.localdatetime": - case "java.time.year": - case "java.time.localtime": - case "java.time.yearmonth": - case "java.time.monthday": - case "java.time.localdate": - case "java.time.period": - case "localdate": - case "offsetdatetime": - case "localtime": - case "timestamp": - case "zoneddatetime": - case "period": - case "java.time.zoneddatetime": - case "java.time.offsetdatetime": - case "java.sql.timestamp": - case "java.lang.character": - case "character": - case "org.bson.types.objectid": - return "string"; - case "java.util.list": - case "list": - case "java.util.set": - case "set": - case "java.util.linkedlist": - case "linkedlist": - case "java.util.arraylist": - case "arraylist": - case "java.util.treeset": - case "treeset": - return "array"; - case "java.util.byte": - case "byte": - case "java.lang.integer": - case "integer": - case "int": - case "short": - case "java.lang.short": - case "int32": - return "integer"; - case "double": - case "java.lang.long": - case "long": - case "java.lang.float": - case "float": - case "bigdecimal": - case "int64": - case "biginteger": - return "number"; - case "java.lang.boolean": - case "boolean": - return "boolean"; - case "multipartfile": - case "file": - return "file"; - default: - return "object"; - } - } - - /** - * Gets escape and clean comment. - * - * @param comment the comment - * @return the escape and clean comment - */ - public static String getEscapeAndCleanComment(String comment) { - if (StringUtil.isEmpty(comment)) { - return ""; - } - return comment.replaceAll("<", "<") - .replaceAll(">", ">"); - } - - /** - * Get the url from 'value' or 'path' attribute - * - * @param annotation RequestMapping GetMapping PostMapping etc. - * @return the url - */ - public static String getRequestMappingUrl(JavaAnnotation annotation) { - return getPathUrl(annotation, DocAnnotationConstants.VALUE_PROP, DocAnnotationConstants.NAME_PROP, DocAnnotationConstants.PATH_PROP); - } - - /** - * Get mapping url from Annotation - * - * @param annotation JavaAnnotation - * @param props annotation properties - * @return the path - */ - public static String getPathUrl(JavaAnnotation annotation, String... props) { - for (String prop : props) { - AnnotationValue annotationValue = annotation.getProperty(prop); - if (Objects.nonNull(annotationValue)) { - Object url = resolveAnnotationValue(annotationValue); - if (Objects.nonNull(url)) { - return url.toString(); - } - } - } - return StringUtil.EMPTY; - } - - /** - * resolve the string of {@link Add} which has {@link FieldRef}(to be exact is {@link FieldRef}) children, - * the value of {@link FieldRef} will be resolved with the real value of it if it is the static final member of any other class - * - * @param annotationValue annotationValue - * @return annotation value - */ - public static String resolveAnnotationValue(AnnotationValue annotationValue) { - if (annotationValue instanceof Add) { - Add add = (Add) annotationValue; - String leftValue = resolveAnnotationValue(add.getLeft()); - String rightValue = resolveAnnotationValue(add.getRight()); - return StringUtil.removeQuotes(leftValue + rightValue); - } else { - if (annotationValue instanceof FieldRef) { - FieldRef fieldRef = (FieldRef) annotationValue; - JavaField javaField = fieldRef.getField(); - if (javaField != null) { - return StringUtil.removeQuotes(javaField.getInitializationExpression()); - } - } - return Optional.ofNullable(annotationValue).map(Expression::getParameterValue).map(Object::toString).orElse(StringUtil.EMPTY); - } - } - - - /** - * handle spring mvc RequestHeader value - * - * @param annotation JavaAnnotation - * @return String - */ - public static String handleRequestHeaderValue(JavaAnnotation annotation) { - String header = getRequestHeaderValue(annotation); - if (StringUtil.isEmpty(header)) { - return header; - } - return StringUtil.removeDoubleQuotes(StringUtil.trimBlank(header)); - - } - - /** - * Obtain constant from @RequestHeader annotation - * - * @param annotation RequestMapping GetMapping PostMapping etc. - * @return The constant value - */ - public static String getRequestHeaderValue(JavaAnnotation annotation) { - AnnotationValue annotationValue = annotation.getProperty(DocAnnotationConstants.VALUE_PROP); - return resolveAnnotationValue(annotationValue); - } - - public static List errorCodeDictToList(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - if (CollectionUtil.isNotEmpty(config.getErrorCodes())) { - return config.getErrorCodes(); - } - List errorCodeDictionaries = config.getErrorCodeDictionaries(); - if (CollectionUtil.isEmpty(errorCodeDictionaries)) { - return new ArrayList<>(0); - } else { - ClassLoader classLoader = config.getClassLoader(); - Set errorCodeList = new LinkedHashSet<>(); - try { - for (ApiErrorCodeDictionary dictionary : errorCodeDictionaries) { - Class clzz = dictionary.getEnumClass(); - if (Objects.isNull(clzz)) { - if (StringUtil.isEmpty(dictionary.getEnumClassName())) { - throw new RuntimeException("Enum class name can't be null."); - } - clzz = classLoader.loadClass(dictionary.getEnumClassName()); - } - - Class valuesResolverClass = null; - if (StringUtil.isNotEmpty(dictionary.getValuesResolverClass())) { - valuesResolverClass = classLoader.loadClass(dictionary.getValuesResolverClass()); - } - if (null != valuesResolverClass && DictionaryValuesResolver.class.isAssignableFrom(valuesResolverClass)) { - DictionaryValuesResolver resolver = (DictionaryValuesResolver) DocClassUtil.newInstance(valuesResolverClass); - // add two method results - errorCodeList.addAll(resolver.resolve()); - errorCodeList.addAll(resolver.resolve(clzz)); - } else if (clzz.isInterface()) { - Set> enumImplementSet = dictionary.getEnumImplementSet(); - if (CollectionUtil.isEmpty(enumImplementSet)) { - continue; - } - - for (Class enumClass : enumImplementSet) { - JavaClass interfaceClass = javaProjectBuilder.getClassByName(enumClass.getCanonicalName()); - if (Objects.nonNull(interfaceClass.getTagByName(DocTags.IGNORE))) { - continue; - } - List enumDictionaryList = EnumUtil.getEnumInformation(enumClass, dictionary.getCodeField(), - dictionary.getDescField()); - errorCodeList.addAll(enumDictionaryList); - } - - } else { - JavaClass javaClass = javaProjectBuilder.getClassByName(clzz.getCanonicalName()); - if (Objects.nonNull(javaClass.getTagByName(DocTags.IGNORE))) { - continue; - } - List enumDictionaryList = EnumUtil.getEnumInformation(clzz, dictionary.getCodeField(), - dictionary.getDescField()); - errorCodeList.addAll(enumDictionaryList); - } - - } - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - return new ArrayList<>(errorCodeList); - } - } - - /** - * Build dictionary - * - * @param config api config - * @param javaProjectBuilder JavaProjectBuilder - * @return list of ApiDocDict - */ - public static List buildDictionary(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - List apiDataDictionaryList = config.getDataDictionaries(); - List dictDynamic = config.getDataDictionariesDynamic(); - if (CollectionUtil.isEmpty(apiDataDictionaryList) && CollectionUtil.isEmpty(dictDynamic)) { - return new ArrayList<>(0); - } - List apiDocDictList = new ArrayList<>(); - try { - - ClassLoader classLoader = config.getClassLoader(); - int order = 0; - for (ApiDataDictionary apiDataDictionary : apiDataDictionaryList) { - order++; - Class clazz = apiDataDictionary.getEnumClass(); - if (Objects.isNull(clazz)) { - if (StringUtil.isEmpty(apiDataDictionary.getEnumClassName())) { - throw new RuntimeException("Enum class name can't be null."); - } - clazz = classLoader.loadClass(apiDataDictionary.getEnumClassName()); - } - - if (clazz.isInterface()) { - Set> enumImplementSet = apiDataDictionary.getEnumImplementSet(); - if (CollectionUtil.isEmpty(enumImplementSet)) { - continue; - } - - for (Class enumClass : enumImplementSet) { - JavaClass javaClass = javaProjectBuilder.getClassByName(enumClass.getCanonicalName()); - if (Objects.nonNull(javaClass.getTagByName(DocTags.IGNORE))) { - continue; - } - DocletTag apiNoteTag = javaClass.getTagByName(DocTags.API_NOTE); - ApiDocDict apiDocDict = new ApiDocDict(); - apiDocDict.setOrder(order++); - apiDocDict.setTitle(javaClass.getComment()); - apiDocDict.setDescription( - DocUtil.getEscapeAndCleanComment(Optional.ofNullable(apiNoteTag).map(DocletTag::getValue).orElse(StringUtil.EMPTY))); - List enumDictionaryList = EnumUtil.getEnumInformation(enumClass, apiDataDictionary.getCodeField(), - apiDataDictionary.getDescField()); - apiDocDict.setDataDictList(enumDictionaryList); - apiDocDictList.add(apiDocDict); - } - - } else { - ApiDocDict apiDocDict = new ApiDocDict(); - apiDocDict.setOrder(order); - apiDocDict.setTitle(apiDataDictionary.getTitle()); - JavaClass javaClass = javaProjectBuilder.getClassByName(clazz.getCanonicalName()); - if (Objects.nonNull(javaClass.getTagByName(DocTags.IGNORE))) { - continue; - } - DocletTag apiNoteTag = javaClass.getTagByName(DocTags.API_NOTE); - apiDocDict.setDescription( - DocUtil.getEscapeAndCleanComment(Optional.ofNullable(apiNoteTag).map(DocletTag::getValue).orElse(StringUtil.EMPTY))); - if (apiDataDictionary.getTitle() == null) { - apiDocDict.setTitle(javaClass.getComment()); - } - List enumDictionaryList = EnumUtil.getEnumInformation(clazz, apiDataDictionary.getCodeField(), - apiDataDictionary.getDescField()); - if (!clazz.isEnum()) { - throw new RuntimeException(clazz.getCanonicalName() + " is not an enum class."); - } - apiDocDict.setDataDictList(enumDictionaryList); - apiDocDictList.add(apiDocDict); - } - - } - - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - apiDocDictList.addAll(dictDynamic); - return apiDocDictList; - } - - /** - * Format field Type - * - * @param genericMap genericMap - * @param globGicName globGicName array - * @param fieldGicName fieldGicName - * @return string - */ - public static String formatFieldTypeGicName(Map genericMap, String[] globGicName, String fieldGicName) { - String gicName = ""; - String[] gNameArr = DocClassUtil.getSimpleGicName(fieldGicName); - for (String g : gNameArr) { - if (g.length() == 1) { - if (Objects.nonNull(genericMap.get(g))) { - gicName = genericMap.get(g); - } - if (StringUtil.isNotEmpty(gicName)) { - fieldGicName = fieldGicName.replace(g, gicName); - } - } - } - return fieldGicName; - } - - public static String handleConstants(Map constantsMap, String value) { - Object constantsValue = constantsMap.get(value); - if (Objects.nonNull(constantsValue)) { - return constantsValue.toString(); - } - return value; - } - - public static String handleContentType(String mediaType, JavaAnnotation annotation, String annotationName) { - if (JakartaJaxrsAnnotations.JAX_PRODUCES_FULLY.equals(annotationName) - || JAXRSAnnotations.JAX_PRODUCES_FULLY.equals(annotationName)) { - String annotationValue = StringUtil.removeQuotes(DocUtil.getRequestHeaderValue(annotation)); - if ("MediaType.APPLICATION_JSON".equals(annotationValue) || "application/json".equals(annotationValue) - || "MediaType.TEXT_PLAIN".equals(annotationValue) || "text/plain".equals(annotationValue)) { - mediaType = JSON_CONTENT_TYPE; - } - } - return mediaType; - } - - public static boolean filterPath(RequestMapping requestMapping, ApiReqParam apiReqHeader) { - if (StringUtil.isEmpty(apiReqHeader.getPathPatterns()) - && StringUtil.isEmpty(apiReqHeader.getExcludePathPatterns())) { - return true; - } - return DocPathUtil.matches(requestMapping.getShortUrl(), apiReqHeader.getPathPatterns() - , apiReqHeader.getExcludePathPatterns()); - - } - - public static String paramCommentResolve(String comment) { - if (StringUtil.isEmpty(comment)) { - comment = NO_COMMENTS_FOUND; - } else { - if (comment.contains("|")) { - comment = comment.substring(0, comment.indexOf("|")); - } - } - return comment; - } - - /** - * del ${server.port:/error} - * - * @param value url - * @param visitedPlaceholders cycle - * @return url deleted - */ - public static String delPropertiesUrl(String value, Set visitedPlaceholders) { - int startIndex = value.indexOf(PLACEHOLDER_PREFIX); - if (startIndex == -1) { - return value; - } - StringBuilder result = new StringBuilder(value); - while (startIndex != -1) { - int endIndex = findPlaceholderEndIndex(result, startIndex); - if (endIndex != -1) { - String placeholder = result.substring(startIndex + PLACEHOLDER_PREFIX.length(), endIndex); - String originalPlaceholder = placeholder; - if (visitedPlaceholders == null) { - visitedPlaceholders = new HashSet<>(4); - } - if (!visitedPlaceholders.add(originalPlaceholder)) { - throw new IllegalArgumentException( - "Circular placeholder reference '" + originalPlaceholder + "' in property definitions"); - } - // Recursive invocation, parsing placeholders contained in the placeholder key. - placeholder = delPropertiesUrl(placeholder, visitedPlaceholders); - String propVal = SystemPlaceholders.replaceSystemProperties(placeholder); - if (propVal == null) { - int separatorIndex = placeholder.indexOf(":"); - if (separatorIndex != -1) { - String actualPlaceholder = placeholder.substring(0, separatorIndex); - String defaultValue = placeholder.substring(separatorIndex + ":".length()); - propVal = SystemPlaceholders.replaceSystemProperties(actualPlaceholder); - if (propVal == null) { - propVal = defaultValue; - } - } - } - if (propVal != null) { - propVal = delPropertiesUrl(propVal, visitedPlaceholders); - result.replace(startIndex - 1, endIndex + PLACEHOLDER_PREFIX.length() - 1, propVal); - startIndex = result.indexOf(PLACEHOLDER_PREFIX, startIndex + propVal.length()); - } else { - // Proceed with unprocessed value. - startIndex = result.indexOf(PLACEHOLDER_PREFIX, endIndex + PLACEHOLDER_PREFIX.length()); - } - - visitedPlaceholders.remove(originalPlaceholder); - } else { - startIndex = -1; - } - } - return result.toString(); - } - - private static int findPlaceholderEndIndex(CharSequence buf, int startIndex) { - int index = startIndex + PLACEHOLDER_PREFIX.length(); - int withinNestedPlaceholder = 0; - while (index < buf.length()) { - if (substringMatch(buf, index, PLACEHOLDER_SUFFIX)) { - if (withinNestedPlaceholder > 0) { - withinNestedPlaceholder--; - index = index + "}".length(); - } else { - return index; - } - } else if (substringMatch(buf, index, SIMPLE_PREFIX)) { - withinNestedPlaceholder++; - index = index + SIMPLE_PREFIX.length(); - } else { - index++; - } - } - return -1; - } - - public static boolean substringMatch(CharSequence str, int index, CharSequence substring) { - if (index + substring.length() > str.length()) { - return false; - } - for (int i = 0; i < substring.length(); i++) { - if (str.charAt(index + i) != substring.charAt(i)) { - return false; - } - } - return true; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/Iterables.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/Iterables.java deleted file mode 100644 index 6d30365d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/Iterables.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -/** - * @author daiww 2020/08/26. - */ -package com.power.doc.utils; - -import java.util.function.BiConsumer; - -public class Iterables { - - public static void forEach( - Iterable elements, BiConsumer action) { - if (elements == null || action == null) { - return; - } - int index = 0; - for (E element : elements) { - action.accept(index++, element); - } - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassUtil.java deleted file mode 100644 index 5510ed5d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassUtil.java +++ /dev/null @@ -1,731 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import com.power.common.model.EnumDictionary; -import com.power.common.util.CollectionUtil; -import com.power.common.util.EnumUtil; -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.*; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.ApiDataDictionary; -import com.power.doc.model.DocJavaField; -import com.power.doc.model.torna.EnumInfo; -import com.power.doc.model.torna.Item; -import com.thoughtworks.qdox.JavaProjectBuilder; -import com.thoughtworks.qdox.model.*; -import com.thoughtworks.qdox.model.expression.AnnotationValue; -import com.thoughtworks.qdox.model.expression.AnnotationValueList; -import com.thoughtworks.qdox.model.expression.TypeRef; -import com.thoughtworks.qdox.model.impl.DefaultJavaField; -import com.thoughtworks.qdox.model.impl.DefaultJavaParameterizedType; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; -import java.util.stream.Collectors; - -/** - * Handle JavaClass - * - * @author yu 2019/12/21. - */ -public class JavaClassUtil { - - /** - * Get fields - * - * @param cls1 The JavaClass object - * @param counter Recursive counter - * @param addedFields added fields,Field deduplication - * @return list of JavaField - */ - public static List getFields(JavaClass cls1, int counter, Map addedFields) { - Map actualJavaTypes = new HashMap<>(10); - List fields = getFields(cls1, counter, addedFields, actualJavaTypes); - fields.stream().filter(f -> f.getGenericCanonicalName() != null) - .forEach(f -> actualJavaTypes.entrySet().stream() - .filter(e -> f.getGenericCanonicalName().equals(e.getKey())) - .forEach(e -> - f.setGenericCanonicalName(f.getGenericCanonicalName() - .replace(e.getKey(), e.getValue().getGenericCanonicalName())) - .setFullyQualifiedName(f.getFullyQualifiedName() - .replace(e.getKey(), e.getValue().getFullyQualifiedName())) - .setActualJavaType(e.getValue().getFullyQualifiedName()))); - return fields; - } - - /** - * Get fields - * - * @param cls1 The JavaClass object - * @param counter Recursive counter - * @param addedFields added fields,Field deduplication - * @param actualJavaTypes collected actualJavaTypes - * @return list of JavaField - */ - private static List getFields(JavaClass cls1, int counter, Map addedFields, - Map actualJavaTypes) { - List fieldList = new ArrayList<>(); - if (Objects.isNull(cls1)) { - return fieldList; - } else if ("Object".equals(cls1.getSimpleName()) || "Timestamp".equals(cls1.getSimpleName()) || - "Date".equals(cls1.getSimpleName()) || "Locale".equals(cls1.getSimpleName()) - || "ClassLoader".equals(cls1.getSimpleName()) || JavaClassValidateUtil.isMap(cls1.getFullyQualifiedName()) - || cls1.isEnum() || "Serializable".equals(cls1.getSimpleName()) - || "ZonedDateTime".equals(cls1.getSimpleName())) { - return fieldList; - } else { - String className = cls1.getFullyQualifiedName(); - if (cls1.isInterface() && - !JavaClassValidateUtil.isCollection(className) && - !JavaClassValidateUtil.isMap(className)) { - List methods = cls1.getMethods(); - for (JavaMethod javaMethod : methods) { - String methodName = javaMethod.getName(); - int paramSize = javaMethod.getParameters().size(); - boolean enable = false; - if (methodName.startsWith("get") && !"get".equals(methodName) && paramSize == 0) { - methodName = StringUtil.firstToLowerCase(methodName.substring(3)); - enable = true; - } else if (methodName.startsWith("is") && !"is".equals(methodName) && paramSize == 0) { - methodName = StringUtil.firstToLowerCase(methodName.substring(2)); - enable = true; - } - if (!enable || addedFields.containsKey(methodName)) { - continue; - } - String comment = javaMethod.getComment(); - if (StringUtil.isEmpty(comment)) { - comment = DocGlobalConstants.NO_COMMENTS_FOUND; - } - JavaField javaField = new DefaultJavaField(javaMethod.getReturns(), methodName); - DocJavaField docJavaField = DocJavaField.builder() - .setDeclaringClassName(className) - .setFieldName(methodName) - .setJavaField(javaField) - .setComment(comment) - .setDocletTags(javaMethod.getTags()) - .setAnnotations(javaMethod.getAnnotations()) - .setFullyQualifiedName(javaField.getType() - .getFullyQualifiedName()) - .setGenericCanonicalName(javaField.getType() - .getGenericCanonicalName()); - addedFields.put(methodName, docJavaField); - } - } - // ignore enum parent class - if (actualJavaTypes == null) { - actualJavaTypes = new HashMap<>(10); - } - if (!cls1.isEnum()) { - JavaClass parentClass = cls1.getSuperJavaClass(); - getFields(parentClass, counter, addedFields, actualJavaTypes); - List implClasses = cls1.getImplements(); - for (JavaType type : implClasses) { - JavaClass javaClass = (JavaClass) type; - getFields(javaClass, counter, addedFields, actualJavaTypes); - } - } - actualJavaTypes.putAll(getActualTypesMap(cls1)); - List javaMethods = cls1.getMethods(); - for (JavaMethod method : javaMethods) { - String methodName = method.getName(); - if (method.getAnnotations().size() < 1) { - continue; - } - int paramSize = method.getParameters().size(); - if (methodName.startsWith("get") && !"get".equals(methodName) && paramSize == 0) { - methodName = StringUtil.firstToLowerCase(methodName.substring(3)); - } else if (methodName.startsWith("is") && !"is".equals(methodName) && paramSize == 0) { - methodName = StringUtil.firstToLowerCase(methodName.substring(2)); - } - if (addedFields.containsKey(methodName)) { - String comment = method.getComment(); - if (Objects.isNull(comment)) { - comment = addedFields.get(methodName).getComment(); - } - if (StringUtil.isEmpty(comment)) { - comment = DocGlobalConstants.NO_COMMENTS_FOUND; - } - DocJavaField docJavaField = addedFields.get(methodName); - docJavaField.setAnnotations(method.getAnnotations()); - docJavaField.setComment(comment); - docJavaField.setFieldName(methodName); - docJavaField.setDeclaringClassName(className); - addedFields.put(methodName, docJavaField); - } - } - if (!cls1.isInterface()) { - for (JavaField javaField : cls1.getFields()) { - long count = javaField.getAnnotations().stream() - .filter(annotation -> DocAnnotationConstants.SHORT_JSON_IGNORE.equals( - annotation.getType().getSimpleName())) - .count(); - if (count > 0) { - continue; - } - String fieldName = javaField.getName(); - String subTypeName = javaField.getType().getFullyQualifiedName(); - - if (javaField.isStatic() || "this$0".equals(fieldName) || - JavaClassValidateUtil.isIgnoreFieldTypes(subTypeName)) { - continue; - } - if (fieldName.startsWith("is") && ("boolean".equals(subTypeName))) { - fieldName = StringUtil.firstToLowerCase(fieldName.substring(2)); - } - - DocJavaField docJavaField = DocJavaField.builder(); - boolean typeChecked = false; - String gicName = javaField.getType().getGenericCanonicalName(); - - String actualType = null; - if (JavaClassValidateUtil.isCollection(subTypeName) && - !JavaClassValidateUtil.isCollection(gicName)) { - String[] gNameArr = DocClassUtil.getSimpleGicName(gicName); - actualType = JavaClassUtil.getClassSimpleName(gNameArr[0]); - docJavaField.setArray(true); - typeChecked = true; - } - if (JavaClassValidateUtil.isPrimitive(subTypeName) && !typeChecked) { - docJavaField.setPrimitive(true); - typeChecked = true; - } - if (JavaClassValidateUtil.isFile(subTypeName) && !typeChecked) { - docJavaField.setFile(true); - typeChecked = true; - } - if (javaField.getType().isEnum() && !typeChecked) { - docJavaField.setEnum(true); - } - String comment = javaField.getComment(); - if (Objects.isNull(comment)) { - comment = DocGlobalConstants.NO_COMMENTS_FOUND; - } - docJavaField.setComment(comment) - .setJavaField(javaField) - .setFullyQualifiedName(subTypeName) - .setGenericCanonicalName(gicName) - .setActualJavaType(actualType) - .setAnnotations(javaField.getAnnotations()) - .setFieldName(fieldName) - .setDeclaringClassName(className); - if (addedFields.containsKey(fieldName)) { - addedFields.remove(fieldName); - addedFields.put(fieldName, docJavaField); - continue; - } - addedFields.put(fieldName, docJavaField); - } - } - List parentFieldList = addedFields.values() - .stream() - .filter(Objects::nonNull) - .collect(Collectors.toList()); - fieldList.addAll(parentFieldList); - } - return fieldList; - } - - - /** - * get enum value - * - * @param javaClass enum class - * @param formDataEnum is return method - * @return Object - */ - public static Object getEnumValue(JavaClass javaClass, boolean formDataEnum) { - List javaFields = javaClass.getEnumConstants(); - if (Objects.isNull(javaFields)) { - throw new RuntimeException(javaClass.getName() + " enum not existed"); - } - List methodList = javaClass.getMethods(); - String methodName = null; - for (JavaMethod method : methodList) { - List annotations = method.getAnnotations(); - for (JavaAnnotation annotation : annotations) { - String annotationName = annotation.getType().getValue(); - // enum serialize while use JsonValue and JsonCreator annotation - if (DocAnnotationConstants.JSON_VALUE.equals(annotationName) - || DocAnnotationConstants.JSON_CREATOR.equals(annotationName)) { - methodName = method.getName(); - break; - } - } - } - Object value = null; - int index = 0; - for (JavaField javaField : javaFields) { - String simpleName = javaField.getType().getSimpleName(); - StringBuilder valueBuilder = new StringBuilder(); - valueBuilder.append("\"").append(javaField.getName()).append("\"").toString(); - if (formDataEnum) { - value = valueBuilder.toString(); - return value; - } - if (!JavaClassValidateUtil.isPrimitive(simpleName) && index < 1) { - if (CollectionUtil.isNotEmpty(javaField.getEnumConstantArguments()) && Objects.nonNull(methodName)) { - // enum serialize while use JsonValue - value = javaField.getEnumConstantArguments().get(0); - } else { - value = valueBuilder.toString(); - } - } - index++; - } - return value; - } - - public static String getEnumParams(JavaClass javaClass) { - List javaFields = javaClass.getEnumConstants(); - StringBuilder stringBuilder = new StringBuilder(); - for (JavaField javaField : javaFields) { - //string comment - String exception = javaField.getInitializationExpression(); - stringBuilder.append(javaField.getName()); - stringBuilder.append("(").append(exception).append(")").append("
"); - } - return stringBuilder.toString(); - } - - public static List getEnumValues(JavaClass javaClass) { - List javaFields = javaClass.getEnumConstants(); - List enums = new ArrayList<>(); - for (JavaField javaField : javaFields) { - enums.add(javaField.getName()); - } - return enums; - } - - public static JavaClass getSeeEnum(JavaField javaField, ProjectDocConfigBuilder builder) { - if (Objects.isNull(javaField)) { - return null; - } - JavaClass javaClass = javaField.getType(); - if (javaClass.isEnum()) { - return javaClass; - } - - DocletTag see = javaField.getTagByName(DocTags.SEE); - if (Objects.isNull(see)) { - return null; - } - String value = see.getValue(); - if (!JavaClassValidateUtil.isClassName(value)) { - return null; - } - // not FullyQualifiedName - if (!StringUtils.contains(value, ".")) { - List imports = javaField.getDeclaringClass().getSource().getImports(); - String finalValue = value; - value = imports.stream().filter(i -> StringUtils.endWith(i, finalValue)).findFirst().orElse(StringUtils.EMPTY); - } - - JavaClass enumClass = builder.getJavaProjectBuilder().getClassByName(value); - if (enumClass.isEnum()) { - return enumClass; - } - return null; - } - - /** - * get enum info by java class - * - * @param javaClass the java class info - * @param builder builder - * @return EnumInfo - * @author chen qi - * @since 1.0.0 - */ - public static EnumInfo getEnumInfo(JavaClass javaClass, ProjectDocConfigBuilder builder) { - if (Objects.isNull(javaClass) || !javaClass.isEnum()) { - return null; - } - if (Objects.nonNull(javaClass.getTagByName(DocTags.IGNORE))) { - return null; - } - //todo support the field described by @see - - ApiConfig apiConfig = builder.getApiConfig(); - ClassLoader classLoader = apiConfig.getClassLoader(); - ApiDataDictionary dataDictionary = apiConfig.getDataDictionary(javaClass.getFullyQualifiedName()); - - EnumInfo enumInfo = new EnumInfo(); - String comment = javaClass.getComment(); - DocletTag apiNoteTag = javaClass.getTagByName(DocTags.API_NOTE); - enumInfo.setName(comment); - enumInfo.setDescription(DocUtil.getEscapeAndCleanComment(Optional.ofNullable(apiNoteTag).map(DocletTag::getValue).orElse(StringUtil.EMPTY))); - List enumConstants = javaClass.getEnumConstants(); - - // value can use invoke method to get value, desc too - if (Objects.nonNull(dataDictionary)) { - Class enumClass = dataDictionary.getEnumClass(); - if (enumClass.isInterface()) { - try { - enumClass = classLoader.loadClass(javaClass.getFullyQualifiedName()); - } catch (ClassNotFoundException e) { - return enumInfo; - } - } - List enumInformation = EnumUtil.getEnumInformation(enumClass, dataDictionary.getCodeField(), - dataDictionary.getDescField()); - List itemList = enumInformation.stream().map(i -> new Item(i.getName(), i.getType(), i.getValue(), i.getDesc())) - .collect(Collectors.toList()); - enumInfo.setItems(itemList); - if (StringUtils.isNotEmpty(dataDictionary.getTitle())) { - enumInfo.setName(dataDictionary.getTitle()); - } - return enumInfo; - } - - List collect = enumConstants.stream().map(cons -> { - Item item = new Item(); - String name = cons.getName(); - String enumComment = cons.getComment(); - item.setName(name); - item.setType("string"); - item.setValue(name); - item.setDescription(enumComment); - return item; - }).collect(Collectors.toList()); - enumInfo.setItems(collect); - return enumInfo; - } - - - /** - * Get annotation simpleName - * - * @param annotationName annotationName - * @return String - */ - public static String getAnnotationSimpleName(String annotationName) { - return getClassSimpleName(annotationName); - } - - /** - * Get className - * - * @param className className - * @return String - */ - public static String getClassSimpleName(String className) { - if (className.contains(".")) { - if (className.contains("<")) { - className = className.substring(0, className.indexOf("<")); - } - int index = className.lastIndexOf("."); - className = className.substring(index + 1); - } - if (className.contains("[")) { - int index = className.indexOf("["); - className = className.substring(0, index); - } - return className; - } - - /** - * get Actual type - * - * @param javaClass JavaClass - * @return JavaClass - */ - public static JavaType getActualType(JavaClass javaClass) { - return getActualTypes(javaClass).get(0); - } - - /** - * get Actual type list - * - * @param javaType JavaClass - * @return JavaClass - */ - public static List getActualTypes(JavaType javaType) { - if (Objects.isNull(javaType)) { - return new ArrayList<>(0); - } - String typeName = javaType.getGenericFullyQualifiedName(); - if (typeName.contains("<")) { - return ((JavaParameterizedType) javaType).getActualTypeArguments(); - } - return new ArrayList<>(0); - - } - - /** - * get Actual type map - * - * @param javaClass JavaClass - * @return Map - */ - public static Map getActualTypesMap(JavaClass javaClass) { - Map genericMap = new HashMap<>(10); - List> variables = javaClass.getTypeParameters(); - if (variables.size() < 1) { - return genericMap; - } - List javaTypes = getActualTypes(javaClass); - for (int i = 0; i < variables.size(); i++) { - if (javaTypes.size() > 0) { - genericMap.put(variables.get(i).getName(), javaTypes.get(i)); - } - } - return genericMap; - } - - /** - * Obtain Validate Group classes - * - * @param annotations the annotations of controller method param - * @param builder builder - * @return the group annotation value - */ - public static Set getParamGroupJavaClass(List annotations, JavaProjectBuilder builder) { - if (CollectionUtil.isEmpty(annotations)) { - return new HashSet<>(0); - } - Set javaClassList = new HashSet<>(); - List validates = DocValidatorAnnotationEnum.listValidatorAnnotations(); - for (JavaAnnotation javaAnnotation : annotations) { - List annotationValueList = getAnnotationValues(validates, javaAnnotation); - addGroupClass(annotationValueList, javaClassList, builder); - } - return javaClassList; - } - - /** - * Obtain Validate Group classes - * - * @param javaAnnotation the annotation of controller method param - * @return the group annotation value - */ - public static Set getParamGroupJavaClass(JavaAnnotation javaAnnotation) { - if (Objects.isNull(javaAnnotation)) { - return new HashSet<>(0); - } - Set javaClassList = new HashSet<>(); - List validates = DocValidatorAnnotationEnum.listValidatorAnnotations(); - List annotationValueList = getAnnotationValues(validates, javaAnnotation); - addGroupClass(annotationValueList, javaClassList); - String simpleAnnotationName = javaAnnotation.getType().getValue(); - // add default group - if (javaClassList.size() == 0 && JavaClassValidateUtil.isJSR303Required(simpleAnnotationName)) { - javaClassList.add("javax.validation.groups.Default"); - } - return javaClassList; - } - - public static String getClassTagsValue(final JavaClass cls, final String tagName, boolean checkComments) { - if (StringUtil.isNotEmpty(tagName)) { - StringBuilder result = new StringBuilder(); - List tags = cls.getTags(); - for (int i = 0; i < tags.size(); i++) { - if (!tagName.equals(tags.get(i).getName())) { - continue; - } - String value = tags.get(i).getValue(); - if (StringUtil.isEmpty(value) && checkComments) { - throw new RuntimeException("ERROR: #" + cls.getName() - + "() - bad @" + tagName + " javadoc from " + cls.getName() + ", must be add comment if you use it."); - } - if (tagName.equals(tags.get(i).getName())) { - if (result.length() > 0) { - result.append(","); - } - result.append(value); - } - } - return result.toString(); - } - return ""; - } - - /** - * Get Map of final field and value - * - * @param clazz Java class - * @return Map - * @throws IllegalAccessException IllegalAccessException - */ - public static Map getFinalFieldValue(Class clazz) throws IllegalAccessException { - String className = getClassSimpleName(clazz.getName()); - Field[] fields = clazz.getDeclaredFields(); - Map constants = new HashMap<>(); - for (Field field : fields) { - if (Modifier.isPrivate(field.getModifiers())) { - continue; - } - if (Modifier.isFinal(field.getModifiers()) && Modifier.isStatic(field.getModifiers())) { - String name = field.getName(); - constants.put(className + "." + name, String.valueOf(field.get(null))); - } - } - return constants; - } - - private static void addGroupClass(List annotationValueList, Set javaClassList) { - if (CollectionUtil.isEmpty(annotationValueList)) { - return; - } - for (AnnotationValue annotationValue : annotationValueList) { - TypeRef typeRef = (TypeRef) annotationValue; - DefaultJavaParameterizedType annotationValueType = (DefaultJavaParameterizedType) typeRef.getType(); - javaClassList.add(annotationValueType.getGenericFullyQualifiedName()); - } - } - - - private static void addGroupClass(List annotationValueList, Set javaClassList, JavaProjectBuilder builder) { - if (CollectionUtil.isEmpty(annotationValueList)) { - return; - } - for (AnnotationValue annotationValue : annotationValueList) { - TypeRef typeRef = (TypeRef) annotationValue; - DefaultJavaParameterizedType annotationValueType = (DefaultJavaParameterizedType) typeRef.getType(); - String genericCanonicalName = annotationValueType.getGenericFullyQualifiedName(); - JavaClass classByName = builder.getClassByName(genericCanonicalName); - recursionGetAllValidInterface(classByName, javaClassList, builder); - javaClassList.add(genericCanonicalName); - } - } - - private static void recursionGetAllValidInterface(JavaClass classByName, Set javaClassSet, JavaProjectBuilder builder) { - List anImplements = classByName.getImplements(); - if (CollectionUtil.isEmpty(anImplements)) { - return; - } - for (JavaType javaType : anImplements) { - String genericFullyQualifiedName = javaType.getGenericFullyQualifiedName(); - javaClassSet.add(genericFullyQualifiedName); - if (Objects.equals("javax.validation.groups.Default", genericFullyQualifiedName) - ||Objects.equals("jakarta.validation.groups.Default", genericFullyQualifiedName)) { - continue; - } - JavaClass implementJavaClass = builder.getClassByName(genericFullyQualifiedName); - recursionGetAllValidInterface(implementJavaClass, javaClassSet, builder); - } - } - - private static List getAnnotationValues(List validates, JavaAnnotation javaAnnotation) { - List annotationValueList = new ArrayList<>(); - String simpleName = javaAnnotation.getType().getValue(); - if (simpleName.equalsIgnoreCase(ValidatorAnnotations.VALIDATED)) { - if (Objects.nonNull(javaAnnotation.getProperty(DocAnnotationConstants.VALUE_PROP))) { - AnnotationValue v = javaAnnotation.getProperty(DocAnnotationConstants.VALUE_PROP); - if (v instanceof AnnotationValueList) { - annotationValueList = ((AnnotationValueList) v).getValueList(); - } - if (v instanceof TypeRef) { - annotationValueList.add(v); - } - } - } else if (validates.contains(simpleName)) { - if (Objects.nonNull(javaAnnotation.getProperty(DocAnnotationConstants.GROUP_PROP))) { - AnnotationValue v = javaAnnotation.getProperty(DocAnnotationConstants.GROUP_PROP); - if (v instanceof AnnotationValueList) { - annotationValueList = ((AnnotationValueList) v).getValueList(); - } - if (v instanceof TypeRef) { - annotationValueList.add(v); - } - } - } - return annotationValueList; - } - - public static void genericParamMap(Map genericMap, JavaClass cls, String[] globGicName) { - if (Objects.nonNull(cls) && Objects.nonNull(cls.getTypeParameters())) { - List> variables = cls.getTypeParameters(); - for (int i = 0; i < cls.getTypeParameters().size() && i < globGicName.length; i++) { - genericMap.put(variables.get(i).getName(), globGicName[i]); - } - } - } - - public static String javaTypeFormat(String returnType) { - if (returnType.contains("?")) { - return returnType.replaceAll("[?\\s]", "").replaceAll("extends", ""); - } else { - return returnType; - } - } - - public static boolean isTargetChildClass(String sourceClass, String targetClass) { - try { - if (sourceClass.equals(targetClass)) { - return true; - } - Class c = Class.forName(sourceClass); - while (c != null) { - if (c.getName().equals(targetClass)) { - return true; - } - c = c.getSuperclass(); - } - } catch (ClassNotFoundException e) { - e.getMessage(); - return false; - } - return false; - } - - public static Map getClassJsonIgnoreFields(JavaClass cls) { - if (Objects.isNull(cls)) { - return Collections.EMPTY_MAP; - } - List classAnnotation = cls.getAnnotations(); - Map ignoreFields = new HashMap<>(); - for (JavaAnnotation annotation : classAnnotation) { - String simpleAnnotationName = annotation.getType().getValue(); - if (DocAnnotationConstants.SHORT_JSON_IGNORE_PROPERTIES.equalsIgnoreCase(simpleAnnotationName)) { - return JavaClassUtil.getJsonIgnoresProp(annotation, DocAnnotationConstants.VALUE_PROP); - } - if (DocAnnotationConstants.SHORT_JSON_TYPE.equals(simpleAnnotationName)) { - return JavaClassUtil.getJsonIgnoresProp(annotation, DocAnnotationConstants.IGNORE_PROP); - } - } - return ignoreFields; - } - - public static Map getJsonIgnoresProp(JavaAnnotation annotation, String propName) { - Map ignoreFields = new HashMap<>(); - Object ignoresObject = annotation.getNamedParameter(propName); - if (Objects.isNull(ignoresObject)) { - return ignoreFields; - } - if (ignoresObject instanceof String) { - String prop = StringUtil.removeQuotes(ignoresObject.toString()); - ignoreFields.put(prop, null); - return ignoreFields; - } - LinkedList ignorePropList = (LinkedList) ignoresObject; - for (String str : ignorePropList) { - String prop = StringUtil.removeQuotes(str); - ignoreFields.put(prop, null); - } - return ignoreFields; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java deleted file mode 100644 index c3fde5e7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaClassValidateUtil.java +++ /dev/null @@ -1,424 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.List; -import java.util.Objects; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.common.util.ValidateUtil; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.SolonAnnotations; -import com.power.doc.constants.SpringMvcAnnotations; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.expression.AnnotationValue; - -import static com.power.doc.constants.DocGlobalConstants.JSON_PROPERTY_READ_ONLY; -import static com.power.doc.constants.DocGlobalConstants.JSON_PROPERTY_WRITE_ONLY; - -/** - * @author yu 2019/12/25. - */ -public class JavaClassValidateUtil { - - private static String CLASS_PATTERN = "^([A-Za-z]{1}[A-Za-z\\d_]*\\.)+[A-Za-z][A-Za-z\\d_]*$"; - - /** - * Check if it is the basic data array type of json data - * - * @param type0 java class name - * @return boolean - */ - public static boolean isPrimitiveArray(String type0) { - String type = type0.contains("java.lang") ? type0.substring(type0.lastIndexOf(".") + 1) : type0; - type = type.toLowerCase(); - switch (type) { - case "integer[]": - case "void": - case "int[]": - case "long[]": - case "double[]": - case "float[]": - case "short[]": - case "bigdecimal[]": - case "char[]": - case "string[]": - case "boolean[]": - case "byte[]": - return true; - default: - return false; - } - } - - /** - * Check if it is the basic data type of json data - * - * @param type0 java class name - * @return boolean - */ - public static boolean isPrimitive(String type0) { - if (Objects.isNull(type0)) { - return true; - } - String type = type0.contains("java.lang") ? type0.substring(type0.lastIndexOf(".") + 1) : type0; - type = type.toLowerCase(); - switch (type) { - case "integer": - case "void": - case "int": - case "long": - case "double": - case "float": - case "short": - case "bigdecimal": - case "char": - case "string": - case "number": - case "boolean": - case "byte": - case "uuid": - case "character": - case "java.sql.timestamp": - case "java.util.date": - case "java.time.localdatetime": - case "java.time.localtime": - case "java.time.year": - case "java.time.yearmonth": - case "java.time.monthday": - case "java.time.period": - case "localdatetime": - case "localdate": - case "zoneddatetime": - case "offsetdatetime": - case "period": - case "java.time.localdate": - case "java.time.zoneddatetime": - case "java.time.offsetdatetime": - case "java.math.bigdecimal": - case "java.math.biginteger": - case "java.util.uuid": - case "java.io.serializable": - case "java.lang.character": - case "org.bson.types.objectid": - return true; - default: - return false; - } - } - - /** - * validate java collection - * - * @param type java typeName - * @return boolean - */ - public static boolean isCollection(String type) { - switch (type) { - case "java.util.List": - case "java.util.LinkedList": - case "java.util.ArrayList": - case "java.util.Set": - case "java.util.TreeSet": - case "java.util.HashSet": - case "java.util.SortedSet": - case "java.util.Collection": - case "java.util.ArrayDeque": - case "java.util.PriorityQueue": - return true; - default: - return false; - } - } - - /** - * Check if it is an map - * - * @param type java type - * @return boolean - */ - public static boolean isMap(String type) { - switch (type) { - case "java.util.Map": - case "java.util.SortedMap": - case "java.util.TreeMap": - case "java.util.LinkedHashMap": - case "java.util.HashMap": - case "java.util.concurrent.ConcurrentHashMap": - case "java.util.concurrent.ConcurrentMap": - case "java.util.Properties": - case "java.util.Hashtable": - return true; - default: - return false; - } - } - - /** - * check array - * - * @param type type name - * @return boolean - */ - public static boolean isArray(String type) { - return type.endsWith("[]"); - } - - /** - * check JSR303 - * - * @param annotationSimpleName annotation name - * @return boolean - */ - public static boolean isJSR303Required(String annotationSimpleName) { - switch (annotationSimpleName) { - case "NotNull": - case "NotEmpty": - case "NotBlank": - case "Required": - return true; - default: - return false; - } - } - - - /** - * ignore tag request field - * - * @param tagName custom field tag - * @return boolean - */ - public static boolean isIgnoreTag(String tagName) { - switch (tagName) { - case "ignore": - return true; - default: - return false; - } - } - - /** - * Download - * - * @param typeName return type name - * @return boolean - */ - public static boolean isFileDownloadResource(String typeName) { - switch (typeName) { - case "org.springframework.core.io.Resource": - case "org.springframework.core.io.InputStreamSource": - case "org.springframework.core.io.ByteArrayResource": - case "org.noear.solon.core.handle.DownloadedFile": - return true; - default: - return false; - } - } - - /** - * ignore param of spring mvc - * - * @param paramType param type name - * @param ignoreParams ignore param list - * @return boolean - */ - public static boolean isMvcIgnoreParams(String paramType, List ignoreParams) { - if (CollectionUtil.isNotEmpty(ignoreParams) && ignoreParams.contains(paramType)) { - return true; - } - switch (paramType) { - case "org.springframework.ui.Model": - case "org.springframework.ui.ModelMap": - case "org.springframework.web.servlet.ModelAndView": - case "org.springframework.web.servlet.mvc.support.RedirectAttributesModelMap": - case "org.springframework.validation.BindingResult": - case "javax.servlet.http.HttpServletRequest": - case "javax.servlet.http.HttpServlet": - case "javax.servlet.http.HttpSession": - case "javax.servlet.http.HttpServletResponse": - case "jakarta.servlet.http.HttpServletRequest": - case "jakarta.servlet.http.HttpServlet": - case "jakarta.servlet.http.HttpSession": - case "jakarta.servlet.http.HttpServletResponse": - case "org.springframework.web.context.request.WebRequest": - case "org.springframework.web.reactive.function.server.ServerRequest": - case "org.springframework.web.multipart.MultipartHttpServletRequest": - case "org.springframework.http.HttpHeaders": - case "org.springframework.core.io.Resource": - case "org.springframework.core.io.InputStreamSource": - case "org.springframework.core.io.ByteArrayResource": - case "org.noear.solon.core.handle.Context": - case "org.noear.solon.core.handle.ModelAndView": - return true; - default: - return false; - } - } - - /** - * ignore field type name - * - * @param typeName field type name - * @return String - */ - public static boolean isIgnoreFieldTypes(String typeName) { - switch (typeName) { - case "org.slf4j.Logger": - case "org.apache.ibatis.logging.Log": - case "java.lang.Class": - return true; - default: - return false; - } - } - - /** - * check file - * - * @param typeName type name - * @return boolean - */ - public static boolean isFile(String typeName) { - switch (typeName) { - case "org.springframework.web.multipart.MultipartFile": - case "org.springframework.web.multipart.MultipartFile[]": - case "java.util.List": - case "org.springframework.web.multipart.commons.CommonsMultipartFile": // spring 6 not supported - case "org.springframework.web.multipart.commons.CommonsMultipartFile[]": - case "java.util.List": - case "javax.servlet.http.Part": - case "javax.servlet.http.Part[]": - case "jakarta.servlet.http.Part": - case "jakarta.servlet.http.Part[]": - case "java.util.List": - case "org.noear.solon.core.handle.UploadedFile": - case "org.noear.solon.core.handle.DownloadedFile": - return true; - default: - return false; - } - } - - /** - * check reactor param - * - * @param typeName class name - * @return boolean - */ - public static boolean isReactor(String typeName) { - switch (typeName) { - case "reactor.core.publisher.Mono": - case "reactor.core.publisher.Flux": - return true; - default: - return false; - } - } - - /** - * ignore param with annotation - * - * @param annotation Spring Mvc's annotation - * @return boolean - */ - public static boolean ignoreSpringMvcParamWithAnnotation(String annotation) { - switch (annotation) { - case SpringMvcAnnotations.SESSION_ATTRIBUTE: - case SpringMvcAnnotations.REQUEST_ATTRIBUTE: - case SpringMvcAnnotations.REQUEST_HERDER: - return true; - default: - return false; - } - } - - public static boolean ignoreSolonMvcParamWithAnnotation(String annotation) { - switch (annotation) { - case SolonAnnotations.REQUEST_HERDER: - return true; - default: - return false; - } - } - - /** - * valid java class name - * - * @param className class nem - * @return boolean - */ - public static boolean isClassName(String className) { - if (StringUtil.isEmpty(className) || !className.contains(".")) { - return false; - } - if (ValidateUtil.isContainsChinese(className)) { - return false; - } - String classNameTemp = className; - if (className.contains("<")) { - int index = className.indexOf("<"); - classNameTemp = className.substring(0, index); - } - if (!ValidateUtil.validate(classNameTemp, CLASS_PATTERN)) { - return false; - } - if (className.contains("<") && !className.contains(">")) { - return false; - } else if (className.contains(">") && !className.contains("<")) { - return false; - } - return true; - } - - public static boolean isIgnoreFieldJson(JavaAnnotation annotation, Boolean isResp) { - String simpleAnnotationName = annotation.getType().getValue(); - if (DocAnnotationConstants.SHORT_JSON_IGNORE.equals(simpleAnnotationName)) { - return true; - } - if (DocAnnotationConstants.JSON_PROPERTY.equalsIgnoreCase(simpleAnnotationName)) { - AnnotationValue value = annotation.getProperty("access"); - if (Objects.nonNull(value)) { - if (JSON_PROPERTY_READ_ONLY.equals(value.getParameterValue()) && !isResp) { - return true; - } - if (JSON_PROPERTY_WRITE_ONLY.equals(value.getParameterValue()) && isResp) { - return true; - } - } - } - if (DocAnnotationConstants.SHORT_JSON_FIELD.equals(simpleAnnotationName)) { - AnnotationValue serialize = annotation.getProperty(DocAnnotationConstants.SERIALIZE_PROP); - AnnotationValue deserialize = annotation.getProperty(DocAnnotationConstants.DESERIALIZE_PROP); - if (!isResp && Objects.nonNull(deserialize) && Boolean.FALSE.toString().equals(deserialize.toString())) { - return true; - } - if (isResp && Objects.nonNull(serialize) && Boolean.FALSE.toString().equals(serialize.toString())) { - return true; - } - } - return false; - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaFieldUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaFieldUtil.java deleted file mode 100644 index 82df1a3c..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JavaFieldUtil.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocAnnotationConstants; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocValidatorAnnotationEnum; -import com.power.doc.model.CustomField; -import com.power.doc.model.DocJavaField; -import com.thoughtworks.qdox.model.JavaAnnotation; -import com.thoughtworks.qdox.model.expression.AnnotationValue; - -/** - * @author yu 2019/12/21. - */ -public class JavaFieldUtil { - - /** - * @param fields list of fields - * @return boolean - */ - public static boolean checkGenerics(List fields) { - for (DocJavaField field : fields) { - if (field.getJavaField().getType().getFullyQualifiedName().length() == 1) { - return true; - } - } - return false; - } - - /** - * @param data0 data0 - * @param typeSimpleName typeName - * @param customField config field - */ - public static void buildCustomField(StringBuilder data0, String typeSimpleName, CustomField customField) { - Object val = customField.getValue(); - if (null != val) { - if (DocUtil.javaPrimaryType(typeSimpleName)) { - data0.append(val).append(","); - } else { - data0.append(DocUtil.handleJsonStr(String.valueOf(val))).append(","); - } - } - } - - /** - * @param paramsComments 参数列表 - * @param paramName 参数名称 - * @param typeName 参数数据类型 - * @param simpleTypeName 参数简单数据类型 - * @return mock value - */ - public static String createMockValue(Map paramsComments, String paramName, String typeName, String simpleTypeName) { - String mockValue = ""; - if (JavaClassValidateUtil.isPrimitive(typeName)) { - mockValue = paramsComments.get(paramName); - if (Objects.nonNull(mockValue) && mockValue.contains("|")) { - mockValue = mockValue.substring(mockValue.lastIndexOf("|") + 1); - } else { - mockValue = ""; - } - if (StringUtil.isEmpty(mockValue)) { - mockValue = DocUtil.getValByTypeAndFieldName(simpleTypeName, paramName, Boolean.TRUE); - } - } - return mockValue; - } - - /** - * @param annotations annotation - * @return max length - */ - public static String getParamMaxLength(List annotations) { - String maxLength = ""; - for (JavaAnnotation annotation : annotations) { - String simpleAnnotationName = annotation.getType().getValue(); - AnnotationValue annotationValue = null; - if (DocAnnotationConstants.MAX.equalsIgnoreCase(simpleAnnotationName)) { - annotationValue = annotation.getProperty(DocAnnotationConstants.VALUE_PROP); - } - if (DocAnnotationConstants.SIZE.equalsIgnoreCase(simpleAnnotationName)) { - annotationValue = annotation.getProperty(DocAnnotationConstants.MAX); - } - if (DocAnnotationConstants.LENGTH.equalsIgnoreCase(simpleAnnotationName)) { - annotationValue = annotation.getProperty(DocAnnotationConstants.MAX); - } - if (!Objects.isNull(annotationValue)) { - maxLength = annotationValue.toString(); - } - } - return maxLength; - } - - /** - * getJsr303Comment - * - * @param annotations annotations - * @return Jsr comments - */ - public static String getJsrComment(List annotations) { - StringBuilder sb = new StringBuilder(); - for (JavaAnnotation annotation : annotations) { - Map values = annotation.getPropertyMap(); - String name = annotation.getType().getValue(); - if (DocValidatorAnnotationEnum.listValidatorAnnotations().contains(name)) { - for (Map.Entry m : values.entrySet()) { - String value = DocUtil.resolveAnnotationValue(m.getValue()); - if (DocAnnotationConstants.REGEXP.equals(m.getKey())) { - sb.append(m.getKey()).append(": ").append(StringUtil.removeDoubleQuotes(value)) - .append("; "); - } - if (DocAnnotationConstants.MAX.equals(m.getKey())) { - sb.append(m.getKey()).append(": ").append(StringUtil.removeDoubleQuotes(value)) - .append("; "); - } - if (DocAnnotationConstants.LENGTH.equals(m.getKey())) { - sb.append(m.getKey()).append(": ").append(StringUtil.removeDoubleQuotes(value)) - .append("; "); - } - if (DocAnnotationConstants.SIZE.equals(m.getKey())) { - sb.append(m.getKey()).append(": ").append(StringUtil.removeDoubleQuotes(value)) - .append("; "); - } - } - } - } - if (sb.length() < 1) { - return DocGlobalConstants.EMPTY; - } - StringBuilder finalSb = new StringBuilder(); - finalSb.append("\nValidate[").append(sb).append("]"); - return finalSb.toString(); - } - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JsonUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JsonUtil.java deleted file mode 100644 index 7ed61a81..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/JsonUtil.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; - -/** - * @author yu 2021/6/26. - */ -public class JsonUtil { - - /** - * Convert a JSON string to pretty print - * - * @param jsonString json string - * @return Format json string - */ - public static String toPrettyFormat(String jsonString) { - try { - JsonElement jsonElement = JsonParser.parseString(jsonString); - Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - return gson.toJson(jsonElement); - } catch (Exception e) { - return jsonString; - } - } - - /** - * Convert a JSON to String and pretty print - * - * @param src Json - * @return Format json string - */ - public static String toPrettyJson(Object src) { - Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - return gson.toJson(src); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/OpenApiSchemaUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/OpenApiSchemaUtil.java deleted file mode 100644 index 9e8ec966..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/OpenApiSchemaUtil.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * smart-doc https://github.com/smart-doc-group/smart-doc - * - * Copyright (C) 2018-2023 smart-doc - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package com.power.doc.utils; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import com.power.common.util.CollectionUtil; -import com.power.common.util.StringUtil; -import com.power.doc.model.ApiParam; - -/** - * @author yu 2020/11/29. - */ -public class OpenApiSchemaUtil { - - public static final String NO_BODY_PARAM = "NO_BODY_PARAM"; - static final Pattern PATTRRN = Pattern.compile("[A-Z]\\w+.*?|[A-Z]"); - - public static Map primaryTypeSchema(String primaryType) { - Map map = new HashMap<>(); - map.put("type", DocUtil.javaTypeToOpenApiTypeConvert(primaryType)); - return map; - } - - public static Map mapTypeSchema(String primaryType) { - Map map = new LinkedHashMap<>(); - map.put("type", "object"); - Map items = new HashMap<>(); - items.put("type", DocUtil.javaTypeToOpenApiTypeConvert(primaryType)); - map.put("additionalProperties", items); - return map; - } - - public static Map arrayTypeSchema(String primaryType) { - Map map = new HashMap<>(); - map.put("type", "array"); - Map items = new HashMap<>(); - items.put("type", DocUtil.javaTypeToOpenApiTypeConvert(primaryType)); - map.put("items", items); - return map; - } - - public static Map returnSchema(String returnGicName) { - if (StringUtil.isEmpty(returnGicName)) { - return null; - } - returnGicName = returnGicName.replace(">", ""); - String[] types = returnGicName.split("<"); - StringBuilder builder = new StringBuilder(); - for (String str : types) { - builder.append(DocClassUtil.getSimpleName(str).replace(",", "")); - } - Map map = new HashMap<>(); - map.put("$ref", builder.toString()); - return map; - } - - public static String getClassNameFromParams(List apiParams, String suffix) { - // if array[Primitive] or Primitive - if (CollectionUtil.isNotEmpty(apiParams) && apiParams.size() == 1 - && StringUtil.isEmpty(apiParams.get(0).getClassName()) - && CollectionUtil.isEmpty(apiParams.get(0).getChildren())) { - return "string"; - } - for (ApiParam a : apiParams) { - if (StringUtil.isNotEmpty(a.getClassName())) { - return OpenApiSchemaUtil.delClassName(a.getClassName()) + suffix; - } - } - return NO_BODY_PARAM; - } - - public static String delClassName(String className) { - return String.join("", getPatternResult(PATTRRN, className)); - } - - public static List getPatternResult(Pattern p, String content) { - List matchers = new ArrayList<>(); - Matcher m = p.matcher(content); - while (m.find()) { - matchers.add(m.group()); - } - return matchers; - } - - public static List getPatternResult(String rex, String content) { - Pattern p = Pattern.compile(rex); - List matchers = new ArrayList<>(); - Matcher m = p.matcher(content); - while (m.find()) { - matchers.add(m.group()); - } - return matchers; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ParamUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ParamUtil.java deleted file mode 100644 index b562a946..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/ParamUtil.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.power.doc.utils; - -import java.util.Map; -import java.util.Objects; - -import com.power.common.util.StringUtil; -import com.power.doc.builder.ProjectDocConfigBuilder; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocTags; -import com.power.doc.model.ApiParam; -import com.thoughtworks.qdox.model.JavaClass; -import com.thoughtworks.qdox.model.JavaField; - -/** - * @author chenqi - * @version 1.0 - */ -public class ParamUtil { - - public static JavaClass handleSeeEnum(ApiParam param, JavaField javaField, ProjectDocConfigBuilder builder, boolean jsonRequest, - Map tagsMap) { - JavaClass seeEnum = JavaClassUtil.getSeeEnum(javaField, builder); - if (Objects.isNull(seeEnum)) { - return null; - } - param.setType(DocGlobalConstants.ENUM); - Object value = JavaClassUtil.getEnumValue(seeEnum, !jsonRequest); - param.setValue(String.valueOf(value)); - param.setEnumValues(JavaClassUtil.getEnumValues(seeEnum)); - param.setEnumInfo(JavaClassUtil.getEnumInfo(seeEnum, builder)); - // Override old value - if (tagsMap.containsKey(DocTags.MOCK) && StringUtil.isNotEmpty(tagsMap.get(DocTags.MOCK))) { - param.setValue(tagsMap.get(DocTags.MOCK)); - } - return seeEnum; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/StringUtils.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/StringUtils.java deleted file mode 100644 index 208bb329..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/StringUtils.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.power.doc.utils; - -import cn.hutool.core.util.StrUtil; - -public class StringUtils extends StrUtil { -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/TornaUtil.java b/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/TornaUtil.java deleted file mode 100644 index bafe13e5..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/java/com/power/doc/utils/TornaUtil.java +++ /dev/null @@ -1,366 +0,0 @@ -package com.power.doc.utils; - -import com.google.gson.Gson; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; -import com.power.common.model.EnumDictionary; -import com.power.common.util.CollectionUtil; -import com.power.common.util.OkHttp3Util; -import com.power.common.util.StringUtil; -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.TornaConstants; -import com.power.doc.model.*; -import com.power.doc.model.rpc.RpcApiDependency; -import com.power.doc.model.torna.*; -import com.thoughtworks.qdox.JavaProjectBuilder; -import com.thoughtworks.qdox.model.JavaMethod; -import com.thoughtworks.qdox.model.JavaParameter; - -import java.util.*; - -import static com.power.doc.constants.DocGlobalConstants.ARRAY; -import static com.power.doc.constants.DocGlobalConstants.OBJECT; -import static com.power.doc.constants.TornaConstants.ENUM_PUSH; -import static com.power.doc.constants.TornaConstants.PUSH; - -/** - * @author xingzi 2021/4/28 16:15 - **/ -public class TornaUtil { - - public static void pushToTorna(TornaApi tornaApi, ApiConfig apiConfig, JavaProjectBuilder builder) { - //Build push document information - Map requestJson = TornaConstants.buildParams(PUSH, new Gson().toJson(tornaApi), apiConfig); - //Push dictionary information - Map dicMap = new HashMap<>(2); - List docDicts = TornaUtil.buildTornaDic(DocUtil.buildDictionary(apiConfig, builder)); - if (CollectionUtil.isNotEmpty(docDicts)) { - dicMap.put("enums", docDicts); - Map dicRequestJson = TornaConstants.buildParams(ENUM_PUSH, new Gson().toJson(dicMap), apiConfig); - String dicResponseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(dicRequestJson)); - TornaUtil.printDebugInfo(apiConfig, dicResponseMsg, dicRequestJson, ENUM_PUSH); - } - //Get the response result - String responseMsg = OkHttp3Util.syncPostJson(apiConfig.getOpenUrl(), new Gson().toJson(requestJson)); - //Print the log of pushing documents to Torna - TornaUtil.printDebugInfo(apiConfig, responseMsg, requestJson, PUSH); - } - - public static boolean setDebugEnv(ApiConfig apiConfig, TornaApi tornaApi) { - boolean hasDebugEnv = StringUtils.isNotBlank(apiConfig.getDebugEnvName()) - && - StringUtils.isNotBlank(apiConfig.getDebugEnvUrl()); - //Set up the test environment - List debugEnvs = new ArrayList<>(); - if (hasDebugEnv) { - DebugEnv debugEnv = new DebugEnv(); - debugEnv.setName(apiConfig.getDebugEnvName()); - debugEnv.setUrl(apiConfig.getDebugEnvUrl()); - debugEnvs.add(debugEnv); - } - tornaApi.setDebugEnvs(debugEnvs); - return hasDebugEnv; - } - - public static void printDebugInfo(ApiConfig apiConfig, String responseMsg, Map requestJson, String category) { - if (apiConfig.isTornaDebug()) { - String sb = "Configuration information : \n" + - "OpenUrl: " + - apiConfig.getOpenUrl() + - "\n" + - "appToken: " + - apiConfig.getAppToken() + - "\n"; - System.out.println(sb); - try { - JsonElement element = JsonParser.parseString(responseMsg); - TornaRequestInfo info = new TornaRequestInfo() - .of() - .setCategory(category) - .setCode(element.getAsJsonObject().get(TornaConstants.CODE).getAsString()) - .setMessage(element.getAsJsonObject().get(TornaConstants.MESSAGE).getAsString()) - .setRequestInfo(requestJson) - .setResponseInfo(responseMsg); - System.out.println(info.buildInfo()); - } catch (Exception e) { - //Ex : Nginx Error,Tomcat Error - System.out.println("Response Error : \n" + responseMsg); - } - } - } - - /** - * build apis - * - * @param apiMethodDocs apiMethodDocs - * @param hasDebugEnv has debug environment - * @return List of Api - */ - public static List buildApis(List apiMethodDocs, boolean hasDebugEnv) { - //Parameter list - List apis = new ArrayList<>(); - Apis methodApi; - //Iterative classification interface - for (ApiMethodDoc apiMethodDoc : apiMethodDocs) { - methodApi = new Apis(); - methodApi.setIsFolder(TornaConstants.NO); - methodApi.setName(apiMethodDoc.getDesc()); - methodApi.setUrl(hasDebugEnv ? subFirstUrlOrPath(apiMethodDoc.getPath()) : subFirstUrlOrPath(apiMethodDoc.getUrl())); - methodApi.setHttpMethod(apiMethodDoc.getType()); - methodApi.setContentType(apiMethodDoc.getContentType()); - methodApi.setDescription(apiMethodDoc.getDetail()); - methodApi.setIsShow(TornaConstants.YES); - methodApi.setAuthor(apiMethodDoc.getAuthor()); - methodApi.setOrderIndex(apiMethodDoc.getOrder()); - - methodApi.setHeaderParams(buildHerder(apiMethodDoc.getRequestHeaders())); - methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams())); - methodApi.setIsRequestArray(apiMethodDoc.getIsRequestArray()); - methodApi.setIsResponseArray(apiMethodDoc.getIsResponseArray()); - methodApi.setRequestArrayType(apiMethodDoc.getRequestArrayType()); - methodApi.setResponseArrayType(apiMethodDoc.getResponseArrayType()); - methodApi.setDeprecated(apiMethodDoc.isDeprecated() ? "Deprecated" : null); - //Path - if (CollectionUtil.isNotEmpty(apiMethodDoc.getPathParams())) { - methodApi.setPathParams(buildParams(apiMethodDoc.getPathParams())); - } - - if (CollectionUtil.isNotEmpty(apiMethodDoc.getQueryParams()) - && DocGlobalConstants.FILE_CONTENT_TYPE.equals(apiMethodDoc.getContentType())) { - // file upload - methodApi.setRequestParams(buildParams(apiMethodDoc.getQueryParams())); - } else if (CollectionUtil.isNotEmpty(apiMethodDoc.getQueryParams())) { - methodApi.setQueryParams(buildParams(apiMethodDoc.getQueryParams())); - } - //Json - if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) { - methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams())); - } - apis.add(methodApi); - } - return apis; - } - - /** - * build apis - * - * @param apiMethodDocs apiMethodDocs - * @return List of Api - */ - public static List buildDubboApis(List apiMethodDocs) { - //Parameter list - List apis = new ArrayList<>(); - Apis methodApi; - //Iterative classification interface - for (RpcJavaMethod apiMethodDoc : apiMethodDocs) { - methodApi = new Apis(); - methodApi.setIsFolder(TornaConstants.NO); - methodApi.setName(apiMethodDoc.getDesc()); - methodApi.setDescription(apiMethodDoc.getDetail()); - methodApi.setIsShow(TornaConstants.YES); - methodApi.setAuthor(apiMethodDoc.getAuthor()); - methodApi.setUrl(apiMethodDoc.getMethodDefinition()); - methodApi.setResponseParams(buildParams(apiMethodDoc.getResponseParams())); - methodApi.setOrderIndex(apiMethodDoc.getOrder()); - methodApi.setDeprecated(apiMethodDoc.isDeprecated() ? "Deprecated" : null); - //Json - if (CollectionUtil.isNotEmpty(apiMethodDoc.getRequestParams())) { - methodApi.setRequestParams(buildParams(apiMethodDoc.getRequestParams())); - } - apis.add(methodApi); - } - return apis; - } - - /** - * build request header - * - * @param apiReqParams Request header parameter list - * @return List of HttpParam - */ - public static List buildHerder(List apiReqParams) { - HttpParam httpParam; - List headers = new ArrayList<>(); - for (ApiReqParam header : apiReqParams) { - httpParam = new HttpParam(); - httpParam.setName(header.getName()); - httpParam.setRequired(header.isRequired() ? TornaConstants.YES : TornaConstants.NO); - httpParam.setExample(StringUtil.removeQuotes(header.getValue())); - if (StringUtil.isNotEmpty(header.getSince()) && !DocGlobalConstants.DEFAULT_VERSION.equals(header.getSince())) { - httpParam.setDescription(header.getDesc() + "@since " + header.getSince()); - } else { - httpParam.setDescription(header.getDesc()); - } - headers.add(httpParam); - } - return headers; - } - - /** - * build request response params - * - * @param apiParams Param list - * @return List of HttpParam - */ - public static List buildParams(List apiParams) { - HttpParam httpParam; - List bodies = new ArrayList<>(); - for (ApiParam apiParam : apiParams) { - httpParam = new HttpParam(); - httpParam.setName(apiParam.getField()); - httpParam.setOrderIndex(apiParam.getId()); - httpParam.setMaxLength(apiParam.getMaxLength()); - String type = apiParam.getType(); - if (Objects.equals(type, DocGlobalConstants.PARAM_TYPE_FILE) && apiParam.isHasItems()) { - type = TornaConstants.PARAM_TYPE_FILE_ARRAY; - } - httpParam.setType(type); - httpParam.setRequired(apiParam.isRequired() ? TornaConstants.YES : TornaConstants.NO); - httpParam.setExample(StringUtil.removeQuotes(apiParam.getValue())); - if (StringUtil.isNotEmpty(apiParam.getVersion()) && !DocGlobalConstants.DEFAULT_VERSION.equals(apiParam.getVersion())) { - httpParam.setDescription(DocUtil.replaceNewLineToHtmlBr(apiParam.getDesc()) + "@since " + apiParam.getVersion()); - } else { - httpParam.setDescription(DocUtil.replaceNewLineToHtmlBr(apiParam.getDesc())); - } - httpParam.setEnumInfo(apiParam.getEnumInfo()); - if (apiParam.getChildren() != null) { - httpParam.setChildren(buildParams(apiParam.getChildren())); - } - bodies.add(httpParam); - } - return bodies; - } - - public static String buildDependencies(List dependencies) { - StringBuilder s = new StringBuilder(); - if (CollectionUtil.isNotEmpty(dependencies)) { - for (RpcApiDependency r : dependencies) { - s.append(r.toString()).append("\n\n"); - } - } - return s.toString(); - } - - public static List buildErrorCode(ApiConfig config, JavaProjectBuilder javaProjectBuilder) { - List commonErrorCodes = new ArrayList<>(); - CommonErrorCode commonErrorCode; - List errorCodes = DocUtil.errorCodeDictToList(config, javaProjectBuilder); - if (CollectionUtil.isNotEmpty(errorCodes)) { - for (EnumDictionary code : errorCodes) { - commonErrorCode = new CommonErrorCode(); - commonErrorCode.setCode(code.getValue()); - // commonErrorCode.setSolution(code.getDesc()); - commonErrorCode.setMsg(DocUtil.replaceNewLineToHtmlBr(code.getDesc())); - commonErrorCodes.add(commonErrorCode); - } - } - return commonErrorCodes; - } - - public static List buildTornaDic(List apiDocDicts) { - List dics = new ArrayList<>(); - TornaDic tornaDic; - if (CollectionUtil.isNotEmpty(apiDocDicts)) { - for (ApiDocDict doc : apiDocDicts) { - tornaDic = new TornaDic(); - tornaDic.setName(doc.getTitle()) - .setDescription(DocUtil.replaceNewLineToHtmlBr(doc.getDescription())) - .setItems(buildTornaDicItems(doc.getDataDictList())); - dics.add(tornaDic); - } - } - return dics; - } - - private static List buildTornaDicItems(List dataDicts) { - List apis = new ArrayList<>(); - HttpParam api; - if (CollectionUtil.isNotEmpty(dataDicts)) { - for (EnumDictionary d : dataDicts) { - api = new HttpParam(); - api.setName(d.getName()); - api.setType(d.getType()); - api.setValue(d.getValue()); - api.setDescription(d.getDesc()); - apis.add(api); - } - } - return apis; - } - - /** - * 设置请求参数是否为数组 - * - * @param apiMethodDoc 请求参数 - */ - public static void setTornaArrayTags(JavaMethod method, ApiMethodDoc apiMethodDoc) { - String returnTypeName = method.getReturnType().getCanonicalName(); - apiMethodDoc.setIsRequestArray(0); - apiMethodDoc.setIsResponseArray(0); - boolean respArray = JavaClassValidateUtil.isCollection(returnTypeName) || JavaClassValidateUtil.isArray(returnTypeName); - //response - if (respArray) { - apiMethodDoc.setIsResponseArray(1); - String className = getType(method.getReturnType().getGenericCanonicalName()); - String arrayType = JavaClassValidateUtil.isPrimitive(className) ? className : OBJECT; - apiMethodDoc.setResponseArrayType(arrayType); - } - //request - if (CollectionUtil.isNotEmpty(method.getParameters())) { - for (JavaParameter param : method.getParameters()) { - String typeName = param.getType().getCanonicalName(); - boolean reqArray = JavaClassValidateUtil.isCollection(typeName) || JavaClassValidateUtil.isArray(typeName); - if (reqArray) { - apiMethodDoc.setIsRequestArray(1); - String className = getType(param.getType().getGenericCanonicalName()); - String arrayType = JavaClassValidateUtil.isPrimitive(className) ? className : OBJECT; - apiMethodDoc.setRequestArrayType(arrayType); - break; - } - } - } - - } - - private static String getArrayType(Map schemaMap) { - String arrayType = null; - if (Objects.nonNull(schemaMap) && Objects.equals(ARRAY, schemaMap.get("type"))) { - Map innerSchemeMap = (Map) schemaMap.get("items"); - if (Objects.nonNull(innerSchemeMap)) { - String type = (String) innerSchemeMap.get("type"); - if (StringUtil.isNotEmpty(type)) { - String className = getType(type); - arrayType = JavaClassValidateUtil.isPrimitive(className) ? className : OBJECT; - } - } - } - return arrayType; - } - - private static String getType(String typeName) { - String gicType; - //get generic type - if (typeName.contains("<")) { - gicType = typeName.substring(typeName.indexOf("<") + 1, typeName.lastIndexOf(">")); - } else { - gicType = typeName; - } - if (gicType.contains("[")) { - gicType = gicType.substring(0, gicType.indexOf("[")); - } - return gicType.substring(gicType.lastIndexOf(".") + 1).toLowerCase(); - } - - private static String subFirstUrlOrPath(String url) { - if (StringUtil.isEmpty(url)) { - return StringUtil.EMPTY; - } - if (!url.contains(DocGlobalConstants.MULTI_URL_SEPARATOR)) { - return url; - } - String[] split = StringUtil.split(url, DocGlobalConstants.MULTI_URL_SEPARATOR); - return split[0]; - } - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/beetl.properties b/blossom-backend/smart-doc-2.6.7/src/main/resources/beetl.properties deleted file mode 100644 index 1a1b75d1..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/beetl.properties +++ /dev/null @@ -1,2 +0,0 @@ -DELIMITER_STATEMENT_START=<% -DELIMITER_STATEMENT_END=%> \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/default.json b/blossom-backend/smart-doc-2.6.7/src/main/resources/default.json deleted file mode 100644 index 7b01fd16..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/default.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "serverUrl": "http://127.0.0.1", - "isStrict": false, - "allInOne": true, - "outPath": "D://md2", - "coverOld": true, - "allInOneDocFileName": "demoProject.html", - "packageFilters": "", - "md5EncryptedHtmlName": false, - "projectName": "smart-doc", - "skipTransientField": true, - "requestExample": true, - "responseExample": true, - "revisionLogs": [ - { - "version": "1.0", - "status": "use", - "author": "author", - "revisionTime": "2019-10-12", - "remarks": "desc" - } - ], - "errorCodes": [ - { - "value": "200", - "type": "string", - "desc": "desc" - } - ], - "customResponseFields": [ - { - "name": "name", - "desc": "desc", - "ownerClassName": "ownerClassName", - "value": "value" - } - ], - "requestHeaders": [ - { - "name": "token", - "type": "string", - "desc": "desc", - "required": false, - "since": "-" - } - ], - "sourceCodePaths": [ - { - "path": "src/main/java", - "desc": "测试" - } - ] -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/dict-db.setting b/blossom-backend/smart-doc-2.6.7/src/main/resources/dict-db.setting deleted file mode 100644 index 4573981e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/dict-db.setting +++ /dev/null @@ -1,9 +0,0 @@ -## 用于生成API文档,查询数据库中的配置信息 -# JDBC URL,根据不同的数据库,使用相应的JDBC连接字符串 -url = jdbc:mysql://192.168.31.99:3306/xzzz-blossom -# 用户名,此处也可以使用 user 代替 -username = root -# 密码,此处也可以使用 pass 代替 -password = jasmine888 -# JDBC驱动名 -driver = com.mysql.cj.jdbc.Driver \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/smart-doc-beetl.properties b/blossom-backend/smart-doc-2.6.7/src/main/resources/smart-doc-beetl.properties deleted file mode 100644 index 9c3f34be..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/smart-doc-beetl.properties +++ /dev/null @@ -1,6 +0,0 @@ -DELIMITER_STATEMENT_START=<% -DELIMITER_STATEMENT_END=%> -FN.htmlEscape=com.power.doc.function.HtmlEscape -FN.removeLineBreaks=com.power.doc.function.RemoveLineBreaks -FN.lineBreaksToBr=com.power.doc.function.LineBreaksToBr -FNP.strUtil=org.beetl.ext.fn.StringUtil \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.adoc b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.adoc deleted file mode 100644 index 54cbc4ec..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.adoc +++ /dev/null @@ -1,178 +0,0 @@ -<%if(isNotEmpty(projectName)){%> -= ${projectName} -<%}%> -<%if(isNotEmpty(revisionLogList)){%> - -[width="100%",options="header"] -[stripes=even] -|==================== -|Version | Update Time | Status | Author | Description -<% -for(revisionLog in revisionLogList){ -%> -|${revisionLog.version}|${revisionLog.revisionTime}|${revisionLog.status}|${revisionLog.author}|${revisionLog.remarks} -<%}%> -|==================== -<%}%> - - -<% -for(apiGroup in apiDocList){ -%> -<% -if(!apiDocListOnlyHasDefaultGroup) {%> -== ${apiGroup.group} -<%} %> -<% -for(api in apiGroup.childrenApiDocs){ -%> -=== ${api.desc} -<% -for(doc in api.list){ -%> -<%if(doc.deprecated){%> -==== [line-through]#${doc.desc}# -<%}else{%> -==== ${doc.desc} -<%}%> -*URL:* `${doc.url}` - -*Type:* `${doc.type}` - -<%if(isNotEmpty(doc.author)){%> -*Author:* ${doc.author} -<%}%> - -*Content-Type:* `${doc.contentType}` - -<%if(isNotEmpty(doc.headers)){%> -*Request-headers:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Header | Type|Required|Description|Since -${doc.headers} -|==================== -<%}%> - -<%if(isNotEmpty(doc.pathParams)){%> -*Path-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.pathParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.queryParams)){%> -*Query-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.queryParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.requestParams)){%> -*Body-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -*Request-example:* ----- -${doc.requestUsage} ----- -<%}%> -<%if(isNotEmpty(doc.responseParams)){%> -*Response-fields:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Field | Type|Description|Since -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -*Response-example:* ----- -${doc.responseUsage} ----- -<%}%> - -<% } %> -<% } %> -<% } %> -<%if(isNotEmpty(errorCodeList)){%> -<%if(apiDocListOnlyHasDefaultGroup) { %> -=== ${errorListTitle} -<% } else { %> -== ${errorListTitle} -<% } %> - -[width="100%",options="header"] -[stripes=even] -|==================== -|Error code |Description -<% -for(error in errorCodeList){ -%> -|${error.value}|${error.desc} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(dictList)){%> - -<%if(apiDocListOnlyHasDefaultGroup) { %> -=== ${dictListTitle} -<% } else { %> -== ${dictListTitle} -<% } %> - -<% -for(dict in dictList){ -%> -=== ${dict.title} - -[width="100%",options="header"] -[stripes=even] -|==================== -|Code |Type|Description -<% -for(dataDict in dict.dataDictList){ -%> -|${dataDict.value}|${dataDict.type}|${dataDict.desc} -<%}%> -|==================== -<%}%> -<%}%> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.html deleted file mode 100644 index ee534602..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.html +++ /dev/null @@ -1,713 +0,0 @@ - - - - - - - <%if(isNotEmpty(projectName)){%> - ${projectName} - <%}else{%> - API 接口文档 - <%}%> - - - <%if(isNotEmpty(highlightCssLink)){%> - - <%}%> - - - - - - - -
- <%if(isNotEmpty(revisionLogList)){%> -
-
-

项目事项说明

-

- 1. 说明接口基本注意事项, 建议使用接口文档前阅读该部分。 -

-

- 2. 仓库地址: https://github.com/blossom-editor/blossom -

-
-
- - - - - - - - - - - - - - - - - - - <%for(revisionLog in revisionLogList){%> - - - - - - - - - - - - - - <%}%> - -
事项使用说明
-

${revisionLog.version}

-
-

${htmlEscape(revisionLog.remarks)}

-
-
-
- <%}%> - <%for(apiGroup in apiDocList){%> - <%if(!apiDocListOnlyHasDefaultGroup){%> -

- - - ${apiGroup.order}.${htmlEscape(apiGroup.name)} -

- <%}%> - <%for(api in apiGroup.childrenApiDocs){%> -
-

- - - - <%if(apiGroupLP.size>1){%>${apiGroup.order}.${api.order}.${htmlEscape(api.desc)} - <%}else{%>${api.order}.${htmlEscape(api.desc)} - <%}%> -

-
- <%for(doc in api.list){%> -
-

- - - <%if(doc.deprecated){%> - - <%if(!apiDocListOnlyHasDefaultGroup){%>${apiGroup.order}.${api.order}.${doc.order}. - <%}else{%>${api.order}.${doc.order}. - <%}%> - ${htmlEscape(doc.desc)} - - <%}else{%> - - <%if(!apiDocListOnlyHasDefaultGroup){%>${apiGroup.order}.${api.order}.${doc.order}.${htmlEscape(doc.desc)} - <%}else{%>${api.order}.${doc.order}.${htmlEscape(doc.desc)} - <%}%> - <%}%> -

-
-

- - <%if(doc.type == 'POST'){%> - ${doc.type} - <%}%> - <%if(doc.type == 'GET'){%> - ${doc.type} - <%}%> - ${doc.url} -

-
- - - - <%if(isNotEmpty(doc.author)){%> -
-

- Author: ${doc.author}

-
- <%}%> - - - - -
-

- - ${htmlEscape(doc.detail)} -

-
- <%if(isNotEmpty(doc.requestHeaders)&&displayRequestParams){%> -
-

- 请求头(RequestHeaders)说明: -

-
- - - - - - - - - - - - - - - - - - - <%for(header in doc.requestHeaders){%> - - - - - - - - - - - - <%}%> - -
请求头说明是否必填
-

${header.name}

-
-

${htmlEscape(header.desc)}

-
-

${header.required}

-
- <%}%> - <%if(isNotEmpty(doc.pathParams)&&displayRequestParams){%> -
-

- Path-parameters: -

-
- - - - - - - - - - - - - - - - - - - <%for(param in doc.pathParams){%> - - - - - - - - <%}%> - -
ParameterTypeDescriptionRequiredSince
-

${param.field}

-
-

${param.type}

-
-

${param.desc}

-
-

${param.required}

-
-

${param.version}

-
- <%}%> - <%if(isNotEmpty(doc.queryParams)&&displayRequestParams){%> -
-

- 请求链接(QueryParams)参数说明: -

-
- - - - - - - - - - - - - - - - - - - <%for(param in doc.queryParams){%> - - - - - - - - - - <%}%> - -
字段名称字段类型字段类型是否必填
-

${param.field}

-
-

${param.type}

-
-

${param.desc}

-
- <%if(param.required){%> -

${param.required}

- <%}%> - <%else{%> -

${param.required}

- <%}%> -
- <%}%> - <%if(isNotEmpty(doc.requestParams)&&displayRequestParams){%> -
-

- 请求体(RequestBody)参数说明: -

-
- - - - - - - - - - - - - - - - - - - <%for(param in doc.requestParams){%> - - - - - - - - - - <%}%> - -
字段名字段类型字段说明是否必填
-

${param.field}

-
-

${param.type}

-
-

${param.desc}

-
- <%if(param.required){%> -

${param.required}

- <%}%> - <%else{%> -

${param.required}

- <%}%> -
- <%}%> - <%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -
-

- 请求示例: -

-
-
-
-
-              ${doc.requestUsage}
-            
-
-
- <%}%> - <%if(isNotEmpty(doc.responseParams)&&displayResponseParams){%> -
-

- 响应字段(ResponseBody)说明: -

-
- - - - - - - - - - - - - - - - - <%for(param in doc.responseParams){%> - - - - - - - - - <%}%> - -
字段名字段类型字段说明
-

${param.field}

-
-

${param.type}

-
-

${param.desc}

-
- <%}%> - <%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -
-

- 响应示例: -

-
-
-
-
${doc.responseUsage}
-
-
- <%}%> -
- <%}%> -
-
- <%}%> - <%}%> - <%if(isNotEmpty(errorCodeList)){%> -
-

- - - ${errorCodeListOrder}.${errorListTitle} -

-
- - - - - - - - - - - - - <%for(error in errorCodeList){%> - - - - - <%}%> - -
错误码字段说明
-

${error.value}

-
-

${htmlEscape(error.desc)}

-
-
-
- <%}%> - <%if(isNotEmpty(dictList)){%> -
-

- - - ${dictListOrder}.${dictListTitle} -

-
- <%for(dict in dictList){%> -
-

- - - ${dictListOrder}.${dict.order}.${htmlEscape(dict.title)} -

- - - - - - - - - - - - - - - <%for(dataDict in dict.dataDictList){%> - - - - - - <%}%> - -
字典值数据类型字典说明
-

${dataDict.value}

-
-

${dataDict.type}

-
-

${htmlEscape(dataDict.desc)}

-
-
- <%}%> -
-
- <%}%> -
- Generated by smart-doc at ${createTime} - Suggestions,contact,support and error reporting on -  Gitee or -  Github - -
-
- - Top -
-
- - - - - \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.md deleted file mode 100644 index 40a0b22a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/AllInOne.md +++ /dev/null @@ -1,161 +0,0 @@ -<%if(isNotEmpty(projectName)){%> -# ${projectName} -<%}%> -<%if(isNotEmpty(revisionLogList)){%> - -| Version | Update Time | Status | Author | Description | -|---------|-------------|--------|--------|-------------| -<% -for(revisionLog in revisionLogList){ -%> -|${revisionLog.version}|${revisionLog.revisionTime}|${revisionLog.status}|${revisionLog.author}|${revisionLog.remarks}| -<%}%> - -<%}%> - - -<% -for(apiGroup in apiDocList){ -%> -<% -if(!apiDocListOnlyHasDefaultGroup) {%> -# ${apiGroup.group} -<%}%> -<% -for(api in apiGroup.childrenApiDocs){ -%> -## ${api.desc} -<% -for(doc in api.list){ -%> -<%if(doc.deprecated){%> -### ~~${htmlEscape(doc.desc)}~~ -<%}else{%> -### ${htmlEscape(doc.desc)} -<%}%> -**URL:** ${doc.url} - -**Type:** ${doc.type} - -<%if(isNotEmpty(doc.author)){%> -**Author:** ${doc.author} -<%}%> - -**Content-Type:** ${doc.contentType} - -**Description:** ${doc.detail} -<%if(isNotEmpty(doc.headers)){%> - -**Request-headers:** - -| Header | Type | Required | Description | Since | -|--------|------|----------|-------------|-------| -${doc.headers} -<%}%> -<%if(isNotEmpty(doc.pathParams)){%> - -**Path-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.pathParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> -<%if(isNotEmpty(doc.queryParams)){%> - -**Query-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.queryParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> -<%if(isNotEmpty(doc.requestParams)){%> - -**Body-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -**Request-example:** -``` -${doc.requestUsage} -``` -<%}%> -<%if(isNotEmpty(doc.responseParams)){%> -**Response-fields:** - -| Field | Type | Description | Since | -|-------|------|-------------|-------| -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -**Response-example:** -``` -${doc.responseUsage} -``` -<%}%> - -<% } %> -<% } %> -<% } %> -<%if(isNotEmpty(errorCodeList)){%> -<%if(apiDocListOnlyHasDefaultGroup) { %> -## ${errorListTitle} -<% } else { %> -# ${errorListTitle} -<% } %> - -| Error code | Description | -|------------|-------------| -<% -for(error in errorCodeList){ -%> -|${error.value}|${htmlEscape(error.desc)}| -<%}%> -<%}%> - -<%if(isNotEmpty(dictList)){%> -<%if(apiDocListOnlyHasDefaultGroup) { %> -## ${dictListTitle} -<% } else { %> -# ${dictListTitle} -<% } %> - -<% -for(dict in dictList){ -%> - -<%if(apiDocListOnlyHasDefaultGroup) { %> -### ${dict.title} -<% } else { %> -## ${dict.title} -<% } %> - -| Code | Type | Description | -|------|------|-------------| -<% -for(dataDict in dict.dataDictList){ -%> -|${dataDict.value}|${dataDict.type}|${htmlEscape(dataDict.desc)}| -<%}%> -<%}%> -<%}%> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.adoc b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.adoc deleted file mode 100644 index c238581e..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.adoc +++ /dev/null @@ -1,110 +0,0 @@ - -== ${desc} -<% -for(doc in list){ -%> -<%if(doc.deprecated){%> -=== [line-through]#${doc.desc}# -<%}else{%> -=== ${doc.desc} -<%}%> -*URL:* `${doc.url}` - -*Type:* `${doc.type}` - -<%if(isNotEmpty(doc.author)){%> -*Author:* ${doc.author} -<%}%> - -*Content-Type:* `${doc.contentType}` - -*Description:* ${doc.detail} - -<%if(isNotEmpty(doc.headers)){%> -*Request-headers:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Header | Type|Required|Description|Since -${doc.headers} -|==================== -<%}%> - - -<%if(isNotEmpty(doc.pathParams)){%> -*Path-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.pathParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.queryParams)){%> -*Query-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.queryParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.requestParams)){%> -*Body-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - - -<%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -*Request-example:* ----- -${doc.requestUsage} ----- -<%}%> -<%if(isNotEmpty(doc.responseParams)){%> -*Response-fields:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Field | Type|Description|Since -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${param.desc}|${param.version} -<%}%> -|==================== -<%}%> - - -<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -*Response-example:* ----- -${doc.responseUsage} ----- -<%}%> - -<% } %> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.md deleted file mode 100644 index 1b7341c6..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ApiDoc.md +++ /dev/null @@ -1,94 +0,0 @@ - -# ${desc} -<% -for(doc in list){ -%> -<%if(doc.deprecated){%> -## ~~${htmlEscape(doc.desc)}~~ -<%}else{%> -## ${htmlEscape(doc.desc)} -<%}%> - -**URL:** `${doc.url}` - -**Type:** `${doc.type}` - -<%if(isNotEmpty(doc.author)){%> -**Author:** ${doc.author} -<%}%> - -**Content-Type:** `${doc.contentType}` - -**Description:** ${doc.detail} - -<%if(isNotEmpty(doc.headers)){%> -**Request-headers:** - -| Header | Type | Required | Description | Since | -|--------|------|----------|-------------|-------| -${doc.headers} -<%}%> - -<%if(isNotEmpty(doc.pathParams)){%> -**Path-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.pathParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.queryParams)){%> -**Query-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.queryParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.requestParams)){%> -**Body-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -**Request-example:** -``` -${doc.requestUsage} -``` -<%}%> -<%if(isNotEmpty(doc.responseParams)){%> - -**Response-fields:** - -| Field | Type | Description | Since | -|-------|------|-------------|-------| -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -**Response-example:** -``` -${doc.responseUsage} -``` -<%}%> - -<% } %> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/Dictionary.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/Dictionary.md deleted file mode 100644 index c56baa7a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/Dictionary.md +++ /dev/null @@ -1,16 +0,0 @@ -<%if(isNotEmpty(dictList)){%> -# ${dictListTitle!"Data Dictionaries"} -<% -for(dict in dictList){ -%> -## ${dict.title} - -| Code | Type | Description | -|------|------|-------------| -<% -for(dataDict in dict.dataDictList){ -%> -|${dataDict.value}|${dataDict.type}|${htmlEscape(dataDict.desc)}| -<%}%> -<%}%> -<%}%> \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.adoc b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.adoc deleted file mode 100644 index 0f188173..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.adoc +++ /dev/null @@ -1,12 +0,0 @@ -# Error code list - -[width="100%",options="header"] -[stripes=even] -|==================== -|Error code |Description -<% -for(error in list){ -%> -|${error.value}|${error.desc} -<%}%> -|==================== \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.md deleted file mode 100644 index 511cce25..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/ErrorCodeList.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Error code list - -| Error code | Description | -|------------|-------------| -<% -for(error in list){ -%> -|${error.value}|${htmlEscape(error.desc)}| -<%}%> \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/HtmlApiDoc.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/HtmlApiDoc.html deleted file mode 100644 index bb567d2d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/HtmlApiDoc.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - ${title} - - -
- ${html} -
- Generated by smart-doc at ${createTime} - Suggestions, contact, support and error reporting on - Gitee or - Github - -
-
- - \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/AllInOne.css b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/AllInOne.css deleted file mode 100644 index 50f226c8..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/AllInOne.css +++ /dev/null @@ -1,4401 +0,0 @@ -article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { - display: block -} - -audio, canvas, video { - display: inline-block -} - -audio:not([controls]) { - display: none; - height: 0 -} - -[hidden], template { - display: none -} - -script { - display: none !important -} - -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100% -} - -a { - background: transparent -} - -a:focus { - outline: thin dotted -} - -a:active, a:hover { - outline: 0 -} - -h1 { - font-size: 2em; - margin: .67em 0 -} - -abbr[title] { - border-bottom: 1px dotted -} - -b, strong { - font-weight: bold -} - -dfn { - font-style: italic -} - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0 -} - -mark { - background: #ff0; - color: #000 -} - -code, kbd, pre, samp { - font-family: monospace; - font-size: 1em -} - -pre { - white-space: pre-wrap -} - -q { - quotes: "\201C" "\201D" "\2018" "\2019" -} - -small { - font-size: 80% -} - -sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline -} - -sup { - top: -.5em -} - -sub { - bottom: -.25em -} - -img { - border: 0 -} - -svg:not(:root) { - overflow: hidden -} - -figure { - margin: 0 -} - -fieldset { - border: 1px solid silver; - margin: 0 2px; - padding: .35em .625em .75em -} - -legend { - border: 0; - padding: 0 -} - -button, input, select, textarea { - font-family: inherit; - font-size: 100%; - margin: 0 -} - -button, input { - line-height: normal -} - -button, select { - text-transform: none -} - -button, html input[type="button"], input[type="reset"], input[type="submit"] { - -webkit-appearance: button; - cursor: pointer -} - -button[disabled], html input[disabled] { - cursor: default -} - -input[type="checkbox"], input[type="radio"] { - box-sizing: border-box; - padding: 0 -} - -input[type="search"] { - -webkit-appearance: textfield; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box -} - -input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none -} - -button::-moz-focus-inner, input::-moz-focus-inner { - border: 0; - padding: 0 -} - -textarea { - overflow: auto; - vertical-align: top -} - -table { - border-collapse: collapse; - border-spacing: 0 -} - -*, *:before, *:after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box -} - -html, body { - font-size: 100% -} - -body { - background: #fff; - color: rgba(0, 0, 0, .8); - padding: 0; - margin: 0; - font-family: "Noto Serif", "DejaVu Serif", serif; - font-weight: 400; - font-style: normal; - line-height: 1; - position: relative; - cursor: auto; - tab-size: 4; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased -} - -a:hover { - cursor: pointer -} - -img, object, embed { - max-width: 100%; - height: auto -} - -object, embed { - height: 100% -} - -img { - -ms-interpolation-mode: bicubic -} - -.left { - float: left !important -} - -.right { - float: right !important -} - -.text-left { - text-align: left !important -} - -.text-right { - text-align: right !important -} - -.text-center { - text-align: center !important -} - -.text-justify { - text-align: justify !important -} - -.hide { - display: none -} - -img, object, svg { - display: inline-block; - vertical-align: middle -} - -textarea { - height: auto; - min-height: 50px -} - -select { - width: 100% -} - -.center { - margin-left: auto; - margin-right: auto -} - -.spread { - width: 100% -} - -p.lead, .paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { - font-size: 1.21875em; - line-height: 1.6 -} - -.subheader, .admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { - line-height: 1.45; - color: #7a2518; - font-weight: 400; - margin-top: 0; - margin-bottom: .25em -} - -div, dl, dt, dd, ul, ol, li, h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6, pre, form, p, blockquote, th, td { - margin: 0; - padding: 0; - direction: ltr -} - -a { - color: #364149; - text-decoration: underline; - line-height: inherit -} - -a:hover, a:focus { - color: #364149 -} - -a img { - border: 0 -} - -p { - font-family: inherit; - font-weight: 400; - font-size: 1em; - line-height: 1.6; - margin-bottom: 0.3em; - text-rendering: optimizeLegibility -} - -p aside { - font-size: .875em; - line-height: 1.35; - font-style: italic -} - -h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - font-family: "Open Sans", "DejaVu Sans", sans-serif; - font-weight: 300; - font-style: normal; - color: #359905; - text-rendering: optimizeLegibility; - margin-top: 1em; - margin-bottom: .5em; - line-height: 1.0125em -} - -h1 small, h2 small, h3 small, #toctitle small, .sidebarblock > .content > .title small, h4 small, h5 small, h6 small { - font-size: 60%; - color: #e99b8f; - line-height: 0 -} - -h1 { - font-size: 2.125em -} - -h2 { - font-size: 1.6875em -} - -h3, #toctitle, .sidebarblock > .content > .title { - font-size: 1.375em -} - -h4, h5 { - font-size: 1.125em -} - -h6 { - font-size: 1em -} - -hr { - border: solid #ddddd8; - border-width: 1px 0 0; - clear: both; - margin: 1.25em 0 1.1875em; - height: 0 -} - -em, i { - font-style: italic; - line-height: inherit -} - -strong, b { - font-weight: bold; - line-height: inherit -} - -small { - font-size: 60%; - line-height: inherit -} - -code { - font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace; - font-weight: 400; - color: rgba(0, 0, 0, .9) -} - -ul, ol, dl { - font-size: 1em; - line-height: 1.6; - margin-bottom: 1.25em; - list-style-position: outside; - font-family: inherit -} - -ul, ol { - margin-left: 1.5em -} - -ul li ul, ul li ol { - margin-left: 1.25em; - margin-bottom: 0; - font-size: 1em -} - -ul.square li ul, ul.circle li ul, ul.disc li ul { - list-style: inherit -} - -ul.square { - list-style-type: square -} - -ul.circle { - list-style-type: circle -} - -ul.disc { - list-style-type: disc -} - -ol li ul, ol li ol { - margin-left: 1.25em; - margin-bottom: 0 -} - -dl dt { - margin-bottom: .3125em; - font-weight: bold -} - -dl dd { - margin-bottom: 1.25em -} - -abbr, acronym { - text-transform: uppercase; - font-size: 90%; - color: rgba(0, 0, 0, .8); - border-bottom: 1px dotted #ddd; - cursor: help -} - -abbr { - text-transform: none -} - -blockquote { - margin: 0 0 1.25em; - padding: .5625em 1.25em 0 1.1875em; - border-left: 1px solid #ddd -} - -blockquote cite { - display: block; - font-size: .9375em; - color: rgba(0, 0, 0, .6) -} - -blockquote cite:before { - content: "\2014 \0020" -} - -blockquote cite a, blockquote cite a:visited { - color: rgba(0, 0, 0, .6) -} - -blockquote, blockquote p { - line-height: 1.6; - color: rgba(0, 0, 0, .85) -} - -@media only screen and (min-width: 768px) { - h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - line-height: 1.2 - } - - h1 { - font-size: 2.75em - } - - h2 { - font-size: 2.3125em - } - - h3, #toctitle, .sidebarblock > .content > .title { - font-size: 1.6875em - } - - h4 { - font-size: 1.4375em - } -} - -table { - background: #fff; - margin-bottom: 1.25em; - border: solid 1px #dedede -} - -table thead, table tfoot { - background: #f7f8f7; - font-weight: bold -} - -table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td { - padding: .5em .625em .625em; - font-size: inherit; - color: rgba(0, 0, 0, .8); - text-align: left -} - -table tr th, table tr td { - padding: .5625em .625em; - font-size: inherit; - color: rgba(0, 0, 0, .8) -} - -table tr.even, table tr.alt, table tr:nth-of-type(even) { - background: #f8f8f7 -} - -table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { - display: table-cell; - line-height: 1.6 -} - -h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - line-height: 1.2; - word-spacing: -.05em -} - -h1 strong, h2 strong, h3 strong, #toctitle strong, .sidebarblock > .content > .title strong, h4 strong, h5 strong, h6 strong { - font-weight: 400 -} - -.clearfix:before, .clearfix:after, .float-group:before, .float-group:after { - content: " "; - display: table -} - -.clearfix:after, .float-group:after { - clear: both -} - -*:not(pre) > code { - font-size: .9375em; - font-style: normal !important; - letter-spacing: 0; - padding: .1em .5ex; - word-spacing: -.15em; - background-color: #f7f7f8; - -webkit-border-radius: 4px; - border-radius: 4px; - line-height: 1.45; - text-rendering: optimizeSpeed; - word-wrap: break-word -} - -*:not(pre) > code.nobreak { - word-wrap: normal -} - -*:not(pre) > code.nowrap { - white-space: nowrap -} - -pre, pre > code { - line-height: 1.45; - color: rgba(0, 0, 0, .9); - font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace; - font-weight: 400; - text-rendering: optimizeSpeed -} - -em em { - font-style: normal -} - -strong strong { - font-weight: 400 -} - -.keyseq { - color: rgba(51, 51, 51, .8) -} - -kbd { - font-family: "Droid Sans Mono", "DejaVu Sans Mono", monospace; - display: inline-block; - color: rgba(0, 0, 0, .8); - font-size: .65em; - line-height: 1.45; - background-color: #f7f7f7; - border: 1px solid #ccc; - -webkit-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em white inset; - box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em #fff inset; - margin: 0 .15em; - padding: .2em .5em; - vertical-align: middle; - position: relative; - top: -.1em; - white-space: nowrap -} - -.keyseq kbd:first-child { - margin-left: 0 -} - -.keyseq kbd:last-child { - margin-right: 0 -} - -.menuseq, .menuref { - color: #000 -} - -.menuseq b:not(.caret), .menuref { - font-weight: inherit -} - -.menuseq { - word-spacing: -.02em -} - -.menuseq b.caret { - font-size: 1.25em; - line-height: .8 -} - -.menuseq i.caret { - font-weight: bold; - text-align: center; - width: .45em -} - -b.button:before, b.button:after { - position: relative; - top: -1px; - font-weight: 400 -} - -b.button:before { - content: "["; - padding: 0 3px 0 2px -} - -b.button:after { - content: "]"; - padding: 0 2px 0 3px -} - -p a > code:hover { - color: rgba(0, 0, 0, .9) -} - -#header, #content, #footnotes, #footer { - width: 100%; - margin-left: auto; - margin-right: auto; - margin-top: 0; - margin-bottom: 0; - max-width: 62.5em; - *zoom: 1; - position: relative; - padding-left: .9375em; - padding-right: .9375em -} - -#header:before, #header:after, #content:before, #content:after, #footnotes:before, #footnotes:after, #footer:before, #footer:after { - content: " "; - display: table -} - -#header:after, #content:after, #footnotes:after, #footer:after { - clear: both -} - -#content { - margin-top: 1.25em -} - -#content:before { - content: none -} - -#header > h1:first-child { - color: rgba(0, 0, 0, .85); - margin-top: 2.25rem; - margin-bottom: 0 -} - -#header > h1:first-child + #toc { - margin-top: 8px; - border-top: 1px solid #ddddd8 -} - -#header > h1:only-child, body.toc2 #header > h1:nth-last-child(2) { - border-bottom: 1px solid #ddddd8; - padding-bottom: 8px -} - -#header .details { - border-bottom: 1px solid #ddddd8; - line-height: 1.45; - padding-top: .25em; - padding-bottom: .25em; - padding-left: .25em; - color: rgba(0, 0, 0, .6); - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - -ms-flex-flow: row wrap; - -webkit-flex-flow: row wrap; - flex-flow: row wrap -} - -#header .details span:first-child { - margin-left: -.125em -} - -#header .details span.email a { - color: rgba(0, 0, 0, .85) -} - -#header .details br { - display: none -} - -#header .details br + span:before { - content: "\00a0\2013\00a0" -} - -#header .details br + span.author:before { - content: "\00a0\22c5\00a0"; - color: rgba(0, 0, 0, .85) -} - -#header .details br + span#revremark:before { - content: "\00a0|\00a0" -} - -#header #revnumber { - text-transform: capitalize -} - -#header #revnumber:after { - content: "\00a0" -} - -#content > h1:first-child:not([class]) { - color: rgba(0, 0, 0, .85); - border-bottom: 1px solid #ddddd8; - padding-bottom: 8px; - margin-top: 0; - padding-top: 1rem; - margin-bottom: 1.25rem -} - -#toc { - border-bottom: 1px solid #efefed; - padding-bottom: .5em -} - -#toc > ul { - margin-left: .125em; - padding-left: 1.25em -} - -#toc ul.sectlevel0 > li > a { - font-style: italic -} - -#toc ul.sectlevel0 ul.sectlevel1 { - margin: .5em 0 -} - -#toc ul { - font-family: "Open Sans", "DejaVu Sans", sans-serif; - list-style-type: none -} - -#toc li { - line-height: 1.3334; - /*margin-top: .3334em;*/ - margin-top: 0; - padding-bottom: 4px; - padding-top: 4px -} - -#toc a { - text-decoration: none -} - -#toc a:active { - text-decoration: underline -} - -#toctitle { - color: #7a2518; - font-size: 1.2em -} - -@media only screen and (min-width: 768px) { - #toctitle { - font-size: 1.375em - } - - body.toc2 { - padding-left: 15em; - padding-right: 0 - } - - #toc.toc2 { - margin-top: 0 !important; - background-color: #f8f8f7; - position: fixed; - width: 15em; - left: 0; - top: 0; - border-right: 1px solid #efefed; - border-top-width: 0 !important; - border-bottom-width: 0 !important; - z-index: 1000; - #padding: 1.25em 1em; - height: 100%; - overflow: auto - } - - #toc.toc2 #toctitle { - margin-top: 0; - margin-bottom: .8rem; - font-size: 1.2em - } - - #toc.toc2 > ul { - font-size: .9em; - margin-bottom: 0 - } - - #toc.toc2 ul ul { - margin-left: 0; - padding-left: 1em - } - - #toc.toc2 ul.sectlevel0 ul.sectlevel1 { - padding-left: 0; - margin-top: .5em; - margin-bottom: .5em - } - - body.toc2.toc-right { - padding-left: 0; - padding-right: 15em - } - - body.toc2.toc-right #toc.toc2 { - border-right-width: 0; - border-left: 1px solid #efefed; - left: auto; - right: 0 - } -} - -@media only screen and (min-width: 1280px) { - body.toc2 { - padding-left: 20em; - padding-right: 0 - } - - #toc.toc2 { - width: 20em - } - - #toc.toc2 #toctitle { - border-bottom: 1px solid rgba(0, 0, 0, .07); - padding-top: 20px; - padding-bottom: 15px - } - - #toc.toc2 #toctitle span { - padding-left: 1.25em; - padding-bottom: 15px - } - - #toc.toc2 > ul { - font-size: .95em - } - - #toc.toc2 ul ul { - padding-left: 1.25em - } - - body.toc2.toc-right { - padding-left: 0; - padding-right: 20em - } -} - -#content #toc { - border-style: solid; - border-width: 1px; - border-color: #e0e0dc; - margin-bottom: 1.25em; - padding: 1.25em; - background: #f8f8f7; - -webkit-border-radius: 4px; - border-radius: 4px -} - -#content #toc > :first-child { - margin-top: 0 -} - -#content #toc > :last-child { - margin-bottom: 0 -} - -#footer { - max-width: 100%; - background-color: rgba(0, 0, 0, .8); - padding: 1.25em -} - -#footer-text { - color: rgba(255, 255, 255, .8); - line-height: 1.44 -} - -.sect1 { - padding-bottom: .625em -} - -@media only screen and (min-width: 768px) { - .sect1 { - padding-bottom: 1.25em - } -} - -.sect1 + .sect1 { - border-top: 1px solid #efefed -} - -#content h1 > a.anchor, h2 > a.anchor, h3 > a.anchor, #toctitle > a.anchor, .sidebarblock > .content > .title > a.anchor, h4 > a.anchor, h5 > a.anchor, h6 > a.anchor { - position: absolute; - z-index: 1001; - width: 1.5ex; - margin-left: -1.5ex; - display: block; - text-decoration: none !important; - visibility: hidden; - text-align: center; - font-weight: 400 -} - -#content h1 > a.anchor:before, h2 > a.anchor:before, h3 > a.anchor:before, #toctitle > a.anchor:before, .sidebarblock > .content > .title > a.anchor:before, h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before { - content: "\00A7"; - font-size: .85em; - display: block; - padding-top: .1em -} - -#content h1:hover > a.anchor, #content h1 > a.anchor:hover, h2:hover > a.anchor, h2 > a.anchor:hover, h3:hover > a.anchor, #toctitle:hover > a.anchor, .sidebarblock > .content > .title:hover > a.anchor, h3 > a.anchor:hover, #toctitle > a.anchor:hover, .sidebarblock > .content > .title > a.anchor:hover, h4:hover > a.anchor, h4 > a.anchor:hover, h5:hover > a.anchor, h5 > a.anchor:hover, h6:hover > a.anchor, h6 > a.anchor:hover { - visibility: visible -} - -#content h1 > a.link, h2 > a.link, h3 > a.link, #toctitle > a.link, .sidebarblock > .content > .title > a.link, h4 > a.link, h5 > a.link, h6 > a.link { - color: #359905; - text-decoration: none -} - -#content h1 > a.link:hover, h2 > a.link:hover, h3 > a.link:hover, #toctitle > a.link:hover, .sidebarblock > .content > .title > a.link:hover, h4 > a.link:hover, h5 > a.link:hover, h6 > a.link:hover { - color: #a53221 -} - -.audioblock, .imageblock, .literalblock, .listingblock, .stemblock, .videoblock { - margin-bottom: 1.25em -} - -.admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { - text-rendering: optimizeLegibility; - text-align: left; - font-family: "Consolas", "Noto Serif", "DejaVu Serif", serif; - font-size: 1rem; - font-style: italic -} - -table.tableblock > caption.title { - white-space: nowrap; - overflow: visible; - max-width: 0 -} - -.paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { - color: rgba(0, 0, 0, .85) -} - -table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { - font-size: inherit -} - -.admonitionblock > table { - border-collapse: separate; - border: 0; - background: 0; - width: 100% -} - -.admonitionblock > table td.icon { - text-align: center; - width: 80px -} - -.admonitionblock > table td.icon img { - max-width: initial -} - -.admonitionblock > table td.icon .title { - font-weight: bold; - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - text-transform: uppercase -} - -.admonitionblock > table td.content { - padding-left: 1.125em; - padding-right: 1.25em; - border-left: 1px solid #ddddd8; - color: rgba(0, 0, 0, .6) -} - -.admonitionblock > table td.content > :last-child > :last-child { - margin-bottom: 0 -} - -.exampleblock > .content { - border-style: solid; - border-width: 1px; - border-color: #e6e6e6; - margin-bottom: 1.25em; - padding: 1.25em; - background: #fff; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.exampleblock > .content > :first-child { - margin-top: 0 -} - -.exampleblock > .content > :last-child { - margin-bottom: 0 -} - -.sidebarblock { - border-style: solid; - border-width: 1px; - border-color: #e0e0dc; - margin-bottom: 1.25em; - padding: 1.25em; - background: #f8f8f7; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.sidebarblock > :first-child { - margin-top: 0 -} - -.sidebarblock > :last-child { - margin-bottom: 0 -} - -.sidebarblock > .content > .title { - color: #7a2518; - margin-top: 0; - text-align: center -} - -.exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child, .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { - margin-bottom: 0 -} - -.literalblock pre, .listingblock pre:not(.highlight), .listingblock pre[class="highlight"], .listingblock pre[class^="highlight "], .listingblock pre.CodeRay, .listingblock pre.prettyprint { - background: #f7f7f8 -} - -.sidebarblock .literalblock pre, .sidebarblock .listingblock pre:not(.highlight), .sidebarblock .listingblock pre[class="highlight"], .sidebarblock .listingblock pre[class^="highlight "], .sidebarblock .listingblock pre.CodeRay, .sidebarblock .listingblock pre.prettyprint { - background: #f2f1f1 -} - -.literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - -webkit-border-radius: 4px; - border-radius: 4px; - word-wrap: break-word; - padding: 1em; - font-size: .8125em -} - -.literalblock pre.nowrap, .literalblock pre[class].nowrap, .listingblock pre.nowrap, .listingblock pre[class].nowrap { - overflow-x: auto; - white-space: pre; - word-wrap: normal -} - -@media only screen and (min-width: 768px) { - .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - font-size: .90625em - } -} - -@media only screen and (min-width: 1280px) { - .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - font-size: 1em - } -} - -.literalblock.output pre { - color: #f7f7f8; - background-color: rgba(0, 0, 0, .9) -} - -.listingblock pre.highlightjs { - padding: 0 -} - -.listingblock pre.highlightjs > code { - padding: 1em; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.listingblock pre.prettyprint { - border-width: 0 -} - -.listingblock > .content { - position: relative -} - -.listingblock code[data-lang]:before { - display: none; - content: attr(data-lang); - position: absolute; - font-size: .75em; - top: .425rem; - right: .5rem; - line-height: 1; - text-transform: uppercase; - color: #999 -} - -.listingblock:hover code[data-lang]:before { - display: block -} - -.listingblock.terminal pre .command:before { - content: attr(data-prompt); - padding-right: .5em; - color: #999 -} - -.listingblock.terminal pre .command:not([data-prompt]):before { - content: "$" -} - -table.pyhltable { - border-collapse: separate; - border: 0; - margin-bottom: 0; - background: 0 -} - -table.pyhltable td { - vertical-align: top; - padding-top: 0; - padding-bottom: 0; - line-height: 1.45 -} - -table.pyhltable td.code { - padding-left: .75em; - padding-right: 0 -} - -pre.pygments .lineno, table.pyhltable td:not(.code) { - color: #999; - padding-left: 0; - padding-right: .5em; - border-right: 1px solid #ddddd8 -} - -pre.pygments .lineno { - display: inline-block; - margin-right: .25em -} - -table.pyhltable .linenodiv { - background: none !important; - padding-right: 0 !important -} - -.quoteblock { - margin: 0 1em 1.25em 1.5em; - display: table -} - -.quoteblock > .title { - margin-left: -1.5em; - margin-bottom: .75em -} - -.quoteblock blockquote, .quoteblock blockquote p { - color: rgba(0, 0, 0, .85); - font-size: 1.15rem; - line-height: 1.75; - word-spacing: .1em; - letter-spacing: 0; - font-style: italic; - text-align: justify -} - -.quoteblock blockquote { - margin: 0; - padding: 0; - border: 0 -} - -.quoteblock blockquote:before { - content: "\201c"; - float: left; - font-size: 2.75em; - font-weight: bold; - line-height: .6em; - margin-left: -.6em; - color: #7a2518; - text-shadow: 0 1px 2px rgba(0, 0, 0, .1) -} - -.quoteblock blockquote > .paragraph:last-child p { - margin-bottom: 0 -} - -.quoteblock .attribution { - margin-top: .5em; - margin-right: .5ex; - text-align: right -} - -.quoteblock .quoteblock { - margin-left: 0; - margin-right: 0; - padding: .5em 0; - border-left: 3px solid rgba(0, 0, 0, .6) -} - -.quoteblock .quoteblock blockquote { - padding: 0 0 0 .75em -} - -.quoteblock .quoteblock blockquote:before { - display: none -} - -.verseblock { - margin: 0 1em 1.25em 1em -} - -.verseblock pre { - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans; - font-size: 1.15rem; - color: rgba(0, 0, 0, .85); - font-weight: 300; - text-rendering: optimizeLegibility -} - -.verseblock pre strong { - font-weight: 400 -} - -.verseblock .attribution { - margin-top: 1.25rem; - margin-left: .5ex -} - -.quoteblock .attribution, .verseblock .attribution { - font-size: .9375em; - line-height: 1.45; - font-style: italic -} - -.quoteblock .attribution br, .verseblock .attribution br { - display: none -} - -.quoteblock .attribution cite, .verseblock .attribution cite { - display: block; - letter-spacing: -.025em; - color: rgba(0, 0, 0, .6) -} - -.quoteblock.abstract { - margin: 0 0 1.25em 0; - display: block -} - -.quoteblock.abstract blockquote, .quoteblock.abstract blockquote p { - text-align: left; - word-spacing: 0 -} - -.quoteblock.abstract blockquote:before, .quoteblock.abstract blockquote p:first-of-type:before { - display: none -} - -table.tableblock { - max-width: 100%; - border-collapse: separate -} - -table.tableblock td > .paragraph:last-child p > p:last-child, table.tableblock th > p:last-child, table.tableblock td > p:last-child { - margin-bottom: 0 -} - -table.tableblock, th.tableblock, td.tableblock { - border: 0 solid #dedede -} - -table.grid-all > thead > tr > .tableblock, table.grid-all > tbody > tr > .tableblock { - border-width: 0 1px 1px 0 -} - -table.grid-all > tfoot > tr > .tableblock { - border-width: 1px 1px 0 0 -} - -table.grid-cols > * > tr > .tableblock { - border-width: 0 1px 0 0 -} - -table.grid-rows > thead > tr > .tableblock, table.grid-rows > tbody > tr > .tableblock { - border-width: 0 0 1px 0 -} - -table.grid-rows > tfoot > tr > .tableblock { - border-width: 1px 0 0 0 -} - -table.grid-all > * > tr > .tableblock:last-child, table.grid-cols > * > tr > .tableblock:last-child { - border-right-width: 0 -} - -table.grid-all > tbody > tr:last-child > .tableblock, table.grid-all > thead:last-child > tr > .tableblock, table.grid-rows > tbody > tr:last-child > .tableblock, table.grid-rows > thead:last-child > tr > .tableblock { - border-bottom-width: 0 -} - -table.frame-all { - border-width: 1px -} - -table.frame-sides { - border-width: 0 1px -} - -table.frame-topbot { - border-width: 1px 0 -} - -th.halign-left, td.halign-left { - text-align: left -} - -th.halign-right, td.halign-right { - text-align: right -} - -th.halign-center, td.halign-center { - text-align: center -} - -th.valign-top, td.valign-top { - vertical-align: top -} - -th.valign-bottom, td.valign-bottom { - vertical-align: bottom -} - -th.valign-middle, td.valign-middle { - vertical-align: middle -} - -table thead th, table tfoot th { - font-weight: bold -} - -tbody tr th { - display: table-cell; - line-height: 1.6; - background: #f7f8f7 -} - -tbody tr th, tbody tr th p, tfoot tr th, tfoot tr th p { - color: rgba(0, 0, 0, .8); - font-weight: bold -} - -p.tableblock > code:only-child { - background: 0; - padding: 0 -} - -p.tableblock { - font-size: 1em -} - -td > div.verse { - white-space: pre -} - -ol { - margin-left: 1.75em -} - -ul li ol { - margin-left: 1.5em -} - -dl dd { - margin-left: 1.125em -} - -dl dd:last-child, dl dd:last-child > :last-child { - margin-bottom: 0 -} - -ol > li p, ul > li p, ul dd, ol dd, .olist .olist, .ulist .ulist, .ulist .olist, .olist .ulist { - margin-bottom: .625em -} - -ul.checklist, ul.none, ol.none, ul.no-bullet, ol.no-bullet, ol.unnumbered, ul.unstyled, ol.unstyled { - list-style-type: none -} - -ul.no-bullet, ol.no-bullet, ol.unnumbered { - margin-left: .625em -} - -ul.unstyled, ol.unstyled { - margin-left: 0 -} - -ul.checklist { - margin-left: .625em -} - -ul.checklist li > p:first-child > .fa-square-o:first-child, ul.checklist li > p:first-child > .fa-check-square-o:first-child { - width: 1.25em; - font-size: .8em; - position: relative; - bottom: .125em -} - -ul.checklist li > p:first-child > input[type="checkbox"]:first-child { - margin-right: .25em -} - -ul.inline { - margin: 0 auto .625em auto; - margin-left: -1.375em; - margin-right: 0; - padding: 0; - list-style: none; - overflow: hidden -} - -ul.inline > li { - list-style: none; - float: left; - margin-left: 1.375em; - display: block -} - -ul.inline > li > * { - display: block -} - -.unstyled dl dt { - font-weight: 400; - font-style: normal -} - -ol.arabic { - list-style-type: decimal -} - -ol.decimal { - list-style-type: decimal-leading-zero -} - -ol.loweralpha { - list-style-type: lower-alpha -} - -ol.upperalpha { - list-style-type: upper-alpha -} - -ol.lowerroman { - list-style-type: lower-roman -} - -ol.upperroman { - list-style-type: upper-roman -} - -ol.lowergreek { - list-style-type: lower-greek -} - -.hdlist > table, .colist > table { - border: 0; - background: 0 -} - -.hdlist > table > tbody > tr, .colist > table > tbody > tr { - background: 0 -} - -td.hdlist1, td.hdlist2 { - vertical-align: top; - padding: 0 .625em -} - -td.hdlist1 { - font-weight: bold; - padding-bottom: 1.25em -} - -.literalblock + .colist, .listingblock + .colist { - margin-top: -.5em -} - -.colist > table tr > td:first-of-type { - padding: .4em .75em 0 .75em; - line-height: 1; - vertical-align: top -} - -.colist > table tr > td:first-of-type img { - max-width: initial -} - -.colist > table tr > td:last-of-type { - padding: .25em 0 -} - -.thumb, .th { - line-height: 0; - display: inline-block; - border: solid 4px #fff; - -webkit-box-shadow: 0 0 0 1px #ddd; - box-shadow: 0 0 0 1px #ddd -} - -.imageblock.left, .imageblock[style*="float:left"] { - margin: .25em .625em 1.25em 0 -} - -.imageblock.right, .imageblock[style*="float:right"] { - margin: .25em 0 1.25em .625em -} - -.imageblock > .title { - margin-bottom: 0 -} - -.imageblock.thumb, .imageblock.th { - border-width: 6px -} - -.imageblock.thumb > .title, .imageblock.th > .title { - padding: 0 .125em -} - -.image.left, .image.right { - margin-top: .25em; - margin-bottom: .25em; - display: inline-block; - line-height: 0 -} - -.image.left { - margin-right: .625em -} - -.image.right { - margin-left: .625em -} - -a.image { - text-decoration: none; - display: inline-block -} - -a.image object { - pointer-events: none -} - -sup.footnote, sup.footnoteref { - font-size: .875em; - position: static; - vertical-align: super -} - -sup.footnote a, sup.footnoteref a { - text-decoration: none -} - -sup.footnote a:active, sup.footnoteref a:active { - text-decoration: underline -} - -#footnotes { - padding-top: .75em; - padding-bottom: .75em; - margin-bottom: .625em -} - -#footnotes hr { - width: 20%; - min-width: 6.25em; - margin: -.25em 0 .75em 0; - border-width: 1px 0 0 0 -} - -#footnotes .footnote { - padding: 0 .375em 0 .225em; - line-height: 1.3334; - font-size: .875em; - margin-left: 1.2em; - text-indent: -1.05em; - margin-bottom: .2em -} - -#footnotes .footnote a:first-of-type { - font-weight: bold; - text-decoration: none -} - -#footnotes .footnote:last-of-type { - margin-bottom: 0 -} - -#content #footnotes { - margin-top: -.625em; - margin-bottom: 0; - padding: .75em 0 -} - -.gist .file-data > table { - border: 0; - background: #fff; - width: 100%; - margin-bottom: 0 -} - -.gist .file-data > table td.line-data { - width: 99% -} - -div.unbreakable { - page-break-inside: avoid -} - -.big { - font-size: larger -} - -.small { - font-size: smaller -} - -.underline { - text-decoration: underline -} - -.overline { - text-decoration: overline -} - -.line-through { - text-decoration: line-through -} - -.aqua { - color: #00bfbf -} - -.aqua-background { - background-color: #00fafa -} - -.black { - color: #000 -} - -.black-background { - background-color: #000 -} - -.blue { - color: #0000bf -} - -.blue-background { - background-color: #0000fa -} - -.fuchsia { - color: #bf00bf -} - -.fuchsia-background { - background-color: #fa00fa -} - -.gray { - color: #606060 -} - -.gray-background { - background-color: #7d7d7d -} - -.green { - color: #006000 -} - -.green-background { - background-color: #007d00 -} - -.lime { - color: #00bf00 -} - -.lime-background { - background-color: #00fa00 -} - -.maroon { - color: #600000 -} - -.maroon-background { - background-color: #7d0000 -} - -.navy { - color: #000060 -} - -.navy-background { - background-color: #00007d -} - -.olive { - color: #606000 -} - -.olive-background { - background-color: #7d7d00 -} - -.purple { - color: #600060 -} - -.purple-background { - background-color: #7d007d -} - -.red { - color: #bf0000 -} - -.red-background { - background-color: #fa0000 -} - -.silver { - color: #909090 -} - -.silver-background { - background-color: #bcbcbc -} - -.teal { - color: #006060 -} - -.teal-background { - background-color: #007d7d -} - -.white { - color: #bfbfbf -} - -.white-background { - background-color: #fafafa -} - -.yellow { - color: #bfbf00 -} - -.yellow-background { - background-color: #fafa00 -} - -span.icon > .fa { - cursor: default -} - -a span.icon > .fa { - cursor: inherit -} - -.admonitionblock td.icon [class^="fa icon-"] { - font-size: 2.5em; - text-shadow: 1px 1px 2px rgba(0, 0, 0, .5); - cursor: default -} - -.admonitionblock td.icon .icon-note:before { - content: "\f05a"; - color: #19407c -} - -.admonitionblock td.icon .icon-tip:before { - content: "\f0eb"; - text-shadow: 1px 1px 2px rgba(155, 155, 0, .8); - color: #111 -} - -.admonitionblock td.icon .icon-warning:before { - content: "\f071"; - color: #bf6900 -} - -.admonitionblock td.icon .icon-caution:before { - content: "\f06d"; - color: #bf3400 -} - -.admonitionblock td.icon .icon-important:before { - content: "\f06a"; - color: #bf0000 -} - -.conum[data-value] { - display: inline-block; - color: #fff !important; - background-color: rgba(0, 0, 0, .8); - -webkit-border-radius: 100px; - border-radius: 100px; - text-align: center; - font-size: .75em; - width: 1.67em; - height: 1.67em; - line-height: 1.67em; - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - font-style: normal; - font-weight: bold -} - -.conum[data-value] * { - color: #fff !important -} - -.conum[data-value] + b { - display: none -} - -.conum[data-value]:after { - content: attr(data-value) -} - -pre .conum[data-value] { - position: relative; - top: -.125em -} - -b.conum * { - color: inherit !important -} - -.conum:not([data-value]):empty { - display: none -} - -dt, th.tableblock, td.content, div.footnote { - text-rendering: optimizeLegibility -} - -h1, h2, p, td.content, span.alt { - letter-spacing: -.01em -} - -p strong, td.content strong, div.footnote strong { - letter-spacing: -.005em -} - -p, blockquote, dt, td.content, span.alt { - /*font-size: 1.0rem*/ -} - -p { - margin-bottom: 1.25rem -} - -.sidebarblock p, .sidebarblock dt, .sidebarblock td.content, p.tableblock { - font-size: 1em -} - -.exampleblock > .content { - background-color: #fffef7; - border-color: #e0e0dc; - -webkit-box-shadow: 0 1px 4px #e0e0dc; - box-shadow: 0 1px 4px #e0e0dc -} - -.print-only { - display: none !important -} - -@media print { - @page { - margin: 1.25cm .75cm - } - - * { - -webkit-box-shadow: none !important; - box-shadow: none !important; - text-shadow: none !important - } - - a { - color: inherit !important; - text-decoration: underline !important - } - - a.bare, a[href^="#"], a[href^="mailto:"] { - text-decoration: none !important - } - - a[href^="http:"]:not(.bare):after, a[href^="https:"]:not(.bare):after { - content: "(" attr(href) ")"; - display: inline-block; - font-size: .875em; - padding-left: .25em - } - - abbr[title]:after { - content: " (" attr(title) ")" - } - - pre, blockquote, tr, img, object, svg { - page-break-inside: avoid - } - - thead { - display: table-header-group - } - - svg { - max-width: 100% - } - - p, blockquote, dt, td.content { - font-size: 1em; - orphans: 3; - widows: 3 - } - - h2, h3, #toctitle, .sidebarblock > .content > .title { - page-break-after: avoid - } - - #toc, .sidebarblock, .exampleblock > .content { - background: none !important - } - - #toc { - border-bottom: 1px solid #ddddd8 !important; - padding-bottom: 0 !important - } - - .sect1 { - padding-bottom: 0 !important - } - - .sect1 + .sect1 { - border: 0 !important - } - - #header > h1:first-child { - margin-top: 1.25rem - } - - body.book #header { - text-align: center - } - - body.book #header > h1:first-child { - border: 0 !important; - margin: 2.5em 0 1em 0 - } - - body.book #header .details { - border: 0 !important; - display: block; - padding: 0 !important - } - - body.book #header .details span:first-child { - margin-left: 0 !important - } - - body.book #header .details br { - display: block - } - - body.book #header .details br + span:before { - content: none !important - } - - body.book #toc { - border: 0 !important; - text-align: left !important; - padding: 0 !important; - margin: 0 !important - } - - body.book #toc, body.book #preamble, body.book h1.sect0, body.book .sect1 > h2 { - page-break-before: always - } - - .listingblock code[data-lang]:before { - display: block - } - - #footer { - background: none !important; - padding: 0 .9375em - } - - #footer-text { - color: rgba(0, 0, 0, .6) !important; - font-size: .9em - } - - .hide-on-print { - display: none !important - } - - .print-only { - display: block !important - } - - .hide-for-print { - display: none !important - } - - .show-for-print { - display: inherit !important - } -} - -#content .page-footer { - height: 100px; - border-top: 1px solid #ccc; - overflow: hidden; - padding: 10px 0; - font-size: 14px; - color: gray -} - -#content .footer-modification { - float: right -} - -#content .footer-modification a { - text-decoration: none -} - -.sectlevel2 { - display: none -} - -.submenu { - background: #e7e7e6 -} - -.submenu li { - border: 0 -} - -.submenu a { - color: #555 -} - -.checkbox { - position: relative; - height: 30px -} - -.checkbox input[type='checkbox'] { - position: absolute; - left: 0; - top: 0; - width: 20px; - height: 20px; - opacity: 0; - border-radius: 4px -} - -.checkbox label { - position: absolute; - left: 30px; - top: 0; - height: 20px; - line-height: 20px -} - -.checkbox label:before { - content: ''; - position: absolute; - left: -30px; - top: 2px; - width: 20px; - height: 20px; - border: 1px solid #ddd; - border-radius: 4px; - transition: all .3s ease; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease -} - -.checkbox label:after { - content: ''; - position: absolute; - left: -22px; - top: 3px; - width: 6px; - height: 12px; - border: 0; - border-right: 1px solid #fff; - border-bottom: 1px solid #fff; - border-radius: 2px; - transform: rotate(45deg); - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - transition: all .3s ease; - -webkit-transition: all .3s ease; - -moz-transition: all .3s ease -} - -.checkbox input[type='checkbox']:checked + label:before { - background: #4cd764; - border-color: #4cd764 -} - -.checkbox input[type='checkbox']:checked + label:after { - background: #4cd764 -} - -.send-button { - color: #fff; - background-color: #5cb85c; - display: inline-block; - padding: 6px 12px; - margin-bottom: 0; - font-size: 14px; - font-weight: 400; - line-height: 1.42857143; - text-align: center; - white-space: nowrap; - vertical-align: middle; - -ms-touch-action: manipulation; - touch-action: manipulation; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - background-image: none; - border: 1px solid transparent; - border-radius: 4px; - outline-color: transparent -} - -textarea { - width: 100%; - background-color: #f7f7f8; - border: 1px solid #f7f7f8; - border-radius: 4px; - font-size: 1em; - padding: 1em; - font-family: "Consolas", "Droid Sans Mono", "DejaVu Sans Mono", monospace; - outline-color: #dedede -} - -input { - border: 0; - background-color: transparent; - outline-color: transparent; - outline-style: dotted; - max-width: 100% -} - -#book-search-input { - padding: 13px; - background: 0; - transition: top .5s ease; - border-bottom: 1px solid rgba(0, 0, 0, .07); - border-top: 1px solid rgba(0, 0, 0, .07); - margin-top: -1px -} - -#book-search-input input, #book-search-input input:focus, #book-search-input input:hover { - width: 100%; - background: 0; - border: 1px solid transparent; - box-shadow: none; - outline: 0; - line-height: 22px; - padding: 7px 7px; - color: inherit -} - -[contenteditable="plaintext-only"]:focus { - border: 0; - outline: 0 -} - -article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { - display: block -} - -audio, canvas, video { - display: inline-block -} - -audio:not([controls]) { - display: none; - height: 0 -} - -[hidden], template { - display: none -} - -script { - display: none !important -} - -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100% -} - -a { - background: transparent -} - -a:focus { - outline: thin dotted -} - -a:active, a:hover { - outline: 0 -} - -h1 { - font-size: 2em; - margin: .67em 0 -} - -abbr[title] { - border-bottom: 1px dotted -} - -b, strong { - font-weight: bold -} - -dfn { - font-style: italic -} - -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0 -} - -mark { - background: #ff0; - color: #000 -} - -code, kbd, pre, samp { - font-family: monospace; - font-size: 1em -} - -pre { - white-space: pre-wrap -} - -q { - quotes: "\201C" "\201D" "\2018" "\2019" -} - -small { - font-size: 80% -} - -sub, sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline -} - -sup { - top: -.5em -} - -sub { - bottom: -.25em -} - -img { - border: 0 -} - -svg:not(:root) { - overflow: hidden -} - -figure { - margin: 0 -} - -fieldset { - border: 1px solid silver; - margin: 0 2px; - padding: .35em .625em .75em -} - -legend { - border: 0; - padding: 0 -} - -button, input, select, textarea { - font-family: inherit; - font-size: 100%; - margin: 0 -} - -button, input { - line-height: normal -} - -button, select { - text-transform: none -} - -button, html input[type="button"], input[type="reset"], input[type="submit"] { - -webkit-appearance: button; - cursor: pointer -} - -button[disabled], html input[disabled] { - cursor: default -} - -input[type="checkbox"], input[type="radio"] { - box-sizing: border-box; - padding: 0 -} - -input[type="search"] { - -webkit-appearance: textfield; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box -} - -input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none -} - -button::-moz-focus-inner, input::-moz-focus-inner { - border: 0; - padding: 0 -} - -textarea { - overflow: auto; - vertical-align: top -} - -table { - border-collapse: collapse; - border-spacing: 0 -} - -*, *:before, *:after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box -} - -html, body { - font-size: 100% -} - -body { - background: #fff; - color: rgba(0, 0, 0, .8); - padding: 0; - margin: 0; - font-family: "Consolas", "Noto Serif", "DejaVu Serif", serif; - font-weight: 400; - font-style: normal; - line-height: 1; - position: relative; - cursor: auto; - tab-size: 4; - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased -} - -a:hover { - cursor: pointer -} - -img, object, embed { - max-width: 100%; - height: auto -} - -object, embed { - height: 100% -} - -img { - -ms-interpolation-mode: bicubic -} - -.left { - float: left !important -} - -.right { - float: right !important -} - -.text-left { - text-align: left !important -} - -.text-right { - text-align: right !important -} - -.text-center { - text-align: center !important -} - -.text-justify { - text-align: justify !important -} - -.hide { - display: none -} - -img, object, svg { - display: inline-block; - vertical-align: middle -} - -textarea { - height: auto; - min-height: 50px -} - -select { - width: 100% -} - -.center { - margin-left: auto; - margin-right: auto -} - -.spread { - width: 100% -} - -p.lead, .paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { - font-size: 1.21875em; - line-height: 1.6 -} - -.subheader, .admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { - line-height: 1.45; - color: #7a2518; - font-weight: 400; - margin-top: 0; - margin-bottom: .25em -} - -div, dl, dt, dd, ul, ol, li, h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6, pre, form, p, blockquote, th, td { - margin: 0; - padding: 0; - direction: ltr -} - -a { - color: #364149; - text-decoration: underline; - line-height: inherit -} - -a:hover, a:focus { - color: #364149 -} - -a img { - border: 0 -} - -p { - font-family: inherit; - font-weight: 400; - font-size: 1em; - line-height: 1.6; - margin-bottom: 1.25em; - text-rendering: optimizeLegibility -} - -p aside { - font-size: .875em; - line-height: 1.35; - font-style: italic -} - -h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - font-weight: 300; - font-style: normal; - color: #359905; - text-rendering: optimizeLegibility; - margin-top: 1em; - margin-bottom: .5em; - line-height: 1.0125em -} - -h1 small, h2 small, h3 small, #toctitle small, .sidebarblock > .content > .title small, h4 small, h5 small, h6 small { - font-size: 60%; - color: #e99b8f; - line-height: 0 -} - -h1 { - font-size: 2.125em -} - -h2 { - font-size: 1.6875em -} - -h3, #toctitle, .sidebarblock > .content > .title { - font-size: 1.375em -} - -h4, h5 { - font-size: 1.125em -} - -h6 { - font-size: 1em -} - -hr { - border: solid #ddddd8; - border-width: 1px 0 0; - clear: both; - margin: 1.25em 0 1.1875em; - height: 0 -} - -em, i { - font-style: italic; - line-height: inherit -} - -strong, b { - font-weight: bold; - line-height: inherit -} - -small { - font-size: 60%; - line-height: inherit -} - -code { - font-family: "Consolas", "Droid Sans Mono", "DejaVu Sans Mono", monospace; - font-weight: 400; - color: rgba(0, 0, 0, .9) -} - -ul, ol, dl { - font-size: 1em; - line-height: 1.6; - margin-bottom: 1.25em; - list-style-position: outside; - font-family: inherit -} - -ul, ol { - margin-left: 1.5em -} - -ul li ul, ul li ol { - margin-left: 1.25em; - margin-bottom: 0; - font-size: 1em -} - -ul.square li ul, ul.circle li ul, ul.disc li ul { - list-style: inherit -} - -ul.square { - list-style-type: square -} - -ul.circle { - list-style-type: circle -} - -ul.disc { - list-style-type: disc -} - -ol li ul, ol li ol { - margin-left: 1.25em; - margin-bottom: 0 -} - -dl dt { - margin-bottom: .3125em; - font-weight: bold -} - -dl dd { - margin-bottom: 1.25em -} - -abbr, acronym { - text-transform: uppercase; - font-size: 90%; - color: rgba(0, 0, 0, .8); - border-bottom: 1px dotted #ddd; - cursor: help -} - -abbr { - text-transform: none -} - -blockquote { - margin: 0 0 1.25em; - padding: .5625em 1.25em 0 1.1875em; - border-left: 1px solid #ddd -} - -blockquote cite { - display: block; - font-size: .9375em; - color: rgba(0, 0, 0, .6) -} - -blockquote cite:before { - content: "\2014 \0020" -} - -blockquote cite a, blockquote cite a:visited { - color: rgba(0, 0, 0, .6) -} - -blockquote, blockquote p { - line-height: 1.6; - color: rgba(0, 0, 0, .85) -} - -@media only screen and (min-width: 768px) { - h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - line-height: 1.2 - } - - h1 { - font-size: 2.75em - } - - h2 { - font-size: 2.3125em - } - - h3, #toctitle, .sidebarblock > .content > .title { - font-size: 1.6875em - } - - h4 { - font-size: 1.4375em - } -} - -table { - background: #fff; - margin-bottom: 1.25em; - border: solid 1px #dedede -} - -table thead, table tfoot { - background: #f7f8f7; - font-weight: bold -} - -table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td { - padding: .5em .625em .625em; - font-size: inherit; - color: rgba(0, 0, 0, .8); - text-align: left -} - -table tr th, table tr td { - padding: .2625em .625em; - font-size: inherit; - color: rgba(0, 0, 0, .8) -} - -table tr.even, table tr.alt, table tr:nth-of-type(even) { - background: #f8f8f7 -} - -table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { - display: table-cell; - line-height: 1.6 -} - -h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { - line-height: 1.2; - word-spacing: -.05em -} - -h1 strong, h2 strong, h3 strong, #toctitle strong, .sidebarblock > .content > .title strong, h4 strong, h5 strong, h6 strong { - font-weight: 400 -} - -.clearfix:before, .clearfix:after, .float-group:before, .float-group:after { - content: " "; - display: table -} - -.clearfix:after, .float-group:after { - clear: both -} - -*:not(pre) > code { - font-size: .9375em; - font-style: normal !important; - letter-spacing: 0; - padding: .1em .5ex; - word-spacing: -.15em; - background-color: #f7f7f8; - -webkit-border-radius: 4px; - border-radius: 4px; - line-height: 1.45; - text-rendering: optimizeSpeed; - word-wrap: break-word -} - -*:not(pre) > code.nobreak { - word-wrap: normal -} - -*:not(pre) > code.nowrap { - white-space: nowrap -} - -pre, pre > code { - line-height: 1.2; - color: rgba(0, 0, 0, .9); - font-family: "Consolas", "Droid Sans Mono", "DejaVu Sans Mono", monospace; - font-weight: 400; - font-size: 14px; - text-rendering: optimizeSpeed -} - -em em { - font-style: normal -} - -strong strong { - font-weight: 400 -} - -.keyseq { - color: rgba(51, 51, 51, .8) -} - -kbd { - font-family: "Consolas", "Droid Sans Mono", "DejaVu Sans Mono", monospace; - display: inline-block; - color: rgba(0, 0, 0, .8); - font-size: .65em; - line-height: 1.45; - background-color: #f7f7f7; - border: 1px solid #ccc; - -webkit-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em white inset; - box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 0 0 .1em #fff inset; - margin: 0 .15em; - padding: .2em .5em; - vertical-align: middle; - position: relative; - top: -.1em; - white-space: nowrap -} - -.keyseq kbd:first-child { - margin-left: 0 -} - -.keyseq kbd:last-child { - margin-right: 0 -} - -.menuseq, .menuref { - color: #000 -} - -.menuseq b:not(.caret), .menuref { - font-weight: inherit -} - -.menuseq { - word-spacing: -.02em -} - -.menuseq b.caret { - font-size: 1.25em; - line-height: .8 -} - -.menuseq i.caret { - font-weight: bold; - text-align: center; - width: .45em -} - -b.button:before, b.button:after { - position: relative; - top: -1px; - font-weight: 400 -} - -b.button:before { - content: "["; - padding: 0 3px 0 2px -} - -b.button:after { - content: "]"; - padding: 0 2px 0 3px -} - -p a > code:hover { - color: rgba(0, 0, 0, .9) -} - -#header, #content, #footnotes, #footer { - width: 100%; - margin-left: auto; - margin-right: auto; - margin-top: 0; - margin-bottom: 0; - max-width: 62.5em; - *zoom: 1; - position: relative; - padding-left: .9375em; - padding-right: .9375em -} - -#header:before, #header:after, #content:before, #content:after, #footnotes:before, #footnotes:after, #footer:before, #footer:after { - content: " "; - display: table -} - -#header:after, #content:after, #footnotes:after, #footer:after { - clear: both -} - -#content { - margin-top: 1.25em -} - -#content:before { - content: none -} - -#header > h1:first-child { - color: rgba(0, 0, 0, .85); - margin-top: 2.25rem; - margin-bottom: 0 -} - -#header > h1:first-child + #toc { - margin-top: 8px; - border-top: 1px solid #ddddd8 -} - -#header > h1:only-child, body.toc2 #header > h1:nth-last-child(2) { - border-bottom: 1px solid #ddddd8; - padding-bottom: 8px -} - -#header .details { - border-bottom: 1px solid #ddddd8; - line-height: 1.45; - padding-top: .25em; - padding-bottom: .25em; - padding-left: .25em; - color: rgba(0, 0, 0, .6); - display: -ms-flexbox; - display: -webkit-flex; - display: flex; - -ms-flex-flow: row wrap; - -webkit-flex-flow: row wrap; - flex-flow: row wrap -} - -#header .details span:first-child { - margin-left: -.125em -} - -#header .details span.email a { - color: rgba(0, 0, 0, .85) -} - -#header .details br { - display: none -} - -#header .details br + span:before { - content: "\00a0\2013\00a0" -} - -#header .details br + span.author:before { - content: "\00a0\22c5\00a0"; - color: rgba(0, 0, 0, .85) -} - -#header .details br + span#revremark:before { - content: "\00a0|\00a0" -} - -#header #revnumber { - text-transform: capitalize -} - -#header #revnumber:after { - content: "\00a0" -} - -#content > h1:first-child:not([class]) { - color: rgba(0, 0, 0, .85); - border-bottom: 1px solid #ddddd8; - padding-bottom: 8px; - margin-top: 0; - padding-top: 1rem; - margin-bottom: 1.25rem -} - -#toc { - border-bottom: 1px solid #efefed; - padding-bottom: .5em -} - -#toc > ul { - margin-left: .125em; - padding-left: 1.25em -} - -#toc ul.sectlevel0 > li > a { - font-style: italic -} - -#toc ul.sectlevel0 ul.sectlevel1 { - margin: .5em 0 -} - -#toc ul { - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - list-style-type: none -} - -#toc li { - line-height: 1.3334; - margin-top: .3334em; - padding-bottom: 4px; - padding-top: 4px -} - -#toc a { - text-decoration: none -} - -#toc a:active { - text-decoration: underline -} - -#toctitle { - color: #7a2518; - font-size: 1.2em -} - -@media only screen and (min-width: 768px) { - #toctitle { - font-size: 1.375em - } - - body.toc2 { - padding-left: 15em; - padding-right: 0 - } - - #toc.toc2 { - margin-top: 0 !important; - background-color: #f8f8f7; - position: fixed; - width: 15em; - left: 0; - top: 0; - border-right: 1px solid #efefed; - border-top-width: 0 !important; - border-bottom-width: 0 !important; - z-index: 1000; - #padding: 1.25em 1em; - height: 100%; - overflow: auto - } - - #toc.toc2 #toctitle { - margin-top: 0; - margin-bottom: .8rem; - font-size: 1.2em - } - - #toc.toc2 > ul { - font-size: .9em; - margin-bottom: 0 - } - - #toc.toc2 ul ul { - margin-left: 0; - padding-left: 1em - } - - #toc.toc2 ul.sectlevel0 ul.sectlevel1 { - padding-left: 0; - margin-top: .5em; - margin-bottom: .5em - } - - body.toc2.toc-right { - padding-left: 0; - padding-right: 15em - } - - body.toc2.toc-right #toc.toc2 { - border-right-width: 0; - border-left: 1px solid #efefed; - left: auto; - right: 0 - } -} - -@media only screen and (min-width: 1280px) { - body.toc2 { - padding-left: 20em; - padding-right: 0 - } - - #toc.toc2 { - width: 20em - } - - #toc.toc2 #toctitle { - font-size: 1.375em; - border-bottom: 1px solid rgba(0, 0, 0, .07); - padding-top: 20px; - padding-bottom: 15px - } - - #toc.toc2 #toctitle span { - padding-left: 1.25em; - padding-bottom: 15px - } - - #toc.toc2 > ul { - font-size: .95em - } - - #toc.toc2 ul ul { - padding-left: 1.25em - } - - body.toc2.toc-right { - padding-left: 0; - padding-right: 20em - } -} - -#content #toc { - border-style: solid; - border-width: 1px; - border-color: #e0e0dc; - margin-bottom: 1.25em; - padding: 1.25em; - background: #f8f8f7; - -webkit-border-radius: 4px; - border-radius: 4px -} - -#content #toc > :first-child { - margin-top: 0 -} - -#content #toc > :last-child { - margin-bottom: 0 -} - -#footer { - max-width: 100%; - background-color: rgba(0, 0, 0, .8); - padding: 1.25em -} - -#footer-text { - color: rgba(255, 255, 255, .8); - line-height: 1.44 -} - -.sect1 { - padding-bottom: .625em -} - -@media only screen and (min-width: 768px) { - .sect1 { - padding-bottom: 1.25em - } -} - -.sect1 + .sect1 { - border-top: 1px solid #efefed -} - -#content h1 > a.anchor, h2 > a.anchor, h3 > a.anchor, #toctitle > a.anchor, .sidebarblock > .content > .title > a.anchor, h4 > a.anchor, h5 > a.anchor, h6 > a.anchor { - position: absolute; - z-index: 1001; - width: 1.5ex; - margin-left: -1.5ex; - display: block; - text-decoration: none !important; - visibility: hidden; - text-align: center; - font-weight: 400 -} - -#content h1 > a.anchor:before, h2 > a.anchor:before, h3 > a.anchor:before, #toctitle > a.anchor:before, .sidebarblock > .content > .title > a.anchor:before, h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before { - content: "\00A7"; - font-size: .85em; - display: block; - padding-top: .1em -} - -#content h1:hover > a.anchor, #content h1 > a.anchor:hover, h2:hover > a.anchor, h2 > a.anchor:hover, h3:hover > a.anchor, #toctitle:hover > a.anchor, .sidebarblock > .content > .title:hover > a.anchor, h3 > a.anchor:hover, #toctitle > a.anchor:hover, .sidebarblock > .content > .title > a.anchor:hover, h4:hover > a.anchor, h4 > a.anchor:hover, h5:hover > a.anchor, h5 > a.anchor:hover, h6:hover > a.anchor, h6 > a.anchor:hover { - visibility: visible -} - -#content h1 > a.link, h2 > a.link, h3 > a.link, #toctitle > a.link, .sidebarblock > .content > .title > a.link, h4 > a.link, h5 > a.link, h6 > a.link { - color: #359905; - text-decoration: none -} - -#content h1 > a.link:hover, h2 > a.link:hover, h3 > a.link:hover, #toctitle > a.link:hover, .sidebarblock > .content > .title > a.link:hover, h4 > a.link:hover, h5 > a.link:hover, h6 > a.link:hover { - color: #359905 -} - -.audioblock, .imageblock, .literalblock, .listingblock, .stemblock, .videoblock { - margin-bottom: 1.25em -} - -.admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { - text-rendering: optimizeLegibility; - text-align: left; - font-family: "Consolas", "Noto Serif", "DejaVu Serif", serif; - font-size: 1rem; - font-style: italic -} - -table.tableblock > caption.title { - white-space: nowrap; - overflow: visible; - max-width: 0 -} - -.paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { - color: rgba(0, 0, 0, .85) -} - -table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { - font-size: inherit -} - -.admonitionblock > table { - border-collapse: separate; - border: 0; - background: 0; - width: 100% -} - -.admonitionblock > table td.icon { - text-align: center; - width: 80px -} - -.admonitionblock > table td.icon img { - max-width: initial -} - -.admonitionblock > table td.icon .title { - font-weight: bold; - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - text-transform: uppercase -} - -.admonitionblock > table td.content { - padding-left: 1.125em; - padding-right: 1.25em; - border-left: 1px solid #ddddd8; - color: rgba(0, 0, 0, .6) -} - -.admonitionblock > table td.content > :last-child > :last-child { - margin-bottom: 0 -} - -.exampleblock > .content { - border-style: solid; - border-width: 1px; - border-color: #e6e6e6; - margin-bottom: 1.25em; - padding: 1.25em; - background: #fff; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.exampleblock > .content > :first-child { - margin-top: 0 -} - -.exampleblock > .content > :last-child { - margin-bottom: 0 -} - -.sidebarblock { - border-style: solid; - border-width: 1px; - border-color: #e0e0dc; - margin-bottom: 1.25em; - padding: 1.25em; - background: #f8f8f7; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.sidebarblock > :first-child { - margin-top: 0 -} - -.sidebarblock > :last-child { - margin-bottom: 0 -} - -.sidebarblock > .content > .title { - color: #7a2518; - margin-top: 0; - text-align: center -} - -.exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child, .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { - margin-bottom: 0 -} - -.literalblock pre, .listingblock pre:not(.highlight), .listingblock pre[class="highlight"], .listingblock pre[class^="highlight "], .listingblock pre.CodeRay, .listingblock pre.prettyprint { - background: #f7f7f8 -} - -.sidebarblock .literalblock pre, .sidebarblock .listingblock pre:not(.highlight), .sidebarblock .listingblock pre[class="highlight"], .sidebarblock .listingblock pre[class^="highlight "], .sidebarblock .listingblock pre.CodeRay, .sidebarblock .listingblock pre.prettyprint { - background: #f2f1f1 -} - -.literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - -webkit-border-radius: 4px; - border-radius: 4px; - word-wrap: break-word; - padding: 1em; - font-size: .8125em -} - -.literalblock pre.nowrap, .literalblock pre[class].nowrap, .listingblock pre.nowrap, .listingblock pre[class].nowrap { - overflow-x: auto; - white-space: pre; - word-wrap: normal -} - -@media only screen and (min-width: 768px) { - .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - font-size: .90625em - } -} - -@media only screen and (min-width: 1280px) { - .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { - font-size: 1em - } -} - -.literalblock.output pre { - color: #f7f7f8; - background-color: rgba(0, 0, 0, .9) -} - -.listingblock pre.highlightjs { - padding: 0 -} - -.listingblock pre.highlightjs > code { - padding: 1em; - -webkit-border-radius: 4px; - border-radius: 4px -} - -.listingblock pre.prettyprint { - border-width: 0 -} - -.listingblock > .content { - position: relative -} - -.listingblock code[data-lang]:before { - display: none; - content: attr(data-lang); - position: absolute; - font-size: .75em; - top: .425rem; - right: .5rem; - line-height: 1; - text-transform: uppercase; - color: #999 -} - -.listingblock:hover code[data-lang]:before { - display: block -} - -.listingblock.terminal pre .command:before { - content: attr(data-prompt); - padding-right: .5em; - color: #999 -} - -.listingblock.terminal pre .command:not([data-prompt]):before { - content: "$" -} - -table.pyhltable { - border-collapse: separate; - border: 0; - margin-bottom: 0; - background: 0 -} - -table.pyhltable td { - vertical-align: top; - padding-top: 0; - padding-bottom: 0; - line-height: 1.45 -} - -table.pyhltable td.code { - padding-left: .75em; - padding-right: 0 -} - -pre.pygments .lineno, table.pyhltable td:not(.code) { - color: #999; - padding-left: 0; - padding-right: .5em; - border-right: 1px solid #ddddd8 -} - -pre.pygments .lineno { - display: inline-block; - margin-right: .25em -} - -table.pyhltable .linenodiv { - background: none !important; - padding-right: 0 !important -} - -.quoteblock { - margin: 0 1em 1.25em 1.5em; - display: table -} - -.quoteblock > .title { - margin-left: -1.5em; - margin-bottom: .75em -} - -.quoteblock blockquote, .quoteblock blockquote p { - color: rgba(0, 0, 0, .85); - font-size: 1.15rem; - line-height: 1.75; - word-spacing: .1em; - letter-spacing: 0; - font-style: italic; - text-align: justify -} - -.quoteblock blockquote { - margin: 0; - padding: 0; - border: 0 -} - -.quoteblock blockquote:before { - content: "\201c"; - float: left; - font-size: 2.75em; - font-weight: bold; - line-height: .6em; - margin-left: -.6em; - color: #7a2518; - text-shadow: 0 1px 2px rgba(0, 0, 0, .1) -} - -.quoteblock blockquote > .paragraph:last-child p { - margin-bottom: 0 -} - -.quoteblock .attribution { - margin-top: .5em; - margin-right: .5ex; - text-align: right -} - -.quoteblock .quoteblock { - margin-left: 0; - margin-right: 0; - padding: .5em 0; - border-left: 3px solid rgba(0, 0, 0, .6) -} - -.quoteblock .quoteblock blockquote { - padding: 0 0 0 .75em -} - -.quoteblock .quoteblock blockquote:before { - display: none -} - -.verseblock { - margin: 0 1em 1.25em 1em -} - -.verseblock pre { - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans; - font-size: 1.15rem; - color: rgba(0, 0, 0, .85); - font-weight: 300; - text-rendering: optimizeLegibility -} - -.verseblock pre strong { - font-weight: 400 -} - -.verseblock .attribution { - margin-top: 1.25rem; - margin-left: .5ex -} - -.quoteblock .attribution, .verseblock .attribution { - font-size: .9375em; - line-height: 1.45; - font-style: italic -} - -.quoteblock .attribution br, .verseblock .attribution br { - display: none -} - -.quoteblock .attribution cite, .verseblock .attribution cite { - display: block; - letter-spacing: -.025em; - color: rgba(0, 0, 0, .6) -} - -.quoteblock.abstract { - margin: 0 0 1.25em 0; - display: block -} - -.quoteblock.abstract blockquote, .quoteblock.abstract blockquote p { - text-align: left; - word-spacing: 0 -} - -.quoteblock.abstract blockquote:before, .quoteblock.abstract blockquote p:first-of-type:before { - display: none -} - -table.tableblock { - max-width: 100%; - border-collapse: separate -} - -table.tableblock td > .paragraph:last-child p > p:last-child, table.tableblock th > p:last-child, table.tableblock td > p:last-child { - margin-bottom: 0 -} - -table.tableblock, th.tableblock, td.tableblock { - border: 0 solid #dedede -} - -table.grid-all > thead > tr > .tableblock, table.grid-all > tbody > tr > .tableblock { - border-width: 0 1px 1px 0 -} - -table.grid-all > tfoot > tr > .tableblock { - border-width: 1px 1px 0 0 -} - -table.grid-cols > * > tr > .tableblock { - border-width: 0 1px 0 0 -} - -table.grid-rows > thead > tr > .tableblock, table.grid-rows > tbody > tr > .tableblock { - border-width: 0 0 1px 0 -} - -table.grid-rows > tfoot > tr > .tableblock { - border-width: 1px 0 0 0 -} - -table.grid-all > * > tr > .tableblock:last-child, table.grid-cols > * > tr > .tableblock:last-child { - border-right-width: 0 -} - -table.grid-all > tbody > tr:last-child > .tableblock, table.grid-all > thead:last-child > tr > .tableblock, table.grid-rows > tbody > tr:last-child > .tableblock, table.grid-rows > thead:last-child > tr > .tableblock { - border-bottom-width: 0 -} - -table.frame-all { - border-width: 1px -} - -table.frame-sides { - border-width: 0 1px -} - -table.frame-topbot { - border-width: 1px 0 -} - -th.halign-left, td.halign-left { - text-align: left -} - -th.halign-right, td.halign-right { - text-align: right -} - -th.halign-center, td.halign-center { - text-align: center -} - -th.valign-top, td.valign-top { - vertical-align: top -} - -th.valign-bottom, td.valign-bottom { - vertical-align: bottom -} - -th.valign-middle, td.valign-middle { - vertical-align: middle -} - -table thead th, table tfoot th { - font-weight: bold -} - -tbody tr th { - display: table-cell; - line-height: 1.6; - background: #f7f8f7 -} - -tbody tr th, tbody tr th p, tfoot tr th, tfoot tr th p { - color: rgba(0, 0, 0, .8); - font-weight: bold -} - -p.tableblock > code:only-child { - background: 0; - padding: 0 -} - -p.tableblock { - font-size: 1em -} - -td > div.verse { - white-space: pre -} - -ol { - margin-left: 1.75em -} - -ul li ol { - margin-left: 1.5em -} - -dl dd { - margin-left: 1.125em -} - -dl dd:last-child, dl dd:last-child > :last-child { - margin-bottom: 0 -} - -ol > li p, ul > li p, ul dd, ol dd, .olist .olist, .ulist .ulist, .ulist .olist, .olist .ulist { - margin-bottom: .625em -} - -ul.checklist, ul.none, ol.none, ul.no-bullet, ol.no-bullet, ol.unnumbered, ul.unstyled, ol.unstyled { - list-style-type: none -} - -ul.no-bullet, ol.no-bullet, ol.unnumbered { - margin-left: .625em -} - -ul.unstyled, ol.unstyled { - margin-left: 0 -} - -ul.checklist { - margin-left: .625em -} - -ul.checklist li > p:first-child > .fa-square-o:first-child, ul.checklist li > p:first-child > .fa-check-square-o:first-child { - width: 1.25em; - font-size: .8em; - position: relative; - bottom: .125em -} - -ul.checklist li > p:first-child > input[type="checkbox"]:first-child { - margin-right: .25em -} - -ul.inline { - margin: 0 auto .625em auto; - margin-left: -1.375em; - margin-right: 0; - padding: 0; - list-style: none; - overflow: hidden -} - -ul.inline > li { - list-style: none; - float: left; - margin-left: 1.375em; - display: block -} - -ul.inline > li > * { - display: block -} - -.unstyled dl dt { - font-weight: 400; - font-style: normal -} - -ol.arabic { - list-style-type: decimal -} - -ol.decimal { - list-style-type: decimal-leading-zero -} - -ol.loweralpha { - list-style-type: lower-alpha -} - -ol.upperalpha { - list-style-type: upper-alpha -} - -ol.lowerroman { - list-style-type: lower-roman -} - -ol.upperroman { - list-style-type: upper-roman -} - -ol.lowergreek { - list-style-type: lower-greek -} - -.hdlist > table, .colist > table { - border: 0; - background: 0 -} - -.hdlist > table > tbody > tr, .colist > table > tbody > tr { - background: 0 -} - -td.hdlist1, td.hdlist2 { - vertical-align: top; - padding: 0 .625em -} - -td.hdlist1 { - font-weight: bold; - padding-bottom: 1.25em -} - -.literalblock + .colist, .listingblock + .colist { - margin-top: -.5em -} - -.colist > table tr > td:first-of-type { - padding: .4em .75em 0 .75em; - line-height: 1; - vertical-align: top -} - -.colist > table tr > td:first-of-type img { - max-width: initial -} - -.colist > table tr > td:last-of-type { - padding: .25em 0 -} - -.thumb, .th { - line-height: 0; - display: inline-block; - border: solid 4px #fff; - -webkit-box-shadow: 0 0 0 1px #ddd; - box-shadow: 0 0 0 1px #ddd -} - -.imageblock.left, .imageblock[style*="float:left"] { - margin: .25em .625em 1.25em 0 -} - -.imageblock.right, .imageblock[style*="float:right"] { - margin: .25em 0 1.25em .625em -} - -.imageblock > .title { - margin-bottom: 0 -} - -.imageblock.thumb, .imageblock.th { - border-width: 6px -} - -.imageblock.thumb > .title, .imageblock.th > .title { - padding: 0 .125em -} - -.image.left, .image.right { - margin-top: .25em; - margin-bottom: .25em; - display: inline-block; - line-height: 0 -} - -.image.left { - margin-right: .625em -} - -.image.right { - margin-left: .625em -} - -a.image { - text-decoration: none; - display: inline-block -} - -a.image object { - pointer-events: none -} - -sup.footnote, sup.footnoteref { - font-size: .875em; - position: static; - vertical-align: super -} - -sup.footnote a, sup.footnoteref a { - text-decoration: none -} - -sup.footnote a:active, sup.footnoteref a:active { - text-decoration: underline -} - -#footnotes { - padding-top: .75em; - padding-bottom: .75em; - margin-bottom: .625em -} - -#footnotes hr { - width: 20%; - min-width: 6.25em; - margin: -.25em 0 .75em 0; - border-width: 1px 0 0 0 -} - -#footnotes .footnote { - padding: 0 .375em 0 .225em; - line-height: 1.3334; - font-size: .875em; - margin-left: 1.2em; - text-indent: -1.05em; - margin-bottom: .2em -} - -#footnotes .footnote a:first-of-type { - font-weight: bold; - text-decoration: none -} - -#footnotes .footnote:last-of-type { - margin-bottom: 0 -} - -#content #footnotes { - margin-top: -.625em; - margin-bottom: 0; - padding: .75em 0 -} - -.gist .file-data > table { - border: 0; - background: #fff; - width: 100%; - margin-bottom: 0 -} - -.gist .file-data > table td.line-data { - width: 99% -} - -div.unbreakable { - page-break-inside: avoid -} - -.big { - font-size: larger -} - -.small { - font-size: smaller -} - -.underline { - text-decoration: underline -} - -.overline { - text-decoration: overline -} - -.line-through { - text-decoration: line-through -} - -.aqua { - color: #00bfbf -} - -.aqua-background { - background-color: #00fafa -} - -.black { - color: #000 -} - -.black-background { - background-color: #000 -} - -.blue { - color: #0000bf -} - -.blue-background { - background-color: #0000fa -} - -.fuchsia { - color: #bf00bf -} - -.fuchsia-background { - background-color: #fa00fa -} - -.gray { - color: #606060 -} - -.gray-background { - background-color: #7d7d7d -} - -.green { - color: #006000 -} - -.green-background { - background-color: #007d00 -} - -.lime { - color: #00bf00 -} - -.lime-background { - background-color: #00fa00 -} - -.maroon { - color: #600000 -} - -.maroon-background { - background-color: #7d0000 -} - -.navy { - color: #000060 -} - -.navy-background { - background-color: #00007d -} - -.olive { - color: #606000 -} - -.olive-background { - background-color: #7d7d00 -} - -.purple { - color: #600060 -} - -.purple-background { - background-color: #7d007d -} - -.red { - color: #bf0000 -} - -.red-background { - background-color: #fa0000 -} - -.silver { - color: #909090 -} - -.silver-background { - background-color: #bcbcbc -} - -.teal { - color: #006060 -} - -.teal-background { - background-color: #007d7d -} - -.white { - color: #bfbfbf -} - -.white-background { - background-color: #fafafa -} - -.yellow { - color: #bfbf00 -} - -.yellow-background { - background-color: #fafa00 -} - -span.icon > .fa { - cursor: default -} - -a span.icon > .fa { - cursor: inherit -} - -.admonitionblock td.icon [class^="fa icon-"] { - font-size: 2.5em; - text-shadow: 1px 1px 2px rgba(0, 0, 0, .5); - cursor: default -} - -.admonitionblock td.icon .icon-note:before { - content: "\f05a"; - color: #19407c -} - -.admonitionblock td.icon .icon-tip:before { - content: "\f0eb"; - text-shadow: 1px 1px 2px rgba(155, 155, 0, .8); - color: #111 -} - -.admonitionblock td.icon .icon-warning:before { - content: "\f071"; - color: #bf6900 -} - -.admonitionblock td.icon .icon-caution:before { - content: "\f06d"; - color: #bf3400 -} - -.admonitionblock td.icon .icon-important:before { - content: "\f06a"; - color: #bf0000 -} - -.conum[data-value] { - display: inline-block; - color: #fff !important; - background-color: rgba(0, 0, 0, .8); - -webkit-border-radius: 100px; - border-radius: 100px; - text-align: center; - font-size: .75em; - width: 1.67em; - height: 1.67em; - line-height: 1.67em; - font-family: "Consolas", "Open Sans", "DejaVu Sans", sans-serif; - font-style: normal; - font-weight: bold -} - -.conum[data-value] * { - color: #fff !important -} - -.conum[data-value] + b { - display: none -} - -.conum[data-value]:after { - content: attr(data-value) -} - -pre .conum[data-value] { - position: relative; - top: -.125em -} - -b.conum * { - color: inherit !important -} - -.conum:not([data-value]):empty { - display: none -} - -dt, th.tableblock, td.content, div.footnote { - text-rendering: optimizeLegibility -} - -h1, h2, p, td.content, span.alt { - letter-spacing: -.01em -} - -p strong, td.content strong, div.footnote strong { - letter-spacing: -.005em -} - -p, blockquote, dt, td.content, span.alt { - /*font-size: 1.0625rem*/ -} - -p { - margin-bottom: .25rem -} - -.sidebarblock p, .sidebarblock dt, .sidebarblock td.content, p.tableblock { - font-size: 1em -} - -.exampleblock > .content { - background-color: #fffef7; - border-color: #e0e0dc; - -webkit-box-shadow: 0 1px 4px #e0e0dc; - box-shadow: 0 1px 4px #e0e0dc -} - -.print-only { - display: none !important -} - -@media print { - @page { - margin: 1.25cm .75cm - } - - * { - -webkit-box-shadow: none !important; - box-shadow: none !important; - text-shadow: none !important - } - - a { - color: inherit !important; - text-decoration: underline !important - } - - a.bare, a[href^="#"], a[href^="mailto:"] { - text-decoration: none !important - } - - a[href^="http:"]:not(.bare):after, a[href^="https:"]:not(.bare):after { - content: "(" attr(href) ")"; - display: inline-block; - font-size: .875em; - padding-left: .25em - } - - abbr[title]:after { - content: " (" attr(title) ")" - } - - pre, blockquote, tr, img, object, svg { - page-break-inside: avoid - } - - thead { - display: table-header-group - } - - svg { - max-width: 100% - } - - p, blockquote, dt, td.content { - font-size: 1em; - orphans: 3; - widows: 3 - } - - h2, h3, #toctitle, .sidebarblock > .content > .title { - page-break-after: avoid - } - - #toc, .sidebarblock, .exampleblock > .content { - background: none !important - } - - #toc { - border-bottom: 1px solid #ddddd8 !important; - padding-bottom: 0 !important - } - - .sect1 { - padding-bottom: 0 !important - } - - .sect1 + .sect1 { - border: 0 !important - } - - #header > h1:first-child { - margin-top: 1.25rem - } - - body.book #header { - text-align: center - } - - body.book #header > h1:first-child { - border: 0 !important; - margin: 2.5em 0 1em 0 - } - - body.book #header .details { - border: 0 !important; - display: block; - padding: 0 !important - } - - body.book #header .details span:first-child { - margin-left: 0 !important - } - - body.book #header .details br { - display: block - } - - body.book #header .details br + span:before { - content: none !important - } - - body.book #toc { - border: 0 !important; - text-align: left !important; - padding: 0 !important; - margin: 0 !important - } - - body.book #toc, body.book #preamble, body.book h1.sect0, body.book .sect1 > h2 { - page-break-before: always - } - - .listingblock code[data-lang]:before { - display: block - } - - #footer { - background: none !important; - padding: 0 .9375em - } - - #footer-text { - color: rgba(0, 0, 0, .6) !important; - font-size: .9em - } - - .hide-on-print { - display: none !important - } - - .print-only { - display: block !important - } - - .hide-for-print { - display: none !important - } - - .show-for-print { - display: inherit !important - } -} - -#content .page-footer { - height: 100px; - border-top: 1px solid #ccc; - overflow: hidden; - padding: 10px 0; - font-size: 14px; - color: gray -} - -#content .footer-modification { - float: right -} - -#content .footer-modification a { - text-decoration: none -} - -.sectlevel2 { - display: none -} - -.submenu { - background: #e7e7e6 -} - -.submenu li { - border: 0 -} - -.submenu a { - color: #555 -} - -.copyright { - text-align: right; - padding-top: 1.25em -} - -#toTop { - display: none; - position: fixed; - bottom: 10px; - right: 0; - width: 44px; - height: 44px; - border-radius: 50%; - background-color: #ced4ce; - cursor: pointer; - text-align: center -} - -#upArrow { - position: absolute; - left: 24%; - right: 0; - bottom: 19%; - transition: .3s ease-in-out; - display: block -} - -#upText { - position: absolute; - left: 0; - right: 0; - bottom: 0; - font-size: 16px; - font-weight: 600; - line-height: 45px; - display: none; - transition: .3s ease-in-out; - -webkit-box-align: center -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/font.css b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/font.css deleted file mode 100644 index 3c85d80a..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/font.css +++ /dev/null @@ -1,6 +0,0 @@ -@font-face{font-family:'Droid Sans Mono';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/droidsansmono/v19/6NUO8FuJNQ2MbkrZ5-J8lKFrp7pRef2r.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImZzC7TMQ.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImbjC7TMQ.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImZjC7TMQ.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImaTC7TMQ.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImZTC7TMQ.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImZDC7TMQ.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Kaw1J5X9T9RW6j9bNfFImajC7.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWufuVMCoY.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWud-VMCoY.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWuf-VMCoY.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWucOVMCoY.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWufOVMCoY.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWufeVMCoY.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Noto Serif';font-style:italic;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Vaw1J5X9T9RW6j9bNfFIu0RWuc-VM.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFoWaCi_.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F} -@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFMWaCi_.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFsWaCi_.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFQWaCi_.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFgWaCi_.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFkWaCi_.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:400;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Iaw1J5X9T9RW6j9bNfFcWaA.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfRqecf1I.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfROecf1I.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfRuecf1I.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfRSecf1I.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfRiecf1I.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfRmecf1I.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Noto Serif';font-style:normal;font-weight:700;src:url(https://fonts.gstatic.com/s/notoserif/v20/ga6Law1J5X9T9RW6j9bNdOwzfReecQ.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWV0ewJER.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVQewJER.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVwewJER.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVMewJER.woff2) format('woff2');unicode-range:U+0370-03FF} -@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVIewJER.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWV8ewJER.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWV4ewJER.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAewA.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWV0ewJER.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVQewJER.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVwewJER.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVMewJER.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVIewJER.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWV8ewJER.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWV4ewJER.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAewA.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWV0ewJER.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWVQewJER.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116} -@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWVwewJER.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWVMewJER.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWVIewJER.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWV8ewJER.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWV4ewJER.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjWVAewA.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4taVIGxA.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4kaVIGxA.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4saVIGxA.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4jaVIGxA.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4iaVIGxA.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4vaVIGxA.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4uaVIGxA.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVI.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} -@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4taVIGxA.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4kaVIGxA.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4saVIGxA.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4jaVIGxA.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4iaVIGxA.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4vaVIGxA.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4uaVIGxA.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVI.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4taVIGxA.woff2) format('woff2');unicode-range:U+0460-052F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4kaVIGxA.woff2) format('woff2');unicode-range:U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4saVIGxA.woff2) format('woff2');unicode-range:U+1F00-1FFF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4jaVIGxA.woff2) format('woff2');unicode-range:U+0370-03FF}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4iaVIGxA.woff2) format('woff2');unicode-range:U+0590-05FF,U+200C-2010,U+20AA,U+25CC,U+FB1D-FB4F}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4vaVIGxA.woff2) format('woff2');unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4uaVIGxA.woff2) format('woff2');unicode-range:U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF} -@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-stretch:normal;src:url(https://fonts.gstatic.com/s/opensans/v28/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1x4gaVI.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/xt256.min.css b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/xt256.min.css deleted file mode 100644 index d860d115..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/css/xt256.min.css +++ /dev/null @@ -1 +0,0 @@ -.hljs{display:block;overflow-x:auto;color:#eaeaea;background:#000;padding:.5em}.hljs-subst{color:#eaeaea}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-builtin-name,.hljs-type{color:#eaeaea}.hljs-params{color:#da0000}.hljs-literal,.hljs-name,.hljs-number{color:red;font-weight:bolder}.hljs-comment{color:#969896}.hljs-quote,.hljs-selector-id{color:#0ff}.hljs-template-variable,.hljs-title,.hljs-variable{color:#0ff;font-weight:700}.hljs-keyword,.hljs-selector-class,.hljs-symbol{color:#fff000}.hljs-bullet,.hljs-string{color:#0f0}.hljs-section,.hljs-tag{color:#000fff}.hljs-selector-tag{color:#000fff;font-weight:700}.hljs-attribute,.hljs-built_in,.hljs-link,.hljs-regexp{color:#f0f}.hljs-meta{color:#fff;font-weight:bolder} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/debug-all.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/debug-all.html deleted file mode 100644 index d2745eeb..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/debug-all.html +++ /dev/null @@ -1,726 +0,0 @@ - - - - - - - <%if(isNotEmpty(projectName)){%> - ${projectName} - <%}else{%> - API 接口文档 - <%}%> - - - <%if(isNotEmpty(highlightCssLink)){%> - - <%}%> - - - - - - - -
- <%if(isNotEmpty(revisionLogList)){%> -
-
- - - - - - - - - - - - - - - - - - - <%for(revisionLog in revisionLogList){%> - - - - - - - - - - - - <%}%> - -
版本号修改时间说明
-

${revisionLog.version}

-
-

${revisionLog.revisionTime}

-
-

${htmlEscape(revisionLog.remarks)}

-
-
-
- <%}%> - <%for(apiGroup in apiDocList){%> - <%if(!apiDocListOnlyHasDefaultGroup){%> -

- - ${apiGroup.order}. ${htmlEscape(apiGroup.name)} -

- <%}%> - <%for(api in apiGroup.childrenApiDocs){%> -
-

- - - <%if(!apiDocListOnlyHasDefaultGroup){%>${apiGroup.order}.${api.order}. ${htmlEscape(api.desc)} - <%}else{%>${api.order}. ${htmlEscape(api.desc)} - <%}%> - -

-
- <%for(doc in api.list){%> -
-

- - <%if(doc.deprecated){%> - - <%if(!apiDocListOnlyHasDefaultGroup){%>${apiGroup.order}.${api.order}.${doc.order}.  - <%}else{%>${api.order}.${doc.order}.  - <%}%> - ${htmlEscape(doc.desc)} - - <%}else{%> - - <%if(!apiDocListOnlyHasDefaultGroup){%>${apiGroup.order}.${api.order}.${doc.order}. ${htmlEscape(doc.desc)} - <%}else{%>${api.order}.${doc.order}. ${htmlEscape(doc.desc)} - <%}%> - - <%}%> -

-
-

- URL: -  ${doc.url} -

-
-
-

- Type: ${doc.type} -

-
- <%if(isNotEmpty(doc.author)){%> -
-

- Author: ${doc.author} -

-
- <%}%> - - - - - -
-

- 接口说明: ${htmlEscape(doc.detail)} -

-
- <%if(isNotEmpty(doc.requestHeaders)&&displayRequestParams){%> -
-

- 请求头(RequestHeaders)说明: -

-
- - - - - - - - - - - - - - - - - - - - - <%for(header in doc.requestHeaders){%> - - - - - - - - - - - <%}%> - -
-
- - -
-
HeaderValueRequiredDescription
-
- - -
-
-

${header.name}

-
-

- -

-

${header.required}

-
-

${htmlEscape(header.desc)}

-
- <%}%> - <%if(isNotEmpty(doc.pathParams)&&displayRequestParams){%> -
-

- Path-parameters: -

-
- - - - - - - - - - - - - - - - - - - - - <%for(param in doc.pathParams){%> - - - - - - - - - <%}%> - -
-
- - -
-
ParameterValueTypeRequiredDescription
-
- - -
-
-

${param.field}

-
-

- -

-
-

${param.type}

-
-

${param.required}

-
-

${param.desc}

-
- <%}%> - <%if(isNotEmpty(doc.queryParams)&&displayRequestParams){%> -
-

- 请求链接(QueryParams)参数说明: -

-
- - - - - - - - - - - - - - - - - - - - - <%for(param in doc.queryParams){%> - - - - - - - <%if(param.version!='-'){%> - - <%}else{%> - - <%}%> - - <%}%> - -
-
- - -
-
ParameterValueTypeRequiredDescription
-
- - -
-
-

${param.field}

-
-

- <%if(param.type=="file"&&!param.hasItems){%> - - <%}else if(param.type=="file"&¶m.hasItems){%> - - <%}else{%> - - <%}%> -

-
-

${param.type}

-
-

${param.required}

-
-

${param.desc}@since ${param.version}

-
-

${param.desc}

-
- <%}%> - <%if(isNotEmpty(doc.requestParams)&&displayRequestParams){%> -
-

- 请求体(RequestBody)参数说明: -

-
- - - - - - - - - - - - - - - - - <%for(param in doc.requestParams){%> - - - - - <%if(param.version!='-'){%> - - <%}else{%> - - <%}%> - - <%}%> - -
字段名字段类型字段说明是否必填
-

${param.field}

-
-

${param.type}

-
-

${param.required}

-
-

${param.desc}@since ${param.version}

-
-

${param.desc}

-
- <%}%> - <%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%> -
-

- 请求体(RequestBody)参数说明: -

-
-
-
-
${doc.requestExample.jsonBody}
-
-
- <%}%> - <%if(isNotEmpty(doc.responseParams)&&displayResponseParams){%> -
-

- 响应字段(ResponseBody)说明: -

-
- - - - - - - - - - - - - - - - - <%for(param in doc.responseParams){%> - - - - - - - - - <%}%> - -
字段名字段类型字段说明
-

${param.field}

-
-

${param.type}

-
-

${param.desc}

-
- <%}%> -
-

- - - - -

-
- <%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -
-

- 响应示例: -

-
-
-
-
${doc.responseUsage}
-
-
- <%}%> - <%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -
-

- Curl请求示例: -

-
-
-
-
${doc.requestUsage}
-
-
- <%}%> -
- <%}%> -
-
- <%}%> - <%}%> - <%if(isNotEmpty(errorCodeList)){%> -
-

- - ${errorCodeListOrder}. ${errorListTitle} -

-
- - - - - - - - - - - - - <%for(error in errorCodeList){%> - - - - - <%}%> - -
错误码字段说明
-

${error.value}

-
-

${htmlEscape(error.desc)}

-
-
-
- <%}%> - <%if(isNotEmpty(dictList)){%> -
-

- - ${dictListOrder}. ${dictListTitle} -

-
- <%for(dict in dictList){%> -
-

- - ${dictListOrder}.${dict.order}. ${htmlEscape(dict.title)} -

- - - - - - - - - - - - - - - <%for(dataDict in dict.dataDictList){%> - - - - - - <%}%> - -
字典值数据类型字典说明
-

${dataDict.value}

-
-

${dataDict.type}

-
-

${htmlEscape(dataDict.desc)}

-
-
- <%}%> -
-
- <%}%> -
- Generated by smart-doc at ${createTime} - Suggestions,contact,support and error reporting on Gitee or Github - -
-
- - Top -
-
- - - - - \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.adoc b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.adoc deleted file mode 100644 index 14d14930..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.adoc +++ /dev/null @@ -1,60 +0,0 @@ - -= ${desc} - -*URI:* ${uri} - -*Service:* ${name} - -*Protocol:* ${protocol} - -*Author:* ${author} - -*Version:* ${version} -<% -for(doc in list){ -%> -<%if(doc.deprecated){%> -== ~~${htmlEscape(doc.desc)}~~ -<%}else{%> -## ${htmlEscape(doc.desc)} -<%}%> - -*Definition:* ${doc.methodDefinition} - -<%if(isNotEmpty(doc.author)){%> -*Author:* ${doc.author} -<%}%> - -*Description:* ${doc.detail} - -<%if(isNotEmpty(doc.requestParams)){%> -*Invoke-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type|Required|Description|Since -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${htmlEscape(param.desc)}|${param.version} -<%}%> -|==================== -<%}%> - -<%if(isNotEmpty(doc.responseParams)){%> -*Response-fields:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Field | Type|Description|Since -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${htmlEscape(param.desc)}|${param.version} -<%}%> -|==================== -<%}%> - -<% } %> \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.md deleted file mode 100644 index e1fce31f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/Dubbo.md +++ /dev/null @@ -1,60 +0,0 @@ -# ${htmlEscape(desc)} - -**URI:** ${uri} - -**Service:** ${name} - -**Protocol:** ${protocol} - -**Author:** ${author} - -**Version:** ${version} -<% -for(doc in list){ -%> -<%if(doc.deprecated){%> - -## ~~${htmlEscape(doc.desc)}~~ - -<%}else{%> - -## ${htmlEscape(doc.desc)} - -<%}%> - -**Definition:** ${doc.methodDefinition} - -<%if(isNotEmpty(doc.author)){%> -**Author:** ${doc.author} -<%}%> - -**Description:** ${doc.detail} - -<%if(isNotEmpty(doc.requestParams)){%> -**Invoke-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% -for(param in doc.requestParams){ -%> -|${param.field}|${param.type}|${param.required}|${htmlEscape(param.desc)}|${param.version} -<%}%> -<%}%> - -<%if(isNotEmpty(doc.responseParams)){%> -**Response-fields:** - -| Field | Type | Description | Since | -|-------|------|-------------|-------| -<% -for(param in doc.responseParams){ -%> -|${param.field}|${param.type}|${htmlEscape(param.desc)}|${param.version} -<%}%> -<%}%> - -<% } %> - - - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.adoc b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.adoc deleted file mode 100644 index ce0f8990..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.adoc +++ /dev/null @@ -1,132 +0,0 @@ -<%if(isNotEmpty(projectName)){%> ${projectName} -<%}%> - -[width="100%",options="header"] -[stripes=even] -<%if(isNotEmpty(revisionLogList)){%> - -|==================== -|Version |Update Time |Status | Author |Description -<% for(revisionLog in revisionLogList){ %> -|${revisionLog.version} |${revisionLog.revisionTime} |${revisionLog.status} |${revisionLog.author} |${revisionLog.remarks} -<%}%> -|==================== - -<%}%> - -<%if(isNotEmpty(dependencyList)){%> Add dependency - ----- -<% -for(dependency in dependencyList){ -%> - - ${dependency.groupId} - ${dependency.artifactId} - ${dependency.version} - - -<%}%> ----- - -<%if(isNotEmpty(consumerConfigExample)){%> Consumer config - ----- -${consumerConfigExample} ----- - -<%}%> <%}%> - -<% for(api in apiDocList){ -%> - -== ${htmlEscape(api.desc)} - -*URI:* ${api.uri} - -*Service:* ${api.name} - -*Protocol:* ${api.protocol} - -*Author:* ${api.author} - -*Version:* ${api.version} <% for(doc in api.list){ -%> <%if(doc.deprecated){%> ~~${htmlEscape(doc.desc)}~~ <%}else{%> ${htmlEscape(doc.desc)} <%}%> - -*Definition:* ${doc.methodDefinition} - -<%if(isNotEmpty(doc.author)){%> -*Author:* ${doc.author} <%}%> - -*Description:* ${doc.detail} - -<%if(isNotEmpty(doc.requestParams)){%> -*Invoke-parameters:* - -[width="100%",options="header"] -[stripes=even] -|==================== -|Parameter | Type |Required|Description |Since -<% -for(param in doc.requestParams){ -%> -|${param.field} |${param.type} |${param.required}|${htmlEscape(param.desc)} |${param.version} -<%}%> -|==================== - -<%}%> - -<%if(isNotEmpty(doc.responseParams)){%> -*Response-fields:* -[width="100%",options="header"] -[stripes=even] - -|==================== -|Field | Type |Description |Since -<% -for(param in doc.responseParams){ -%> -|${param.field} |${param.type} |${htmlEscape(param.desc)} |${param.version} -<%}%> -<%}%> -|==================== - -<%}%> <%}%> - -<%if(isNotEmpty(errorCodeList)){%> -${errorListTitle} - -[width="100%",options="header"] -[stripes=even] - -|==================== -|Error code |Description -<% for(error in errorCodeList){ %> - - -|${error.value} |${htmlEscape(error.desc)} -<%}%> -|==================== - - -<%}%> - -<%if(isNotEmpty(dictList)){ %> -${dictListTitle} - -<% for(dict in dictList){ -%> -[width="100%",options="header"] -[stripes=even] - -${dict.title} -|==================== -|Code |Type |Description -<% for(dataDict in dict.dataDictList){%> -|${dataDict.value} |${dataDict.type} |${htmlEscape(dataDict.desc)} -<%}%> -|==================== - -<%}%> - -<%}%> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.html deleted file mode 100644 index 9e917259..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.html +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - - <%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%> - - - - - - -
<%if(isNotEmpty(revisionLogList)){%> -
-
- - - - - - - - - - - - - - - - - - <%for(revisionLog in revisionLogList){%> - - - - - - - - <%}%> - -
VersionUpdate TimeStatusAuthorDescription

${revisionLog.version}

${revisionLog.revisionTime}

-

${revisionLog.status}

${revisionLog.author}

${revisionLog.remarks}

-
-
- <%}%><%if(isNotEmpty(dependencyList)){%> -

1. Add - dependency

-
-
-
-
<%for(dp in dependencyList){%><dependency>
-    <groupId>${dp.groupId}</groupId>
-    <artifactId>${dp.artifactId}</artifactId>
-    <version>${dp.version}</version>
-</dependency>
-<%}%>
- 
-
-
- <%if(isNotEmpty(consumerConfigExample)){%> -

Consumer config

-
-
-
${consumerConfigExample}
-
-
- <%}%> -
-
- <%}%><%for(api in apiDocList){%> -

${api.order+1}. ${htmlEscape(api.desc)} -

-
-

URI: ${api.uri}

-

Service: ${api.name}

-

Protocol: ${api.protocol}

-

Author: ${api.author}

-

Version: ${api.version}

- <%for(doc in api.list){%> -

<%if(doc.deprecated){%>${api.order+1}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%>${api.order+1}.${doc.order}. ${htmlEscape(doc.desc)}<%}%> -

-

Definition: ${doc.escapeMethodDefinition}

-

Description: ${doc.detail}

- <%if(isNotEmpty(doc.requestParams)){%> -

Invoke-parameters:

- - - - - - - - - - - - - - - - - - <%for(param in doc.requestParams){%> - - - - - - - - <%}%> - -
ParameterTypeDescriptionRequiredSince

${param.field}

${param.type}

${param.desc}

${param.required}

${param.version}

- <%}%><%if(isNotEmpty(doc.responseParams)){%> -

Response-fields:

- - - - - - - - - - - - - - - - <%for(param in doc.responseParams){%> - - - - - - - <%}%> - -
FieldTypeDescriptionSince

${param.field}

${param.type}

${param.desc}

${param.version}

- <%}%> -
- <%}%> -
-
- <%}%><%if(isNotEmpty(errorCodeList)){%> -

${apiDocList.~size+2}. ${errorListTitle} -

-
- - - - - - - - - - - - <%for(error in errorCodeList){%> - - - - - <%}%> - -
Error codeDescription

${error.value}

${htmlEscape(error.desc)}

-
-
-
- <%}%><%if(isNotEmpty(dictList)){%> -

${dictListOrder}. ${dictListTitle} -

-
<%for(dict in dictList){%> -

${dictListOrder}.${dict.order}. ${htmlEscape(dict.title)} -

- - - - - - - - - - - - - - <%for(dataDict in dict.dataDictList){%> - - - - - - <%}%> - -
CodeTypeDescription

${dataDict.value}

${dataDict.type}

- ${htmlEscape(dataDict.desc)}

-
- <%}%> -
-
- <%}%> -
Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github -
-
Top
-
- - - - \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.md deleted file mode 100644 index ae62f372..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboAllInOne.md +++ /dev/null @@ -1,125 +0,0 @@ -<%if(isNotEmpty(projectName)){%> - -# ${projectName} - -<%}%> - -<%if(isNotEmpty(revisionLogList)){%> - -| Version | Update Time | Status | Author | Description | -|---------|-------------|--------|--------|-------------| -<% for(revisionLog in revisionLogList){ %> -|${revisionLog.version} |${revisionLog.revisionTime} |${revisionLog.status} |${revisionLog.author} |${lineBreaksToBr(revisionLog.remarks)}| -<%}%> - -<%}%> - -<%if(isNotEmpty(dependencyList)){%> - -## Add dependency - -``` -<% -for(dependency in dependencyList){ -%> - - ${dependency.groupId} - ${dependency.artifactId} - ${dependency.version} - - -<%}%> -``` - -<%if(isNotEmpty(consumerConfigExample)){%> -Consumer config - -``` -${consumerConfigExample} -``` - -<%}%> -<%}%> - -<% for(api in apiDocList){ %> - -## ${htmlEscape(api.desc)} - -**URI:** ${api.uri} - -**Service:** ${api.name} - -**Protocol:** ${api.protocol} - -**Author:** ${api.author} - -**Version:** ${api.version} -<% for(doc in api.list){ %> -<%if(doc.deprecated){%> - -### ~~${htmlEscape(doc.desc)}~~ - -<%}else{%> - -### ${htmlEscape(doc.desc)} - -<%}%> - -**Definition:** ${doc.methodDefinition} - -<%if(isNotEmpty(doc.author)){%> -**Author:** ${doc.author} -<%}%> - -**Description:** ${doc.detail} - -<%if(isNotEmpty(doc.requestParams)){%> -**Invoke-parameters:** - -| Parameter | Type | Required | Description | Since | -|-----------|------|----------|-------------|-------| -<% for(param in doc.requestParams){ %> -|${param.field}|${param.type}|${param.required}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%if(isNotEmpty(doc.responseParams)){%> -**Response-fields:** - -| Field | Type | Description | Since | -|-------|------|-------------|-------| -<% for(param in doc.responseParams){ %> -|${param.field}|${param.type}|${lineBreaksToBr(param.desc)}|${param.version}| -<%}%> -<%}%> - -<%}%> -<%}%> -<%if(isNotEmpty(errorCodeList)){%> - -## ${errorListTitle} - -| Error code | Description | -|------------|-------------| -<% for(error in errorCodeList){ %> -|${error.value}|${htmlEscape(error.desc)}| -<%}%> - -<%}%> - -<%if(isNotEmpty(dictList)){%> - -## ${dictListTitle} - -<% for(dict in dictList){ %> - -### ${dict.title} - -| Code | Type | Description | -|------|------|-------------| -<% for(dataDict in dict.dataDictList){ %> -|${dataDict.value}|${dataDict.type}|${htmlEscape(dataDict.desc)}| -<%}%> - -<%}%> -<%}%> diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependency.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependency.md deleted file mode 100644 index 741b5fc7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependency.md +++ /dev/null @@ -1,23 +0,0 @@ -# Add dependency - -``` -<% -for(dependency in dependencyList){ -%> - - ${dependency.groupId} - ${dependency.artifactId} - ${dependency.version} - - -<%}%> -``` - -<%if(isNotEmpty(consumerConfigExample)){%> -Consumer config - -``` -${consumerConfigExample} -``` - -<%}%> \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependencyEmpty.md b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependencyEmpty.md deleted file mode 100644 index 5636c9a2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboApiDependencyEmpty.md +++ /dev/null @@ -1,18 +0,0 @@ -# Add dependency - -``` - - Your api group - Your api artifactId - 1.0.0 - -``` - -Consumer config - -``` -dubbo: - registry: - protocol: zookeeper - address: localhost:2181 -``` \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboSearch.btl b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboSearch.btl deleted file mode 100644 index 40c1422c..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/dubbo/DubboSearch.btl +++ /dev/null @@ -1,105 +0,0 @@ -let api = []; -<%for(api in directoryTree){%> -api.push({ - alias: '${api.alias}', - order: '${api.order}', - link: '${api.link}', - desc: '${api.desc}', - list: [] -}) -<%for(doc in api.list) {%> -api[${apiLP.dataIndex}].list.push({ - order: '${doc.order}', - desc: '${doc.desc}', -}); -<%}%> -<%}%> -document.onkeydown = keyDownSearch; -function keyDownSearch(e) { - const theEvent = e; - const code = theEvent.keyCode || theEvent.which || theEvent.charCode; - if (code == 13) { - const search = document.getElementById('search'); - const searchValue = search.value; - let searchArr = []; - for (let i = 0; i < api.length; i++) { - let apiData = api[i]; - const desc = apiData.desc; - if (desc.indexOf(searchValue) > -1) { - searchArr.push({ - order: apiData.order, - desc: apiData.desc, - link: apiData.link, - list: apiData.list - }); - } else { - let methodList = apiData.list || []; - let methodListTemp = []; - for (let j = 0; j < methodList.length; j++) { - const methodData = methodList[j]; - const methodDesc = methodData.desc; - if (methodDesc.indexOf(searchValue) > -1) { - methodListTemp.push(methodData); - break; - } - } - if (methodListTemp.length > 0) { - const data = { - order: apiData.order, - desc: apiData.desc, - link: apiData.link, - list: methodListTemp - }; - searchArr.push(data); - } - } - } - let html; - if (searchValue == '') { - const liClass = ""; - const display = "display: none"; - html = buildAccordion(api,liClass,display); - document.getElementById('accordion').innerHTML = html; - } else { - const liClass = "open"; - const display = "display: block"; - html = buildAccordion(searchArr,liClass,display); - document.getElementById('accordion').innerHTML = html; - } - const Accordion = function (el, multiple) { - this.el = el || {}; - this.multiple = multiple || false; - const links = this.el.find('.dd'); - links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); - }; - Accordion.prototype.dropdown = function (e) { - const $el = e.data.el; - $this = $(this), $next = $this.next(); - $next.slideToggle(); - $this.parent().toggleClass('open'); - if (!e.data.multiple) { - $el.find('.submenu').not($next).slideUp("20").parent().removeClass('open'); - } - }; - new Accordion($('#accordion'), false); - } -} - -function buildAccordion(apiData, liClass, display) { - let html = ""; - let doc; - if (apiData.length > 0) { - for (let j = 0; j < apiData.length; j++) { - html += '
  • '; - html += '' + apiData[j].order + '. ' + apiData[j].desc + ''; - html += ''; - html += '
  • '; - } - } - return html; -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/debug.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/debug.html deleted file mode 100644 index ef2aa25d..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/debug.html +++ /dev/null @@ -1 +0,0 @@ -<%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%><%if(isNotEmpty(highlightCssLink)){%><%}%>

    ${order}. ${desc}

    <%for(doc in list){%>

    <%if(doc.deprecated){%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%>

    Type: ${doc.type}

    <%if(isNotEmpty(doc.author)){%>

    Author: ${doc.author}

    <%}%>

    Content-Type: ${doc.contentType}

    Description: ${lineBreaksToBr(doc.detail)}

    <%if(isNotEmpty(doc.requestHeaders)){%>

    Request-headers:

    <%for(header in doc.requestHeaders){%><%}%>
    HeaderValueTypeRequiredDescription

    ${header.name}

    ${header.type}

    ${header.required}

    ${htmlEscape(header.desc)}

    <%}%><%if(isNotEmpty(doc.pathParams)){%>

    Path-parameters:

    <%for(param in doc.pathParams){%><%}%>
    ParameterValueTypeRequiredDescription

    ${param.field}

    ${param.type}

    ${param.required}

    ${htmlEscape(param.desc)}

    <%}%><%if(isNotEmpty(doc.queryParams)){%>

    Query-parameters:

    <%for(param in doc.queryParams){%><%if(param.version!='-'){%><%}else{%><%}%><%}%>
    ParameterValueTypeRequiredDescription

    ${param.field}

    <%if(param.type=="file"){%><%}else{%><%}%>

    ${param.type}

    ${param.required}

    ${htmlEscape(param.desc)}@since ${param.version}

    ${htmlEscape(param.desc)}

    <%}%><%if(isNotEmpty(doc.requestParams)){%>

    Body-parameters:

    <%for(param in doc.requestParams){%><%if(param.version!='-'){%><%}else{%><%}%><%}%>
    ParameterTypeRequiredDescription

    ${param.field}

    ${param.type}

    ${param.required}

    ${htmlEscape(param.desc)}@since ${param.version}

    ${htmlEscape(param.desc)}

    <%}%><%if(isNotEmpty(doc.requestExample.jsonBody)&&isRequestExample){%>

    Request-body:

    ${doc.requestExample.jsonBody}
    <%}%><%if(isNotEmpty(doc.responseParams)){%>

    Response-fields:

    <%for(param in doc.responseParams){%><%}%>
    FieldTypeDescriptionSince

    ${param.field}

    ${param.type}

    ${htmlEscape(param.desc)}

    ${param.version}

    <%}%>

    <%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%>

    Response-example:

    ${doc.responseUsage}
    <%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%>

    Curl-example:

    ${doc.requestUsage}
    <%}%>
    <%}%>
    Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
    \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/dict.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/dict.html deleted file mode 100644 index fc715650..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/dict.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - Dictionary - - - <%if(isNotEmpty(highlightCssLink)){%><%}%> - - - - - - -
    <%if(isNotEmpty(dictList)){%> -

    ${dictListOrder}. ${dictListTitle} -

    -
    <%for(dict in dictList){%> -

    - - ${dictListOrder}.${dict.order}. ${dict.title} -

    - - - - - - - - - - - - - - <%for(dataDict in dict.dataDictList){%> - - - - - - <%}%> - -
    CodeTypeDescription

    ${dataDict.value}

    ${dataDict.type}

    ${htmlEscape(dataDict.desc)}

    -
    - <%}%> -
    -
    - <%}%> -
    Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
    -
    - - - - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/error.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/error.html deleted file mode 100644 index b80d8f69..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/error.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - Error Code - - - <%if(isNotEmpty(highlightCssLink)){%><%}%> - - - - - - -
    <%if(isNotEmpty(errorCodeList)){%> -

    ${apiDocList.~size+1}. ${errorListTitle} -

    -
    -

    ${apiDocList.~size+1}.1. ${errorListTitle} -

    - - - - - - - - - - - - <%for(error in errorCodeList){%> - - - - - <%}%> - -
    Error codeDescription

    ${error.value}

    ${htmlEscape(error.desc)}

    -
    -
    -
    - <%}%> -
    Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
    -
    - - - - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/index.html b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/index.html deleted file mode 100644 index dc964cce..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/html/index.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - - - <%if(isNotEmpty(projectName)){%>${projectName}<%}else{%>API Reference<%}%> - - - <%if(isNotEmpty(highlightCssLink)){%><%}%> - - - - - - -
    -

    ${order}. ${htmlEscape(desc)} -

    -
    <%for(doc in list){%> -

    - <%if(doc.deprecated){%>${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}else{%> - ${order}.${doc.order}. ${htmlEscape(doc.desc)}<%}%> -

    -

    请求地址: ${doc.url} -

    -

    请求方法: ${doc.type}

    - <%if(isNotEmpty(doc.author)){%> -

    Author: ${doc.author}

    - <%}%> -

    Content-Type: ${doc.contentType}

    -

    说明: ${lineBreaksToBr(doc.detail)}

    - <%if(isNotEmpty(doc.requestHeaders)){%> -

    请求头:

    - - - - - - - - - - - - - - - - - - <%for(header in doc.requestHeaders){%> - - - - - - - - <%}%> - -
    HeaderTypeDescriptionRequiredSince

    ${header.name}

    ${header.type}

    ${htmlEscape(header.desc)}

    ${header.required}

    ${header.since}

    - <%}%><%if(isNotEmpty(doc.pathParams)){%> -

    请求参数:

    - - - - - - - - - - - - - - - - - - <%for(param in doc.pathParams){%> - - - - - - - - <%}%> - -
    ParameterTypeDescriptionRequiredSince

    ${param.field}

    ${param.type}

    ${htmlEscape(param.desc)}

    ${param.required}

    ${param.version}

    - <%}%><%if(isNotEmpty(doc.queryParams)){%> -

    Query-parameters:

    - - - - - - - - - - - - - - - - - - <%for(param in doc.queryParams){%> - - - - - - - - <%}%> - -
    ParameterTypeDescriptionRequiredSince

    ${param.field}

    ${param.type}

    ${htmlEscape(param.desc)}

    ${param.required}

    ${param.version}

    - <%}%><%if(isNotEmpty(doc.requestParams)){%> -

    Body-parameters:

    - - - - - - - - - - - - - - - - - - <%for(param in doc.requestParams){%> - - - - - - - - <%}%> - -
    ParameterTypeDescriptionRequiredSince

    ${param.field}

    ${param.type}

    ${htmlEscape(param.desc)}

    ${param.required}

    ${param.version}

    - <%}%><%if(isNotEmpty(doc.requestUsage)&&isRequestExample){%> -

    Request-example:

    -
    -
    -
    ${doc.requestUsage}
    -
    -
    - <%}%><%if(isNotEmpty(doc.responseParams)){%> -

    Response-fields:

    - - - - - - - - - - - - - - - - <%for(param in doc.responseParams){%> - - - - - - - <%}%> - -
    FieldTypeDescriptionSince

    ${param.field}

    ${param.type}

    ${htmlEscape(param.desc)}

    ${param.version}

    - <%}%><%if(isNotEmpty(doc.responseUsage)&&isResponseExample){%> -

    Response-example:

    -
    -
    -
    ${doc.responseUsage}
    -
    -
    - <%}%> -
    - <%}%> -
    -
    -
    Generated by smart-doc at ${createTime}Suggestions,contact,support and error reporting on Gitee or Github
    -
    - - - - diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/debug.js b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/debug.js deleted file mode 100644 index f9017828..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/debug.js +++ /dev/null @@ -1,403 +0,0 @@ -$(function () { - const Accordion = function (el, multiple) { - this.el = el || {}; - this.multiple = multiple || false; - const links = this.el.find('.dd'); - links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); - }; - Accordion.prototype.dropdown = function (e) { - const $el = e.data.el; - const $this = $(this), $next = $this.next(); - $next.slideToggle(); - $this.parent().toggleClass('open'); - if (!e.data.multiple) { - $el.find('.submenu').not($next).slideUp("20").parent().removeClass( - 'open'); - } - }; - new Accordion($('#accordion'), false); - hljs.highlightAll(); -}); - -$("[contenteditable=plaintext-only]").on('blur', function (e) { - e.preventDefault(); - const $this = $(this); - const data = $this.text(); - let content; - if (undefined === e.originalEvent.clipboardData) { - content = data; - } else { - content = e.originalEvent.clipboardData.getData('text/plain') - } - content = JSON.stringify(JSON.parse(content), null, 4); - const highlightedCode = hljs.highlight('json', content).value; - $this.html(highlightedCode); -}) -$("button").on("click", function () { - const $this = $(this); - const id = $this.data("id"); - console.log("method-id=>" + id); - - let body = $("#" + id + "-body").text(); - - // header - const $headerElement = $("#" + id + "-header"); - const headersData = getInputData($headerElement); - - // body param - const $paramElement = $("#" + id + "-param"); - let bodyParamData = getInputData($paramElement) - - // path param - const $pathElement = $("#" + id + "-path-params") - const pathParamData = getInputData($pathElement) - - // query param - const $queryElement = $("#" + id + "-query-params") - let $urlDataElement = $("#" + id + "-url"); - const url = $urlDataElement.data("url"); - const isDownload = $urlDataElement.data("download"); - const page = $urlDataElement.data("page"); - const method = $("#" + id + "-method").data("method"); - const contentType = $("#" + id + "-content-type").data("content-type"); - console.log("request-headers=>" + JSON.stringify(headersData)) - console.log("path-params=>" + JSON.stringify(pathParamData)) - - console.log("body-params=>" + JSON.stringify(bodyParamData)) - console.log("json-body=>" + body); - let finalUrl = ""; - let queryParamData; - if (!isEmpty(page)) { - queryParamData = getInputData($queryElement) - finalUrl = castToGetUri(page, pathParamData, queryParamData) - window.open(finalUrl, "_blank"); - return; - } - if (isDownload) { - queryParamData = getInputData($queryElement); - download(url, headersData, pathParamData, queryParamData, bodyParamData, - method, contentType); - return; - } - const ajaxOptions = {}; - - if ("multipart/form-data" === contentType) { - finalUrl = castToGetUri(url, pathParamData); - queryParamData = getInputData($queryElement, true,true) - body = queryParamData; - ajaxOptions.processData = false; - ajaxOptions.contentType = false; - } else if ("POST" === method && contentType !== "multipart/form-data" - && contentType !== "application/json") { - finalUrl = castToGetUri(url, pathParamData); - queryParamData = getInputData($queryElement,true) - body = queryParamData; - } else { - queryParamData = getInputData($queryElement) - finalUrl = castToGetUri(url, pathParamData, queryParamData) - ajaxOptions.contentType = contentType; - } - console.log("query-params=>" + JSON.stringify(queryParamData)); - console.log("url=>" + finalUrl) - ajaxOptions.headers = headersData - ajaxOptions.url = finalUrl - ajaxOptions.type = method - ajaxOptions.data = body; - - const $responseEle = $("#" + id + "-response").find("pre code"); - const ajaxTime = new Date().getTime(); - $.ajax(ajaxOptions).done(function (result, textStatus, jqXHR) { - const totalTime = new Date().getTime() - ajaxTime; - $this.css("background", "#5cb85c"); - $("#" + id + "-resp-status").html( - " Status: " + jqXHR.status + "  " + jqXHR.statusText - + "    Time: " + totalTime + " ms"); - const highlightedCode = hljs.highlight('json', - JSON.stringify(result, null, 4)).value; - $responseEle.html(highlightedCode); - }).fail(function (jqXHR) { - const totalTime = new Date().getTime() - ajaxTime; - $this.css("background", "#D44B47"); - if (jqXHR.status === 0 && jqXHR.readyState === 0) { - $("#" + id + "-resp-status").html( - "Connection refused, please check the server."); - } else { - $("#" + id + "-resp-status").html( - " Status: " + jqXHR.status + "  " - + jqXHR.statusText + "    Time: " + totalTime - + " ms"); - } - if (undefined !== jqXHR.responseJSON) { - const highlightedCode = hljs.highlight('json', - JSON.stringify(jqXHR.responseJSON, null, 4)).value; - $responseEle.html(highlightedCode); - } - }).always(function () { - - }); - const curlCmd = toCurl(ajaxOptions); - const highlightedCode = hljs.highlight('bash', curlCmd).value; - $("#" + id + "-curl").find("pre code").html(highlightedCode); -}) -$(".check-all").on("click", function () { - const checkboxName = $(this).prop("name"); - const checked = $(this).is(':checked'); - if (!checked) { - $(this).removeAttr("checked"); - } else { - $(this).prop("checked", true); - } - $('input[name="' + checkboxName + '"]').each(function () { - if (!checked) { - $(this).prop("checked", false); - } else { - $(this).prop("checked", true); - } - }) -}) - -function castToGetUri(url, pathParams, params) { - if (pathParams instanceof Object && !(pathParams instanceof Array)) { - url = url.format(pathParams) - } - if (params instanceof Object && !(params instanceof Array)) { - const pm = params || {}; - const arr = []; - arr.push(url); - let j = 0; - for (const i in pm) { - if (j === 0) { - arr.push("?"); - arr.push(i + "=" + pm[i]); - } else { - arr.push("&" + i + "=" + pm[i]); - } - j++; - } - return arr.join(""); - } else { - return url; - } -} - -function getInputData(element, isPost, returnFormDate) { - const formData = new FormData(); - $(element).find("tr").each(function (i) { - const checked = $(this).find('td:eq(0)').children(".checkbox").children( - "input").is(':checked'); - if (checked) { - const input = $(this).find('td:eq(2) input'); - let attr = $(input).attr("type"); - let multiple = $(input).attr("multiple"); - console.log("input type:" + attr) - const name = $(input).attr("name"); - if (attr === "file") { - let files = $(input)[0].files; - if (multiple) { - $.each(files, function (i, file) { - formData.append(name, file); - }) - } else { - formData.append(name, files[0]); - } - } else { - const val = $(input).val(); - if (isValidUrl(val)) { - formData.append(name, encodeURI(val)); - } else { - // support chinese - if (hasChinese(val) && !isPost) { - formData.append(name, encodeURIComponent(val)); - } else { - formData.append(name, val); - } - } - } - } - }); - if (returnFormDate) { - return formData; - } - const headersData = {}; - formData.forEach((value, key) => headersData[key] = value); - return headersData; -} - -String.prototype.format = function (args) { - let reg; - if (arguments.length > 0) { - let result = this; - if (arguments.length === 1 && typeof (args) == "object") { - for (const key in args) { - reg = new RegExp("({" + key + "})", "g"); - result = result.replace(reg, args[key]); - } - } else { - for (let i = 0; i < arguments.length; i++) { - if (arguments[i] === undefined) { - return ""; - } else { - reg = new RegExp("({[" + i + "]})", "g"); - result = result.replace(reg, arguments[i]); - } - } - } - return result; - } else { - return this; - } -} - -function download(url, headersData, pathParamData, queryParamData, - bodyParamData, method, contentType) { - url = castToGetUri(url, pathParamData, queryParamData) - const xmlRequest = new XMLHttpRequest(); - xmlRequest.open(method, url, true); - xmlRequest.setRequestHeader("Content-type", contentType); - for (let key in headersData) { - xmlRequest.setRequestHeader(key, headersData[key]) - } - xmlRequest.responseType = "blob"; - xmlRequest.onload = function () { - if (this.status === 200) { - let fileName = ""; - const disposition = xmlRequest.getResponseHeader('Content-Disposition'); - if (disposition && disposition.indexOf('attachment') !== -1) { - const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; - const matches = filenameRegex.exec(disposition); - if (matches != null && matches[1]) { - fileName = decodeURI(matches[1].replace(/['"]/g, '')); - } - } - console.log("download filename:" + fileName); - const blob = this.response; - if (navigator.msSaveBlob) { - // IE10 can't do a[download], only Blobs: - window.navigator.msSaveBlob(blob, fileName); - return; - } - if (window.URL) { // simple fast and modern way using Blob and URL: - const a = document.createElement("a"); - document.body.appendChild(a); - const url = window.URL.createObjectURL(blob); - a.href = url; - a.download = fileName; - a.click(); - window.URL.revokeObjectURL(url); - } - console.log(fileName); - } else { - console.log("download failed"); - } - }; - try { - xmlRequest.send(bodyParamData); - } catch (e) { - console.error("Failed to send data", e); - } -} - -function toCurl(request) { - if (typeof request !== 'object') { - throw "Request is not an object"; - } - // default is a GET request - const cmd = ["curl", "-X", request.type || "GET"]; - - if (request.url.indexOf('https') === 0) { - cmd.push("-k"); - } - - // append Content-Type - if (request.contentType) { - cmd.push("-H"); - cmd.push("'Content-Type:"); - cmd.push(request.contentType + "'"); - } - // append request headers - let headerValue; - if (typeof request.headers == 'object') { - for (let key in request.headers) { - if (Object.prototype.hasOwnProperty.call(request.headers, key)) { - cmd.push("-H"); - headerValue = request.headers[key]; - if (headerValue.value === '') { - cmd.push("'" + key + "'"); - } else { - cmd.push("'" + key + ':' + headerValue + "'"); - } - } - } - } - - // display the response headers - cmd.push("-i"); - // append request url - let url = request.url; - if (!url.startsWith("http")) { - const protocol = window.document.location.protocol; - const domain = window.document.location.hostname; - const port = window.document.location.port; - url = protocol + "//" + domain + ":" + port + url; - } - cmd.push(url); - // append data - - if (typeof request.data == 'object') { - let index = 0; - const bodyData = []; - bodyData.push("\"") - for (let key in request.data) { - if (Object.prototype.hasOwnProperty.call(request.data, key)) { - if (index === 0) { - bodyData.push(key); - bodyData.push("="); - bodyData.push(request.data[key]); - } else { - bodyData.push("&") - bodyData.push(key); - bodyData.push("="); - bodyData.push(request.data[key]); - } - } - index++; - } - bodyData.push("\""); - let bodyStr = "" - bodyData.forEach(function (item) { - bodyStr += item; - }); - cmd.push("--data"); - cmd.push(bodyStr); - } else if (request.data && request.data.length > 0) { - // append json data - cmd.push("--data"); - cmd.push("'" + request.data + "'"); - } - - let curlCmd = ""; - cmd.forEach(function (item) { - curlCmd += item + " "; - }); - console.log(curlCmd); - return curlCmd; -} - -function isEmpty(obj) { - return obj === undefined || obj === null || String(obj).trim() === ''; -} - -function hasChinese(_string) { - const chineseReg = /[\u4e00-\u9fa5]/g - return chineseReg.test(_string); -} - -function isValidUrl(_string) { - let urlString; - try { - urlString = new URL(_string); - } catch (_) { - return false; - } - return urlString.protocol === "http:" || urlString.protocol === "https:"; -} diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/highlight.min.js b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/highlight.min.js deleted file mode 100644 index e01913fb..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/highlight.min.js +++ /dev/null @@ -1,1120 +0,0 @@ -/*! - Highlight.js v11.2.0 (git: 2a5c592e5e) - (c) 2006-2021 Ivan Sagalaev and other contributors - License: BSD-3-Clause - */ -var hljs=function(){"use strict";var e={exports:{}};function n(e){ -return e instanceof Map?e.clear=e.delete=e.set=()=>{ -throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ -throw Error("set is read-only") -}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var a=e[t] -;"object"!=typeof a||Object.isFrozen(a)||n(a)})),e} -e.exports=n,e.exports.default=n;var t=e.exports;class a{constructor(e){ -void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} -ignoreMatch(){this.isMatchIgnored=!0}}function i(e){ -return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") -}function s(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n] -;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t}const r=e=>!!e.kind -;class o{constructor(e,n){ -this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){ -this.buffer+=i(e)}openNode(e){if(!r(e))return;let n=e.kind -;n=e.sublanguage?"language-"+n:((e,{prefix:n})=>{if(e.includes(".")){ -const t=e.split(".") -;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ") -}return`${n}${e}`})(n,{prefix:this.classPrefix}),this.span(n)}closeNode(e){ -r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ -this.buffer+=``}}class l{constructor(){this.rootNode={ -children:[]},this.stack=[this.rootNode]}get top(){ -return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ -this.top.children.push(e)}openNode(e){const n={kind:e,children:[]} -;this.add(n),this.stack.push(n)}closeNode(){ -if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ -for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} -walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){ -return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n), -n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){ -"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ -l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e} -addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())} -addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root -;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){ -return new o(this,this.options).value()}finalize(){return!0}}function d(e){ -return e?"string"==typeof e?e:e.source:null}function g(e){return b("(?=",e,")")} -function u(e){return b("(?:",e,")?")}function b(...e){ -return e.map((e=>d(e))).join("")}function m(...e){return"("+((e=>{ -const n=e[e.length-1] -;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} -})(e).capture?"":"?:")+e.map((e=>d(e))).join("|")+")"}function p(e){ -return RegExp(e.toString()+"|").exec("").length-1} -const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ -;function h(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t -;let a=d(e),i="";for(;a.length>0;){const e=_.exec(a);if(!e){i+=a;break} -i+=a.substring(0,e.index), -a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0], -"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)} -const f="[a-zA-Z]\\w*",E="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",w="\\b(0b[01]+)",v={ -begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", -illegal:"\\n",contains:[v]},M={scope:"string",begin:'"',end:'"',illegal:"\\n", -contains:[v]},x=(e,n,t={})=>{const a=s({scope:"comment",begin:e,end:n, -contains:[]},t);a.contains.push({scope:"doctag", -begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", -end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) -;const i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) -;return a.contains.push({begin:b(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a -},S=x("//","$"),k=x("/\\*","\\*/"),A=x("#","$");var C=Object.freeze({ -__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:f,UNDERSCORE_IDENT_RE:E, -NUMBER_RE:y,C_NUMBER_RE:N,BINARY_NUMBER_RE:w, -RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", -SHEBANG:(e={})=>{const n=/^#![ ]*\// -;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:n, -end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)}, -BACKSLASH_ESCAPE:v,APOS_STRING_MODE:O,QUOTE_STRING_MODE:M,PHRASAL_WORDS_MODE:{ -begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ -},COMMENT:x,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:k,HASH_COMMENT_MODE:A, -NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number", -begin:N,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:w,relevance:0}, -REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, -end:/\/[gimuy]*/,illegal:/\n/,contains:[v,{begin:/\[/,end:/\]/,relevance:0, -contains:[v]}]}]},TITLE_MODE:{scope:"title",begin:f,relevance:0}, -UNDERSCORE_TITLE_MODE:{scope:"title",begin:E,relevance:0},METHOD_GUARD:{ -begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ -"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{ -n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function T(e,n){ -"."===e.input[e.index-1]&&n.ignoreMatch()}function R(e,n){ -void 0!==e.className&&(e.scope=e.className,delete e.className)}function D(e,n){ -n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", -e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, -void 0===e.relevance&&(e.relevance=0))}function I(e,n){ -Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function L(e,n){ -if(e.match){ -if(e.begin||e.end)throw Error("begin & end are not supported with match") -;e.begin=e.match,delete e.match}}function B(e,n){ -void 0===e.relevance&&(e.relevance=1)}const $=(e,n)=>{if(!e.beforeMatch)return -;if(e.starts)throw Error("beforeMatch cannot be used with starts") -;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n] -})),e.keywords=t.keywords,e.begin=b(t.beforeMatch,g(t.begin)),e.starts={ -relevance:0,contains:[Object.assign(t,{endsParent:!0})] -},e.relevance=0,delete t.beforeMatch -},z=["of","and","for","in","not","or","if","then","parent","list","value"] -;function F(e,n,t="keyword"){const a=Object.create(null) -;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{ -Object.assign(a,F(e[t],n,t))})),a;function i(e,t){ -n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|") -;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){ -return n?Number(n):(e=>z.includes(e.toLowerCase()))(e)?0:1}const U={},P=e=>{ -console.error(e)},K=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{ -U[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),U[`${e}/${n}`]=!0) -},H=Error();function G(e,n,{key:t}){let a=0;const i=e[t],s={},r={} -;for(let e=1;e<=n.length;e++)r[e+a]=i[e],s[e+a]=!0,a+=p(n[e-1]) -;e[t]=r,e[t]._emit=s,e[t]._multi=!0}function Z(e){(e=>{ -e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, -delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ -_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope -}),(e=>{if(Array.isArray(e.begin)){ -if(e.skip||e.excludeBegin||e.returnBegin)throw P("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), -H -;if("object"!=typeof e.beginScope||null===e.beginScope)throw P("beginScope must be object"), -H;G(e,e.begin,{key:"beginScope"}),e.begin=h(e.begin,{joinWith:""})}})(e),(e=>{ -if(Array.isArray(e.end)){ -if(e.skip||e.excludeEnd||e.returnEnd)throw P("skip, excludeEnd, returnEnd not compatible with endScope: {}"), -H -;if("object"!=typeof e.endScope||null===e.endScope)throw P("endScope must be object"), -H;G(e,e.end,{key:"endScope"}),e.end=h(e.end,{joinWith:""})}})(e)}function W(e){ -function n(n,t){return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))} -class t{constructor(){ -this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} -addRule(e,n){ -n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]), -this.matchAt+=p(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) -;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(h(e,{joinWith:"|" -}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex -;const n=this.matcherRe.exec(e);if(!n)return null -;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t] -;return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){ -this.rules=[],this.multiRegexes=[], -this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ -if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t -;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))), -n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){ -return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){ -this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){ -const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex -;let t=n.exec(e) -;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{ -const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)} -return t&&(this.regexIndex+=t.position+1, -this.regexIndex===this.count&&this.considerAll()),t}} -if(e.compilerExtensions||(e.compilerExtensions=[]), -e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") -;return e.classNameAliases=s(e.classNameAliases||{}),function t(i,r){const o=i -;if(i.isCompiled)return o -;[R,L,Z,$].forEach((e=>e(i,r))),e.compilerExtensions.forEach((e=>e(i,r))), -i.__beforeBegin=null,[D,I,B].forEach((e=>e(i,r))),i.isCompiled=!0;let l=null -;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords), -l=i.keywords.$pattern, -delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=F(i.keywords,e.case_insensitive)), -o.keywordPatternRe=n(l,!0), -r&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/), -i.end&&(o.endRe=n(i.end)), -o.terminatorEnd=d(i.end)||"",i.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+r.terminatorEnd)), -i.illegal&&(o.illegalRe=n(i.illegal)), -i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>s(e,{ -variants:null},n)))),e.cachedVariants?e.cachedVariants:Q(e)?s(e,{ -starts:e.starts?s(e.starts):null -}):Object.isFrozen(e)?s(e):e))("self"===e?i:e)))),i.contains.forEach((e=>{t(e,o) -})),i.starts&&t(i.starts,r),o.matcher=(e=>{const n=new a -;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin" -}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end" -}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function Q(e){ -return!!e&&(e.endsWithParent||Q(e.starts))}const X=i,V=s,J=Symbol("nomatch") -;var Y=(e=>{const n=Object.create(null),i=Object.create(null),s=[];let r=!0 -;const o="Could not find the language '{}', did you forget to load/include a language module?",l={ -disableAutodetect:!0,name:"Plain text",contains:[]};let d={ -ignoreUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, -languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", -cssSelector:"pre code",languages:null,__emitter:c};function g(e){ -return d.noHighlightRe.test(e)}function u(e,n,t){let a="",i="" -;"object"==typeof n?(a=e, -t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), -q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), -i=e,a=n),void 0===t&&(t=!0);const s={code:a,language:i};N("before:highlight",s) -;const r=s.result?s.result:b(s.language,s.code,t) -;return r.code=s.code,N("after:highlight",r),r}function b(e,t,i,s){ -const l=Object.create(null);function c(){if(!M.keywords)return void S.addText(k) -;let e=0;M.keywordPatternRe.lastIndex=0;let n=M.keywordPatternRe.exec(k),t="" -;for(;n;){t+=k.substring(e,n.index) -;const i=w.case_insensitive?n[0].toLowerCase():n[0],s=(a=i,M.keywords[a]);if(s){ -const[e,a]=s -;if(S.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(A+=a),e.startsWith("_"))t+=n[0];else{ -const t=w.classNameAliases[e]||e;S.addKeyword(n[0],t)}}else t+=n[0] -;e=M.keywordPatternRe.lastIndex,n=M.keywordPatternRe.exec(k)}var a -;t+=k.substr(e),S.addText(t)}function g(){null!=M.subLanguage?(()=>{ -if(""===k)return;let e=null;if("string"==typeof M.subLanguage){ -if(!n[M.subLanguage])return void S.addText(k) -;e=b(M.subLanguage,k,!0,x[M.subLanguage]),x[M.subLanguage]=e._top -}else e=m(k,M.subLanguage.length?M.subLanguage:null) -;M.relevance>0&&(A+=e.relevance),S.addSublanguage(e._emitter,e.language) -})():c(),k=""}function u(e,n){let t=1;for(;void 0!==n[t];){if(!e._emit[t]){t++ -;continue}const a=w.classNameAliases[e[t]]||e[t],i=n[t] -;a?S.addKeyword(i,a):(k=i,c(),k=""),t++}}function p(e,n){ -return e.scope&&"string"==typeof e.scope&&S.openNode(w.classNameAliases[e.scope]||e.scope), -e.beginScope&&(e.beginScope._wrap?(S.addKeyword(k,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), -k=""):e.beginScope._multi&&(u(e.beginScope,n),k="")),M=Object.create(e,{parent:{ -value:M}}),M}function _(e,n,t){let i=((e,n)=>{const t=e&&e.exec(n) -;return t&&0===t.index})(e.endRe,t);if(i){if(e["on:end"]){const t=new a(e) -;e["on:end"](n,t),t.isMatchIgnored&&(i=!1)}if(i){ -for(;e.endsParent&&e.parent;)e=e.parent;return e}} -if(e.endsWithParent)return _(e.parent,n,t)}function h(e){ -return 0===M.matcher.regexIndex?(k+=e[0],1):(R=!0,0)}function E(e){ -const n=e[0],a=t.substr(e.index),i=_(M,e,a);if(!i)return J;const s=M -;M.endScope&&M.endScope._wrap?(g(), -S.addKeyword(n,M.endScope._wrap)):M.endScope&&M.endScope._multi?(g(), -u(M.endScope,e)):s.skip?k+=n:(s.returnEnd||s.excludeEnd||(k+=n), -g(),s.excludeEnd&&(k=n));do{ -M.scope&&S.closeNode(),M.skip||M.subLanguage||(A+=M.relevance),M=M.parent -}while(M!==i.parent);return i.starts&&p(i.starts,e),s.returnEnd?0:n.length} -let y={};function N(n,s){const o=s&&s[0];if(k+=n,null==o)return g(),0 -;if("begin"===y.type&&"end"===s.type&&y.index===s.index&&""===o){ -if(k+=t.slice(s.index,s.index+1),!r){const n=Error(`0 width match regex (${e})`) -;throw n.languageName=e,n.badRule=y.rule,n}return 1} -if(y=s,"begin"===s.type)return(e=>{ -const n=e[0],t=e.rule,i=new a(t),s=[t.__beforeBegin,t["on:begin"]] -;for(const t of s)if(t&&(t(e,i),i.isMatchIgnored))return h(n) -;return t.skip?k+=n:(t.excludeBegin&&(k+=n), -g(),t.returnBegin||t.excludeBegin||(k=n)),p(t,e),t.returnBegin?0:n.length})(s) -;if("illegal"===s.type&&!i){ -const e=Error('Illegal lexeme "'+o+'" for mode "'+(M.scope||"")+'"') -;throw e.mode=M,e}if("end"===s.type){const e=E(s);if(e!==J)return e} -if("illegal"===s.type&&""===o)return 1 -;if(T>1e5&&T>3*s.index)throw Error("potential infinite loop, way more iterations than matches") -;return k+=o,o.length}const w=f(e) -;if(!w)throw P(o.replace("{}",e)),Error('Unknown language: "'+e+'"') -;const v=W(w);let O="",M=s||v;const x={},S=new d.__emitter(d);(()=>{const e=[] -;for(let n=M;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) -;e.forEach((e=>S.openNode(e)))})();let k="",A=0,C=0,T=0,R=!1;try{ -for(M.matcher.considerAll();;){ -T++,R?R=!1:M.matcher.considerAll(),M.matcher.lastIndex=C -;const e=M.matcher.exec(t);if(!e)break;const n=N(t.substring(C,e.index),e) -;C=e.index+n}return N(t.substr(C)),S.closeAllNodes(),S.finalize(),O=S.toHTML(),{ -language:e,value:O,relevance:A,illegal:!1,_emitter:S,_top:M}}catch(n){ -if(n.message&&n.message.includes("Illegal"))return{language:e,value:X(t), -illegal:!0,relevance:0,_illegalBy:{message:n.message,index:C, -context:t.slice(C-100,C+100),mode:n.mode,resultSoFar:O},_emitter:S};if(r)return{ -language:e,value:X(t),illegal:!1,relevance:0,errorRaised:n,_emitter:S,_top:M} -;throw n}}function m(e,t){t=t||d.languages||Object.keys(n);const a=(e=>{ -const n={value:X(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)} -;return n._emitter.addText(e),n})(e),i=t.filter(f).filter(y).map((n=>b(n,e,!1))) -;i.unshift(a);const s=i.sort(((e,n)=>{ -if(e.relevance!==n.relevance)return n.relevance-e.relevance -;if(e.language&&n.language){if(f(e.language).supersetOf===n.language)return 1 -;if(f(n.language).supersetOf===e.language)return-1}return 0})),[r,o]=s,c=r -;return c.secondBest=o,c}function p(e){let n=null;const t=(e=>{ -let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"" -;const t=d.languageDetectRe.exec(n);if(t){const n=f(t[1]) -;return n||(K(o.replace("{}",t[1])), -K("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"} -return n.split(/\s+/).find((e=>g(e)||f(e)))})(e);if(g(t))return -;N("before:highlightElement",{el:e,language:t -}),!d.ignoreUnescapedHTML&&e.children.length>0&&(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), -console.warn("https://github.com/highlightjs/highlight.js/issues/2886"), -console.warn(e)),n=e;const a=n.textContent,s=t?u(a,{language:t,ignoreIllegals:!0 -}):m(a);e.innerHTML=s.value,((e,n,t)=>{const a=n&&i[n]||t -;e.classList.add("hljs"),e.classList.add("language-"+a) -})(e,t,s.language),e.result={language:s.language,re:s.relevance, -relevance:s.relevance},s.secondBest&&(e.secondBest={ -language:s.secondBest.language,relevance:s.secondBest.relevance -}),N("after:highlightElement",{el:e,result:s,text:a})}let _=!1;function h(){ -"loading"!==document.readyState?document.querySelectorAll(d.cssSelector).forEach(p):_=!0 -}function f(e){return e=(e||"").toLowerCase(),n[e]||n[i[e]]} -function E(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ -i[e.toLowerCase()]=n}))}function y(e){const n=f(e) -;return n&&!n.disableAutodetect}function N(e,n){const t=e;s.forEach((e=>{ -e[t]&&e[t](n)}))} -"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ -_&&h()}),!1),Object.assign(e,{highlight:u,highlightAuto:m,highlightAll:h, -highlightElement:p, -highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"), -q("10.7.0","Please use highlightElement now."),p(e)),configure:e=>{d=V(d,e)}, -initHighlighting:()=>{ -h(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, -initHighlightingOnLoad:()=>{ -h(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") -},registerLanguage:(t,a)=>{let i=null;try{i=a(e)}catch(e){ -if(P("Language definition for '{}' could not be registered.".replace("{}",t)), -!r)throw e;P(e),i=l} -i.name||(i.name=t),n[t]=i,i.rawDefinition=a.bind(null,e),i.aliases&&E(i.aliases,{ -languageName:t})},unregisterLanguage:e=>{delete n[e] -;for(const n of Object.keys(i))i[n]===e&&delete i[n]}, -listLanguages:()=>Object.keys(n),getLanguage:f,registerAliases:E, -autoDetection:y,inherit:V,addPlugin:e=>{(e=>{ -e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{ -e["before:highlightBlock"](Object.assign({block:n.el},n)) -}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{ -e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),s.push(e)} -}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0},e.versionString="11.2.0" -;for(const e in C)"object"==typeof C[e]&&t(C[e]);return Object.assign(e,C),e -})({});const ee=e=>({IMPORTANT:{scope:"meta",begin:"!important"},HEXCOLOR:{ -scope:"number",begin:"#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})"}, -ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", -contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ -scope:"number", -begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", -relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/} -}),ne=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],te=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ae=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ie=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],se=["align-content","align-items","align-self","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","auto","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","clip-path","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-variant","font-variant-ligatures","font-variation-settings","font-weight","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inherit","initial","justify-content","left","letter-spacing","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","max-height","max-width","min-height","min-width","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","perspective","perspective-origin","pointer-events","position","quotes","resize","right","src","tab-size","table-layout","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-indent","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","white-space","widows","width","word-break","word-spacing","word-wrap","z-index"].reverse(),re=ae.concat(ie) -;var oe="\\.([0-9](_*[0-9])*)",le="[0-9a-fA-F](_*[0-9a-fA-F])*",ce={ -className:"number",variants:[{ -begin:`(\\b([0-9](_*[0-9])*)((${oe})|\\.)?|(${oe}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:`\\b([0-9](_*[0-9])*)((${oe})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ -begin:`(${oe})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ -begin:`\\b0[xX]((${le})\\.?|(${le})?\\.(${le}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` -},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${le})[lL]?\\b`},{ -begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], -relevance:0};function de(e,n,t){return-1===t?"":e.replace(n,(a=>de(e,n,t-1)))} -const ge="[A-Za-z$_][0-9A-Za-z$_]*",ue=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],be=["true","false","null","undefined","NaN","Infinity"],me=["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer","BigInt64Array","BigUint64Array","BigInt"],pe=["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_e=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],he=["arguments","this","super","console","window","document","localStorage","module","global"],fe=[].concat(_e,me,pe) -;function Ee(e){const n=ge,t={begin:/<[A-Za-z0-9\\._:-]+/, -end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ -const t=e[0].length+e.index,a=e.input[t];"<"!==a?">"===a&&(((e,{after:n})=>{ -const t="",x={ -match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,g(M)],className:{1:"keyword", -3:"title.function"},contains:[h]};return{name:"Javascript", -aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:_}, -illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node", -relevance:5}),{label:"use_strict",className:"meta",relevance:10, -begin:/^\s*['"]use (strict|asm)['"]/ -},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,c,d,u,r,E,{className:"attr", -begin:n+g(":"),relevance:0},x,{ -begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", -keywords:"return throw case",relevance:0,contains:[u,e.REGEXP_MODE,{ -className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{ -className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{ -className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, -excludeEnd:!0,keywords:a,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/, -relevance:0},{variants:[{begin:"<>",end:""},{begin:t.begin, -"on:begin":t.isTrulyOpeningTag,end:t.end}],subLanguage:"xml",contains:[{ -begin:t.begin,end:t.end,skip:!0,contains:["self"]}]}]},y,{ -beginKeywords:"while if switch catch for"},{ -begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", -returnBegin:!0,label:"func.def",contains:[h,e.inherit(e.TITLE_MODE,{begin:n, -className:"title.function"})]},{match:/\.\.\./,relevance:0},v,{match:"\\$"+n, -relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, -contains:[h]},N,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, -className:"variable.constant"},f,O,{match:/\$[(.]/}]}} -const ye=e=>b(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Ne=["Protocol","Type"].map(ye),we=["init","self"].map(ye),ve=["Any","Self"],Oe=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Me=["false","nil","true"],xe=["assignment","associativity","higherThan","left","lowerThan","none","right"],Se=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],ke=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ae=m(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Ce=m(Ae,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Te=b(Ae,Ce,"*"),Re=m(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),De=m(Re,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ie=b(Re,De,"*"),Le=b(/[A-Z]/,De,"*"),Be=["autoclosure",b(/convention\(/,m("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",b(/objc\(/,Ie,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],$e=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] -;var ze=Object.freeze({__proto__:null,grmr_bash:e=>{const n={},t={begin:/\$\{/, -end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{ -className:"variable",variants:[{ -begin:b(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},t]});const a={ -className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={ -begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, -end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(s);const r={begin:/\$\(\(/, -end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n] -},o=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 -}),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, -contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ -name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/, -keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], -literal:["true","false"], -built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp" -},contains:[o,e.SHEBANG(),l,r,e.HASH_COMMENT_MODE,i,s,{className:"",begin:/\\"/ -},{className:"string",begin:/'/,end:/'/},n]}},grmr_c:e=>{ -const n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}] -}),t="[a-zA-Z_]\\w*::",a="(decltype\\(auto\\)|"+u(t)+"[a-zA-Z_]\\w*"+u("<[^<>]+>")+")",i={ -className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ -match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{ -begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ -begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", -end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ -begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},r={ -className:"number",variants:[{begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" -},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},o={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ -keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" -},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{ -className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={ -className:"title",begin:u(t)+e.IDENT_RE,relevance:0 -},c=u(t)+e.IDENT_RE+"\\s*\\(",d={ -keyword:["asm","auto","break","case","const","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","static","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], -type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","complex","bool","imaginary"], -literal:"true false NULL", -built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" -},g=[o,i,n,e.C_BLOCK_COMMENT_MODE,r,s],b={variants:[{begin:/=/,end:/;/},{ -begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], -keywords:d,contains:g.concat([{begin:/\(/,end:/\)/,keywords:d, -contains:g.concat(["self"]),relevance:0}]),relevance:0},m={ -begin:"("+a+"[\\*&\\s]+)+"+c,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, -keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", -keywords:d,relevance:0},{begin:c,returnBegin:!0,contains:[e.inherit(l,{ -className:"title.function"})],relevance:0},{relevance:0,match:/,/},{ -className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0, -contains:[n,e.C_BLOCK_COMMENT_MODE,s,r,i,{begin:/\(/,end:/\)/,keywords:d, -relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,r,i]}] -},i,n,e.C_BLOCK_COMMENT_MODE,o]};return{name:"C",aliases:["h"],keywords:d, -disableAutodetect:!0,illegal:"=]/,contains:[{ -beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:o, -strings:s,keywords:d}}},grmr_cpp:e=>{const n=e.COMMENT("//","$",{contains:[{ -begin:/\\\n/}] -}),t="[a-zA-Z_]\\w*::",a="(?!struct)(decltype\\(auto\\)|"+u(t)+"[a-zA-Z_]\\w*"+u("<[^<>]+>")+")",i={ -className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{ -begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ -begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", -end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ -begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},r={ -className:"number",variants:[{begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" -},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},o={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ -keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" -},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{ -className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={ -className:"title",begin:u(t)+e.IDENT_RE,relevance:0 -},c=u(t)+e.IDENT_RE+"\\s*\\(",d={ -type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t"], -keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","signed","sizeof","static","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","unsigned","using","virtual","volatile","while","xor","xor_eq,"], -literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], -_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] -},m={className:"function.dispatch",relevance:0,keywords:{ -_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] -}, -begin:b(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!while)/,e.IDENT_RE,g(/(<[^<>]+>|)\s*\(/)) -},p=[m,o,i,n,e.C_BLOCK_COMMENT_MODE,r,s],_={variants:[{begin:/=/,end:/;/},{ -begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], -keywords:d,contains:p.concat([{begin:/\(/,end:/\)/,keywords:d, -contains:p.concat(["self"]),relevance:0}]),relevance:0},h={className:"function", -begin:"("+a+"[\\*&\\s]+)+"+c,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, -keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", -keywords:d,relevance:0},{begin:c,returnBegin:!0,contains:[l],relevance:0},{ -begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,r]},{ -relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:d, -relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,s,r,i,{begin:/\(/,end:/\)/, -keywords:d,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,s,r,i]}] -},i,n,e.C_BLOCK_COMMENT_MODE,o]};return{name:"C++", -aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:d,illegal:"",keywords:d,contains:["self",i]},{begin:e.IDENT_RE+"::",keywords:d},{ -match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], -className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={ -keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), -built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], -literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{ -begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ -begin:"\\b(0b[01']+)"},{ -begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ -begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" -}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] -},s=e.inherit(i,{illegal:/\n/}),r={className:"subst",begin:/\{/,end:/\}/, -keywords:n},o=e.inherit(r,{illegal:/\n/}),l={className:"string",begin:/\$"/, -end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ -},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{ -begin:/\{\{/},{begin:/\}\}/},{begin:'""'},r]},d=e.inherit(c,{illegal:/\n/, -contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]}) -;r.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], -o.contains=[d,l,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ -illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t] -},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={ -begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], -keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, -contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ -begin:"\x3c!--|--\x3e"},{begin:""}]}] -}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", -end:"$",keywords:{ -keyword:"if else elif endif define undef warning error line region endregion pragma checksum" -}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, -illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" -},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", -relevance:0,end:/[{;=]/,illegal:/[^\s:]/, -contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ -beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, -contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", -begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ -className:"string",begin:/"/,end:/"/}]},{ -beginKeywords:"new return throw await else",relevance:0},{className:"function", -begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, -end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ -beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", -relevance:0},{begin:e.IDENT_RE+"\\s*(<.+>\\s*)?\\(",returnBegin:!0, -contains:[e.TITLE_MODE,u],relevance:0},{className:"params",begin:/\(/,end:/\)/, -excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, -contains:[g,a,e.C_BLOCK_COMMENT_MODE] -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{ -const n=ee(e),t=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS", -case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"}, -classNameAliases:{keyframePosition:"selector-tag"}, -contains:[e.C_BLOCK_COMMENT_MODE,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ -},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 -},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 -},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ -begin:":("+ae.join("|")+")"},{begin:"::("+ie.join("|")+")"}]},n.CSS_VARIABLE,{ -className:"attribute",begin:"\\b("+se.join("|")+")\\b"},{begin:":",end:"[;}]", -contains:[n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...t,{ -begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" -},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}] -},{className:"built_in",begin:/[\w-]+(?=\()/}]},{begin:g(/@/),end:"[{;]", -relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/ -},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ -$pattern:/[a-z-]+/,keyword:"and or not only",attribute:te.join(" ")},contains:[{ -begin:/[a-z-]+(?=:)/,className:"attribute"},...t,n.CSS_NUMBER_MODE]}]},{ -className:"selector-tag",begin:"\\b("+ne.join("|")+")\\b"}]}},grmr_diff:e=>({ -name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10, -match:m(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/) -},{className:"comment",variants:[{ -begin:m(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/), -end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{ -className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, -end:/$/}]}),grmr_go:e=>{const n={ -keyword:["break","default","func","interface","select","case","map","struct","chan","else","goto","package","switch","const","fallthrough","if","range","type","continue","for","import","return","var","go","defer","bool","byte","complex64","complex128","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"], -literal:["true","false","iota","nil"], -built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"] -};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{const n={ -className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{ -begin:e.NUMBER_RE}]},t=e.COMMENT();t.variants=[{begin:/;/,end:/$/},{begin:/#/, -end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{ -begin:/\$\{(.*?)\}/}]},i={className:"literal", -begin:/\bon|off|true|false|yes|no\b/},s={className:"string", -contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{ -begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}] -},r={begin:/\[/,end:/\]/,contains:[t,i,a,s,n,"self"],relevance:0 -},o=m(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI", -aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[t,{ -className:"section",begin:/\[+/,end:/\]+/},{ -begin:b(o,"(\\s*\\.\\s*",o,")*",g(/\s*=\s*[^#\s]/)),className:"attr",starts:{ -end:/$/,contains:[t,r,i,a,s,n]}}]}},grmr_java:e=>{ -const n="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",t=n+de("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),a={ -keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do"], -literal:["false","true","null"], -type:["char","boolean","long","float","int","byte","short","double"], -built_in:["super","this"]},i={className:"meta",begin:"@"+n,contains:[{ -begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/, -end:/\)/,keywords:a,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0} -;return{name:"Java",aliases:["jsp"],keywords:a,illegal:/<\/|#/, -contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, -relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ -begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ -match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{ -1:"keyword",3:"title.class"}},{begin:[n,/\s+/,n,/\s+/,/=/],className:{1:"type", -3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword", -3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ -beginKeywords:"new throw return else",relevance:0},{ -begin:["(?:"+t+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{ -2:"title.function"},keywords:a,contains:[{className:"params",begin:/\(/, -end:/\)/,keywords:a,relevance:0, -contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,ce,e.C_BLOCK_COMMENT_MODE] -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},ce,i]}},grmr_javascript:Ee, -grmr_json:e=>({name:"JSON",contains:[{className:"attr", -begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/, -className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{ -beginKeywords:"true false null" -},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}), -grmr_kotlin:e=>{const n={ -keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", -built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", -literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" -},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={ -className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string", -variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'", -illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, -contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(s);const r={ -className:"meta", -begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" -},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, -end:/\)/,contains:[e.inherit(s,{className:"string"})]}] -},l=ce,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={ -variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, -contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g], -{name:"Kotlin",aliases:["kt","kts"],keywords:n, -contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", -begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword", -begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", -begin:/@\w+/}]}},t,r,o,{className:"function",beginKeywords:"fun",end:"[(]|$", -returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ -begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, -contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, -keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, -endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, -endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0 -},e.C_LINE_COMMENT_MODE,c,r,o,s,e.C_NUMBER_MODE]},c]},{className:"class", -beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, -illegal:"extends implements",contains:[{ -beginKeywords:"public protected internal private constructor" -},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, -excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/, -excludeBegin:!0,returnEnd:!0},r,o]},s,{className:"meta",begin:"^#!/usr/bin/env", -end:"$",illegal:"\n"},l]}},grmr_less:e=>{ -const n=ee(e),t=re,a="([\\w-]+|@\\{[\\w-]+\\})",i=[],s=[],r=e=>({ -className:"string",begin:"~?"+e+".*?"+e}),o=(e,n,t)=>({className:e,begin:n, -relevance:t}),l={$pattern:/[a-z-]+/,keyword:"and or not only", -attribute:te.join(" ")},c={begin:"\\(",end:"\\)",contains:s,keywords:l, -relevance:0} -;s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r("'"),r('"'),n.CSS_NUMBER_MODE,{ -begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", -excludeEnd:!0} -},n.HEXCOLOR,c,o("variable","@@?[\\w-]+",10),o("variable","@\\{[\\w-]+\\}"),o("built_in","~?`[^`]*?`"),{ -className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 -},n.IMPORTANT);const d=s.concat({begin:/\{/,end:/\}/,contains:i}),g={ -beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not" -}].concat(s)},u={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0, -contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute", -begin:"\\b("+se.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0, -illegal:"[<=$]",relevance:0,contains:s}}]},b={className:"keyword", -begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", -starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:s,relevance:0}},m={ -className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ -begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},p={variants:[{ -begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0, -returnEnd:!0,illegal:"[<='$\"]",relevance:0, -contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,o("keyword","all\\b"),o("variable","@\\{[\\w-]+\\}"),{ -begin:"\\b("+ne.join("|")+")\\b",className:"selector-tag" -},o("selector-tag",a+"%?",0),o("selector-id","#"+a),o("selector-class","\\."+a,0),o("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{ -className:"selector-pseudo",begin:":("+ae.join("|")+")"},{ -className:"selector-pseudo",begin:"::("+ie.join("|")+")"},{begin:/\(/,end:/\)/, -relevance:0,contains:d},{begin:"!important"}]},_={ -begin:`[\\w-]+:(:)?(${t.join("|")})`,returnBegin:!0,contains:[p]} -;return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,m,_,u,p),{ -name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}},grmr_lua:e=>{ -const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"] -},i=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",t,{contains:[a], -relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, -literal:"true false nil", -keyword:"and break do else elseif end for goto if in local not or repeat return then until while", -built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" -},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)", -contains:[e.inherit(e.TITLE_MODE,{ -begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", -begin:"\\(",endsWithParent:!0,contains:i}].concat(i) -},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", -begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={ -className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", -contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{ -const n=b(/[A-Z_]/,u(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),t={className:"symbol", -begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{ -className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(a,{ -begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string" -}),r=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),o={endsWithParent:!0, -illegal:/`]+/}]}]}]};return{name:"HTML, XML", -aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], -case_insensitive:!0,contains:[{className:"meta",begin://, -relevance:10,contains:[a,r,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta", -begin://,contains:[a,i,r,s]}]}]},e.COMMENT(//,{ -relevance:10}),{begin://,relevance:10},t,{ -className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag", -begin:/)/,end:/>/,keywords:{name:"style"},contains:[o],starts:{ -end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", -begin:/)/,end:/>/,keywords:{name:"script"},contains:[o],starts:{ -end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ -className:"tag",begin:/<>|<\/>/},{className:"tag", -begin:b(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name", -begin:n,relevance:0,starts:o}]},{className:"tag",begin:b(/<\//,g(b(n,/>/))), -contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0, -endsParent:!0}]}]}},grmr_markdown:e=>{const n={begin:/<\/?[A-Za-z_]/,end:">", -subLanguage:"xml",relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0 -},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, -relevance:2},{begin:b(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), -relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ -begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ -},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, -returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", -excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", -end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[], -variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},i={ -className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{ -begin:/_(?!_)/,end:/_/,relevance:0}]};a.contains.push(i),i.contains.push(a) -;let s=[n,t] -;return a.contains=a.contains.concat(s),i.contains=i.contains.concat(s), -s=s.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ -className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{ -begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", -contains:s}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", -end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:s, -end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ -begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ -begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", -contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ -begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ -className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ -className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{ -const n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n, -keyword:["@interface","@class","@protocol","@implementation"]};return{ -name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], -keywords:{$pattern:n, -keyword:["int","float","while","char","export","sizeof","typedef","const","struct","for","union","unsigned","long","volatile","static","bool","mutable","if","do","return","goto","void","enum","else","break","extern","asm","case","short","default","double","register","explicit","signed","typename","this","switch","continue","wchar_t","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","super","unichar","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"], -literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"], -built_in:["BOOL","dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"] -},illegal:"/,end:/$/,illegal:"\\n" -},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class", -begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t, -contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE, -relevance:0}]}},grmr_perl:e=>{const n=/[dualxmsipngr]{0,12}/,t={ -$pattern:/[\w.]+/, -keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" -},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:t},i={begin:/->\{/, -end:/\}/},s={variants:[{begin:/\$\d/},{ -begin:b(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") -},{begin:/[$%@][^\s\w{]/,relevance:0}] -},r=[e.BACKSLASH_ESCAPE,a,s],o=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],l=(e,t,a="\\1")=>{ -const i="\\1"===a?a:b(a,t) -;return b(b("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,a,n) -},c=(e,t,a)=>b(b("(?:",e,")"),t,/(?:\\.|[^\\\/])*?/,a,n),d=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ -endsWithParent:!0}),i,{className:"string",contains:r,variants:[{ -begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", -end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ -begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", -relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", -contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", -contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ -begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", -begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", -relevance:0},{ -begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", -keywords:"split return print reverse grep",relevance:0, -contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ -begin:l("s|tr|y",m(...o,{capture:!0}))},{begin:l("s|tr|y","\\(","\\)")},{ -begin:l("s|tr|y","\\[","\\]")},{begin:l("s|tr|y","\\{","\\}")}],relevance:2},{ -className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ -begin:c("(?:m|qr)?",/\//,/\//)},{begin:c("m|qr",m(...o,{capture:!0}),/\1/)},{ -begin:c("m|qr",/\(/,/\)/)},{begin:c("m|qr",/\[/,/\]/)},{ -begin:c("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", -end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ -begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", -subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] -}];return a.contains=d,i.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:t, -contains:d}},grmr_php:e=>{const n={className:"variable", -begin:"\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?![A-Za-z0-9])(?![$])"},t={ -className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{ -begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/, -end:/\}/}]},i=e.inherit(e.APOS_STRING_MODE,{illegal:null -}),s=e.inherit(e.QUOTE_STRING_MODE,{illegal:null, -contains:e.QUOTE_STRING_MODE.contains.concat(a)}),r=e.END_SAME_AS_BEGIN({ -begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, -contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o={className:"string", -contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(i,{begin:"b'",end:"'" -}),e.inherit(s,{begin:'b"',end:'"'}),s,i,r]},l={className:"number",variants:[{ -begin:"\\b0b[01]+(?:_[01]+)*\\b"},{begin:"\\b0o[0-7]+(?:_[0-7]+)*\\b"},{ -begin:"\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b"},{ -begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:e[+-]?\\d+)?" -}],relevance:0},c={ -keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile enum eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list match|0 mixed new object or private protected public real return string switch throw trait try unset use var void while xor yield", -literal:"false null true", -built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException UnhandledMatchError ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Stringable Throwable Traversable WeakReference WeakMap Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass" -};return{case_insensitive:!0,keywords:c, -contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t] -}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}] -}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0, -keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},n,{ -begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function", -relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0, -illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{ -begin:"=>",endsParent:!0},{className:"params",begin:"\\(",end:"\\)", -excludeBegin:!0,excludeEnd:!0,keywords:c, -contains:["self",n,e.C_BLOCK_COMMENT_MODE,o,l]}]},{className:"class",variants:[{ -beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", -illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ -beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ -beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, -contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",relevance:0,end:";", -contains:[e.UNDERSCORE_TITLE_MODE]},o,l]}},grmr_php_template:e=>({ -name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/, -subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"', -end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{ -illegal:null,className:null,contains:null,skip:!0 -}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null, -skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text",aliases:["text","txt"], -disableAutodetect:!0}),grmr_python:e=>{const n={$pattern:/[A-Za-z]\w+|__\w+__/, -keyword:["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"], -built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], -literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], -type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] -},t={className:"meta",begin:/^(>>>|\.\.\.) /},a={className:"subst",begin:/\{/, -end:/\}/,keywords:n,illegal:/#/},i={begin:/\{\{/,relevance:0},s={ -className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, -contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ -begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, -contains:[e.BACKSLASH_ESCAPE,t,i,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, -end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,i,a]},{begin:/([uU]|[rR])'/,end:/'/, -relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ -begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, -end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, -contains:[e.BACKSLASH_ESCAPE,i,a]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, -contains:[e.BACKSLASH_ESCAPE,i,a]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] -},r="[0-9](_?[0-9])*",o=`(\\b(${r}))?\\.(${r})|\\b(${r})\\.`,l={ -className:"number",relevance:0,variants:[{ -begin:`(\\b(${r})|(${o}))[eE][+-]?(${r})[jJ]?\\b`},{begin:`(${o})[jJ]?`},{ -begin:"\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\b"},{ -begin:"\\b0[bB](_?[01])+[lL]?\\b"},{begin:"\\b0[oO](_?[0-7])+[lL]?\\b"},{ -begin:"\\b0[xX](_?[0-9a-fA-F])+[lL]?\\b"},{begin:`\\b(${r})[jJ]\\b`}]},c={ -className:"comment",begin:g(/# type:/),end:/$/,keywords:n,contains:[{ -begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},d={ -className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, -end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n, -contains:["self",t,l,s,e.HASH_COMMENT_MODE]}]};return a.contains=[s,l,t],{ -name:"Python",aliases:["py","gyp","ipython"],keywords:n, -illegal:/(<\/|->|\?)|=>/,contains:[t,l,{begin:/\bself\b/},{beginKeywords:"if", -relevance:0},s,c,e.HASH_COMMENT_MODE,{match:[/def/,/\s+/,E],scope:{1:"keyword", -3:"title.function"},contains:[d]},{variants:[{ -match:[/class/,/\s+/,E,/\s*/,/\(\s*/,E,/\s*\)/]},{match:[/class/,/\s+/,E]}], -scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ -className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[l,d,s]}]}}, -grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta",starts:{ -end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{ -begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{ -const n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,t=m(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=m(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) -;return{name:"R",keywords:{$pattern:n, -keyword:"function if in break next repeat else for while", -literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", -built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" -},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, -starts:{end:g(m(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{ -scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{ -match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag", -match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] -}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], -variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ -}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ -}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ -}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ -}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ -}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', -relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ -1:"operator",2:"number"},match:[a,t]},{scope:{1:"operator",2:"number"}, -match:[/%[^%]*%/,t]},{scope:{1:"punctuation",2:"number"},match:[i,t]},{scope:{ -2:"number"},match:[/[^a-zA-Z0-9._]|^/,t]}]},{scope:{3:"operator"}, -match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{ -match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`", -contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{ -const n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",t={ -keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__", -built_in:"proc lambda",literal:"true false nil"},a={className:"doctag", -begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[a] -}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10 -}),e.COMMENT("^__END__","\\n$")],r={className:"subst",begin:/#\{/,end:/\}/, -keywords:t},o={className:"string",contains:[e.BACKSLASH_ESCAPE,r],variants:[{ -begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/, -end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{ -begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/, -end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{ -begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{ -begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ -begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ -begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ -begin:b(/<<[-~]?'?/,g(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), -contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, -contains:[e.BACKSLASH_ESCAPE,r]})]}]},l="[0-9](_?[0-9])*",c={className:"number", -relevance:0,variants:[{ -begin:`\\b([1-9](_?[0-9])*|0)(\\.(${l}))?([eE][+-]?(${l})|r)?i?\\b`},{ -begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" -},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ -begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ -begin:"\\b0(_?[0-7])+r?i?\\b"}]},d={className:"params",begin:"\\(",end:"\\)", -endsParent:!0,keywords:t},u=[o,{className:"class",beginKeywords:"class module", -end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{ -begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{ -begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(s)},{ -className:"function",begin:b(/def\s+/,g(n+"\\s*(\\(|;|$)")),relevance:0, -keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n -}),d].concat(s)},{begin:e.IDENT_RE+"::"},{className:"symbol", -begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", -begin:":(?!\\s)",contains:[o,{begin:n}],relevance:0},c,{className:"variable", -begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ -className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:t},{ -begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{ -className:"regexp",contains:[e.BACKSLASH_ESCAPE,r],illegal:/\n/,variants:[{ -begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(", -end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}] -}].concat(i,s),relevance:0}].concat(i,s);r.contains=u,d.contains=u;const m=[{ -begin:/^\s*=>/,starts:{end:"$",contains:u}},{className:"meta", -begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", -starts:{end:"$",contains:u}}];return s.unshift(i),{name:"Ruby", -aliases:["rb","gemspec","podspec","thor","irb"],keywords:t,illegal:/\/\*/, -contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(s).concat(u)}}, -grmr_rust:e=>{const n={className:"title.function.invoke",relevance:0, -begin:b(/\b/,/(?!let\b)/,e.IDENT_RE,g(/\s*\(/)) -},t="([ui](8|16|32|64|128|size)|f(32|64))?",a=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"] -;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?", -type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"], -keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], -literal:["true","false","Some","None","Ok","Err"],built_in:a},illegal:""},n]}}, -grmr_scss:e=>{const n=ee(e),t=ie,a=ae,i="@[a-z-]+",s={className:"variable", -begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"};return{name:"SCSS",case_insensitive:!0, -illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{ -className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ -className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 -},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", -begin:"\\b("+ne.join("|")+")\\b",relevance:0},{className:"selector-pseudo", -begin:":("+a.join("|")+")"},{className:"selector-pseudo", -begin:"::("+t.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE] -},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+se.join("|")+")\\b"},{ -begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" -},{begin:":",end:";", -contains:[s,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT] -},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{ -begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, -keyword:"and or not only",attribute:te.join(" ")},contains:[{begin:i, -className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" -},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]}]}}, -grmr_shell:e=>({name:"Shell Session",aliases:["console","shellsession"], -contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{ -end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}),grmr_sql:e=>{ -const n=e.COMMENT("--","$"),t=["true","false","unknown"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],r=i,o=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!i.includes(e))),l={ -begin:b(/\b/,m(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};return{ -name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ -$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:n,when:t}={})=>{const a=t -;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?e+"|0":e)) -})(o,{when:e=>e.length<3}),literal:t,type:a, -built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] -},contains:[{begin:m(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, -keyword:o.concat(s),literal:t,type:a}},{className:"type", -begin:m("double precision","large object","with timezone","without timezone") -},l,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ -begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ -begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator", -begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}, -grmr_swift:e=>{const n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{ -contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,m(...Ne,...we)], -className:{2:"keyword"}},s={match:b(/\./,m(...Oe)),relevance:0 -},r=Oe.filter((e=>"string"==typeof e)).concat(["_|0"]),o={variants:[{ -className:"keyword", -match:m(...Oe.filter((e=>"string"!=typeof e)).concat(ve).map(ye),...we)}]},l={ -$pattern:m(/\b\w+/,/#\w+/),keyword:r.concat(Se),literal:Me},c=[i,s,o],d=[{ -match:b(/\./,m(...ke)),relevance:0},{className:"built_in", -match:b(/\b/,m(...ke),/(?=\()/)}],u={match:/->/,relevance:0},p=[u,{ -className:"operator",relevance:0,variants:[{match:Te},{match:`\\.(\\.|${Ce})+`}] -}],_="([0-9a-fA-F]_*)+",h={className:"number",relevance:0,variants:[{ -match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{ -match:`\\b0x(${_})(\\.(${_}))?([pP][+-]?(([0-9]_*)+))?\\b`},{ -match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({ -className:"subst",variants:[{match:b(/\\/,e,/[0\\tnr"']/)},{ -match:b(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(e="")=>({className:"subst", -match:b(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst", -label:"interpol",begin:b(/\\/,e,/\(/),end:/\)/}),N=(e="")=>({begin:b(e,/"""/), -end:b(/"""/,e),contains:[f(e),E(e),y(e)]}),w=(e="")=>({begin:b(e,/"/), -end:b(/"/,e),contains:[f(e),y(e)]}),v={className:"string", -variants:[N(),N("#"),N("##"),N("###"),w(),w("#"),w("##"),w("###")]},O={ -match:b(/`/,Ie,/`/)},M=[O,{className:"variable",match:/\$\d+/},{ -className:"variable",match:`\\$${De}+`}],x=[{match:/(@|#)available/, -className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:$e, -contains:[...p,h,v]}]}},{className:"keyword",match:b(/@/,m(...Be))},{ -className:"meta",match:b(/@/,Ie)}],S={match:g(/\b[A-Z]/),relevance:0,contains:[{ -className:"type", -match:b(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,De,"+") -},{className:"type",match:Le,relevance:0},{match:/[?!]+/,relevance:0},{ -match:/\.\.\./,relevance:0},{match:b(/\s+&\s+/,g(Le)),relevance:0}]},k={ -begin://,keywords:l,contains:[...a,...c,...x,u,S]};S.contains.push(k) -;const A={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{ -match:b(Ie,/\s*:/),keywords:"_|0",relevance:0 -},...a,...c,...d,...p,h,v,...M,...x,S]},C={begin://,contains:[...a,S] -},T={begin:/\(/,end:/\)/,keywords:l,contains:[{ -begin:m(g(b(Ie,/\s*:/)),g(b(Ie,/\s+/,Ie,/\s*:/))),end:/:/,relevance:0, -contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ie}] -},...a,...c,...p,h,v,...x,S,A],endsParent:!0,illegal:/["']/},R={ -match:[/func/,/\s+/,m(O.match,Ie,Te)],className:{1:"keyword",3:"title.function" -},contains:[C,T,n],illegal:[/\[/,/%/]},D={ -match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"}, -contains:[C,T,n],illegal:/\[|%/},I={match:[/operator/,/\s+/,Te],className:{ -1:"keyword",3:"title"}},L={begin:[/precedencegroup/,/\s+/,Le],className:{ -1:"keyword",3:"title"},contains:[S],keywords:[...xe,...Me],end:/}/} -;for(const e of v.variants){const n=e.contains.find((e=>"interpol"===e.label)) -;n.keywords=l;const t=[...c,...d,...p,h,v,...M];n.contains=[...t,{begin:/\(/, -end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l, -contains:[...a,R,D,{beginKeywords:"struct protocol class extension enum actor", -end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{ -className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c] -},I,L,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0 -},...c,...d,...p,h,v,...M,...x,S,A]}},grmr_typescript:e=>{const n={$pattern:ge, -keyword:ue.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]), -literal:be, -built_in:fe.concat(["any","void","number","boolean","string","object","never","enum"]), -"variable.language":he},t={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*" -},a=(e,n,t)=>{const a=e.contains.findIndex((e=>e.label===n)) -;if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t) -},i=Ee(e) -;return Object.assign(i.keywords,n),i.exports.PARAMS_CONTAINS.push(t),i.contains=i.contains.concat([t,{ -beginKeywords:"namespace",end:/\{/,excludeEnd:!0},{beginKeywords:"interface", -end:/\{/,excludeEnd:!0,keywords:"interface extends" -}]),a(i,"shebang",e.SHEBANG()),a(i,"use_strict",{className:"meta",relevance:10, -begin:/^\s*['"]use strict['"]/ -}),i.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(i,{ -name:"TypeScript",aliases:["ts","tsx"]}),i},grmr_vbnet:e=>{ -const n=/\d{1,2}\/\d{1,2}\/\d{4}/,t=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,i=/\d{1,2}(:\d{1,2}){1,2}/,s={ -className:"literal",variants:[{begin:b(/# */,m(t,n),/ *#/)},{ -begin:b(/# */,i,/ *#/)},{begin:b(/# */,a,/ *#/)},{ -begin:b(/# */,m(t,n),/ +/,m(a,i),/ *#/)}]},r=e.COMMENT(/'''/,/$/,{contains:[{ -className:"doctag",begin:/<\/?/,end:/>/}]}),o=e.COMMENT(null,/$/,{variants:[{ -begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET", -aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{ -keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", -built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", -type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", -literal:"true false nothing"}, -illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ -className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, -end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0, -variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ -},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ -begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ -className:"label",begin:/^\w+:/},r,o,{className:"meta", -begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, -end:/$/,keywords:{ -keyword:"const disable else elseif enable end externalsource if region then"}, -contains:[o]}]}},grmr_yaml:e=>{ -const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={ -className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ -},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", -variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{ -variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={ -end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},r={begin:/\{/, -end:/\}/,contains:[s],illegal:"\\n",relevance:0},o={begin:"\\[",end:"\\]", -contains:[s],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{ -begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ -begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", -relevance:10},{className:"string", -begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ -begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, -relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type", -begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t -},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", -begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", -relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ -className:"number", -begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" -},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},r,o,a],c=[...l] -;return c.pop(),c.push(i),s.contains=c,{name:"YAML",case_insensitive:!0, -aliases:["yml"],contains:l}}});const Fe=Y;for(const e of Object.keys(ze)){ -const n=e.replace("grmr_","").replace("_","-");Fe.registerLanguage(n,ze[e])} -return Fe}() -;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/jquery.min.js b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/jquery.min.js deleted file mode 100644 index 200b54e4..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
    ",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 -api.push({ - alias: '${api.alias}', - order: '${api.order}', - desc: '${removeLineBreaks(api.desc)}', - link: '${removeLineBreaks(api.link)}', - list: [] -}) -<%for(doc in api.list) {%> -api[${apiLP.dataIndex}].list.push({ - order: '${doc.order}', - desc: '${removeLineBreaks(doc.desc)}', -}); -<%}%> -<%}%> -document.onkeydown = keyDownSearch; -function keyDownSearch(e) { - const theEvent = e; - const code = theEvent.keyCode || theEvent.which || theEvent.charCode; - if (code === 13) { - const search = document.getElementById('search'); - const searchValue = search.value; - let searchArr = []; - for (let i = 0; i < api.length; i++) { - let apiData = api[i]; - const desc = apiData.desc; - if (desc.toLocaleLowerCase().indexOf(searchValue) > -1) { - searchArr.push({ - order: apiData.order, - desc: apiData.desc, - link: apiData.link, - alias: apiData.alias, - list: apiData.list - }); - } else { - let methodList = apiData.list || []; - let methodListTemp = []; - for (let j = 0; j < methodList.length; j++) { - const methodData = methodList[j]; - const methodDesc = methodData.desc; - if (methodDesc.toLocaleLowerCase().indexOf(searchValue) > -1) { - methodListTemp.push(methodData); - break; - } - } - if (methodListTemp.length > 0) { - const data = { - order: apiData.order, - desc: apiData.desc, - alias: apiData.alias, - link: apiData.link, - list: methodListTemp - }; - searchArr.push(data); - } - } - } - let html; - if (searchValue === '') { - const liClass = ""; - const display = "display: none"; - html = buildAccordion(api,liClass,display); - document.getElementById('accordion').innerHTML = html; - } else { - const liClass = "open"; - const display = "display: block"; - html = buildAccordion(searchArr,liClass,display); - document.getElementById('accordion').innerHTML = html; - } - const Accordion = function (el, multiple) { - this.el = el || {}; - this.multiple = multiple || false; - const links = this.el.find('.dd'); - links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); - }; - Accordion.prototype.dropdown = function (e) { - const $el = e.data.el; - let $this = $(this), $next = $this.next(); - $next.slideToggle(); - $this.parent().toggleClass('open'); - if (!e.data.multiple) { - $el.find('.submenu').not($next).slideUp("20").parent().removeClass('open'); - } - }; - new Accordion($('#accordion'), false); - } -} - -function buildAccordion(apiData, liClass, display) { - let html = ""; - if (apiData.length > 0) { - for (let j = 0; j < apiData.length; j++) { - html += '
  • '; - html += '' + apiData[j].order + '. ' + apiData[j].desc + ''; - html += ''; - html += '
  • '; - } - } - return html; -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/search_all.js.btl b/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/search_all.js.btl deleted file mode 100644 index 3161ea34..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/main/resources/template/js/search_all.js.btl +++ /dev/null @@ -1,176 +0,0 @@ -let api = []; -const apiDocListSize = ${apiDocList.~size} -<%for(apiGroup in apiDocList) {%> -api.push({ - name: '${strUtil.replace(apiGroup.group, "\'", "\\'")}', - order: '${apiGroup.order}', - list: [] -}) -<%for(api in apiGroup.childrenApiDocs) {%> -api[${apiGroupLP.dataIndex}].list.push({ - alias: '${strUtil.replace(api.alias, "\'", "\\'")}', - order: '${api.order}', - link: '${strUtil.replace(removeLineBreaks(api.link), "\'", "\\'")}', - desc: '${strUtil.replace(removeLineBreaks(api.desc), "\'", "\\'")}', - list: [] -}) -<%for(doc in api.list) {%> -api[${apiGroupLP.dataIndex}].list[${apiLP.dataIndex}].list.push({ - order: '${doc.order}', - deprecated: '${doc.deprecated}', - url: '${doc.url}', - desc: '${strUtil.replace(removeLineBreaks(doc.desc), "\'", "\\'")}', -}); -<%}%> -<%}%> -<%}%> -document.onkeydown = keyDownSearch; -function keyDownSearch(e) { - const theEvent = e; - const code = theEvent.keyCode || theEvent.which || theEvent.charCode; - if (code === 13) { - const search = document.getElementById('search'); - const searchValue = search.value.toLocaleLowerCase(); - - let searchGroup = []; - for (let i = 0; i < api.length; i++) { - - let apiGroup = api[i]; - - let searchArr = []; - for (let i = 0; i < apiGroup.list.length; i++) { - let apiData = apiGroup.list[i]; - const desc = apiData.desc; - if (desc.toLocaleLowerCase().indexOf(searchValue) > -1) { - searchArr.push({ - order: apiData.order, - desc: apiData.desc, - link: apiData.link, - list: apiData.list - }); - } else { - let methodList = apiData.list || []; - let methodListTemp = []; - for (let j = 0; j < methodList.length; j++) { - const methodData = methodList[j]; - const methodDesc = methodData.desc; - if (methodDesc.toLocaleLowerCase().indexOf(searchValue) > -1) { - methodListTemp.push(methodData); - break; - } - } - if (methodListTemp.length > 0) { - const data = { - order: apiData.order, - desc: apiData.desc, - link: apiData.link, - list: methodListTemp - }; - searchArr.push(data); - } - } - } - if (apiGroup.name.toLocaleLowerCase().indexOf(searchValue) > -1) { - searchGroup.push({ - name: apiGroup.name, - order: apiGroup.order, - list: searchArr - }); - continue; - } - if (searchArr.length === 0) { - continue; - } - searchGroup.push({ - name: apiGroup.name, - order: apiGroup.order, - list: searchArr - }); - } - let html; - if (searchValue === '') { - const liClass = ""; - const display = "display: none"; - html = buildAccordion(api,liClass,display); - document.getElementById('accordion').innerHTML = html; - } else { - const liClass = "open"; - const display = "display: block"; - html = buildAccordion(searchGroup,liClass,display); - document.getElementById('accordion').innerHTML = html; - } - const Accordion = function (el, multiple) { - this.el = el || {}; - this.multiple = multiple || false; - const links = this.el.find('.dd'); - links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown); - }; - Accordion.prototype.dropdown = function (e) { - const $el = e.data.el; - let $this = $(this), $next = $this.next(); - $next.slideToggle(); - $this.parent().toggleClass('open'); - if (!e.data.multiple) { - $el.find('.submenu').not($next).slideUp("20").parent().removeClass('open'); - } - }; - new Accordion($('#accordion'), false); - } -} - -function buildAccordion(apiGroups, liClass, display) { - let html = ""; - if (apiGroups.length > 0) { - if (apiDocListSize === 1) { - let apiData = apiGroups[0].list; - let order = apiGroups[0].order; - for (let j = 0; j < apiData.length; j++) { - html += '
  • '; - html += '' + apiData[j].order + '. ' + apiData[j].desc + ''; - html += ''; - html += '
  • '; - } - } else { - for (let i = 0; i < apiGroups.length; i++) { - let apiGroup = apiGroups[i]; - html += '
  • '; - html += '' + apiGroup.order + '. ' + apiGroup.name + ''; - html += ''; - html += '
  • '; - } - } - } - return html; -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/ApiDocTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/ApiDocTest.java deleted file mode 100644 index 20b95688..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/ApiDocTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.power.doc; - -import com.power.common.util.DateTimeUtil; -import com.power.doc.builder.ApiDocBuilder; -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.SourceCodePath; -import org.junit.jupiter.api.Test; - -/** - * Description: - * ApiDoc测试 - * - * @author yu 2018/06/11. - */ -public class ApiDocTest { - - /** - * 包括设置请求头,缺失注释的字段批量在文档生成期使用定义好的注释 - */ - @Test - public void testBuilderControllersApi() { - ApiConfig config = new ApiConfig(); - config.setServerUrl("http://127.0.0.1:8899"); - // config.setStrict(true); - config.setOpenUrl("http://localhost:7700/api"); - config.setAppToken("be4211613a734b45888c075741680e49"); - // config.setAppToken("7b0935531d1144e58a86d7b4f2ad23c6"); - - config.setDebugEnvName("测试环境"); - config.setInlineEnum(true); - config.setStyle("randomLight"); - config.setCreateDebugPage(true); - // config.setAuthor("test"); - config.setDebugEnvUrl("http://127.0.0.1"); - // config.setTornaDebug(true); - config.setAllInOne(true); - config.setCoverOld(true); - config.setOutPath("./demoOut"); - config.setMd5EncryptedHtmlName(true); - config.setFramework(FrameworkEnum.SPRING.getFramework()); - // 不指定SourcePaths默认加载代码为项目src/main/java下的 - config.setSourceCodePaths( - SourceCodePath.builder().setDesc("本项目代码") - .setPath("./demo/src/main/java") - ); - config.setPackageFilters("com.example.demo.controller.*"); - - long start = System.currentTimeMillis(); - ApiDocBuilder.buildApiDoc(config); - // HtmlApiDocBuilder.buildApiDoc(config); - long end = System.currentTimeMillis(); - DateTimeUtil.printRunTime(end, start); - } - - -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/GenerexTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/GenerexTest.java deleted file mode 100644 index 4d873616..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/GenerexTest.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.power.doc; - -import com.mifmif.common.regex.Generex; - -import org.junit.jupiter.api.Test; - -/** - * @author yu3.sun on 2022/10/15 - */ -public class GenerexTest { - - @Test - public void testGenerateValue() { - Generex generex = new Generex("[a-zA-Z0-9]{3}"); - // Generate random String - String randomStr = generex.random(); - System.out.println(randomStr); - - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/Main.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/Main.java deleted file mode 100644 index 81635bc2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/Main.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.power.doc; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class Main { - - private final static Set PREFIX_LIST = new HashSet<>(); - - - static { - PREFIX_LIST.add("maven"); - PREFIX_LIST.add("asm"); - PREFIX_LIST.add("tomcat"); - PREFIX_LIST.add("jboss"); - PREFIX_LIST.add("undertow"); - PREFIX_LIST.add("jackson"); - PREFIX_LIST.add("micrometer"); - PREFIX_LIST.add("spring-boot-actuator"); - PREFIX_LIST.add("sharding"); - PREFIX_LIST.add("mybatis-spring-boot-starter"); - PREFIX_LIST.add("flexmark"); - } - - public static void main(String[] args) { - Long start = System.currentTimeMillis(); - //结果集 - List list = new ArrayList<>(); - List list2 = new ArrayList<>(); - //定长10线程池 - ExecutorService exs = Executors.newFixedThreadPool(10); - final List taskList = Arrays.asList(2, 1, 3, 4, 5, 6, 7, 8, 9, 10); - try { - CompletableFuture[] cfs = taskList.stream().map(object -> CompletableFuture.supplyAsync(() -> calc(object), exs) - .thenApply(h -> Integer.toString(h)) - //如需获取任务完成先后顺序,此处代码即可 - .whenComplete((v, e) -> { - System.out.println("任务" + v + "完成!result=" + v + ",异常 e=" + e + "," + new Date()); - list2.add(v); - })).toArray(CompletableFuture[]::new); - CompletableFuture.allOf(cfs).join(); - System.out.println("任务完成先后顺序,结果list2=" + list2 + ";任务提交顺序,结果list=" + list + ",耗时=" + (System.currentTimeMillis() - start)); - } catch (Exception e) { - e.printStackTrace(); - } finally { - exs.shutdown(); - } - } - - public static Integer calc(Integer i) { - try { - if (i == 1) { - //任务1耗时3秒 - Thread.sleep(3000); - } else if (i == 5) { - //任务5耗时5秒 - Thread.sleep(5000); - } else { - //其它任务耗时1秒 - Thread.sleep(1000); - } - System.out.println("task线程:" + Thread.currentThread().getName() + "任务i=" + i + ",完成!+" + new Date()); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return i; - } - - public static boolean ignoreArtifactById(String artifactId) { - if (PREFIX_LIST.stream().anyMatch(artifactId::startsWith)) { - return true; - } - return false; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/BaseEnum.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/BaseEnum.java deleted file mode 100644 index 0527c0b0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/BaseEnum.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.power.doc.enums; - -/** - * @author chenqi - * @version 1.0 - */ -public interface BaseEnum extends IEnum { - - /** - * get the enum desc - */ - String getDesc(); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/IEnum.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/IEnum.java deleted file mode 100644 index deba6a1f..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/IEnum.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.power.doc.enums; - -/** - * @author chenqi - * @version 1.0 - */ -public interface IEnum { - - /** - * get the enum code - */ - String getCode(); -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/OrderEnum.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/OrderEnum.java deleted file mode 100644 index 63001ab2..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/enums/OrderEnum.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.power.doc.enums; - -/** - * @author yu 2019/10/31. - */ -public enum OrderEnum implements BaseEnum { - SUCCESS("0000", "success"), - - PARAM_EMPTY("1001", "必选参数为空"), - - PARAM_ERROR("1002", "参数格式错误"), - - UNKNOWN_ERROR("9999", "系统繁忙,请稍后再试...."); - - private String code; - - private String desc; - - OrderEnum(String code, String desc) { - this.code = code; - this.desc = desc; - } - - public String getCode() { - return this.code; - } - - - public String getDesc() { - return desc; - } - - @Override - public String toString() { - return "ErrorCodeEnum{" + - "code='" + code + '\'' + - ", desc='" + desc + '\'' + - '}'; - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/QboxScanSourceTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/QboxScanSourceTest.java deleted file mode 100644 index 3b14d44b..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/QboxScanSourceTest.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.power.doc.qbox; - -import java.nio.file.Paths; - -import com.power.doc.builder.HtmlApiDocBuilder; -import com.power.doc.constants.FrameworkEnum; -import com.power.doc.model.ApiConfig; -import com.power.doc.model.SourceCodePath; - -import org.junit.jupiter.api.Test; - -/** - * smart-doc - * - * @author spencer - * @project smart-doc - * @date 2022-01-2022/1/13 - */ -public class QboxScanSourceTest { - - @Test - public void scanError() { - // target source folder for scan - String testJavaDirectory = Paths.get("src", "test", "java").toAbsolutePath().toString(); - String outPath = Paths.get("target").toAbsolutePath().toString(); - - // config and scan - ApiConfig config = new ApiConfig(); - config.setServerUrl("HSF://127.0.0.1:8088"); - config.setOpenUrl("http://demo.torna.cn/api"); - config.setDebugEnvName("测试环境"); - config.setStyle("randomLight"); - config.setCreateDebugPage(true); - config.setAuthor("test"); - config.setDebugEnvUrl("HSF://127.0.0.1"); - config.setCreateDebugPage(false); - config.setAllInOne(true); - config.setOutPath(outPath); - config.setMd5EncryptedHtmlName(true); - config.setFramework(FrameworkEnum.DUBBO.getFramework()); - config.setSourceCodePaths( - SourceCodePath.builder().setDesc("tesSourceScan") - .setPath(testJavaDirectory)); - - // This bug caused not all source code to be found. - // error at ProjectDocConfigBuilder#loadJavaSource when qbox parse ScanErrorSource - HtmlApiDocBuilder.buildApiDoc(config); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/ScanErrorSource.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/ScanErrorSource.java deleted file mode 100644 index 84ed5c71..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/qbox/ScanErrorSource.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.power.doc.qbox; - -/** - * qbox scan error - */ -public class ScanErrorSource { - - - protected void record(Object invasionDto, String aggregationType, String aggregationName, Long taskId) { - - } - -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocClassUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocClassUtilTest.java deleted file mode 100644 index dc578853..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocClassUtilTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.power.doc.util; - -import com.power.doc.utils.DocClassUtil; -import com.power.doc.utils.JavaClassValidateUtil; - -import org.junit.jupiter.api.Test; - -/** - * Description: - * DocUtil junit test - * - * @author yu 2018/06/16. - */ -public class DocClassUtilTest { - - @Test - public void testGetSimpleGicName() { - char me = 'k'; - String className = "com.power.doc.controller.Teacher,com.power.doc.controller.Teacher,com.power.doc.controller.Teacher>"; - String[] arr = DocClassUtil.getSimpleGicName(className); -// System.out.println("arr:"+ JSON.toJSONString(arr)); - } - - @Test - public void testIsPrimitive() { - String typeName = "java.time.LocalDateTime"; - System.out.println(JavaClassValidateUtil.isPrimitive(typeName)); - } - - @Test - public void testProcessReturnType() { - String typeName = "org.springframework.data.domain.Pageable"; - System.out.println(DocClassUtil.rewriteRequestParam(typeName)); - - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocPathUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocPathUtilTest.java deleted file mode 100644 index e8c0f522..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocPathUtilTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.power.doc.util; - -import com.power.doc.utils.DocPathUtil; - -import org.junit.jupiter.api.Test; - -/** - * @author yu 2021/6/27. - */ -public class DocPathUtilTest { - - @Test - public void testMatches() { - String pattern = "/app/page/**"; - String path = "/app/page/{pageIndex}/{pageSize}/{ag}"; - System.out.println(DocPathUtil.matches(path, null, pattern)); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUrlUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUrlUtilTest.java deleted file mode 100644 index 6c127810..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUrlUtilTest.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.power.doc.util; - -import java.util.ArrayList; -import java.util.List; - -import com.power.doc.utils.DocUrlUtil; - -import org.junit.jupiter.api.Test; - -public class DocUrlUtilTest { - - @Test - public void getMvcUrls() { - String baseUrl = "/[/testMultiPathOne/{path}/test, /testMultiPathTwo/{path}/test]"; - List urls = new ArrayList<>(); - urls.add("[/{path2}/abc2"); - urls.add(" /{path2}/abc3]"); - String baseServer = "http://{{host}}:{{port}}"; - - System.out.println(DocUrlUtil.getMvcUrls(baseServer, baseUrl, urls)); - - } -} \ No newline at end of file diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUtilTest.java deleted file mode 100644 index 16dfa1c7..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/DocUtilTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.power.doc.util; - -import java.util.HashMap; -import java.util.Map; - -import com.power.doc.constants.DocGlobalConstants; -import com.power.doc.constants.DocLanguage; -import com.power.doc.enums.IEnum; -import com.power.doc.enums.OrderEnum; -import com.power.doc.utils.DocUtil; - -import org.junit.jupiter.api.Test; - -/** - * @author yu 2018/12/10. - */ -public class DocUtilTest { - - @Test - public void test() { - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode()); - String str = DocUtil.getValByTypeAndFieldName("string", "hostName"); - System.out.println(str); - } - - /* @Test*/ - public void testFormatAndRemove() { - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode()); - Map params = new HashMap<>(); - params.put("name", "dd"); - params.put("age", "0"); - - String url2 = "/user/getUserById/{name}/{age}"; - String me = DocUtil.formatAndRemove(url2, params); - - System.out.println(params.size()); - System.out.println(me); - } - - @Test - public void testGetInterfacesEnum() throws ClassNotFoundException { - System.out.println(IEnum.class.isAssignableFrom(OrderEnum.class)); - } - - @Test - public void testIsMatch() { - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode()); - String pattern = "com.aaa.*.controller"; - String controllerName = "com.aaa.cc.controlle"; - - System.out.println(DocUtil.isMatch(pattern, controllerName)); - } - - @Test - public void testFormatPathUrl() { - System.setProperty(DocGlobalConstants.DOC_LANGUAGE, DocLanguage.CHINESE.getCode()); - String url = "http://localhost:8080/detail/{id:[a-zA-Z0-9]{3}}/{name:[a-zA-Z0-9]{3}}"; - System.out.println(DocUtil.formatPathUrl(url)); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/JsonUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/JsonUtilTest.java deleted file mode 100644 index d3cf5899..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/JsonUtilTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.power.doc.util; - -import com.power.doc.utils.JsonUtil; - -import org.junit.jupiter.api.Test; - -/** - * @author yu 2021/6/27. - */ -public class JsonUtilTest { - - @Test - public void toPrettyFormat() { - String json = "{\"MAX_SPEED\":210,\"gender\":0,\"simpleEnum\":\"RED\",\"username\":\"梓晨.田\",\"password\":\"slujk7\",\"nickName\":\"select * from table where field = 'value'\",\"mobile\":\"17658638153\"}"; - System.out.println(JsonUtil.toPrettyFormat(json)); - } -} diff --git a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/MarkDownUtilTest.java b/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/MarkDownUtilTest.java deleted file mode 100644 index 23fa76a0..00000000 --- a/blossom-backend/smart-doc-2.6.7/src/test/java/com/power/doc/util/MarkDownUtilTest.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.power.doc.util; - - -import org.junit.jupiter.api.Test; - -/** - * @author yu 2019/9/21. - */ -public class MarkDownUtilTest { - - - @Test - public void testToHtml() { - - } -} diff --git a/blossom-editor/electron.vite.config.ts b/blossom-editor/electron.vite.config.ts index 3b5362b0..0643bdef 100644 --- a/blossom-editor/electron.vite.config.ts +++ b/blossom-editor/electron.vite.config.ts @@ -17,6 +17,11 @@ export default defineConfig({ }, renderer: { envDir: resolve('src/env'), + server: { + host: '0.0.0.0', + port: 5173, + hmr: true + }, plugins: [ vue(), visualizer({ diff --git a/blossom-editor/package-lock.json b/blossom-editor/package-lock.json index f0875d0e..079e0a22 100644 --- a/blossom-editor/package-lock.json +++ b/blossom-editor/package-lock.json @@ -20,7 +20,7 @@ "dayjs": "^1.11.10", "echarts": "^5.4.3", "electron-updater": "^5.3.0", - "element-plus": "^2.4.0", + "element-plus": "^2.4.4", "highlight.js": "^11.8.0", "hotkeys-js": "^3.12.0", "katex": "^0.16.8", @@ -32,7 +32,7 @@ "mermaid": "^10.4.0", "pinia": "^2.1.6", "prettier": "^3.0.2", - "sass": "^1.65.1", + "sass": "^1.66.1", "vue-router": "^4.2.4" }, "devDependencies": { @@ -40,9 +40,9 @@ "@electron/notarize": "^1.2.4", "@rushstack/eslint-patch": "^1.3.3", "@types/node": "^18.17.8", - "@vitejs/plugin-vue": "^4.3.3", - "@vue/eslint-config-prettier": "^7.1.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vitejs/plugin-vue": "^4.6.2", + "@vue/eslint-config-prettier": "^9.0.0", + "@vue/eslint-config-typescript": "^12.0.0", "electron": "^24.8.0", "electron-builder": "^24.6.3", "electron-vite": "^1.0.27", @@ -53,8 +53,8 @@ "unplugin-auto-import": "^0.16.7", "unplugin-vue-components": "^0.25.1", "vite": "^4.5.1", - "vue": "^3.3.4", - "vue-tsc": "^1.8.8" + "vue": "^3.4.5", + "vue-tsc": "^1.8.27" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1930,6 +1930,18 @@ "node": ">= 8" } }, + "node_modules/@pkgr/core": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.0.tgz", + "integrity": "sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@popperjs/core": { "name": "@sxzz/popperjs-es", "version": "2.11.7", @@ -2374,32 +2386,33 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.0.tgz", + "integrity": "sha512-3lqEvQUdCozi6d1mddWqd+kf8KxmGq2Plzx36BlkjuQe3rSTm/O98cLf0A4uDO+a5N1KD2SeEEl6fW97YHY+6w==", "dev": true, "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/type-utils": "6.18.0", + "@typescript-eslint/utils": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2408,25 +2421,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.18.0.tgz", + "integrity": "sha512-v6uR68SFvqhNQT41frCMCQpsP+5vySy6IdgjlzUWoo7ALCnpaWYcz/Ij2k4L8cEsL0wkvOviCMpjmtRtHNOKzA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2435,16 +2449,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.18.0.tgz", + "integrity": "sha512-o/UoDT2NgOJ2VfHpfr+KBY2ErWvCySNUIX/X7O9g8Zzt/tXdpfEU43qbNk8LVuWUT2E0ptzTWXh79i74PP0twA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -2452,25 +2466,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.18.0.tgz", + "integrity": "sha512-ZeMtrXnGmTcHciJN1+u2CigWEEXgy1ufoxtWcHORt5kGvpjjIlK9MUhzHm4RM8iVy6dqSaZA/6PVkX6+r+ChjQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "@typescript-eslint/utils": "6.18.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -2479,12 +2493,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.18.0.tgz", + "integrity": "sha512-/RFVIccwkwSdW/1zeMx3hADShWbgBxBnV/qSrex6607isYjj05t36P6LyONgqdUrNLl5TYU8NIKdHUYpFvExkA==", "dev": true, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -2492,21 +2506,22 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.0.tgz", + "integrity": "sha512-klNvl+Ql4NsBNGB4W9TZ2Od03lm7aGvTbs0wYaFYsplVPhr+oeXjlPZCDI4U9jgJIDK38W1FKhacCFzCC+nbIg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -2518,43 +2533,57 @@ } } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.18.0.tgz", + "integrity": "sha512-wiKKCbUeDPGaYEYQh1S580dGxJ/V9HI7K5sbGAVklyf+o5g3O+adnS4UNJajplF4e7z2q0uVBaTdT/yLb4XAVA==", "dev": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.0.tgz", + "integrity": "sha512-1wetAlSZpewRDb2h9p/Q8kRjdGuqdTAQbkJIOUMLug2LBLG+QOjiWoSj6/3B/hA9/tVTFFdtiKvAYoYnSRW/RA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.18.0", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -2568,9 +2597,9 @@ "dev": true }, "node_modules/@vitejs/plugin-vue": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.5.2.tgz", - "integrity": "sha512-UGR3DlzLi/SaVBPX0cnSyE37vqxU3O6chn8l0HJNzQzDia6/Au2A4xKv+iIJW8w2daf80G7TYHhi1pAUjdZ0bQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz", + "integrity": "sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==", "dev": true, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -2609,36 +2638,36 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.12.tgz", - "integrity": "sha512-qAtjyG3GBLG0chzp5xGCyRLLe6wFCHmjI82aGzwuGKyznNP+GJJMxjc0wOYWDB2YKfho7niJFdoFpo0CZZQg9w==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz", + "integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==", "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/shared": "3.3.12", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.5", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.12.tgz", - "integrity": "sha512-RdJU9oEYaoPKUdGXCy0l+i4clesdDeLmbvRlszoc9iagsnBnMmQtYfCPVQ5BHB6o7K4SCucDdJM2Dh3oXB0D6g==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz", + "integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==", "dependencies": { - "@vue/compiler-core": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-core": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.12.tgz", - "integrity": "sha512-yy5b9e7b79dsGbMmglCe/YnhCQgBkHO7Uf6JfjWPSf2/5XH+MKn18LhzhHyxbHdJgnA4lZCqtXzLaJz8Pd8lMw==", - "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.12", - "@vue/compiler-dom": "3.3.12", - "@vue/compiler-ssr": "3.3.12", - "@vue/reactivity-transform": "3.3.12", - "@vue/shared": "3.3.12", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz", + "integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==", + "dependencies": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.5", + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5", "estree-walker": "^2.0.2", "magic-string": "^0.30.5", "postcss": "^8.4.32", @@ -2646,12 +2675,12 @@ } }, "node_modules/@vue/compiler-ssr": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.12.tgz", - "integrity": "sha512-adCiMJPznfWcQyk/9HSuXGja859IaMV+b8UNSVzDatqv7h0PvT9BEeS22+gjkWofDiSg5d78/ZLls3sLA+cn3A==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz", + "integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==", "dependencies": { - "@vue/compiler-dom": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-dom": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/devtools-api": { @@ -2660,28 +2689,28 @@ "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==" }, "node_modules/@vue/eslint-config-prettier": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz", - "integrity": "sha512-Pv/lVr0bAzSIHLd9iz0KnvAr4GKyCEl+h52bc4e5yWuDVtLgFwycF7nrbWTAQAS+FU6q1geVd07lc6EWfJiWKQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-z1ZIAAUS9pKzo/ANEfd2sO+v2IUalz7cM/cTLOZ7vRFOPk5/xuRKQteOu1DErFLAh/lYGXMVZ0IfYKlyInuDVg==", "dev": true, "dependencies": { - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0" + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0" }, "peerDependencies": { - "eslint": ">= 7.28.0", - "prettier": ">= 2.0.0" + "eslint": ">= 8.0.0", + "prettier": ">= 3.0.0" } }, "node_modules/@vue/eslint-config-typescript": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.3.tgz", - "integrity": "sha512-dkt6W0PX6H/4Xuxg/BlFj5xHvksjpSlVjtkQCpaYJBIEuKj2hOVU7r+TIe+ysCwRYFz/lGqvklntRkCAibsbPw==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-12.0.0.tgz", + "integrity": "sha512-StxLFet2Qe97T8+7L8pGlhYBBr8Eg05LPuTDVopQV6il+SK6qqom59BA/rcFipUef2jD8P2X44Vd8tMFytfvlg==", "dev": true, "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", - "vue-eslint-parser": "^9.1.1" + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "vue-eslint-parser": "^9.3.1" }, "engines": { "node": "^14.17.0 || >=16.0.0" @@ -2698,9 +2727,9 @@ } }, "node_modules/@vue/language-core": { - "version": "1.8.25", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.25.tgz", - "integrity": "sha512-NJk/5DnAZlpvXX8BdWmHI45bWGLViUaS3R/RMrmFSvFMSbJKuEODpM4kR0F0Ofv5SFzCWuNiMhxameWpVdQsnA==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", "dev": true, "dependencies": { "@volar/language-core": "~1.11.1", @@ -2738,60 +2767,48 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.12.tgz", - "integrity": "sha512-vOJORzO8DlIx88cgTnMLIf2GlLYpoXAKsuoQsK6SGdaqODjxO129pVPTd2s/N/Mb6KKZEFIHIEwWGmtN4YPs+g==", - "dependencies": { - "@vue/shared": "3.3.12" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.12.tgz", - "integrity": "sha512-g5TijmML7FyKkLt6QnpqNmA4KD7K/T5SbXa88Bhq+hydNQEkzA8veVXWAQuNqg9rjaFYD0rPf0a9NofKA0ENgg==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz", + "integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==", "dependencies": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.12", - "@vue/shared": "3.3.12", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.5" + "@vue/shared": "3.4.5" } }, "node_modules/@vue/runtime-core": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.12.tgz", - "integrity": "sha512-5iL4w7MZrSGKEZU2wFAYhDZdZmgn+s//73EfgDXW1M+ZUOl36md7tlWp1QFK/ladiq4FvQ82shVjo0KiPDPr0A==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz", + "integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==", "dependencies": { - "@vue/reactivity": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/reactivity": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/runtime-dom": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.12.tgz", - "integrity": "sha512-8mMzqiIdl+IYa/OXwKwk6/4ebLq7cYV1pUcwCSwBK2KerUa6cwGosen5xrCL9f8o2DJ9TfPFwbPEvH7OXzUpoA==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz", + "integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==", "dependencies": { - "@vue/runtime-core": "3.3.12", - "@vue/shared": "3.3.12", + "@vue/runtime-core": "3.4.5", + "@vue/shared": "3.4.5", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.12.tgz", - "integrity": "sha512-OZ0IEK5TU5GXb5J8/wSplyxvGGdIcwEmS8EIO302Vz8K6fGSgSJTU54X0Sb6PaefzZdiN3vHsLXO8XIeF8crQQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz", + "integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==", "dependencies": { - "@vue/compiler-ssr": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5" }, "peerDependencies": { - "vue": "3.3.12" + "vue": "3.4.5" } }, "node_modules/@vue/shared": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.12.tgz", - "integrity": "sha512-6p0Yin0pclvnER7BLNOQuod9Z+cxSYh8pSh7CzHnWNjAIP6zrTlCdHRvSCb1aYEx6i3Q3kvfuWU7nG16CgG1ag==" + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz", + "integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg==" }, "node_modules/@vueuse/core": { "version": "9.13.0", @@ -4733,6 +4750,17 @@ "once": "^1.4.0" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -4872,9 +4900,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -4884,21 +4912,30 @@ } }, "node_modules/eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.2.tgz", + "integrity": "sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==", "dev": true, "dependencies": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" }, "engines": { - "node": ">=12.0.0" + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" }, "peerDependencies": { - "eslint": ">=7.28.0", - "prettier": ">=2.0.0" + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" }, "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, "eslint-config-prettier": { "optional": true } @@ -4925,19 +4962,6 @@ "eslint": "^6.2.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -5083,15 +5107,6 @@ "node": ">=4.0" } }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, "node_modules/estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -7057,12 +7072,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node_modules/node-addon-api": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", @@ -8143,6 +8152,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + }, "node_modules/tar": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", @@ -8246,6 +8277,18 @@ "utf8-byte-length": "^1.0.1" } }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-dedent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", @@ -8259,27 +8302,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tsutils/node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -8669,15 +8691,15 @@ } }, "node_modules/vue": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.12.tgz", - "integrity": "sha512-jYNv2QmET2OTHsFzfWHMnqgCfqL4zfo97QwofdET+GBRCHhSCHuMTTvNIgeSn0/xF3JRT5OGah6MDwUFN7MPlg==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz", + "integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==", "dependencies": { - "@vue/compiler-dom": "3.3.12", - "@vue/compiler-sfc": "3.3.12", - "@vue/runtime-dom": "3.3.12", - "@vue/server-renderer": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-sfc": "3.4.5", + "@vue/runtime-dom": "3.4.5", + "@vue/server-renderer": "3.4.5", + "@vue/shared": "3.4.5" }, "peerDependencies": { "typescript": "*" @@ -8752,9 +8774,9 @@ } }, "node_modules/vue-template-compiler": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.15.tgz", - "integrity": "sha512-yQxjxMptBL7UAog00O8sANud99C6wJF+7kgbcwqkvA38vCGF7HWE66w0ZFnS/kX5gSoJr/PQ4/oS3Ne2pW37Og==", + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", "dev": true, "dependencies": { "de-indent": "^1.0.2", @@ -8762,13 +8784,13 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.25", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.25.tgz", - "integrity": "sha512-lHsRhDc/Y7LINvYhZ3pv4elflFADoEOo67vfClAfF2heVHpHmVquLSjojgCSIwzA4F0Pc4vowT/psXCYcfk+iQ==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", "dev": true, "dependencies": { "@volar/typescript": "~1.11.1", - "@vue/language-core": "1.8.25", + "@vue/language-core": "1.8.27", "semver": "^7.5.4" }, "bin": { @@ -10343,6 +10365,12 @@ "fastq": "^1.6.0" } }, + "@pkgr/core": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.0.tgz", + "integrity": "sha512-Zwq5OCzuwJC2jwqmpEQt7Ds1DTi6BWSwoGkbb1n9pO3hzb35BoJELx7c0T23iDkBGkh2e7tvOtjF3tr3OaQHDQ==", + "dev": true + }, "@popperjs/core": { "version": "npm:@sxzz/popperjs-es@2.11.7", "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", @@ -10759,102 +10787,115 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", - "integrity": "sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.18.0.tgz", + "integrity": "sha512-3lqEvQUdCozi6d1mddWqd+kf8KxmGq2Plzx36BlkjuQe3rSTm/O98cLf0A4uDO+a5N1KD2SeEEl6fW97YHY+6w==", "dev": true, "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/type-utils": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/type-utils": "6.18.0", + "@typescript-eslint/utils": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4", "graphemer": "^1.4.0", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/parser": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", - "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.18.0.tgz", + "integrity": "sha512-v6uR68SFvqhNQT41frCMCQpsP+5vySy6IdgjlzUWoo7ALCnpaWYcz/Ij2k4L8cEsL0wkvOviCMpjmtRtHNOKzA==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", - "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.18.0.tgz", + "integrity": "sha512-o/UoDT2NgOJ2VfHpfr+KBY2ErWvCySNUIX/X7O9g8Zzt/tXdpfEU43qbNk8LVuWUT2E0ptzTWXh79i74PP0twA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0" + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0" } }, "@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.18.0.tgz", + "integrity": "sha512-ZeMtrXnGmTcHciJN1+u2CigWEEXgy1ufoxtWcHORt5kGvpjjIlK9MUhzHm4RM8iVy6dqSaZA/6PVkX6+r+ChjQ==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "@typescript-eslint/utils": "6.18.0", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", - "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.18.0.tgz", + "integrity": "sha512-/RFVIccwkwSdW/1zeMx3hADShWbgBxBnV/qSrex6607isYjj05t36P6LyONgqdUrNLl5TYU8NIKdHUYpFvExkA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", - "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.18.0.tgz", + "integrity": "sha512-klNvl+Ql4NsBNGB4W9TZ2Od03lm7aGvTbs0wYaFYsplVPhr+oeXjlPZCDI4U9jgJIDK38W1FKhacCFzCC+nbIg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/visitor-keys": "5.62.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/visitor-keys": "6.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "dependencies": { + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "@typescript-eslint/utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz", - "integrity": "sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.18.0.tgz", + "integrity": "sha512-wiKKCbUeDPGaYEYQh1S580dGxJ/V9HI7K5sbGAVklyf+o5g3O+adnS4UNJajplF4e7z2q0uVBaTdT/yLb4XAVA==", "dev": true, "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.62.0", - "@typescript-eslint/types": "5.62.0", - "@typescript-eslint/typescript-estree": "5.62.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.18.0", + "@typescript-eslint/types": "6.18.0", + "@typescript-eslint/typescript-estree": "6.18.0", + "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", - "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.18.0.tgz", + "integrity": "sha512-1wetAlSZpewRDb2h9p/Q8kRjdGuqdTAQbkJIOUMLug2LBLG+QOjiWoSj6/3B/hA9/tVTFFdtiKvAYoYnSRW/RA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.62.0", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.18.0", + "eslint-visitor-keys": "^3.4.1" } }, "@ungap/structured-clone": { @@ -10864,9 +10905,9 @@ "dev": true }, "@vitejs/plugin-vue": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.5.2.tgz", - "integrity": "sha512-UGR3DlzLi/SaVBPX0cnSyE37vqxU3O6chn8l0HJNzQzDia6/Au2A4xKv+iIJW8w2daf80G7TYHhi1pAUjdZ0bQ==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.6.2.tgz", + "integrity": "sha512-kqf7SGFoG+80aZG6Pf+gsZIVvGSCKE98JbiWqcCV9cThtg91Jav0yvYFC9Zb+jKetNGF6ZKeoaxgZfND21fWKw==", "dev": true, "requires": {} }, @@ -10899,36 +10940,36 @@ } }, "@vue/compiler-core": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.12.tgz", - "integrity": "sha512-qAtjyG3GBLG0chzp5xGCyRLLe6wFCHmjI82aGzwuGKyznNP+GJJMxjc0wOYWDB2YKfho7niJFdoFpo0CZZQg9w==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz", + "integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==", "requires": { - "@babel/parser": "^7.23.5", - "@vue/shared": "3.3.12", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.5", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "@vue/compiler-dom": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.12.tgz", - "integrity": "sha512-RdJU9oEYaoPKUdGXCy0l+i4clesdDeLmbvRlszoc9iagsnBnMmQtYfCPVQ5BHB6o7K4SCucDdJM2Dh3oXB0D6g==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz", + "integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==", "requires": { - "@vue/compiler-core": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-core": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/compiler-sfc": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.12.tgz", - "integrity": "sha512-yy5b9e7b79dsGbMmglCe/YnhCQgBkHO7Uf6JfjWPSf2/5XH+MKn18LhzhHyxbHdJgnA4lZCqtXzLaJz8Pd8lMw==", - "requires": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.12", - "@vue/compiler-dom": "3.3.12", - "@vue/compiler-ssr": "3.3.12", - "@vue/reactivity-transform": "3.3.12", - "@vue/shared": "3.3.12", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz", + "integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==", + "requires": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.5", + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5", "estree-walker": "^2.0.2", "magic-string": "^0.30.5", "postcss": "^8.4.32", @@ -10936,12 +10977,12 @@ } }, "@vue/compiler-ssr": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.12.tgz", - "integrity": "sha512-adCiMJPznfWcQyk/9HSuXGja859IaMV+b8UNSVzDatqv7h0PvT9BEeS22+gjkWofDiSg5d78/ZLls3sLA+cn3A==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz", + "integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==", "requires": { - "@vue/compiler-dom": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-dom": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/devtools-api": { @@ -10950,30 +10991,30 @@ "integrity": "sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==" }, "@vue/eslint-config-prettier": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-7.1.0.tgz", - "integrity": "sha512-Pv/lVr0bAzSIHLd9iz0KnvAr4GKyCEl+h52bc4e5yWuDVtLgFwycF7nrbWTAQAS+FU6q1geVd07lc6EWfJiWKQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-prettier/-/eslint-config-prettier-9.0.0.tgz", + "integrity": "sha512-z1ZIAAUS9pKzo/ANEfd2sO+v2IUalz7cM/cTLOZ7vRFOPk5/xuRKQteOu1DErFLAh/lYGXMVZ0IfYKlyInuDVg==", "dev": true, "requires": { - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0" + "eslint-config-prettier": "^9.0.0", + "eslint-plugin-prettier": "^5.0.0" } }, "@vue/eslint-config-typescript": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-11.0.3.tgz", - "integrity": "sha512-dkt6W0PX6H/4Xuxg/BlFj5xHvksjpSlVjtkQCpaYJBIEuKj2hOVU7r+TIe+ysCwRYFz/lGqvklntRkCAibsbPw==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@vue/eslint-config-typescript/-/eslint-config-typescript-12.0.0.tgz", + "integrity": "sha512-StxLFet2Qe97T8+7L8pGlhYBBr8Eg05LPuTDVopQV6il+SK6qqom59BA/rcFipUef2jD8P2X44Vd8tMFytfvlg==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", - "vue-eslint-parser": "^9.1.1" + "@typescript-eslint/eslint-plugin": "^6.7.0", + "@typescript-eslint/parser": "^6.7.0", + "vue-eslint-parser": "^9.3.1" } }, "@vue/language-core": { - "version": "1.8.25", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.25.tgz", - "integrity": "sha512-NJk/5DnAZlpvXX8BdWmHI45bWGLViUaS3R/RMrmFSvFMSbJKuEODpM4kR0F0Ofv5SFzCWuNiMhxameWpVdQsnA==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", "dev": true, "requires": { "@volar/language-core": "~1.11.1", @@ -10999,57 +11040,45 @@ } }, "@vue/reactivity": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.12.tgz", - "integrity": "sha512-vOJORzO8DlIx88cgTnMLIf2GlLYpoXAKsuoQsK6SGdaqODjxO129pVPTd2s/N/Mb6KKZEFIHIEwWGmtN4YPs+g==", - "requires": { - "@vue/shared": "3.3.12" - } - }, - "@vue/reactivity-transform": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.12.tgz", - "integrity": "sha512-g5TijmML7FyKkLt6QnpqNmA4KD7K/T5SbXa88Bhq+hydNQEkzA8veVXWAQuNqg9rjaFYD0rPf0a9NofKA0ENgg==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz", + "integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==", "requires": { - "@babel/parser": "^7.23.5", - "@vue/compiler-core": "3.3.12", - "@vue/shared": "3.3.12", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.5" + "@vue/shared": "3.4.5" } }, "@vue/runtime-core": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.12.tgz", - "integrity": "sha512-5iL4w7MZrSGKEZU2wFAYhDZdZmgn+s//73EfgDXW1M+ZUOl36md7tlWp1QFK/ladiq4FvQ82shVjo0KiPDPr0A==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz", + "integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==", "requires": { - "@vue/reactivity": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/reactivity": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/runtime-dom": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.12.tgz", - "integrity": "sha512-8mMzqiIdl+IYa/OXwKwk6/4ebLq7cYV1pUcwCSwBK2KerUa6cwGosen5xrCL9f8o2DJ9TfPFwbPEvH7OXzUpoA==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz", + "integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==", "requires": { - "@vue/runtime-core": "3.3.12", - "@vue/shared": "3.3.12", + "@vue/runtime-core": "3.4.5", + "@vue/shared": "3.4.5", "csstype": "^3.1.3" } }, "@vue/server-renderer": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.12.tgz", - "integrity": "sha512-OZ0IEK5TU5GXb5J8/wSplyxvGGdIcwEmS8EIO302Vz8K6fGSgSJTU54X0Sb6PaefzZdiN3vHsLXO8XIeF8crQQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz", + "integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==", "requires": { - "@vue/compiler-ssr": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/shared": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.12.tgz", - "integrity": "sha512-6p0Yin0pclvnER7BLNOQuod9Z+cxSYh8pSh7CzHnWNjAIP6zrTlCdHRvSCb1aYEx6i3Q3kvfuWU7nG16CgG1ag==" + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz", + "integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg==" }, "@vueuse/core": { "version": "9.13.0", @@ -12505,6 +12534,11 @@ "once": "^1.4.0" } }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" + }, "env-paths": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", @@ -12668,19 +12702,20 @@ } }, "eslint-config-prettier": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.10.0.tgz", - "integrity": "sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, "requires": {} }, "eslint-plugin-prettier": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", - "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.2.tgz", + "integrity": "sha512-dhlpWc9vOwohcWmClFcA+HjlvUpuyynYs0Rf+L/P6/0iQE6vlHW9l5bkfzN62/Stm9fbq8ku46qzde76T1xlSg==", "dev": true, "requires": { - "prettier-linter-helpers": "^1.0.0" + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.8.6" } }, "eslint-plugin-vue": { @@ -12698,16 +12733,6 @@ "xml-name-validator": "^4.0.0" } }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, "eslint-visitor-keys": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", @@ -12759,12 +12784,6 @@ } } }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - }, "estree-walker": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", @@ -14135,12 +14154,6 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, "node-addon-api": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-1.7.2.tgz", @@ -14904,6 +14917,24 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, + "synckit": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.8.tgz", + "integrity": "sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==", + "dev": true, + "requires": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "dependencies": { + "tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true + } + } + }, "tar": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", @@ -14996,6 +15027,13 @@ "utf8-byte-length": "^1.0.1" } }, + "ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "requires": {} + }, "ts-dedent": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.2.0.tgz", @@ -15006,23 +15044,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - } - } - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -15257,15 +15278,15 @@ } }, "vue": { - "version": "3.3.12", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.12.tgz", - "integrity": "sha512-jYNv2QmET2OTHsFzfWHMnqgCfqL4zfo97QwofdET+GBRCHhSCHuMTTvNIgeSn0/xF3JRT5OGah6MDwUFN7MPlg==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz", + "integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==", "requires": { - "@vue/compiler-dom": "3.3.12", - "@vue/compiler-sfc": "3.3.12", - "@vue/runtime-dom": "3.3.12", - "@vue/server-renderer": "3.3.12", - "@vue/shared": "3.3.12" + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-sfc": "3.4.5", + "@vue/runtime-dom": "3.4.5", + "@vue/server-renderer": "3.4.5", + "@vue/shared": "3.4.5" } }, "vue-eslint-parser": { @@ -15310,9 +15331,9 @@ } }, "vue-template-compiler": { - "version": "2.7.15", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.15.tgz", - "integrity": "sha512-yQxjxMptBL7UAog00O8sANud99C6wJF+7kgbcwqkvA38vCGF7HWE66w0ZFnS/kX5gSoJr/PQ4/oS3Ne2pW37Og==", + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", "dev": true, "requires": { "de-indent": "^1.0.2", @@ -15320,13 +15341,13 @@ } }, "vue-tsc": { - "version": "1.8.25", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.25.tgz", - "integrity": "sha512-lHsRhDc/Y7LINvYhZ3pv4elflFADoEOo67vfClAfF2heVHpHmVquLSjojgCSIwzA4F0Pc4vowT/psXCYcfk+iQ==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", "dev": true, "requires": { "@volar/typescript": "~1.11.1", - "@vue/language-core": "1.8.25", + "@vue/language-core": "1.8.27", "semver": "^7.5.4" } }, diff --git a/blossom-editor/package.json b/blossom-editor/package.json index 60ad6ad7..c58b4af9 100644 --- a/blossom-editor/package.json +++ b/blossom-editor/package.json @@ -39,7 +39,7 @@ "dayjs": "^1.11.10", "echarts": "^5.4.3", "electron-updater": "^5.3.0", - "element-plus": "^2.4.0", + "element-plus": "^2.4.4", "highlight.js": "^11.8.0", "hotkeys-js": "^3.12.0", "katex": "^0.16.8", @@ -51,7 +51,7 @@ "mermaid": "^10.4.0", "pinia": "^2.1.6", "prettier": "^3.0.2", - "sass": "^1.65.1", + "sass": "^1.66.1", "vue-router": "^4.2.4" }, "devDependencies": { @@ -59,9 +59,9 @@ "@electron/notarize": "^1.2.4", "@rushstack/eslint-patch": "^1.3.3", "@types/node": "^18.17.8", - "@vitejs/plugin-vue": "^4.3.3", - "@vue/eslint-config-prettier": "^7.1.0", - "@vue/eslint-config-typescript": "^11.0.3", + "@vitejs/plugin-vue": "^4.6.2", + "@vue/eslint-config-prettier": "^9.0.0", + "@vue/eslint-config-typescript": "^12.0.0", "electron": "^24.8.0", "electron-builder": "^24.6.3", "electron-vite": "^1.0.27", @@ -72,7 +72,7 @@ "unplugin-auto-import": "^0.16.7", "unplugin-vue-components": "^0.25.1", "vite": "^4.5.1", - "vue": "^3.3.4", - "vue-tsc": "^1.8.8" + "vue": "^3.4.5", + "vue-tsc": "^1.8.27" } -} +} \ No newline at end of file diff --git a/blossom-editor/src/renderer/src/components/AppHeader.vue b/blossom-editor/src/renderer/src/components/AppHeader.vue index a3364aa4..ebce6143 100644 --- a/blossom-editor/src/renderer/src/components/AppHeader.vue +++ b/blossom-editor/src/renderer/src/components/AppHeader.vue @@ -27,7 +27,7 @@ 无更多内容 - +
    快速配置
    @@ -47,11 +47,9 @@ -
    +
    -
    -
    @@ -168,12 +166,12 @@ const quickSettingComplete = () => { .window-workbench { @include box($width-workbench, 100%); - @include flex(row, flex-end, flex-end); + @include flex(row, flex-end, center); color: var(--el-color-primary); - padding-right: 4px; + padding-right: 2px; div { - @include box(40px, 90%); + @include box(26px, 26px); @include flex(row, center, center); cursor: pointer; transition: 0.3s; @@ -185,6 +183,10 @@ const quickSettingComplete = () => { } } + .electron-mac-last { + border-top-right-radius: 9px; + } + .divider { width: 20px; cursor: auto; @@ -193,6 +195,10 @@ const quickSettingComplete = () => { } } + .bl-subtract-line { + margin-left: 10px; + } + .close { &:hover { background-color: var(--el-color-danger); @@ -282,6 +288,8 @@ const quickSettingComplete = () => { diff --git a/blossom-editor/src/renderer/src/views/index/setting/QuickSetting.vue b/blossom-editor/src/renderer/src/views/index/setting/QuickSetting.vue index 04f9086d..d5bc1ca9 100644 --- a/blossom-editor/src/renderer/src/views/index/setting/QuickSetting.vue +++ b/blossom-editor/src/renderer/src/views/index/setting/QuickSetting.vue @@ -36,42 +36,49 @@ -->
    -
    -
    您选择使用后台自带博客, 还是自己独立部署博客?
    -
    - 自带博客 - 独立部署 -
    -
    -
    自带博客默认只提供给用户ID为 1 的用户使用。
    -
    您的ID为:{{ userStore.userinfo.id }}
    -
    - 如需修改默认值,请查看文档。 -
    -
    -
    -
    - 填写博客地址,并以/#/articles?articleId=结尾 - - - -
    - - - -
    - 博客地址格式错误! -
    -
    -
    +
    +
    您选择使用后台自带博客, 还是自行独立部署博客?
    + + + +
    自带博客默认只提供给用户ID为 "1" 的用户使用。
    +
    + 您的ID为:{{ userStore.userinfo.id }} +
    +
    + 如需修改,请查看《如何修改默认配置》。 +
    +
    + + + + 1. 请确保博客的config.js中的USER_ID配置为{{ userStore.userinfo.id }}。 + + + 2. 填写博客地址,以/#/articles?articleId=结尾 + + + + + + + +
    + 博客地址格式错误! +
    +
    +
    + +
    上一步 确认使用{{ blogType === 'backend' ? '自带博客' : '独立部署' }} @@ -79,10 +86,13 @@ 我不使用博客
    +
    请填写博客地址
    + +
    有疑问?查看文档。
    -
    图片无法正常显示?点此查看解决方式。
    @@ -310,7 +309,6 @@ const showPicInfo = (url: string) => { * @param a */ const onErrorImg = (a: Event) => { - picCantShow.value = true let imgEle = a.target as HTMLImageElement if (imgEle) { imgEle.src = errorImg @@ -532,24 +530,6 @@ const transferred = () => { isShowTransferDialog.value = false } -//#endregion - -//#region ----------------------------------------< 图片无法显示 >---------------------------------- -const picCantShow = ref(false) -// const handlePicCantShow = () => { -// let domain: string = userStore.userinfo.osRes.domain -// if (!domain.includes('/pic')) { -// picCantShow.value = true -// } -// domain = domain.substring(0, domain.lastIndexOf('/pic')) -// picCantShow.value = serverStore.serverUrl != domain -// } - -const isShowCantShowTipDialog = ref(false) - -const showCantShowTipDialog = () => { - isShowCantShowTipDialog.value = true -} //#endregion diff --git a/blossom-editor/src/renderer/src/views/plan/PlanDayInfo.vue b/blossom-editor/src/renderer/src/views/plan/PlanDayInfo.vue index 3dc66c72..81c5b572 100644 --- a/blossom-editor/src/renderer/src/views/plan/PlanDayInfo.vue +++ b/blossom-editor/src/renderer/src/views/plan/PlanDayInfo.vue @@ -17,7 +17,7 @@ { } .placeholder { + @include font(15px, 300); padding: 20px 0 0 20px; color: var(--bl-text-color-light); } diff --git a/blossom-web/package-lock.json b/blossom-web/package-lock.json index a7836cd7..af4679cf 100644 --- a/blossom-web/package-lock.json +++ b/blossom-web/package-lock.json @@ -10,10 +10,10 @@ "dependencies": { "axios": "^1.4.0", "echarts": "^5.4.3", - "element-plus": "^2.3.9", + "element-plus": "^2.4.4", "katex": "^0.16.8", "pinia": "^2.1.6", - "vue": "^3.3.4", + "vue": "^3.4.5", "vue-router": "^4.2.4" }, "devDependencies": { @@ -24,12 +24,12 @@ "npm-run-all": "^4.1.5", "rollup-plugin-visualizer": "^5.9.2", "sass": "^1.66.1", - "typescript": "~4.7.4", - "unplugin-auto-import": "^0.16.6", + "typescript": "^5.1.6", + "unplugin-auto-import": "^0.16.7", "unplugin-element-plus": "^0.7.2", "unplugin-vue-components": "^0.25.1", - "vite": "^4.4.9", - "vue-tsc": "^1.8.8" + "vite": "^4.5.1", + "vue-tsc": "^1.8.27" } }, "node_modules/@ampproject/remapping": { @@ -379,9 +379,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -495,9 +495,9 @@ } }, "node_modules/@element-plus/icons-vue": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz", - "integrity": "sha512-ygEZ1mwPjcPo/OulhzLE7mtDrQBWI8vZzEWSNB2W/RNCRjoQGwbaK4N8lV4rid7Ts4qvySU3njMN7YCiSlSaTQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", + "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", "peerDependencies": { "vue": "^3.2.0" } @@ -960,9 +960,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", - "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -973,7 +973,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -1043,30 +1043,31 @@ } }, "node_modules/@volar/language-core": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.1.tgz", - "integrity": "sha512-JnsM1mIPdfGPxmoOcK1c7HYAsL6YOv0TCJ4aW3AXPZN/Jb4R77epDyMZIVudSGjWMbvv/JfUa+rQ+dGKTmgwBA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", + "integrity": "sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==", "dev": true, "dependencies": { - "@volar/source-map": "1.10.1" + "@volar/source-map": "1.11.1" } }, "node_modules/@volar/source-map": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.1.tgz", - "integrity": "sha512-3/S6KQbqa7pGC8CxPrg69qHLpOvkiPHGJtWPkI/1AXCsktkJ6gIk/5z4hyuMp8Anvs6eS/Kvp/GZa3ut3votKA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.11.1.tgz", + "integrity": "sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==", "dev": true, "dependencies": { "muggle-string": "^0.3.1" } }, "node_modules/@volar/typescript": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.1.tgz", - "integrity": "sha512-+iiO9yUSRHIYjlteT+QcdRq8b44qH19/eiUZtjNtuh6D9ailYM7DVR0zO2sEgJlvCaunw/CF9Ov2KooQBpR4VQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.11.1.tgz", + "integrity": "sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==", "dev": true, "dependencies": { - "@volar/language-core": "1.10.1" + "@volar/language-core": "1.11.1", + "path-browserify": "^1.0.1" } }, "node_modules/@vue/babel-helper-vue-transform-on": { @@ -1096,49 +1097,49 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz", + "integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==", "dependencies": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.5", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz", + "integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==", "dependencies": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-core": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", - "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", - "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-ssr": "3.3.4", - "@vue/reactivity-transform": "3.3.4", - "@vue/shared": "3.3.4", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz", + "integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==", + "dependencies": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.5", + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5", "estree-walker": "^2.0.2", - "magic-string": "^0.30.0", - "postcss": "^8.1.10", + "magic-string": "^0.30.5", + "postcss": "^8.4.32", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", - "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz", + "integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==", "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/devtools-api": { @@ -1147,18 +1148,19 @@ "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" }, "node_modules/@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", "dev": true, "dependencies": { - "@volar/language-core": "~1.10.0", - "@volar/source-map": "~1.10.0", + "@volar/language-core": "~1.11.1", + "@volar/source-map": "~1.11.1", "@vue/compiler-dom": "^3.3.0", - "@vue/reactivity": "^3.3.0", "@vue/shared": "^3.3.0", - "minimatch": "^9.0.0", + "computeds": "^0.0.1", + "minimatch": "^9.0.3", "muggle-string": "^0.3.1", + "path-browserify": "^1.0.1", "vue-template-compiler": "^2.7.14" }, "peerDependencies": { @@ -1195,60 +1197,48 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", - "dependencies": { - "@vue/shared": "3.3.4" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", - "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz", + "integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==", "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.0" + "@vue/shared": "3.4.5" } }, "node_modules/@vue/runtime-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", - "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz", + "integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==", "dependencies": { - "@vue/reactivity": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/reactivity": "3.4.5", + "@vue/shared": "3.4.5" } }, "node_modules/@vue/runtime-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", - "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz", + "integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==", "dependencies": { - "@vue/runtime-core": "3.3.4", - "@vue/shared": "3.3.4", - "csstype": "^3.1.1" + "@vue/runtime-core": "3.4.5", + "@vue/shared": "3.4.5", + "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", - "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz", + "integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==", "dependencies": { - "@vue/compiler-ssr": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5" }, "peerDependencies": { - "vue": "3.3.4" + "vue": "3.4.5" } }, "node_modules/@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz", + "integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg==" }, "node_modules/@vue/tsconfig": { "version": "0.1.3", @@ -1264,16 +1254,6 @@ } } }, - "node_modules/@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", - "dev": true, - "dependencies": { - "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" - } - }, "node_modules/@vueuse/core": { "version": "9.10.0", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", @@ -1358,9 +1338,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1650,6 +1630,12 @@ "node": ">= 12" } }, + "node_modules/computeds": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz", + "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1688,9 +1674,9 @@ } }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/dayjs": { "version": "1.11.7", @@ -1769,12 +1755,12 @@ "dev": true }, "node_modules/element-plus": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.3.9.tgz", - "integrity": "sha512-TIOLnPl4cnoCPXqK3QYh+jpkthUBQnAM21O7o3Lhbse8v9pfrRXRTaBJtoEKnYNa8GZ4lZptUfH0PeZgDCNLUg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.4.4.tgz", + "integrity": "sha512-TlKubXJgxwhER0dw+8ULn9hr9kZjraV4R6Q/eidwWUwCKxwXYPBGmMKsZ/85tlxlhMYbcLZd/YZh6G3QkHX4fg==", "dependencies": { "@ctrl/tinycolor": "^3.4.1", - "@element-plus/icons-vue": "^2.0.6", + "@element-plus/icons-vue": "^2.3.1", "@floating-ui/dom": "^1.0.1", "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", "@types/lodash": "^4.14.182", @@ -1799,6 +1785,17 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -1956,9 +1953,9 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -2723,9 +2720,9 @@ } }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -2788,15 +2785,15 @@ } }, "node_modules/mlly": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.0.tgz", - "integrity": "sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.10.0", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "ufo": "^1.1.2" + "ufo": "^1.3.0" } }, "node_modules/ms": { @@ -2812,9 +2809,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "funding": [ { "type": "github", @@ -2966,6 +2963,12 @@ "node": ">=4" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "node_modules/path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -3099,9 +3102,9 @@ } }, "node_modules/postcss": { - "version": "8.4.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", - "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "funding": [ { "type": "opencollective", @@ -3117,7 +3120,7 @@ } ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -3335,9 +3338,9 @@ } }, "node_modules/scule": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz", - "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.1.1.tgz", + "integrity": "sha512-sHtm/SsIK9BUBI3EFT/Gnp9VoKfY6QLvlkvAE6YK7454IF8FSgJEAnJpVdSC7K5/pjI5NfxhzBLW2JAfYA/shQ==", "dev": true }, "node_modules/semver": { @@ -3605,22 +3608,22 @@ } }, "node_modules/typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/ufo": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.2.0.tgz", - "integrity": "sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", "dev": true }, "node_modules/unbox-primitive": { @@ -3639,22 +3642,24 @@ } }, "node_modules/unimport": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.1.3.tgz", - "integrity": "sha512-up4TE2yA+nMyyErGTjbYGVw95MriGa2hVRXQ3/JRp7984cwwqULcnBjHaovVpsO8tZc2j0fvgGu9yiBKOyxvYw==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.7.1.tgz", + "integrity": "sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==", "dev": true, "dependencies": { - "@rollup/pluginutils": "^5.0.2", + "@rollup/pluginutils": "^5.1.0", + "acorn": "^8.11.2", "escape-string-regexp": "^5.0.0", - "fast-glob": "^3.3.1", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.2", - "mlly": "^1.4.0", + "estree-walker": "^3.0.3", + "fast-glob": "^3.3.2", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "mlly": "^1.4.2", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "scule": "^1.0.0", + "scule": "^1.1.1", "strip-literal": "^1.3.0", - "unplugin": "^1.4.0" + "unplugin": "^1.5.1" } }, "node_modules/unimport/node_modules/escape-string-regexp": { @@ -3669,32 +3674,57 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unimport/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/unimport/node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/unplugin": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.4.0.tgz", - "integrity": "sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.6.0.tgz", + "integrity": "sha512-BfJEpWBu3aE/AyHx8VaNE/WgouoQxgH9baAiH82JjX8cqVyi3uJQstqwD5J+SZxIK326SZIhsSZlALXVBCknTQ==", "dev": true, "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.11.2", "chokidar": "^3.5.3", "webpack-sources": "^3.2.3", - "webpack-virtual-modules": "^0.5.0" + "webpack-virtual-modules": "^0.6.1" } }, "node_modules/unplugin-auto-import": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.16.6.tgz", - "integrity": "sha512-M+YIITkx3C/Hg38hp8HmswP5mShUUyJOzpifv7RTlAbeFlO2Tyw0pwrogSSxnipHDPTtI8VHFBpkYkNKzYSuyA==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.16.7.tgz", + "integrity": "sha512-w7XmnRlchq6YUFJVFGSvG1T/6j8GrdYN6Em9Wf0Ye+HXgD/22kont+WnuCAA0UaUoxtuvRR1u/mXKy63g/hfqQ==", "dev": true, "dependencies": { - "@antfu/utils": "^0.7.5", - "@rollup/pluginutils": "^5.0.2", - "fast-glob": "^3.3.0", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.1", - "minimatch": "^9.0.2", - "unimport": "^3.0.14", - "unplugin": "^1.3.2" + "@antfu/utils": "^0.7.6", + "@rollup/pluginutils": "^5.0.5", + "fast-glob": "^3.3.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "minimatch": "^9.0.3", + "unimport": "^3.4.0", + "unplugin": "^1.5.0" }, "engines": { "node": ">=14" @@ -3724,6 +3754,22 @@ "balanced-match": "^1.0.0" } }, + "node_modules/unplugin-auto-import/node_modules/local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, "node_modules/unplugin-auto-import/node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -3856,9 +3902,9 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz", + "integrity": "sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==", "dev": true, "dependencies": { "esbuild": "^0.18.10", @@ -3911,15 +3957,23 @@ } }, "node_modules/vue": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", - "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz", + "integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==", "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-sfc": "3.3.4", - "@vue/runtime-dom": "3.3.4", - "@vue/server-renderer": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-sfc": "3.4.5", + "@vue/runtime-dom": "3.4.5", + "@vue/server-renderer": "3.4.5", + "@vue/shared": "3.4.5" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/vue-router": { @@ -3937,9 +3991,9 @@ } }, "node_modules/vue-template-compiler": { - "version": "2.7.14", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", - "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", "dev": true, "dependencies": { "de-indent": "^1.0.2", @@ -3947,14 +4001,14 @@ } }, "node_modules/vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", "dev": true, "dependencies": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", - "semver": "^7.3.8" + "@volar/typescript": "~1.11.1", + "@vue/language-core": "1.8.27", + "semver": "^7.5.4" }, "bin": { "vue-tsc": "bin/vue-tsc.js" @@ -3976,9 +4030,9 @@ } }, "node_modules/vue-tsc/node_modules/semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4006,9 +4060,9 @@ } }, "node_modules/webpack-virtual-modules": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", - "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.1.tgz", + "integrity": "sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==", "dev": true }, "node_modules/which": { @@ -4438,9 +4492,9 @@ } }, "@babel/parser": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.10.tgz", - "integrity": "sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==" + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==" }, "@babel/plugin-syntax-jsx": { "version": "7.22.5", @@ -4518,9 +4572,9 @@ "integrity": "sha512-tlJpwF40DEQcfR/QF+wNMVyGMaO9FQp6Z1Wahj4Gk3CJQYHwA2xVG7iKDFdW6zuxZY9XWOpGcfNCTsX4McOsOg==" }, "@element-plus/icons-vue": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.0.10.tgz", - "integrity": "sha512-ygEZ1mwPjcPo/OulhzLE7mtDrQBWI8vZzEWSNB2W/RNCRjoQGwbaK4N8lV4rid7Ts4qvySU3njMN7YCiSlSaTQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz", + "integrity": "sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==", "requires": {} }, "@esbuild/android-arm": { @@ -4760,9 +4814,9 @@ "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" }, "@rollup/pluginutils": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", - "integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "requires": { "@types/estree": "^1.0.0", @@ -4819,30 +4873,31 @@ } }, "@volar/language-core": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.1.tgz", - "integrity": "sha512-JnsM1mIPdfGPxmoOcK1c7HYAsL6YOv0TCJ4aW3AXPZN/Jb4R77epDyMZIVudSGjWMbvv/JfUa+rQ+dGKTmgwBA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", + "integrity": "sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==", "dev": true, "requires": { - "@volar/source-map": "1.10.1" + "@volar/source-map": "1.11.1" } }, "@volar/source-map": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.1.tgz", - "integrity": "sha512-3/S6KQbqa7pGC8CxPrg69qHLpOvkiPHGJtWPkI/1AXCsktkJ6gIk/5z4hyuMp8Anvs6eS/Kvp/GZa3ut3votKA==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.11.1.tgz", + "integrity": "sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==", "dev": true, "requires": { "muggle-string": "^0.3.1" } }, "@volar/typescript": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.1.tgz", - "integrity": "sha512-+iiO9yUSRHIYjlteT+QcdRq8b44qH19/eiUZtjNtuh6D9ailYM7DVR0zO2sEgJlvCaunw/CF9Ov2KooQBpR4VQ==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.11.1.tgz", + "integrity": "sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==", "dev": true, "requires": { - "@volar/language-core": "1.10.1" + "@volar/language-core": "1.11.1", + "path-browserify": "^1.0.1" } }, "@vue/babel-helper-vue-transform-on": { @@ -4869,49 +4924,49 @@ } }, "@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.5.tgz", + "integrity": "sha512-Daka7P1z2AgKjzuueWXhwzIsKu0NkLB6vGbNVEV2iJ8GJTrzraZo/Sk4GWCMRtd/qVi3zwnk+Owbd/xSZbwHtQ==", "requires": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.5", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.5.tgz", + "integrity": "sha512-J8YlxknJVd90SXFJ4HwGANSAXsx5I0lK30sO/zvYV7s5gXf7gZR7r/1BmZ2ju7RGH1lnc6bpBc6nL61yW+PsAQ==", "requires": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-core": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/compiler-sfc": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", - "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", - "requires": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-ssr": "3.3.4", - "@vue/reactivity-transform": "3.3.4", - "@vue/shared": "3.3.4", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.5.tgz", + "integrity": "sha512-jauvkDuSSUbP0ebhfNqljhShA90YEfX/0wZ+w40oZF43IjGyWYjqYaJbvMJwGOd+9+vODW6eSvnk28f0SGV7OQ==", + "requires": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.5", + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5", "estree-walker": "^2.0.2", - "magic-string": "^0.30.0", - "postcss": "^8.1.10", + "magic-string": "^0.30.5", + "postcss": "^8.4.32", "source-map-js": "^1.0.2" } }, "@vue/compiler-ssr": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", - "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.5.tgz", + "integrity": "sha512-DDdEcDzj2lWTMfUMMtEpLDhURai9LhM0zSZ219jCt7b2Vyl0/jy3keFgCPMitG0V1S1YG4Cmws3lWHWdxHQOpg==", "requires": { - "@vue/compiler-dom": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/devtools-api": { @@ -4920,18 +4975,19 @@ "integrity": "sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==" }, "@vue/language-core": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.8.tgz", - "integrity": "sha512-i4KMTuPazf48yMdYoebTkgSOJdFraE4pQf0B+FTOFkbB+6hAfjrSou/UmYWRsWyZV6r4Rc6DDZdI39CJwL0rWw==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", "dev": true, "requires": { - "@volar/language-core": "~1.10.0", - "@volar/source-map": "~1.10.0", + "@volar/language-core": "~1.11.1", + "@volar/source-map": "~1.11.1", "@vue/compiler-dom": "^3.3.0", - "@vue/reactivity": "^3.3.0", "@vue/shared": "^3.3.0", - "minimatch": "^9.0.0", + "computeds": "^0.0.1", + "minimatch": "^9.0.3", "muggle-string": "^0.3.1", + "path-browserify": "^1.0.1", "vue-template-compiler": "^2.7.14" }, "dependencies": { @@ -4956,57 +5012,45 @@ } }, "@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.5.tgz", + "integrity": "sha512-BcWkKvjdvqJwb7BhhFkXPLDCecX4d4a6GATvCduJQDLv21PkPowAE5GKuIE5p6RC07/Lp9FMkkq4AYCTVF5KlQ==", "requires": { - "@vue/shared": "3.3.4" - } - }, - "@vue/reactivity-transform": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", - "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", - "requires": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.0" + "@vue/shared": "3.4.5" } }, "@vue/runtime-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", - "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.5.tgz", + "integrity": "sha512-wh9ELIOQKeWT9SaUPdLrsxRkZv14jp+SJm9aiQGWio+/MWNM3Lib0wE6CoKEqQ9+SCYyGjDBhTOTtO47kCgbkg==", "requires": { - "@vue/reactivity": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/reactivity": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/runtime-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", - "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.5.tgz", + "integrity": "sha512-n5ewvOjyG3IEpqGBahdPXODFSpVlSz3H4LF76Sx0XAqpIOqyJ5bIb2PrdYuH2ogBMAQPh+o5tnoH4nJpBr8U0Q==", "requires": { - "@vue/runtime-core": "3.3.4", - "@vue/shared": "3.3.4", - "csstype": "^3.1.1" + "@vue/runtime-core": "3.4.5", + "@vue/shared": "3.4.5", + "csstype": "^3.1.3" } }, "@vue/server-renderer": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", - "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.5.tgz", + "integrity": "sha512-jOFc/VE87yvifQpNju12VcqimH8pBLxdcT+t3xMeiED1K6DfH9SORyhFEoZlW5TG2Vwfn3Ul5KE+1aC99xnSBg==", "requires": { - "@vue/compiler-ssr": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-ssr": "3.4.5", + "@vue/shared": "3.4.5" } }, "@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.5.tgz", + "integrity": "sha512-6XptuzlMvN4l4cDnDw36pdGEV+9njYkQ1ZE0Q6iZLwrKefKaOJyiFmcP3/KBDHbt72cJZGtllAc1GaHe6XGAyg==" }, "@vue/tsconfig": { "version": "0.1.3", @@ -5015,16 +5059,6 @@ "dev": true, "requires": {} }, - "@vue/typescript": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.8.tgz", - "integrity": "sha512-jUnmMB6egu5wl342eaUH236v8tdcEPXXkPgj+eI/F6JwW/lb+yAU6U07ZbQ3MVabZRlupIlPESB7ajgAGixhow==", - "dev": true, - "requires": { - "@volar/typescript": "~1.10.0", - "@vue/language-core": "1.8.8" - } - }, "@vueuse/core": { "version": "9.10.0", "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-9.10.0.tgz", @@ -5066,9 +5100,9 @@ } }, "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true }, "ansi-styles": { @@ -5264,6 +5298,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==" }, + "computeds": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz", + "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -5298,9 +5338,9 @@ } }, "csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "dayjs": { "version": "1.11.7", @@ -5359,12 +5399,12 @@ "dev": true }, "element-plus": { - "version": "2.3.9", - "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.3.9.tgz", - "integrity": "sha512-TIOLnPl4cnoCPXqK3QYh+jpkthUBQnAM21O7o3Lhbse8v9pfrRXRTaBJtoEKnYNa8GZ4lZptUfH0PeZgDCNLUg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/element-plus/-/element-plus-2.4.4.tgz", + "integrity": "sha512-TlKubXJgxwhER0dw+8ULn9hr9kZjraV4R6Q/eidwWUwCKxwXYPBGmMKsZ/85tlxlhMYbcLZd/YZh6G3QkHX4fg==", "requires": { "@ctrl/tinycolor": "^3.4.1", - "@element-plus/icons-vue": "^2.0.6", + "@element-plus/icons-vue": "^2.3.1", "@floating-ui/dom": "^1.0.1", "@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7", "@types/lodash": "^4.14.182", @@ -5386,6 +5426,11 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -5515,9 +5560,9 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" }, "fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -6042,9 +6087,9 @@ } }, "magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", "requires": { "@jridgewell/sourcemap-codec": "^1.4.15" } @@ -6089,15 +6134,15 @@ } }, "mlly": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.0.tgz", - "integrity": "sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", + "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", "dev": true, "requires": { - "acorn": "^8.9.0", + "acorn": "^8.10.0", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "ufo": "^1.1.2" + "ufo": "^1.3.0" } }, "ms": { @@ -6113,9 +6158,9 @@ "dev": true }, "nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==" }, "nice-try": { "version": "1.0.5", @@ -6222,6 +6267,12 @@ "json-parse-better-errors": "^1.0.1" } }, + "path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", @@ -6301,11 +6352,11 @@ } }, "postcss": { - "version": "8.4.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", - "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "requires": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } @@ -6436,9 +6487,9 @@ } }, "scule": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz", - "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.1.1.tgz", + "integrity": "sha512-sHtm/SsIK9BUBI3EFT/Gnp9VoKfY6QLvlkvAE6YK7454IF8FSgJEAnJpVdSC7K5/pjI5NfxhzBLW2JAfYA/shQ==", "dev": true }, "semver": { @@ -6645,15 +6696,15 @@ } }, "typescript": { - "version": "4.7.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", - "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "devOptional": true }, "ufo": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.2.0.tgz", - "integrity": "sha512-RsPyTbqORDNDxqAdQPQBpgqhWle1VcTSou/FraClYlHf6TZnQcGslpLcAphNR+sQW4q5lLWLbOsRlh9j24baQg==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.2.tgz", + "integrity": "sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==", "dev": true }, "unbox-primitive": { @@ -6669,22 +6720,24 @@ } }, "unimport": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.1.3.tgz", - "integrity": "sha512-up4TE2yA+nMyyErGTjbYGVw95MriGa2hVRXQ3/JRp7984cwwqULcnBjHaovVpsO8tZc2j0fvgGu9yiBKOyxvYw==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.7.1.tgz", + "integrity": "sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==", "dev": true, "requires": { - "@rollup/pluginutils": "^5.0.2", + "@rollup/pluginutils": "^5.1.0", + "acorn": "^8.11.2", "escape-string-regexp": "^5.0.0", - "fast-glob": "^3.3.1", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.2", - "mlly": "^1.4.0", + "estree-walker": "^3.0.3", + "fast-glob": "^3.3.2", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "mlly": "^1.4.2", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "scule": "^1.0.0", + "scule": "^1.1.1", "strip-literal": "^1.3.0", - "unplugin": "^1.4.0" + "unplugin": "^1.5.1" }, "dependencies": { "escape-string-regexp": { @@ -6692,35 +6745,54 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "dev": true + }, + "estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0" + } + }, + "local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "requires": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + } } } }, "unplugin": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.4.0.tgz", - "integrity": "sha512-5x4eIEL6WgbzqGtF9UV8VEC/ehKptPXDS6L2b0mv4FRMkJxRtjaJfOWDd6a8+kYbqsjklix7yWP0N3SUepjXcg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.6.0.tgz", + "integrity": "sha512-BfJEpWBu3aE/AyHx8VaNE/WgouoQxgH9baAiH82JjX8cqVyi3uJQstqwD5J+SZxIK326SZIhsSZlALXVBCknTQ==", "dev": true, "requires": { - "acorn": "^8.9.0", + "acorn": "^8.11.2", "chokidar": "^3.5.3", "webpack-sources": "^3.2.3", - "webpack-virtual-modules": "^0.5.0" + "webpack-virtual-modules": "^0.6.1" } }, "unplugin-auto-import": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.16.6.tgz", - "integrity": "sha512-M+YIITkx3C/Hg38hp8HmswP5mShUUyJOzpifv7RTlAbeFlO2Tyw0pwrogSSxnipHDPTtI8VHFBpkYkNKzYSuyA==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/unplugin-auto-import/-/unplugin-auto-import-0.16.7.tgz", + "integrity": "sha512-w7XmnRlchq6YUFJVFGSvG1T/6j8GrdYN6Em9Wf0Ye+HXgD/22kont+WnuCAA0UaUoxtuvRR1u/mXKy63g/hfqQ==", "dev": true, "requires": { - "@antfu/utils": "^0.7.5", - "@rollup/pluginutils": "^5.0.2", - "fast-glob": "^3.3.0", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.1", - "minimatch": "^9.0.2", - "unimport": "^3.0.14", - "unplugin": "^1.3.2" + "@antfu/utils": "^0.7.6", + "@rollup/pluginutils": "^5.0.5", + "fast-glob": "^3.3.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", + "minimatch": "^9.0.3", + "unimport": "^3.4.0", + "unplugin": "^1.5.0" }, "dependencies": { "brace-expansion": { @@ -6732,6 +6804,16 @@ "balanced-match": "^1.0.0" } }, + "local-pkg": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", + "dev": true, + "requires": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + } + }, "minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", @@ -6814,9 +6896,9 @@ } }, "vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.1.tgz", + "integrity": "sha512-AXXFaAJ8yebyqzoNB9fu2pHoo/nWX+xZlaRwoeYUxEqBO+Zj4msE5G+BhGBll9lYEKv9Hfks52PAF2X7qDYXQA==", "dev": true, "requires": { "esbuild": "^0.18.10", @@ -6826,15 +6908,15 @@ } }, "vue": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", - "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.5.tgz", + "integrity": "sha512-VH6nHFhLPjgu2oh5vEBXoNZxsGHuZNr3qf4PHClwJWw6IDqw6B3x+4J+ABdoZ0aJuT8Zi0zf3GpGlLQCrGWHrw==", "requires": { - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-sfc": "3.3.4", - "@vue/runtime-dom": "3.3.4", - "@vue/server-renderer": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.5", + "@vue/compiler-sfc": "3.4.5", + "@vue/runtime-dom": "3.4.5", + "@vue/server-renderer": "3.4.5", + "@vue/shared": "3.4.5" } }, "vue-router": { @@ -6846,9 +6928,9 @@ } }, "vue-template-compiler": { - "version": "2.7.14", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", - "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", "dev": true, "requires": { "de-indent": "^1.0.2", @@ -6856,14 +6938,14 @@ } }, "vue-tsc": { - "version": "1.8.8", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.8.tgz", - "integrity": "sha512-bSydNFQsF7AMvwWsRXD7cBIXaNs/KSjvzWLymq/UtKE36697sboX4EccSHFVxvgdBlI1frYPc/VMKJNB7DFeDQ==", + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", "dev": true, "requires": { - "@vue/language-core": "1.8.8", - "@vue/typescript": "1.8.8", - "semver": "^7.3.8" + "@volar/typescript": "~1.11.1", + "@vue/language-core": "1.8.27", + "semver": "^7.5.4" }, "dependencies": { "lru-cache": { @@ -6876,9 +6958,9 @@ } }, "semver": { - "version": "7.5.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", - "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -6899,9 +6981,9 @@ "dev": true }, "webpack-virtual-modules": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", - "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.1.tgz", + "integrity": "sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==", "dev": true }, "which": { diff --git a/blossom-web/package.json b/blossom-web/package.json index 7a06fb39..734ec955 100644 --- a/blossom-web/package.json +++ b/blossom-web/package.json @@ -14,10 +14,10 @@ "dependencies": { "axios": "^1.4.0", "echarts": "^5.4.3", - "element-plus": "^2.3.9", + "element-plus": "^2.4.4", "katex": "^0.16.8", "pinia": "^2.1.6", - "vue": "^3.3.4", + "vue": "^3.4.5", "vue-router": "^4.2.4" }, "devDependencies": { @@ -28,11 +28,11 @@ "npm-run-all": "^4.1.5", "rollup-plugin-visualizer": "^5.9.2", "sass": "^1.66.1", - "typescript": "~4.7.4", - "unplugin-auto-import": "^0.16.6", + "typescript": "^5.1.6", + "unplugin-auto-import": "^0.16.7", "unplugin-element-plus": "^0.7.2", "unplugin-vue-components": "^0.25.1", - "vite": "^4.4.9", - "vue-tsc": "^1.8.8" + "vite": "^4.5.1", + "vue-tsc": "^1.8.27" } } diff --git a/blossom-web/src/stores/user.ts b/blossom-web/src/stores/user.ts index 1ae01690..0aa31552 100644 --- a/blossom-web/src/stores/user.ts +++ b/blossom-web/src/stores/user.ts @@ -49,6 +49,7 @@ const DEFAULT_USER_INFO = { } } +export type UserParams = typeof DEFAULT_USER_INFO.userParams export type Userinfo = typeof DEFAULT_USER_INFO /** * 初始化用户信息 @@ -58,7 +59,7 @@ const initUserinfo = () => { } /** - * + * */ export const useUserStore = defineStore('userStore', { state: () => ({ @@ -72,7 +73,7 @@ export const useUserStore = defineStore('userStore', { } return state.auth.status === AuthStatus.Succ }, - userParams: (state): any => { + userParams: (state): UserParams => { return state.userinfo.userParams }, links: (state): any => { diff --git a/blossom-web/src/views/article/Articles.vue b/blossom-web/src/views/article/Articles.vue index 63fa1f9c..905b12ec 100644 --- a/blossom-web/src/views/article/Articles.vue +++ b/blossom-web/src/views/article/Articles.vue @@ -232,9 +232,10 @@ const clickCurDoc = async (tree: DocTree) => { * 如果点击的是文章, 则查询文章信息和正文, 并在编辑器中显示. */ const getCurEditArticle = async (id: number) => { - if (id == -123) { - article.value.html = `
    当您看到这句话, 证明博客地址配置正确
    ` + if (id == -999) { + article.value.html = `
    + 该博客所配置的 USER_ID 为
    ${window.blconfig.DOMAIN.USER_ID} +
    ` return } diff --git a/blossom-web/src/views/index/IndexHeader.vue b/blossom-web/src/views/index/IndexHeader.vue index 07a5bd59..f9efc591 100644 --- a/blossom-web/src/views/index/IndexHeader.vue +++ b/blossom-web/src/views/index/IndexHeader.vue @@ -94,10 +94,10 @@ const sysName = () => { } const logo = () => { - if (userStore.userParams.WEB_LOGO_URL) { + if (userStore.userParams.WEB_LOGO_URL && isNotBlank(userStore.userParams.WEB_LOGO_URL)) { return userStore.userParams.WEB_LOGO_URL } - return '/blog-logo.png' + return 'blog-logo.png' } const links = () => { diff --git a/blossom-web/tsconfig.json b/blossom-web/tsconfig.json index 6dcfa74f..2dcbb7c2 100644 --- a/blossom-web/tsconfig.json +++ b/blossom-web/tsconfig.json @@ -9,6 +9,7 @@ "global.d.ts" ], "compilerOptions": { + "ignoreDeprecations": "5.0", "baseUrl": "./", "types": [ "node" diff --git a/doc/backend-api/index.html b/doc/backend-api/index.html index 91883768..c603051a 100644 --- a/doc/backend-api/index.html +++ b/doc/backend-api/index.html @@ -5,10 +5,10 @@ 《Blossom 接口文档》 - 文档版本:v1.11.0 - 文档时间:2023-12-20 15:26:44 + 文档版本:v1.12.0 + 文档时间:2024-01-11 00:47:59 - +