support ali dubbo

This commit is contained in:
yusun4 2020-10-23 13:48:25 +08:00
parent f132e6811f
commit bd134394cf
3 changed files with 10 additions and 2 deletions

View File

@ -6,6 +6,7 @@
1. 修复restful接口泛型中使用?时的解析错误。
2. 优化rpc html非all in one的问题。
3. 对rest query参数自动添加描述增加可读性。
4. support ali dubbo,#I22CF7 .
#### 版本号1.9.6
- 更新日期: 2020-10-09
- 更新内容:

View File

@ -12,4 +12,9 @@ public interface DubboAnnotationConstants {
* @since dubbo 2.7.7
*/
String DUBBO_SERVICE = "org.apache.dubbo.config.annotation.DubboService";
/**
* support ali dubbo
*/
String ALI_DUBBO_SERVICE= "comm.alibaba.dubbo.config.annotation.Service";
}

View File

@ -229,7 +229,9 @@ public class RpcDocBuildTemplate implements IDocBuildTemplate<RpcApiDoc> {
List<JavaAnnotation> classAnnotations = cls.getAnnotations();
for (JavaAnnotation annotation : classAnnotations) {
String name = annotation.getType().getCanonicalName();
if (DubboAnnotationConstants.SERVICE.equals(name) || DubboAnnotationConstants.DUBBO_SERVICE.equals(name)) {
if (DubboAnnotationConstants.SERVICE.equals(name)
|| DubboAnnotationConstants.DUBBO_SERVICE.equals(name)
|| DubboAnnotationConstants.ALI_DUBBO_SERVICE.equals(name)) {
return true;
}
}
@ -292,7 +294,7 @@ public class RpcDocBuildTemplate implements IDocBuildTemplate<RpcApiDoc> {
String[] generics = str.split("[<,]");
for (String generic : generics) {
if (generic.contains("extends")) {
String className = generic.substring(generic.lastIndexOf(" ")+1);
String className = generic.substring(generic.lastIndexOf(" ") + 1);
returnClass = returnClass.replace(className, JavaClassUtil.getClassSimpleName(className));
}
if (generic.length() != 1 && !generic.contains("extends")) {