From d67fe5923d2c5ea08cde879e1393cca31e1eedeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E7=8E=89=E6=98=8E?= Date: Tue, 30 Jun 2020 11:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0Word=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- knife4j-admin-ui/vue.config.js | 3 +- knife4j-vue/src/assets/common/lang/en.js | 1 + knife4j-vue/src/assets/common/lang/zh.js | 1 + .../officeDocument/wordTransform.js | 553 ++++++++++++++++++ .../src/views/settings/OfficelineDocument.vue | 53 +- knife4j-vue/vue.config.js | 4 +- knife4j/exportWord.html | 303 ++++++++++ knife4j/exportWord1.html | 266 +++++++++ 8 files changed, 1178 insertions(+), 6 deletions(-) create mode 100644 knife4j-vue/src/components/officeDocument/wordTransform.js create mode 100644 knife4j/exportWord.html create mode 100644 knife4j/exportWord1.html diff --git a/knife4j-admin-ui/vue.config.js b/knife4j-admin-ui/vue.config.js index ec5a2c2fe..f08631da9 100644 --- a/knife4j-admin-ui/vue.config.js +++ b/knife4j-admin-ui/vue.config.js @@ -15,8 +15,7 @@ module.exports = { devServer: { proxy: { "/": { - /* target: "http://localhost:19011/", */ - target: "http://cloud.xiaominfo.com/", + target: "http://localhost:19011/", ws: true, changeOrigin: true } diff --git a/knife4j-vue/src/assets/common/lang/en.js b/knife4j-vue/src/assets/common/lang/en.js index 2f3955ba9..0c36356c2 100644 --- a/knife4j-vue/src/assets/common/lang/en.js +++ b/knife4j-vue/src/assets/common/lang/en.js @@ -313,6 +313,7 @@ const langOptions = { imple:'This feature has not been implemented ...', markdown:'Downloading Markdown file, please wait...', html:'Downloading Html file, please wait...', + word:'Downloading Word file, please wait...', copy: 'Copy', toomany: 'The current number of interfaces exceeds the limit. Please use the third-party markdown conversion software for conversion to see the effect.', note: 'swagger-bootstrap-ui provides markdwon-formatted offline documents that developers can copy and convert to HTML or PDF through other markdown conversion tools..' diff --git a/knife4j-vue/src/assets/common/lang/zh.js b/knife4j-vue/src/assets/common/lang/zh.js index c8b552b74..74cc736ed 100644 --- a/knife4j-vue/src/assets/common/lang/zh.js +++ b/knife4j-vue/src/assets/common/lang/zh.js @@ -314,6 +314,7 @@ const langOptions = { imple:'该功能尚未实现...', markdown:'正在下载Markdown文件中,请稍后...', html:'正在下载Html中,请稍后...', + word:'正在下载Word中,请稍后...', copy: '拷贝文档', toomany: '当前接口数量超出限制,请使用第三方markdown转换软件进行转换以查看效果.', note: 'swagger-bootstrap-ui 提供markdwon格式类型的离线文档,开发者可拷贝该内容通过其他markdown转换工具进行转换为html或pdf.' diff --git a/knife4j-vue/src/components/officeDocument/wordTransform.js b/knife4j-vue/src/components/officeDocument/wordTransform.js new file mode 100644 index 000000000..bab290df2 --- /dev/null +++ b/knife4j-vue/src/components/officeDocument/wordTransform.js @@ -0,0 +1,553 @@ +import KUtils from '@/core/utils' +import marked from 'marked' + +marked.setOptions({ + gfm: true, + tables: true, + breaks: false, + pedantic: false, + sanitize: false, + smartLists: true, + smartypants: false +}) + +/** + * 根据当前swagger分组实例得到当前组下word文本 + * @param {*} instance + */ +export default function wordText(instance) { + var markdownCollections = []; + if (instance != null && instance != undefined) { + createWordHeader(markdownCollections); + createWordBasicInfo(instance, markdownCollections); + createWordTagsInfo(instance, markdownCollections); + //增强文档 + createWordPlusInfo(instance, markdownCollections); + createWordFooter(markdownCollections); + } + return markdownCollections.join('\n'); +} + +/** + * 主动换行 + * @param {*} markdownCollections + */ +function wordLines(markdownCollections) { + markdownCollections.push('\n'); +} + +function createWordHeader(markdownCollections){ + var wordHeader=` + + + + + 导出Swagger文档到Word + + + + +
` + markdownCollections.push(wordHeader); +} + +function createWordFooter(markdownCollections){ + markdownCollections.push('
'); +} + +/** + * 基本信息 + * @param {*} instance 当前分组实例对象 + * @param {*} markdownCollections markdown文本集合对象 + */ +function createWordBasicInfo(instance, markdownCollections) { + markdownCollections.push('

1.项目说明

'); + markdownCollections.push('
'); + + markdownCollections.push('
标题:'+instance.title+'
'); + markdownCollections.push('
'); + + + markdownCollections.push('
简介:'+instance.description+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
作者:'+instance.contact+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
HOST:'+instance.host+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
basePath:'+instance.basePath+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
termsOfService:'+instance.termsOfService+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
联系人:'+instance.contact+'
') + markdownCollections.push('
'); + + markdownCollections.push('
Version:'+instance.version+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
GroupName:'+instance.name+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
分组Url:'+instance.url+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
分组Location:'+instance.location+'
'); + markdownCollections.push('
'); + + markdownCollections.push('
'); +} + +/** + * 增加增强文档 + * @param {*} instance + * @param {*} markdownCollections + */ +function createWordPlusInfo(instance, markdownCollections) { + if (KUtils.checkUndefined(instance.markdownFiles)) { + if (instance.markdownFiles.length > 0) { + wordLines(markdownCollections); + //markdownCollections.push('# 附录'); + markdownCollections.push('

3.附录

') + instance.markdownFiles.forEach(function (md,mdIndex) { + wordLines(markdownCollections); + var mindex=mdIndex+1; + var mdTitle='3.'+mindex+md.title; + markdownCollections.push('

'+mdTitle+'

'); + markdownCollections.push('
'); + //markdownCollections.push('## ' + md.title); + markdownCollections.push(marked(md.content)); + markdownCollections.push('
'); + }) + } + } + +} + +/** + * 遍历tags分组信息 + * @param {*} instance 当前分组实例对象 + * @param {*} markdownCollections markdown文本集合对象 + */ +function createWordTagsInfo(instance, markdownCollections) { + if (instance.tags != undefined && instance.tags != null) { + markdownCollections.push('\n'); + markdownCollections.push('

2.接口列表

') + instance.tags.forEach(function (tag,index) { + var docIdex=parseInt(index)+1; + var docParent='2.'+docIdex; + var tagTitle=docParent+tag.name; + markdownCollections.push('

'+tagTitle+'

'); + wordLines(markdownCollections); + if (tag.childrens != undefined && tag.childrens != null && tag.childrens.length > 0) { + //遍历 + tag.childrens.forEach(function (apiInfo,aIndex) { + var apiIndex=aIndex+1; + createWrodApiInfo(apiInfo, markdownCollections,docParent,apiIndex); + }) + } else { + markdownCollections.push('暂无接口文档') + } + }) + + } +} + +/** + * 遍历接口详情 + * @param {*} apiInfo 接口实例 + * @param {*} markdownCollections markdown文本集合对象 + */ +function createWrodApiInfo(apiInfo, markdownCollections,parentDoc,apiIndex) { + //二级标题 + wordLines(markdownCollections); + var h3Title=parentDoc+'.'+apiIndex+apiInfo.summary; + markdownCollections.push('

'+h3Title+'

'); + markdownCollections.push('
'); + + markdownCollections.push('
接口地址
') + markdownCollections.push('
'+apiInfo.methodType+'  '+apiInfo.showUrl+'
'); + + markdownCollections.push('
接口描述
'); + markdownCollections.push('
'+KUtils.toString(apiInfo.description, '暂无')+'
'); + + markdownCollections.push('
请求数据类型
'); + markdownCollections.push('
'+KUtils.toString(apiInfo.consumes, '*')+'
') + + markdownCollections.push('
响应数据类型
'); + markdownCollections.push('
'+KUtils.toString(apiInfo.produces, '*')+'
') + + if(KUtils.strNotBlank(apiInfo.author)){ + markdownCollections.push('
开发者
'); + markdownCollections.push('
'+KUtils.toString(apiInfo.author, '暂无')+'
'); + } + //判断是否有请求示例 + if (KUtils.checkUndefined(apiInfo.requestValue)) { + markdownCollections.push('
请求示例
'); + + markdownCollections.push('
'); + //需要判断是否是xml请求 + markdownCollections.push('
');
+    if(apiInfo.xmlRequest){
+      //xml请求,不做处理
+      markdownCollections.push(apiInfo.requestValue);
+    }else{
+      markdownCollections.push(wordJsonFormatter(apiInfo.requestValue));
+    }
+
+    markdownCollections.push('
'); + markdownCollections.push('
'); + } + + //请求参数 + createWordApiRequestParameters(apiInfo, markdownCollections); + //响应状态 + createWordApiResponseStatus(apiInfo, markdownCollections); + //响应Schema-参数 + //判断响应参数 + createWordApiResponseParameters(apiInfo, markdownCollections); + + markdownCollections.push('
'); +} +/** + * 响应状态 + * @param {*} apiInfo + * @param {*} markdownCollections + */ +function createWordApiResponseStatus(apiInfo, markdownCollections) { + if (KUtils.checkUndefined(apiInfo.responseCodes) && apiInfo.responseCodes.length > 0) { + wordLines(markdownCollections); + markdownCollections.push('
响应状态

'); + markdownCollections.push('
'); + + markdownCollections.push(''); + //表头 + markdownCollections.push('') + //内容 + markdownCollections.push(''); + wordLines(markdownCollections); + //拥有参数 + apiInfo.responseCodes.forEach(function (respcode) { + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + //markdownCollections.push('|' + KUtils.toString(respcode.code, '') + '|' + KUtils.toString(respcode.description, '') + '|' + KUtils.toString(respcode.schema, '') + '|') + markdownCollections.push(''); + }) + + markdownCollections.push(''); + markdownCollections.push('
状态码说明schema
'+KUtils.toString(respcode.code, '')+''+KUtils.toString(respcode.description, '')+''+KUtils.toString(respcode.schema, '')+'

'); + + markdownCollections.push('
'); + } +} + +/** + * 响应参数拥有响应头 + * @param {*} responseHeaderParameters + * @param {*} markdownCollections + */ +function createWordApiResponseHeaderParams(responseHeaderParameters, markdownCollections) { + if (KUtils.checkUndefined(responseHeaderParameters)) { + if (responseHeaderParameters.length > 0) { + wordLines(markdownCollections); + markdownCollections.push('
响应Header
') + wordLines(markdownCollections); + //拥有参数 + markdownCollections.push('
'); + markdownCollections.push(''); + //表头 + markdownCollections.push(''); + //内容 + markdownCollections.push(''); + responseHeaderParameters.forEach(function (respHeader) { + markdownCollections.push('') + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + //markdownCollections.push('|' + KUtils.toString(respHeader.name, '') + '|' + KUtils.toString(respHeader.description, '') + '|' + KUtils.toString(respHeader.type, '') + '|'); + markdownCollections.push('') + }) + markdownCollections.push(''); + markdownCollections.push('
参数名称参数说明类型
'+KUtils.toString(respHeader.name, '')+''+KUtils.toString(respHeader.description, '')+''+KUtils.toString(respHeader.type, '')+'
'); + markdownCollections.push('
'); + + } + } +} + +/** + * 响应参数 + * @param {*} apiInfo + * @param {*} markdownCollections + * @param {*} singleFlag + */ +function createWordApiResponseParameters(apiInfo, markdownCollections) { + //判断是否多个schema + if (apiInfo.multipartResponseSchema) { + var multipartData = apiInfo.multipCodeDatas; + if (KUtils.arrNotEmpty(multipartData)) { + multipartData.forEach(function (resp) { + wordLines(markdownCollections); + markdownCollections.push('
响应状态码-'+KUtils.toString(resp.code, '')+'
'); + //markdownCollections.push('**响应状态码-' + KUtils.toString(resp.code, '') + '**:'); + createWordApiResponseSingleParam(resp, markdownCollections); + }) + } + } else { + //单个 + createWordApiResponseSingleParam(apiInfo.multipData, markdownCollections); + } +} +/** + * 单个响应状态 + * @param {*} resp + * @param {*} markdownCollections + */ +function createWordApiResponseSingleParam(resp, markdownCollections) { + //判断是否有响应Header + createWordApiResponseHeaderParams(resp.responseHeaderParameters, markdownCollections); + //数据 + wordLines(markdownCollections); + markdownCollections.push('
响应参数
'); + //markdownCollections.push('**响应参数**:'); + wordLines(markdownCollections); + markdownCollections.push('
'); + markdownCollections.push(''); + //表头 + markdownCollections.push(''); + markdownCollections.push('') + if (KUtils.arrNotEmpty(resp.data)) { + //拥有参数 + resp.data.forEach(function (param) { + param.level = 1; + markdownCollections.push('') + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + markdownCollections.push(''); + //markdownCollections.push('|' + getWordTableByLevel(param) + '|' + KUtils.toString(param.description, '') + '|' + KUtils.toString(param.type, '') + '|' + KUtils.toString(param.schemaValue, '') + '|') + deepWordTableByResponseParameter(param.children, markdownCollections, (param.level + 1)); + }) + } else { + //markdownCollections.push('暂无'); + markdownCollections.push('') + } + markdownCollections.push('') + markdownCollections.push('
参数名称参数说明类型schema
'+getWordTableByLevel(param)+''+KUtils.toString(param.description, '')+''+KUtils.toString(param.type, '')+''+KUtils.toString(param.schemaValue, '')+'
暂无
'); + markdownCollections.push('
'); + //判断是否拥有响应示例 + wordLines(markdownCollections); + markdownCollections.push('
响应示例
') + markdownCollections.push('
');
+  if (resp.responseBasicType) {
+    markdownCollections.push(resp.responseText)
+  } else {
+    markdownCollections.push(wordJsonFormatter(resp.responseValue))
+  }
+  markdownCollections.push('
'); + +} + + +/** + * 请求参数 + * @param {*} apiInfo + * @param {*} markdownCollections + */ +function createWordApiRequestParameters(apiInfo, markdownCollections) { + + let reqParameters = apiInfo.reqParameters; + wordLines(markdownCollections); + markdownCollections.push('
请求参数

') + markdownCollections.push('
'); + markdownCollections.push(''); + //表头 + markdownCollections.push(''); + markdownCollections.push(''); + //判断是否拥有请求参数 + if (reqParameters.length > 0) { + //级联表格,在表格需要最佳空格缩进符号 + deepWordTableByRequestParameter(reqParameters, markdownCollections, 1); + }else{ + //无参数 + markdownCollections.push(''); + } + markdownCollections.push(''); + markdownCollections.push('
参数名称参数说明请求类型必须数据类型schema
暂无
') + markdownCollections.push('
'); +} + +/** + * 递归循环遍历响应参数得到markdown表格 + * @param {*} parameters + * @param {*} markdownCollections + */ +function deepWordTableByResponseParameter(parameters, markdownCollections, level) { + if (parameters != null && parameters != undefined && parameters.length > 0) { + parameters.forEach(function (param) { + param.level = level; + markdownCollections.push('') + markdownCollections.push(''+getWordTableByLevel(param)+''); + markdownCollections.push(''+KUtils.toString(param.description, '')+''); + markdownCollections.push(''+KUtils.toString(param.type, '')+''); + markdownCollections.push(''+KUtils.toString(param.schemaValue, '')+''); + markdownCollections.push(''); + //markdownCollections.push('|' + getWordTableByLevel(param) + '|' + KUtils.toString(param.description, '') + '|' + KUtils.toString(param.type, '') + '|' + KUtils.toString(param.schemaValue, '') + '|') + deepWordTableByResponseParameter(param.children, markdownCollections, (param.level + 1)); + }) + } + +} + + +/** + * 递归循环遍历参数得到markdown表格 + * @param {*} parameters + * @param {*} markdownCollections + */ +function deepWordTableByRequestParameter(parameters, markdownCollections, level) { + if (parameters != null && parameters != undefined && parameters.length > 0) { + parameters.forEach(function (param) { + //赋值一个level + param.level = level; + markdownCollections.push(''); + markdownCollections.push(''+getWordTableByLevel(param)+''); + markdownCollections.push(''+KUtils.toString(param.description, '')+''); + markdownCollections.push(''+KUtils.toString(param.in, '')+''); + markdownCollections.push(''+KUtils.toString(param.require, '')+''); + markdownCollections.push(''+KUtils.toString(param.type, '') +''); + markdownCollections.push(''+KUtils.toString(param.schemaValue, '') +''); + markdownCollections.push(''); + //markdownCollections.push('|' + getWordTableByLevel(param) + '|' + KUtils.toString(param.description, '') + '|' + KUtils.toString(param.in, '') + '|' + KUtils.toString(param.require, '') + '|' + KUtils.toString(param.type, '') + '|' + KUtils.toString(param.schemaValue, '') + '|') + deepWordTableByRequestParameter(param.children, markdownCollections, (param.level + 1)); + }) + } + +} + + +/** + * 根据参数级别获取名称 + * @param {*} param + */ +function getWordTableByLevel(param) { + var spaceArr = []; + for (var i = 1; i < param.level; i++) { + spaceArr.push(' ') + } + var tmpName = spaceArr.join('') + param.name; + return tmpName; +} + +function wordJsonFormatter(json){ + try { + if (typeof json != "string") { + json = JSON.stringify(json, undefined, 2); + } + json = json + .replace(/&/g, "&") + .replace(//g, ">"); + return json.replace( + /("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, + function(match) { + var cls = "number"; + if (/^"/.test(match)) { + if (/:$/.test(match)) { + cls = "key"; + } else { + cls = "string"; + } + } else if (/true|false/.test(match)) { + cls = "boolean"; + } else if (/null/.test(match)) { + cls = "null"; + } + return '' + match + ""; + } + ); + } catch (error) { + return json; + } +} diff --git a/knife4j-vue/src/views/settings/OfficelineDocument.vue b/knife4j-vue/src/views/settings/OfficelineDocument.vue index 340e99007..d7b614759 100644 --- a/knife4j-vue/src/views/settings/OfficelineDocument.vue +++ b/knife4j-vue/src/views/settings/OfficelineDocument.vue @@ -35,6 +35,7 @@ import { resumecss } from "./OfficelineCss"; import {getDocumentVueTemplates} from "@/components/officeDocument/officeDocTemplate"; import {getDocumentVueTemplatesUS} from "@/components/officeDocument/officeDocTemplateUS"; import markdownText from "@/components/officeDocument/markdownTransform"; +import wordText from "@/components/officeDocument/wordTransform"; import markdownTextUS from "@/components/officeDocument/markdownTransformUS"; import OnlineDocument from "@/views/api/OnlineDocument"; import { Modal } from "ant-design-vue"; @@ -329,8 +330,38 @@ export default { this.$message.info(message); }, triggerDownloadWord() { - var message=this.getCurrentI18nInstance().message.offline.imple; - this.$message.info(message); + var that = this; + //正在下载word文件中,请稍后... + var downloadMessage=this.getCurrentI18nInstance().message.offline.word; + that.$kloading.show({ + text: downloadMessage + }); + this.deepTags(); + var instance = { + title: that.data.instance.title, + description: that.data.instance.title, + contact: that.data.instance.contact, + version: that.data.instance.version, + host: that.data.instance.host, + basePath: that.data.instance.basePath, + termsOfService: that.data.instance.termsOfService, + name: that.data.instance.name, + url: that.data.instance.url, + location: that.data.instance.location, + pathArrs: that.data.instance.pathArrs, + tags: that.tags, + markdownFiles: that.data.instance.markdownFiles + }; + var word=wordText(instance); + //等待ace-editor渲染,给与充足时间 + setTimeout(() => { + //下载html + that.downloadWord(word); + //关闭 + that.$kloading.destroy(); + }, 1000); + /* var message=this.getCurrentI18nInstance().message.offline.imple; + this.$message.info(message); */ }, triggerDownloadMarkdown() { //下载markdown @@ -390,6 +421,24 @@ export default { that.downloadHtml(); }, 1000); }, + downloadWord(content){ + var a = document.createElement("a"); + //var content = this.getHtmlContent(this.data.instance.title); + var option = {}; + var fileName = this.data.instance.name + ".doc"; + var url = window.URL.createObjectURL( + new Blob([content], { + type: + (option.type || "application/msword") + + ";charset=" + + (option.encoding || "utf-8") + }) + ); + a.href = url; + a.download = fileName || "file"; + a.click(); + window.URL.revokeObjectURL(url); + }, downloadMarkdown(content) { //console("downloadMarkdown"); var a = document.createElement("a"); diff --git a/knife4j-vue/vue.config.js b/knife4j-vue/vue.config.js index bdcf9c52c..7adb74ed9 100644 --- a/knife4j-vue/vue.config.js +++ b/knife4j-vue/vue.config.js @@ -19,8 +19,8 @@ module.exports = { devServer: { proxy: { "/": { - target: 'http://localhost:8999/', - /* target: 'http://knife4j.xiaominfo.com/', */ + /* target: 'http://localhost:8999/', */ + target: 'http://knife4j.xiaominfo.com/', ws: true, changeOrigin: true } diff --git a/knife4j/exportWord.html b/knife4j/exportWord.html new file mode 100644 index 000000000..b88886097 --- /dev/null +++ b/knife4j/exportWord.html @@ -0,0 +1,303 @@ + + + + + + 导出Swagger文档到Word + + + + +
+

1.项目说明

+
+
简介:swagger-bootstrap-ui-demo RESTful APIs
+
+
作者:xiaoymin@foxmail.com
+
+
HOST:127.0.0.1:8999
+
+
联系人:xx@qq.com
+
+
Version:1.0
+
+
接口路径:/v2/api-docs?group=2.X版本
+
+
+

2.接口列表

+

2.1导游预约

+

2.1.1新增导游

+
+
接口地址
+
GET  /api/guide/add
+
接口描述
+
通过填写导游属性,新增导游信息
+
请求数据类型
+
application/json
+
响应数据类型
+
application/json
+
请求示例
+
{
+  "name": "张飞",
+  "code": 8200,
+  "message": "成功",
+  "success": true
+}
+
请求参数
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数名称参数说明请求类型必须数据类型schema
暂无
user用户bodytrueUserVoUserVo
 name姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名queryfalsestringschema
 email邮箱邮箱queryfalsestringschema
id主键编号queryfalsestringschema
+
+
+
响应状态
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
状态码说明schema
200OKRest«Knife4jUser»
201Created
401Unauthorized
403Forbidden
404Not Found
+
+
+
响应参数
+
+ + + + + + + + + + + + + + + + + +
参数名称参数说明类型schema
200OKOKRest«Knife4jUser»
+
+
响应Header
+
+ + + + + + + + + + + + + + + +
参数名称参数说明类型
200OKRest«Knife4jUser»
+
+
响应示例
+
{
+  "name": "张飞",
+  "code": 8200,
+  "message": null,
+  "success": true
+}
+
+
+

2.1.2删除导游

+
+
接口地址
+
DELETE  /api/guide/add
+
接口描述
+
通过填写导游属性,新增导游信息
+
请求数据类型
+
application/json
+
响应数据类型
+
application/json
+
请求示例
+
{"data": "","errCode": 0,"message": "","success": true}
+
请求参数
+
+ 参数table +
+
响应状态
+
+ 状态table +
+
响应参数
+
+ 响应参数table +
+
响应示例
+
+
{"data": "","errCode": 0,"message": "","success": true}
+
+
+

2.1.3分页查询导游

+

2.2用户管理

+

2.2.1新增用户

+

2.2.2删除用户

+

2.2.3分页查询用户

+

2.3权限管理

+

2.3.1新增权限

+

2.3.2删除权限

+

2.3.3分页查询权限

+
+ + \ No newline at end of file diff --git a/knife4j/exportWord1.html b/knife4j/exportWord1.html new file mode 100644 index 000000000..a496b326a --- /dev/null +++ b/knife4j/exportWord1.html @@ -0,0 +1,266 @@ + + + + + + 导出Swagger文档到Word + + + + +
+

1.项目说明

+
+
简介:swagger-bootstrap-ui-demo RESTful APIs
+
+
作者:xiaoymin@foxmail.com
+
+
HOST:127.0.0.1:8999
+
+
联系人:xx@qq.com
+
+
Version:1.0
+
+
接口路径:/v2/api-docs?group=2.X版本
+
+
+

2.接口列表

+

2.1导游预约

+

2.1.1新增导游

+
+
接口地址
+
GET  /api/guide/add
+
接口描述
+
通过填写导游属性,新增导游信息
+
请求数据类型
+
application/json
+
响应数据类型
+
application/json
+
请求示例
+
{
+"name": "张飞",
+"code": 8200,
+"message": "成功",
+"success": true
+}
+
请求参数
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数名称参数说明请求类型必须数据类型schema
user用户bodytrueUserVoUserVo
 name姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名姓名queryfalsestringschema
 email邮箱邮箱邮箱邮箱queryfalsestringschema
id主键编号queryfalsestringschema
+
+
+
响应状态
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
状态码说明schema
200OKRest«Knife4jUser»
201Created
401Unauthorized
403Forbidden
404Not Found
+
+
+
响应参数
+
+ 响应参数table +
+
响应示例
+
{
+"name": "张飞",
+"code": 8200,
+"message": null,
+"success": true
+}
+
+
+

2.1.2删除导游

+
+
接口地址
+
DELETE  /api/guide/add
+
接口描述
+
通过填写导游属性,新增导游信息
+
请求数据类型
+
application/json
+
响应数据类型
+
application/json
+
请求示例
+
{"data": "","errCode": 0,"message": "","success": true}
+
请求参数
+
+ 参数table +
+
响应状态
+
+ 状态table +
+
响应参数
+
+ 响应参数table +
+
响应示例
+
+
{"data": "","errCode": 0,"message": "","success": true}
+
+
+

2.1.3分页查询导游

+

2.2用户管理

+

2.2.1新增用户

+

2.2.2删除用户

+

2.2.3分页查询用户

+

2.3权限管理

+

2.3.1新增权限

+

2.3.2删除权限

+

2.3.3分页查询权限

+
+ + \ No newline at end of file