Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化关联应用功能 #61

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

优化关联应用功能 #61

wants to merge 14 commits into from

Conversation

ashlee618
Copy link

使用knife4j实现接口可视化功能

选择knife4j的原因

  • 界面简洁
  • 支持国际化
  • 支持在线接口调试
  • 可对接口进行排序,比如在一个登录功能模块中,可以对其所有接口进行进行排序,让开发人员清晰地熟知调用流程,有助于开发人员进行接口对接

后续问题

  1. 现在这个版本是没有对接口功能添加文字描述的,在后续版本会,会对实体、接口添加必要的文字描述,帮助理解。
  2. 目前是对所有接口进行展示,后续可能根据业务,对部分接口隐藏。

@sofastack-bot
Copy link

sofastack-bot bot commented Jul 9, 2021

Hi @ashlee618, welcome to SOFAStack community, Please sign Contributor License Agreement!

After you signed CLA, we will automatically sync the status of this pull request in 3 minutes.

@sofastack-bot sofastack-bot bot added cla:yes and removed cla:no labels Jul 10, 2021
@ashlee618 ashlee618 changed the title 新增接口可视化功能 优化关联应用功能 Jul 10, 2021
@ashlee618
Copy link
Author

优化关联应用功能

以前的版本存在可以重复关联的bug
image

并且可以关联在zk中不存在的应用
image
(图中并没有芜湖2,但是可以进行关联)

    public boolean isRelatedByModuleAndApp(int mId, String appName) {
        return arkDao.queryRelationByModuleIdAndAppName(mId, appName).size() > 0;
    }

这里用的并非是最优雅的解决办法,用的是最简单粗暴的,有待优化。

@sofastack-bot sofastack-bot bot added size/XL and removed size/L labels Jul 10, 2021
return new Docket(DocumentationType.SWAGGER_2)
.useDefaultResponseMessages(false)
.apiInfo(apiInfo())
.groupName("1.0版本")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不建议在代码中直接使用这种常量,同时也不建议使用中文

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,这个打算后面换成5个分类,application、arkmng、core、governance、web这样方便开发者对接。

System.out.println(hostAndPort);
}
public static void main(String[] args) {
String id = uniqueId(new HostAndPort("192.168.0.104", "8.16.32.64", 38081));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we need delete sysout?

* @param appName
* @return
*/
List<AppArkDO> queryRelationByModuleIdAndAppName(int mId,String appName);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意格式化

@@ -70,4 +70,10 @@
public static final String ZOOKEEPER_PREFIX = "zookeeper://";
public static final String SOFA_PREFIX = "sofa://";

// API接口类
public static final String API_ARK_TAGS = "Ark相关接口";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是可以考虑使用一个枚举来描述下所有的接口类型,而不是在 常量类中定义

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是个不错的建议

<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>2.0.7</version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

版本管理在主pom 的 dependentmanagement 中

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到

@sofastack-bot sofastack-bot bot added size/L and removed size/XL labels Jul 12, 2021
@sofastack-bot sofastack-bot bot added size/XL and removed size/L labels Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants