Prechádzať zdrojové kódy

自动接口文档相关配置

lin.liu 3 týždňov pred
rodič
commit
fc6c91cccd

+ 1 - 2
.gitignore

@@ -45,8 +45,7 @@ nbdist/
 !*/build/*.xml
 
 **/static/doc/*.*
-/logs/*
 /cabinet/*
 
 **/log/
-**/logs/
+**/logs/

+ 0 - 13
pom.xml

@@ -401,19 +401,6 @@
 					<configFile>./src/main/resources/smart-doc.json</configFile>
 					<!--指定项目名称-->
 					<projectName>重庆海关安全生产网格化智慧管理平台-接口文档</projectName>
-					<!--smart-doc实现自动分析依赖树加载第三方依赖的源码,如果一些框架依赖库加载不到导致报错,这时请使用excludes排除掉-->
-					<!--<excludes>
-						&lt;!&ndash;格式为:groupId:artifactId;参考如下&ndash;&gt;
-						<exclude>com.alibaba:fastjson</exclude>
-					</excludes>-->
-
-					<!--自1.0.8版本开始,插件提供includes支持,配置了includes后插件会按照用户配置加载而不是自动加载,因此使用时需要注意-->
-					<!--smart-doc能自动分析依赖树加载所有依赖源码,原则上会影响文档构建效率,因此你可以使用includes来让插件加载你配置的组件-->
-					<!--<includes>
-						&lt;!&ndash;格式为:groupId:artifactId;参考如下&ndash;&gt;
-						&lt;!&ndash;也可以支持正则式如:com.alibaba:.* &ndash;&gt;
-						<include>com.alibaba:fastjson</include>
-					</includes>-->
 				</configuration>
 				<executions>
 					<execution>

+ 1 - 1
run-doc.bat

@@ -10,7 +10,7 @@ set currPath=%~dp0
 
 cd %currPath%
 
-mvn smart-doc:openapi -Dfile.encoding=UTF-8 -pl :secure-producting-host -am
 mvn smart-doc:html -Dfile.encoding=UTF-8 -pl :secure-producting-host -am
+mvn smart-doc:openapi -Dfile.encoding=UTF-8 -pl :secure-producting-host -am
 
 pause&gt;nul

+ 5 - 0
secure-producting-host/src/main/java/com/customs/cq/datacenter/host/web/controller/system/QuartzController.java

@@ -19,6 +19,11 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.*;
 
+/**
+ * 130.定时任务
+ *
+ * @order 130
+ */
 @Controller
 @RequestMapping("quartz")
 public class QuartzController {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
secure-producting-host/src/main/resources/doc/AllInOne.css


+ 0 - 327
secure-producting-host/src/main/resources/doc/debug.js

@@ -1,327 +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.initHighlightingOnLoad();
-});
-
-$("[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")
-    const url = $("#" + id + "-url").data("url");
-    const isDownload = $("#" + id + "-url").data("download");
-    const page = $("#" + id + "-url").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)
-        body = queryParamData;
-        ajaxOptions.processData = false;
-        ajaxOptions.contentType = false;
-    } else if ("POST" == method && contentType !== "multipart/form-data"
-        && contentType !== "application/json; charset=utf-8") {
-        finalUrl = castToGetUri(url, pathParamData);
-        queryParamData = getInputData($queryElement)
-        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("&nbsp;Status:&nbsp;" + jqXHR.status + "&nbsp;&nbsp;" + jqXHR.statusText + "&nbsp;&nbsp;&nbsp;&nbsp;Time:&nbsp;" + totalTime + "&nbsp;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("&nbsp;Status:&nbsp;" + jqXHR.status + "&nbsp;&nbsp;" + jqXHR.statusText + "&nbsp;&nbsp;&nbsp;&nbsp;Time:&nbsp;" + totalTime + "&nbsp;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).removeAttr("checked");
-        } 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, 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');
-            console.log("input type:" + $(input).attr("type"))
-            const name = $(input).attr("name");
-            if ($(input).attr("type") == "file") {
-                formData.append(name, $(input)[0].files[0]);
-            } else {
-                const val = $(input).val();
-                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.data && request.data.length > 0) {
-        cmd.push("-H");
-        cmd.push("'Content-Type: application/json; charset=utf-8'");
-    }
-    // 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 (request.data && request.data.length > 0) {
-        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 || new String(obj).trim() === '';
-}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
secure-producting-host/src/main/resources/doc/font.css


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 302
secure-producting-host/src/main/resources/doc/highlight.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
secure-producting-host/src/main/resources/doc/index.html


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1
secure-producting-host/src/main/resources/doc/jquery.min.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 24683
secure-producting-host/src/main/resources/doc/openapi.json


+ 0 - 1
secure-producting-host/src/main/resources/doc/xt256.min.css

@@ -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}

+ 1 - 1
secure-producting-host/src/main/resources/smart-doc.json

@@ -5,7 +5,7 @@
   "allInOneDocFileName":"index.html",//自定义设置输出文档名称, @since 1.9.0
   "style": "vs2015",
   "createDebugPage": true, //@since 2.0.0 smart-doc支持创建可以测试的html页面,仅在AllInOne模式中起作用。
-  "packageFilters": "com.customs.cq.datacenter.web.controller.*,com.customs.cq.datacenter.warehouse.controller.*",//controller包过滤,多个包用英文逗号隔开,2.2.2开始需要采用正则:com.test.controller.*
+  "packageFilters": "com.customs.cq.datacenter.host.web.controller.*,com.customs.cq.datacenter.business.controller.*",//controller包过滤,多个包用英文逗号隔开,2.2.2开始需要采用正则:com.test.controller.*
   "requestExample":"true",//是否将请求示例展示在文档中,默认true,@since 1.9.0
   "responseExample":"true"//是否将响应示例展示在文档中,默认为true,@since 1.9.0
 //    "requestHeaders": [{ //设置请求头,没有需求可以不设置

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov