support page render
This commit is contained in:
parent
f5b00a9c9f
commit
0b06704276
|
@ -97,6 +97,11 @@ public interface DocTags {
|
|||
*/
|
||||
String DOWNLOAD = "download";
|
||||
|
||||
/**
|
||||
* custom @page tag
|
||||
*/
|
||||
String PAGE = "page";
|
||||
|
||||
|
||||
/**
|
||||
* Ignore ResponseBodyAdvice
|
||||
|
|
|
@ -177,6 +177,11 @@ public class ApiMethodDoc implements Serializable {
|
|||
*/
|
||||
private String link;
|
||||
|
||||
/**
|
||||
* mark page
|
||||
*/
|
||||
private String page = "";
|
||||
|
||||
public String getMethodId() {
|
||||
return methodId;
|
||||
}
|
||||
|
@ -389,6 +394,14 @@ public class ApiMethodDoc implements Serializable {
|
|||
this.link = link;
|
||||
}
|
||||
|
||||
public String getPage() {
|
||||
return page;
|
||||
}
|
||||
|
||||
public void setPage(String page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
|
|
|
@ -165,6 +165,11 @@ public class SpringBootDocBuildTemplate implements IDocBuildTemplate<ApiDoc> {
|
|||
if (Objects.nonNull(downloadTag)) {
|
||||
apiMethodDoc.setDownload(true);
|
||||
}
|
||||
DocletTag pageTag = method.getTagByName(DocTags.PAGE);
|
||||
if (Objects.nonNull(pageTag)) {
|
||||
String pageUrl = "/" + projectBuilder.getServerUrl() + "/" + pageTag.getValue();
|
||||
apiMethodDoc.setPage(UrlUtil.simplifyUrl(pageUrl));
|
||||
}
|
||||
DocletTag docletTag = method.getTagByName(DocTags.GROUP);
|
||||
if (Objects.nonNull(docletTag)) {
|
||||
apiMethodDoc.setGroup(docletTag.getValue());
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -45,6 +45,7 @@ $("button").on("click", function () {
|
|||
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))
|
||||
|
@ -52,15 +53,21 @@ $("button").on("click", function () {
|
|||
|
||||
console.log("body-params=>" + JSON.stringify(bodyParamData))
|
||||
console.log("json-body=>" + body);
|
||||
|
||||
let finalUrl = "";
|
||||
let queryParamData = "";
|
||||
if (page != "" || page != null) {
|
||||
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 = {};
|
||||
let finalUrl = "";
|
||||
|
||||
if ("multipart/form-data" == contentType) {
|
||||
finalUrl = castToGetUri(url, pathParamData);
|
||||
queryParamData = getInputData($queryElement, true)
|
||||
|
|
Loading…
Reference in New Issue