Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhihang committed Jul 19, 2021
2 parents e4372ec + 7b4e697 commit e99c1cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.intellij.psi.PsiType;
import com.intellij.psi.util.InheritanceUtil;
import com.liuzhihang.doc.view.DocViewBundle;
import com.liuzhihang.doc.view.config.Settings;
import com.liuzhihang.doc.view.config.YApiSettings;
import com.liuzhihang.doc.view.constant.FieldTypeConstant;
import com.liuzhihang.doc.view.dto.Body;
Expand Down Expand Up @@ -57,14 +58,19 @@ public void upload(@NotNull Project project, @NotNull List<DocView> docViewList)
@Override
public void upload(@NotNull Project project, @NotNull DocView docView) {

String catName = docView.getPsiClass().getName();
String catName = docView.getDocTitle();

// 全类名过长
if (Settings.getInstance(project).getTitleUseFullClassName() && catName.contains(".")) {
catName = catName.substring(catName.lastIndexOf("."));
}


try {
YApiSettings settings = YApiSettings.getInstance(project);

YApiFacadeService facadeService = ServiceManager.getService(YApiFacadeServiceImpl.class);

assert catName != null;
YApiCat cat = getOrAddCat(settings, catName);

YapiSave save = new YapiSave();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/liuzhihang/doc/view/ui/PreviewForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ private void buildDoc() {

currentDocView = docViewMap.get(selectedValue);

docNameLabel.setText(currentDocView.getPsiClass().getQualifiedName());
docNameLabel.setText(currentDocView.getDocTitle());

// 将 docView 按照模版转换
currentMarkdownText = DocViewData.buildMarkdownText(project, currentDocView);
Expand Down

0 comments on commit e99c1cd

Please sign in to comment.