Skip to content

Commit

Permalink
fix(html): fix group and dict alias field is null
Browse files Browse the repository at this point in the history
  • Loading branch information
chenqi146 committed Feb 19, 2024
1 parent 3a8ca0b commit e9aca47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/ly/doc/builder/DocBuilderTemplate.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.ly.doc.model.ApiErrorCode;
import com.ly.doc.model.ApiMethodDoc;
import com.ly.doc.utils.BeetlTemplateUtil;
import com.power.common.util.StringUtil;
import com.thoughtworks.qdox.JavaProjectBuilder;

import org.beetl.core.Template;
Expand Down Expand Up @@ -261,14 +262,18 @@ public void buildSearchJs(ApiConfig config, JavaProjectBuilder javaProjectBuilde
for (ApiDocDict apiDocDict : apiDocDictList) {
ApiMethodDoc methodDoc = new ApiMethodDoc();
methodDoc.setOrder(apiDocDict.getOrder());
methodDoc.setDesc(apiDocDict.getTitle());
String title = "";
if (StringUtil.isNotEmpty(apiDocDict.getTitle())) {
title = apiDocDict.getTitle();
}
methodDoc.setDesc(title);
methodDocs.add(methodDoc);

ApiDoc childrenApiDoc = new ApiDoc();
childrenApiDoc.setOrder(apiDocDict.getOrder());
childrenApiDoc.setAlias(apiDocDict.getTitle());
childrenApiDoc.setDesc(apiDocDict.getTitle());
childrenApiDoc.setName(apiDocDict.getTitle());
childrenApiDoc.setAlias(title);
childrenApiDoc.setDesc(title);
childrenApiDoc.setName(title);
childrenApiDoc.setList(new ArrayList<>(0));
childrenApiDocs.add(childrenApiDoc);

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/ly/doc/model/ApiDoc.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public static ApiDoc buildGroupApiDoc(String group) {
ApiDoc apiDoc = new ApiDoc();
apiDoc.setFolder(true);
apiDoc.setGroup(group);
apiDoc.setAlias(group);
apiDoc.setName(group);
apiDoc.setDesc(group);
apiDoc.setChildrenApiDocs(new ArrayList<>());
Expand Down

0 comments on commit e9aca47

Please sign in to comment.