You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by zh...@apache.org on 2023/01/11 13:09:15 UTC
[shenyu] branch master updated: #4029 api-doc example (#4307)
This is an automated email from the ASF dual-hosted git repository.
zhangzicheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new cdb100023 #4029 api-doc example (#4307)
cdb100023 is described below
commit cdb1000238c20c76444a36ee05b434a89c9cc6a6
Author: zhengpeng <84...@qq.com>
AuthorDate: Wed Jan 11 21:09:05 2023 +0800
#4029 api-doc example (#4307)
Co-authored-by: dragon-zhang <zh...@apache.org>
---
.../annotation/impl/DubboClassMultiParamServiceImpl.java | 12 ++++++++++++
.../service/annotation/impl/DubboMultiParamServiceImpl.java | 11 +++++++++++
.../dubbo/service/annotation/impl/DubboTestServiceImpl.java | 7 +++++++
.../dubbo/service/impl/DubboClassMultiParamServiceImpl.java | 12 ++++++++++++
.../dubbo/service/impl/DubboMultiParamServiceImpl.java | 11 +++++++++++
.../alibaba/dubbo/service/impl/DubboTestServiceImpl.java | 7 +++++++
.../annotation/impl/DubboClassMultiParamServiceImpl.java | 12 ++++++++++++
.../service/annotation/impl/DubboMultiParamServiceImpl.java | 11 +++++++++++
.../dubbo/service/annotation/impl/DubboTestServiceImpl.java | 7 +++++++
.../service/xml/impl/DubboClassMultiParamServiceImpl.java | 12 ++++++++++++
.../dubbo/service/xml/impl/DubboMultiParamServiceImpl.java | 11 +++++++++++
.../apache/dubbo/service/xml/impl/DubboTestServiceImpl.java | 7 +++++++
.../dubbo/service/impl/DubboMultiParamServiceImpl.java | 11 +++++++++++
.../apache/dubbo/service/impl/DubboTestServiceImpl.java | 7 +++++++
.../dubbo/service/annotation/impl/MultiParamServiceImpl.java | 11 +++++++++++
.../apache/shenyu/examples/grpc/demo/EventServiceImpl.java | 5 +++++
.../shenyu/examples/http/controller/HttpTestController.java | 9 +++++++++
.../shenyu/examples/http/controller/OauthController.java | 4 ++++
.../shenyu/examples/http/controller/OrderController.java | 8 ++++++++
.../examples/http/controller/ShenyuClientPathController.java | 7 +++++++
.../http/controller/SpringMvcMappingPathController.java | 6 ++++++
.../shenyu/examples/http/controller/UploadController.java | 5 +++++
.../shenyu/examples/https/controller/OrderController.java | 4 ++++
.../shenyu/examples/https/controller/UploadController.java | 4 ++++
.../examples/motan/service/impl/MotanDemoServiceImpl.java | 5 +++++
.../sofa/service/impl/SofaClientMultiParamServiceImpl.java | 12 ++++++++++++
.../sofa/service/impl/SofaMultiParamServiceImpl.java | 12 ++++++++++++
.../sofa/service/impl/SofaSingleParamServiceImpl.java | 6 ++++++
.../examples/springcloud/controller/AllController.java | 5 +++++
.../springcloud/controller/NewFeatureController.java | 9 +++++++++
.../examples/springcloud/controller/OrderController.java | 7 +++++++
.../examples/springcloud/controller/UploadController.java | 4 ++++
.../examples/springmvc/controller/OrderController.java | 9 +++++++++
.../examples/springmvc/controller/UploadController.java | 7 ++++++-
.../examples/springmvc/controller/OrderController.java | 8 ++++++++
.../examples/springmvc/controller/UploadController.java | 7 ++++++-
.../examples/tars/servant/testapp/impl/HelloServantImpl.java | 5 +++++
.../examples/tars/servant/testapp/impl/OrderServantImpl.java | 5 +++++
38 files changed, 300 insertions(+), 2 deletions(-)
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
index 790e165d1..b30ecb9a1 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.annotation.impl;
import org.apache.shenyu.client.alibaba.dubbo.annotation.ShenyuService;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@ShenyuService("/demo")
+@ApiModule(value = "demo")
public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu alibaba dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu alibaba dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
@@ -89,6 +100,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/bigRequestBody")
+ @ApiDoc(desc = "bigRequestBody")
public DubboTest saveBigRequestBody(final DubboTest dubboTest) {
return dubboTest;
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
index db9c4f9fa..607e6c8a3 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.annotation.impl;
import com.alibaba.dubbo.config.annotation.Service;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,52 +35,61 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@Service
+@ApiModule(value = "dubboMultiParamService")
public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId), "hello world shenyu alibaba dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
}
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu alibaba dubbo param batchSaveAndNameAndId :" + name + ":" + join(dubboTestList, DubboTest::getName));
}
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(), "hello world shenyu alibaba dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
}
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(), "hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
index 066c963dc..cb98c9b90 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/annotation/impl/DubboTestServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.annotation.impl;
import com.alibaba.dubbo.config.annotation.Service;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -31,23 +33,27 @@ import java.util.Random;
* The type Dubbo service.
*/
@Service
+@ApiModule(value = "dubboTestService")
public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public DubboTest findById(final String id) {
return new DubboTest(id, "hello world shenyu Alibaba Dubbo, findById");
}
@Override
@ShenyuDubboClient("/findAll")
+ @ApiDoc(desc = "findAll")
public DubboTest findAll() {
return new DubboTest(String.valueOf(new Random().nextInt()), "hello world shenyu Alibaba Dubbo , findAll");
}
@Override
@ShenyuDubboClient("/insert")
+ @ApiDoc(desc = "insert")
public DubboTest insert(final DubboTest dubboTest) {
dubboTest.setName("hello world shenyu Alibaba Dubbo: " + dubboTest.getName());
return dubboTest;
@@ -55,6 +61,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findList")
+ @ApiDoc(desc = "findList")
public ListResp findList() {
return new ListResp(1, Collections.singletonList(new DubboTest("1", "test")));
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboClassMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboClassMultiParamServiceImpl.java
index 21f80629a..89635a8ca 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboClassMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboClassMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -34,34 +36,40 @@ import java.util.stream.Collectors;
*/
@Service("dubboClassMultiParamService")
@ShenyuDubboClient("/demo")
+@ApiModule(value = "/demo")
public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu alibaba dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -69,6 +77,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu alibaba dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -76,6 +85,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -83,6 +93,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
@@ -90,6 +101,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/bigRequestBody")
+ @ApiDoc(desc = "bigRequestBody")
public DubboTest saveBigRequestBody(final DubboTest dubboTest) {
return dubboTest;
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboMultiParamServiceImpl.java
index eb54e11ec..6250b26e9 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@Service("dubboMultiParamService")
+@ApiModule(value = "dubboMultiParamService")
public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu alibaba dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu alibaba dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu alibaba dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu alibaba dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
index 2c3df93b8..6450ffe8e 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-alibaba-dubbo-service/src/main/java/org/apache/shenyu/examples/alibaba/dubbo/service/impl/DubboTestServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.alibaba.dubbo.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -31,23 +33,27 @@ import java.util.Random;
* DubboTestServiceImpl.
*/
@Service("dubboTestService")
+@ApiModule(value = "dubboTestService")
public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public DubboTest findById(final String id) {
return new DubboTest(id, "hello world shenyu Alibaba Dubbo, findById");
}
@Override
@ShenyuDubboClient("/findAll")
+ @ApiDoc(desc = "findAll")
public DubboTest findAll() {
return new DubboTest(String.valueOf(new Random().nextInt()), "hello world shenyu Alibaba Dubbo , findAll");
}
@Override
@ShenyuDubboClient("/insert")
+ @ApiDoc(desc = "insert")
public DubboTest insert(final DubboTest dubboTest) {
dubboTest.setName("hello world shenyu Alibaba Dubbo: " + dubboTest.getName());
return dubboTest;
@@ -55,6 +61,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findList")
+ @ApiDoc(desc = "findList")
public ListResp findList() {
return new ListResp(1, Collections.singletonList(new DubboTest("1", "test")));
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
index 87af706fa..c009b0295 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboClassMultiParamServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.annotation.impl;
import org.apache.shenyu.client.apache.dubbo.annotation.ShenyuDubboService;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@ShenyuDubboService("/demo")
+@ApiModule(value = "demo")
public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
@@ -89,6 +100,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/bigRequestBody")
+ @ApiDoc(desc = "bigRequestBody")
public DubboTest saveBigRequestBody(final DubboTest dubboTest) {
return dubboTest;
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
index 30edb5c22..73be1ebb2 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboMultiParamServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.annotation.impl;
import org.apache.dubbo.config.annotation.DubboService;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@DubboService
+@ApiModule(value = "dubboMultiParamService")
public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
index 071f455d3..acdd6af87 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/annotation/impl/DubboTestServiceImpl.java
@@ -19,6 +19,8 @@ package org.apache.shenyu.examples.apache.dubbo.service.annotation.impl;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.common.utils.GsonUtils;
import org.apache.shenyu.examples.common.aop.Log;
@@ -35,6 +37,7 @@ import java.util.Random;
* The type Dubbo service.
*/
@DubboService
+@ApiModule(value = "dubboTestService")
public class DubboTestServiceImpl implements DubboTestService {
private static final Logger LOGGER = LoggerFactory.getLogger(DubboTestServiceImpl.class);
@@ -42,6 +45,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public DubboTest findById(final String id) {
LOGGER.info(GsonUtils.getInstance().toJson(RpcContext.getContext().getAttachments()));
return new DubboTest(id, "hello world shenyu Apache, findById");
@@ -49,12 +53,14 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findAll")
+ @ApiDoc(desc = "findAll")
public DubboTest findAll() {
return new DubboTest(String.valueOf(new Random().nextInt()), "hello world shenyu Apache, findAll");
}
@Override
@ShenyuDubboClient("/insert")
+ @ApiDoc(desc = "insert")
public DubboTest insert(final DubboTest dubboTest) {
dubboTest.setName("hello world shenyu Apache Dubbo: " + dubboTest.getName());
return dubboTest;
@@ -62,6 +68,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findList")
+ @ApiDoc(desc = "findList")
public ListResp findList() {
return new ListResp(1, Collections.singletonList(new DubboTest("1", "test")));
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboClassMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboClassMultiParamServiceImpl.java
index c09173abf..07c97cc5c 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboClassMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboClassMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.xml.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -34,34 +36,40 @@ import java.util.stream.Collectors;
*/
@Service("dubboClassMultiParamService")
@ShenyuDubboClient("/demo")
+@ApiModule(value = "dubboClassMultiParamService")
public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -69,6 +77,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -76,6 +85,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -83,6 +93,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
@@ -90,6 +101,7 @@ public class DubboClassMultiParamServiceImpl implements DubboClassMultiParamServ
@Override
@ShenyuDubboClient("/bigRequestBody")
+ @ApiDoc(desc = "bigRequestBody")
public DubboTest saveBigRequestBody(final DubboTest dubboTest) {
return dubboTest;
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboMultiParamServiceImpl.java
index 8c4be661a..85999621f 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.xml.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@Service("dubboMultiParamService")
+@ApiModule(value = "dubboMultiParamService")
public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
index 6322b5fd1..1261588b5 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-xml/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/xml/impl/DubboTestServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.xml.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -31,23 +33,27 @@ import java.util.Random;
* DubboTestServiceImpl.
*/
@Service("dubboTestService")
+@ApiModule(value = "dubboTestService")
public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public DubboTest findById(final String id) {
return new DubboTest(id, "hello world shenyu Apache, findById");
}
@Override
@ShenyuDubboClient("/findAll")
+ @ApiDoc(desc = "findAll")
public DubboTest findAll() {
return new DubboTest(String.valueOf(new Random().nextInt()), "hello world shenyu Apache, findAll");
}
@Override
@ShenyuDubboClient("/insert")
+ @ApiDoc(desc = "insert")
public DubboTest insert(final DubboTest dubboTest) {
dubboTest.setName("hello world shenyu Apache Dubbo: " + dubboTest.getName());
return dubboTest;
@@ -55,6 +61,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findList")
+ @ApiDoc(desc = "findList")
public ListResp findList() {
return new ListResp(1, Collections.singletonList(new DubboTest("1", "test")));
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboMultiParamServiceImpl.java
index 0aec2c91e..ed04eea6a 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@Service("dubboMultiParamService")
+@ApiModule(value = "dubboMultiParamService")
public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class DubboMultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
index de2799a8a..40441c43e 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/java/org/apache/shenyu/examples/apache/dubbo/service/impl/DubboTestServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.apache.dubbo.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -31,23 +33,27 @@ import java.util.Random;
* DubboTestServiceImpl.
*/
@Service("dubboTestService")
+@ApiModule(value = "dubboTestService")
public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public DubboTest findById(final String id) {
return new DubboTest(id, "hello world shenyu Apache, findById");
}
@Override
@ShenyuDubboClient("/findAll")
+ @ApiDoc(desc = "findAll")
public DubboTest findAll() {
return new DubboTest(String.valueOf(new Random().nextInt()), "hello world shenyu Apache, findAll");
}
@Override
@ShenyuDubboClient("/insert")
+ @ApiDoc(desc = "insert")
public DubboTest insert(final DubboTest dubboTest) {
dubboTest.setName("hello world shenyu Apache Dubbo: " + dubboTest.getName());
return dubboTest;
@@ -55,6 +61,7 @@ public class DubboTestServiceImpl implements DubboTestService {
@Override
@ShenyuDubboClient("/findList")
+ @ApiDoc(desc = "findList")
public ListResp findList() {
return new ListResp(1, Collections.singletonList(new DubboTest("1", "test")));
}
diff --git a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/MultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/MultiParamServiceImpl.java
index e404af29c..0ffa6ae3c 100644
--- a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/MultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-spring-cloud-alibaba-dubbo-service-annotation/src/main/java/org/apache/shenyu/examples/spring/cloud/dubbo/service/annotation/impl/MultiParamServiceImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.spring.cloud.dubbo.service.annotation.impl;
import org.apache.dubbo.config.annotation.DubboService;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.dubbo.common.annotation.ShenyuDubboClient;
import org.apache.shenyu.examples.dubbo.api.entity.ComplexBeanTest;
import org.apache.shenyu.examples.dubbo.api.entity.DubboTest;
@@ -33,34 +35,40 @@ import java.util.stream.Collectors;
* The type Dubbo multi param service.
*/
@DubboService
+@ApiModule(value = "dubboMultiParamService")
public class MultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public DubboTest findByIdsAndName(final List<Integer> ids, final String name) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public DubboTest findByArrayIdsAndName(final Integer[] ids, final String name) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuDubboClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public DubboTest findByStringArray(final String[] ids) {
return new DubboTest(Arrays.toString(ids), "hello world shenyu apache dubbo param findByStringArray");
}
@Override
@ShenyuDubboClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public DubboTest findByListId(final List<String> ids) {
return new DubboTest(ids.toString(), "hello world shenyu apache dubbo param findByListId");
}
@Override
@ShenyuDubboClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public DubboTest batchSave(final List<DubboTest> dubboTestList) {
return new DubboTest(join(dubboTestList, DubboTest::getId),
"hello world shenyu apache dubbo param batchSave :" + join(dubboTestList, DubboTest::getName));
@@ -68,6 +76,7 @@ public class MultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/batchSaveAndNameAndId")
+ @ApiDoc(desc = "batchSaveAndNameAndId")
public DubboTest batchSaveAndNameAndId(final List<DubboTest> dubboTestList, final String id, final String name) {
return new DubboTest(id, "hello world shenyu apache dubbo param batchSaveAndNameAndId :"
+ name + ":" + join(dubboTestList, DubboTest::getName));
@@ -75,6 +84,7 @@ public class MultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTest")
+ @ApiDoc(desc = "saveComplexBeanTest")
public DubboTest saveComplexBeanTest(final ComplexBeanTest complexBeanTest) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu apache dubbo param saveComplexBeanTest :" + complexBeanTest.getDubboTest().getName());
@@ -82,6 +92,7 @@ public class MultiParamServiceImpl implements DubboMultiParamService {
@Override
@ShenyuDubboClient("/saveComplexBeanTestAndName")
+ @ApiDoc(desc = "saveComplexBeanTestAndName")
public DubboTest saveComplexBeanTestAndName(final ComplexBeanTest complexBeanTest, final String name) {
return new DubboTest(complexBeanTest.getIdLists().toString(),
"hello world shenyu alibaba dubbo param saveComplexBeanTestAndName :" + complexBeanTest.getDubboTest().getName() + "-" + name);
diff --git a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/demo/EventServiceImpl.java b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/demo/EventServiceImpl.java
index 0bc8f17d2..37e6757dd 100644
--- a/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/demo/EventServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-grpc/src/main/java/org/apache/shenyu/examples/grpc/demo/EventServiceImpl.java
@@ -22,6 +22,8 @@ import event.EventResponse;
import event.EventServiceGrpc;
import io.grpc.stub.StreamObserver;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.grpc.common.annotation.ShenyuGrpcClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -29,11 +31,13 @@ import org.springframework.stereotype.Service;
@ShenyuGrpcClient("/eventService")
@Service
+@ApiModule(value = "eventService")
public class EventServiceImpl extends EventServiceGrpc.EventServiceImplBase {
private static final Logger LOG = LoggerFactory.getLogger(EventServiceImpl.class);
@ShenyuGrpcClient("/sendEvent")
+ @ApiDoc(desc = "sendEvent")
@Override
public void sendEvent(final EventRequest request, final StreamObserver<EventResponse> responseObserver) {
EventResponse response = EventResponse.newBuilder().setData("received event:" + request.getData()).build();
@@ -42,6 +46,7 @@ public class EventServiceImpl extends EventServiceGrpc.EventServiceImplBase {
}
@ShenyuGrpcClient("/sendEventStream")
+ @ApiDoc(desc = "sendEventStream")
@Override
public StreamObserver<EventRequest> sendEventStream(final StreamObserver<EventResponse> responseObserver) {
return new StreamObserver<EventRequest>() {
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/HttpTestController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/HttpTestController.java
index 9cb512c0e..b6619c1cb 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/HttpTestController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/HttpTestController.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.http.controller;
import com.google.common.collect.ImmutableMap;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.apache.shenyu.common.utils.GsonUtils;
import org.apache.shenyu.examples.http.dto.UserDTO;
@@ -61,6 +63,7 @@ import java.util.Map;
@RestController
@RequestMapping("/test")
@ShenyuSpringMvcClient("/test/**")
+@ApiModule("/test")
public class HttpTestController {
private static final Logger LOGGER = LoggerFactory.getLogger(HttpTestController.class);
@@ -72,6 +75,7 @@ public class HttpTestController {
* @return the user dto
*/
@PostMapping("/payment")
+ @ApiDoc(desc = "payment")
public UserDTO post(@RequestBody final UserDTO userDTO) {
return userDTO;
}
@@ -83,6 +87,7 @@ public class HttpTestController {
* @return the string
*/
@GetMapping("/findByUserId")
+ @ApiDoc(desc = "findByUserId")
public UserDTO findByUserId(@RequestParam("userId") final String userId) {
return buildUser(userId, "hello world");
}
@@ -95,6 +100,7 @@ public class HttpTestController {
* @return the string
*/
@GetMapping("/findByUserIdName")
+ @ApiDoc(desc = "findByUserIdName")
public UserDTO findByUserId(@RequestParam("userId") final String userId, @RequestParam("name") final String name) {
return buildUser(userId, name);
}
@@ -108,6 +114,7 @@ public class HttpTestController {
* @return the user dto
*/
@GetMapping("/findByPage")
+ @ApiDoc(desc = "findByPage")
public UserDTO findByPage(final String keyword, final Integer page, final Integer pageSize) {
return buildUser(keyword, "hello world keyword is " + keyword + " page is " + page + " pageSize is " + pageSize);
}
@@ -120,6 +127,7 @@ public class HttpTestController {
* @return the path variable
*/
@GetMapping("/path/{id}")
+ @ApiDoc(desc = "path/{id}")
public UserDTO getPathVariable(@PathVariable("id") final String id, @RequestParam("name") final String name) {
return buildUser(id, name);
}
@@ -132,6 +140,7 @@ public class HttpTestController {
* @return the string
*/
@GetMapping("/path/{id}/name")
+ @ApiDoc(desc = "path/{id}/name")
public UserDTO testRestFul(@PathVariable("id") final String id) {
return buildUser(id, "hello world");
}
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OauthController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OauthController.java
index be9c4f63e..7bfab2d44 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OauthController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OauthController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.http.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/oauth")
@ShenyuSpringMvcClient("/oauth")
+@ApiModule(value = "oauth")
public class OauthController {
/**
@@ -36,6 +39,7 @@ public class OauthController {
* @return String
*/
@GetMapping("/authorize")
+ @ApiDoc(desc = "authorize")
public String testCode() {
return "authorize";
}
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OrderController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OrderController.java
index 4694ccdc8..d1f71c156 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OrderController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/OrderController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.http.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.apache.shenyu.examples.http.dto.OAuth2DTO;
import org.apache.shenyu.examples.http.dto.OrderDTO;
@@ -39,6 +41,7 @@ import java.util.Objects;
@RestController
@RequestMapping("/order")
@ShenyuSpringMvcClient("/order")
+@ApiModule(value = "order")
public class OrderController {
/**
@@ -49,6 +52,7 @@ public class OrderController {
*/
@PostMapping("/save")
@ShenyuSpringMvcClient("/save")
+ @ApiDoc(desc = "save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world save order");
return orderDTO;
@@ -62,6 +66,7 @@ public class OrderController {
*/
@GetMapping("/findById")
@ShenyuSpringMvcClient("/findById")
+ @ApiDoc(desc = "findById")
public OrderDTO findById(@RequestParam("id") final String id) {
return build(id, "hello world findById");
}
@@ -75,6 +80,7 @@ public class OrderController {
*/
@GetMapping("/path/{id}/{name}")
@ShenyuSpringMvcClient("/path/**")
+ @ApiDoc(desc = "path/**")
public OrderDTO getPathVariable(@PathVariable("id") final String id, @PathVariable("name") final String name) {
return build(id, "hello world restful: " + name);
}
@@ -87,6 +93,7 @@ public class OrderController {
*/
@GetMapping("/path/{id}/name")
@ShenyuSpringMvcClient("/path/**/name")
+ @ApiDoc(desc = "path/**/name")
public OrderDTO testRestFul(@PathVariable("id") final String id) {
return build(id, "hello world restful inline " + id);
}
@@ -98,6 +105,7 @@ public class OrderController {
*/
@GetMapping("/oauth2/test")
@ShenyuSpringMvcClient("/oauth2/test")
+ @ApiDoc(desc = "oauth2/test")
public OAuth2DTO testRestFul(final ServerHttpRequest request) {
HttpHeaders headers = request.getHeaders();
List<String> tokens = headers.get("Authorization");
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/ShenyuClientPathController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/ShenyuClientPathController.java
index b4e0dbab3..69d24796f 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/ShenyuClientPathController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/ShenyuClientPathController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.http.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
* ShenyuClientPathController.
*/
@RestController
+@ApiModule(value = "shenyuClientPathController")
public class ShenyuClientPathController {
private static final Logger LOG = LoggerFactory.getLogger(ShenyuClientPathController.class);
@@ -41,6 +44,7 @@ public class ShenyuClientPathController {
*/
@RequestMapping("shenyu/client/hello")
@ShenyuSpringMvcClient("shenyu/client/hello")
+ @ApiDoc(desc = "shenyu/client/hello")
public String hello() {
return "hello! " + HELLO_SUFFIX;
}
@@ -54,6 +58,7 @@ public class ShenyuClientPathController {
*/
@RequestMapping("shenyu/client/hi")
@ShenyuSpringMvcClient("shenyu/client/hi")
+ @ApiDoc(desc = "shenyu/client/hi")
public String hello(final String name) {
return "hi! " + name + "! " + HELLO_SUFFIX;
}
@@ -65,6 +70,7 @@ public class ShenyuClientPathController {
*/
@RequestMapping("shenyu/client/timeout")
@ShenyuSpringMvcClient("shenyu/client/timeout")
+ @ApiDoc(desc = "shenyu/client/timeout")
public String timeout() {
LOG.info("timeout");
try {
@@ -82,6 +88,7 @@ public class ShenyuClientPathController {
*/
@PostMapping("shenyu/client/post/hi")
@ShenyuSpringMvcClient(desc = "shenyu client annotation register")
+ @ApiDoc(desc = "shenyu/client/post/hi")
public String post(final String name) {
return "[post method result]:hi! " + name + "! " + HELLO_SUFFIX;
}
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/SpringMvcMappingPathController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/SpringMvcMappingPathController.java
index 529867662..e335eb442 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/SpringMvcMappingPathController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/SpringMvcMappingPathController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.http.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -27,6 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@ShenyuSpringMvcClient(desc = "spring annotation register")
+@ApiModule(value = "springMvcMappingPathController")
public class SpringMvcMappingPathController {
private static final String HELLO_SUFFIX = "I'm Shenyu-Gateway System. Welcome!";
@@ -37,6 +40,7 @@ public class SpringMvcMappingPathController {
* @return result
*/
@RequestMapping("hello")
+ @ApiDoc(desc = "hello")
public String hello() {
return "hello! " + HELLO_SUFFIX;
}
@@ -48,6 +52,7 @@ public class SpringMvcMappingPathController {
* @return result
*/
@RequestMapping("hi")
+ @ApiDoc(desc = "hi")
public String hello(final String name) {
return "hi! " + name + "! " + HELLO_SUFFIX;
}
@@ -59,6 +64,7 @@ public class SpringMvcMappingPathController {
* @return result
*/
@PostMapping("post/hi")
+ @ApiDoc(desc = "post/hi")
public String post(final String name) {
return "[post method result]:hi! " + name + "! " + HELLO_SUFFIX;
}
diff --git a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/UploadController.java b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/UploadController.java
index 8609f8b17..d57f12a87 100644
--- a/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/UploadController.java
+++ b/shenyu-examples/shenyu-examples-http/src/main/java/org/apache/shenyu/examples/http/controller/UploadController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.http.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.http.MediaType;
import org.springframework.http.codec.multipart.FilePart;
@@ -35,6 +37,7 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/upload")
@ShenyuSpringMvcClient("/upload/**")
+@ApiModule(value = "upload")
public class UploadController {
/**
@@ -43,6 +46,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/webFluxSingle", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.TEXT_PLAIN_VALUE})
+ @ApiDoc(desc = "webFluxSingle")
public Mono<String> webFluxSingle(@RequestPart("file") final FilePart file) {
return Mono.just(file.filename());
}
@@ -53,6 +57,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/webFluxFiles", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE, MediaType.TEXT_PLAIN_VALUE})
+ @ApiDoc(desc = "webFluxFiles")
public Mono<String> webFluxFiles(@RequestPart(value = "files", required = false) final Flux<FilePart> files) {
return files.map(FilePart::filename).collect(Collectors.joining(","));
}
diff --git a/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/OrderController.java b/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/OrderController.java
index f5151ff37..807c0aa3e 100644
--- a/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/OrderController.java
+++ b/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/OrderController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.https.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.apache.shenyu.examples.https.dto.OrderDTO;
import org.springframework.web.bind.annotation.GetMapping;
@@ -30,6 +32,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/order")
@ShenyuSpringMvcClient("/order")
+@ApiModule(value = "order")
public class OrderController {
/**
@@ -40,6 +43,7 @@ public class OrderController {
*/
@GetMapping("/findById")
@ShenyuSpringMvcClient("/findById")
+ @ApiDoc(desc = "findById")
public OrderDTO findById(@RequestParam("id") final String id) {
OrderDTO dto = new OrderDTO();
dto.setId(id);
diff --git a/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/UploadController.java b/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/UploadController.java
index 5e4f53954..dd4a8c038 100644
--- a/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/UploadController.java
+++ b/shenyu-examples/shenyu-examples-https/src/main/java/org/apache/shenyu/examples/https/controller/UploadController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.https.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
@@ -31,6 +33,7 @@ import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/upload")
@ShenyuSpringMvcClient("/upload/**")
+@ApiModule(value = "upload")
public class UploadController {
/**
@@ -41,6 +44,7 @@ public class UploadController {
*/
@PostMapping(value = "/file", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
@ShenyuSpringMvcClient("/file")
+ @ApiDoc(desc = "file")
public String uploadFile(@RequestPart("file") final MultipartFile file) {
return file.getOriginalFilename();
}
diff --git a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
index 61f2a14a4..4a2292925 100644
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanDemoServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.motan.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.motan.common.annotation.ShenyuMotanClient;
import org.apache.shenyu.client.motan.common.annotation.ShenyuMotanService;
import org.apache.shenyu.examples.common.aop.Log;
@@ -30,17 +32,20 @@ import org.apache.shenyu.springboot.starter.client.motan.ShenyuMotanClientConfig
* please refer to {@link ShenyuMotanClientConfiguration}
*/
@ShenyuMotanService(value = "/demo/**", export = "motan2:8002")
+@ApiModule("MotanDemoService")
public class MotanDemoServiceImpl implements MotanDemoService {
@Override
@ShenyuMotanClient(value = "/hello")
@Log
+ @ApiDoc(desc = "hello")
public String hello(final String name) {
return "hello " + name;
}
@Override
@ShenyuMotanClient(value = "/timeout")
+ @ApiDoc(desc = "timeout")
public String testTimeOut(final long seconds) {
try {
Thread.sleep(seconds * 1000);
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaClientMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaClientMultiParamServiceImpl.java
index fc9552ff9..813b7f671 100644
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaClientMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaClientMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.sofa.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.sofa.common.annotation.ShenyuSofaClient;
import org.apache.shenyu.examples.sofa.api.entity.SofaComplexTypeBean;
import org.apache.shenyu.examples.sofa.api.entity.SofaSimpleTypeBean;
@@ -35,34 +37,40 @@ import java.util.stream.Collectors;
*/
@ShenyuSofaClient("/demo")
@Service
+@ApiModule(value = "demo")
public class SofaClientMultiParamServiceImpl implements SofaClientMultiParamService {
@Override
@ShenyuSofaClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public SofaSimpleTypeBean findByIdsAndName(final List<Integer> ids, final String name) {
return new SofaSimpleTypeBean(ids.toString(), "hello world shenyu sofa param findByIdsAndName :" + name);
}
@Override
@ShenyuSofaClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public SofaSimpleTypeBean findByArrayIdsAndName(final Integer[] ids, final String name) {
return new SofaSimpleTypeBean(Arrays.toString(ids), "hello world shenyu sofa param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuSofaClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public SofaSimpleTypeBean findByStringArray(final String[] ids) {
return new SofaSimpleTypeBean(Arrays.toString(ids), "hello world shenyu sofa param findByStringArray");
}
@Override
@ShenyuSofaClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public SofaSimpleTypeBean findByListId(final List<String> ids) {
return new SofaSimpleTypeBean(ids.toString(), "hello world shenyu sofa param findByListId");
}
@Override
@ShenyuSofaClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public SofaSimpleTypeBean batchSave(final List<SofaSimpleTypeBean> sofaTestList) {
final String id = sofaTestList.stream().map(SofaSimpleTypeBean::getId).collect(Collectors.joining("-"));
final String name = "hello world shenyu sofa param batchSave :"
@@ -74,6 +82,7 @@ public class SofaClientMultiParamServiceImpl implements SofaClientMultiParamServ
@Override
@ShenyuSofaClient("/batchSaveNameAndId")
+ @ApiDoc(desc = "batchSaveNameAndId")
public SofaSimpleTypeBean batchSaveNameAndId(final List<SofaSimpleTypeBean> sofaTestList, final String id, final String name) {
final String newName = "hello world shenyu sofa param batchSaveAndNameAndId :" + name + ":"
+ sofaTestList.stream()
@@ -84,6 +93,7 @@ public class SofaClientMultiParamServiceImpl implements SofaClientMultiParamServ
@Override
@ShenyuSofaClient("/saveComplexBean")
+ @ApiDoc(desc = "saveComplexBean")
public SofaSimpleTypeBean saveComplexBean(final SofaComplexTypeBean sofaComplexTypeBean) {
final String id = sofaComplexTypeBean.getIdLists().toString();
final String typeName = "hello world shenyu sofa param saveComplexBean :" + sofaComplexTypeBean.getSofaSimpleTypeBean().getName();
@@ -92,6 +102,7 @@ public class SofaClientMultiParamServiceImpl implements SofaClientMultiParamServ
@Override
@ShenyuSofaClient("/saveComplexBeanAndName")
+ @ApiDoc(desc = "saveComplexBeanAndName")
public SofaSimpleTypeBean saveComplexBeanAndName(final SofaComplexTypeBean sofaComplexTypeBean, final String name) {
final String id = sofaComplexTypeBean.getIdLists().toString();
final String typeName = "hello world shenyu sofa param saveComplexBeanAndName :" + sofaComplexTypeBean.getSofaSimpleTypeBean().getName() + "-" + name;
@@ -100,6 +111,7 @@ public class SofaClientMultiParamServiceImpl implements SofaClientMultiParamServ
@Override
@ShenyuSofaClient("/saveTwoList")
+ @ApiDoc(desc = "saveTwoList")
public SofaSimpleTypeBean saveTwoList(final List<SofaComplexTypeBean> sofaComplexTypeBeanList, final Map<String, SofaSimpleTypeBean> sofaSimpleTypeBeanMap) {
SofaSimpleTypeBean simpleTypeBean = new SofaSimpleTypeBean();
if (!CollectionUtils.isEmpty(sofaComplexTypeBeanList) && !CollectionUtils.isEmpty(sofaSimpleTypeBeanMap)) {
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaMultiParamServiceImpl.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaMultiParamServiceImpl.java
index d099c6e8a..67f4f743b 100644
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaMultiParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaMultiParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.sofa.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.sofa.common.annotation.ShenyuSofaClient;
import org.apache.shenyu.examples.sofa.api.entity.SofaComplexTypeBean;
import org.apache.shenyu.examples.sofa.api.entity.SofaSimpleTypeBean;
@@ -34,34 +36,40 @@ import java.util.stream.Collectors;
* Sofa multi parameter service.
*/
@Service("sofaMultiParamService")
+@ApiModule(value = "sofaMultiParamService")
public class SofaMultiParamServiceImpl implements SofaMultiParamService {
@Override
@ShenyuSofaClient("/findByIdsAndName")
+ @ApiDoc(desc = "findByIdsAndName")
public SofaSimpleTypeBean findByIdsAndName(final List<Integer> ids, final String name) {
return new SofaSimpleTypeBean(ids.toString(), "hello world shenyu sofa param findByIdsAndName :" + name);
}
@Override
@ShenyuSofaClient("/findByArrayIdsAndName")
+ @ApiDoc(desc = "findByArrayIdsAndName")
public SofaSimpleTypeBean findByArrayIdsAndName(final Integer[] ids, final String name) {
return new SofaSimpleTypeBean(Arrays.toString(ids), "hello world shenyu sofa param findByArrayIdsAndName :" + name);
}
@Override
@ShenyuSofaClient("/findByStringArray")
+ @ApiDoc(desc = "findByStringArray")
public SofaSimpleTypeBean findByStringArray(final String[] ids) {
return new SofaSimpleTypeBean(Arrays.toString(ids), "hello world shenyu sofa param findByStringArray");
}
@Override
@ShenyuSofaClient("/findByListId")
+ @ApiDoc(desc = "findByListId")
public SofaSimpleTypeBean findByListId(final List<String> ids) {
return new SofaSimpleTypeBean(ids.toString(), "hello world shenyu sofa param findByListId");
}
@Override
@ShenyuSofaClient("/batchSave")
+ @ApiDoc(desc = "batchSave")
public SofaSimpleTypeBean batchSave(final List<SofaSimpleTypeBean> sofaTestList) {
final String id = sofaTestList.stream().map(SofaSimpleTypeBean::getId).collect(Collectors.joining("-"));
final String name = "hello world shenyu sofa param batchSave :"
@@ -73,6 +81,7 @@ public class SofaMultiParamServiceImpl implements SofaMultiParamService {
@Override
@ShenyuSofaClient("/batchSaveNameAndId")
+ @ApiDoc(desc = "batchSaveNameAndId")
public SofaSimpleTypeBean batchSaveNameAndId(final List<SofaSimpleTypeBean> sofaTestList, final String id, final String name) {
final String newName = "hello world shenyu sofa param batchSaveAndNameAndId :" + name + ":"
+ sofaTestList.stream()
@@ -83,6 +92,7 @@ public class SofaMultiParamServiceImpl implements SofaMultiParamService {
@Override
@ShenyuSofaClient("/saveComplexBean")
+ @ApiDoc(desc = "saveComplexBean")
public SofaSimpleTypeBean saveComplexBean(final SofaComplexTypeBean sofaComplexTypeBean) {
final String id = sofaComplexTypeBean.getIdLists().toString();
final String typeName = "hello world shenyu sofa param saveComplexBean :" + sofaComplexTypeBean.getSofaSimpleTypeBean().getName();
@@ -91,6 +101,7 @@ public class SofaMultiParamServiceImpl implements SofaMultiParamService {
@Override
@ShenyuSofaClient("/saveComplexBeanAndName")
+ @ApiDoc(desc = "saveComplexBeanAndName")
public SofaSimpleTypeBean saveComplexBeanAndName(final SofaComplexTypeBean sofaComplexTypeBean, final String name) {
final String id = sofaComplexTypeBean.getIdLists().toString();
final String typeName = "hello world shenyu sofa param saveComplexBeanAndName :" + sofaComplexTypeBean.getSofaSimpleTypeBean().getName() + "-" + name;
@@ -99,6 +110,7 @@ public class SofaMultiParamServiceImpl implements SofaMultiParamService {
@Override
@ShenyuSofaClient("/saveTwoList")
+ @ApiDoc(desc = "saveTwoList")
public SofaSimpleTypeBean saveTwoList(final List<SofaComplexTypeBean> sofaComplexTypeBeanList, final Map<String, SofaSimpleTypeBean> sofaSimpleTypeBeanMap) {
SofaSimpleTypeBean simpleTypeBean = new SofaSimpleTypeBean();
if (!CollectionUtils.isEmpty(sofaComplexTypeBeanList) && !CollectionUtils.isEmpty(sofaSimpleTypeBeanMap)) {
diff --git a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
index db77dcc77..806bbda5f 100644
--- a/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
+++ b/shenyu-examples/shenyu-examples-sofa/shenyu-examples-sofa-service/src/main/java/org/apache/shenyu/examples/sofa/service/impl/SofaSingleParamServiceImpl.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.sofa.service.impl;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.sofa.common.annotation.ShenyuSofaClient;
import org.apache.shenyu.examples.common.aop.Log;
import org.apache.shenyu.examples.sofa.api.entity.SofaSimpleTypeBean;
@@ -29,23 +31,27 @@ import java.util.Random;
* Sofa single param service.
*/
@Service("sofaSingleParamService")
+@ApiModule(value = "sofaSingleParamService")
public class SofaSingleParamServiceImpl implements SofaSingleParamService {
@Override
@ShenyuSofaClient("/findById")
@Log
+ @ApiDoc(desc = "findById")
public SofaSimpleTypeBean findById(final String id) {
return new SofaSimpleTypeBean(id, "hello world shenyu Sofa, findById");
}
@Override
@ShenyuSofaClient("/findAll")
+ @ApiDoc(desc = "findAll")
public SofaSimpleTypeBean findAll() {
return new SofaSimpleTypeBean(String.valueOf(new Random().nextInt()), "hello world shenyu Sofa , findAll");
}
@Override
@ShenyuSofaClient("/insert")
+ @ApiDoc(desc = "insert")
public SofaSimpleTypeBean insert(final SofaSimpleTypeBean sofaSimpleTypeBean) {
sofaSimpleTypeBean.setName("hello world shenyu Sofa: " + sofaSimpleTypeBean.getName());
return sofaSimpleTypeBean;
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/AllController.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/AllController.java
index 3c65c6566..a8595d762 100644
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/AllController.java
+++ b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/AllController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springcloud.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springcloud.annotation.ShenyuSpringCloudClient;
import org.apache.shenyu.examples.springcloud.dto.EntityResult;
import org.springframework.web.bind.annotation.GetMapping;
@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@ShenyuSpringCloudClient
+@ApiModule(value = "allController")
public class AllController {
/**
@@ -36,6 +39,7 @@ public class AllController {
* @return result
*/
@PostMapping("/class/annotation/post")
+ @ApiDoc(desc = "class/annotation/post")
public EntityResult postMappingUrl() {
return new EntityResult(200, "[class annotation] Do not use shenyu annotation path. used post mapping path");
}
@@ -46,6 +50,7 @@ public class AllController {
* @return result
*/
@GetMapping("/class/annotation/get")
+ @ApiDoc(desc = "class/annotation/get")
public EntityResult getMappingUrl() {
return new EntityResult(200, "[class annotation] Do not use shenyu annotation path. used get mapping path");
}
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/NewFeatureController.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/NewFeatureController.java
index a7bf062df..3e92f3248 100644
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/NewFeatureController.java
+++ b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/NewFeatureController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springcloud.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springcloud.annotation.ShenyuSpringCloudClient;
import org.apache.shenyu.examples.springcloud.dto.EntityResult;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -31,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@RequestMapping("new/feature")
+@ApiModule(value = "newFeatureController")
public class NewFeatureController {
/**
@@ -39,6 +42,7 @@ public class NewFeatureController {
* @return result
*/
@RequestMapping("/gateway/not")
+ @ApiDoc(desc = "gateway/not")
public EntityResult noSupportGateway() {
return new EntityResult(200, "no support gateway access");
}
@@ -50,6 +54,7 @@ public class NewFeatureController {
*/
@RequestMapping("/requst/mapping/path")
@ShenyuSpringCloudClient
+ @ApiDoc(desc = "requst/mapping/path")
public EntityResult requestMappingUrl() {
return new EntityResult(200, "Do not use shenyu annotation path. used request mapping path");
}
@@ -61,6 +66,7 @@ public class NewFeatureController {
*/
@PostMapping("/post/mapping/path")
@ShenyuSpringCloudClient
+ @ApiDoc(desc = "post/mapping/path")
public EntityResult postMappingUrl() {
return new EntityResult(200, "Do not use shenyu annotation path. used post mapping path");
}
@@ -72,6 +78,7 @@ public class NewFeatureController {
*/
@GetMapping("/get/mapping/path")
@ShenyuSpringCloudClient
+ @ApiDoc(desc = "get/mapping/path")
public EntityResult getMappingUrl() {
return new EntityResult(200, "Do not use shenyu annotation path. used get mapping path");
}
@@ -83,6 +90,7 @@ public class NewFeatureController {
*/
@PutMapping("/put/mapping/path")
@ShenyuSpringCloudClient
+ @ApiDoc(desc = "put/mapping/path")
public EntityResult putMappingUrl() {
return new EntityResult(200, "Do not use shenyu annotation path. used put mapping path");
}
@@ -94,6 +102,7 @@ public class NewFeatureController {
*/
@DeleteMapping("/delete/mapping/path")
@ShenyuSpringCloudClient
+ @ApiDoc(desc = "delete/mapping/path")
public EntityResult deleteMappingUrl() {
return new EntityResult(200, "Do not use shenyu annotation path. used delete mapping path");
}
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/OrderController.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/OrderController.java
index 30f9f5ae8..a1e90d721 100644
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/OrderController.java
+++ b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/OrderController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springcloud.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springcloud.annotation.ShenyuGetMapping;
import org.apache.shenyu.client.springcloud.annotation.ShenyuPostMapping;
import org.apache.shenyu.client.springcloud.annotation.ShenyuRequestMapping;
@@ -31,6 +33,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@RestController
@ShenyuRequestMapping("/order")
+@ApiModule(value = "order")
public class OrderController {
/**
@@ -40,6 +43,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuPostMapping("/save")
+ @ApiDoc(desc = "save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world spring cloud save order");
return orderDTO;
@@ -52,6 +56,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuGetMapping("/findById")
+ @ApiDoc(desc = "findById")
public OrderDTO findById(@RequestParam("id") final String id) {
return buildOrder(id, "hello world spring cloud findById");
}
@@ -64,6 +69,7 @@ public class OrderController {
* @return the path variable
*/
@ShenyuGetMapping("/path/{id}/{name}")
+ @ApiDoc(desc = "path/{id}/{name}")
public OrderDTO getPathVariable(@PathVariable("id") final String id, @PathVariable("name") final String name) {
return buildOrder(id, "hello world spring cloud restful: " + name);
}
@@ -75,6 +81,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuGetMapping("/path/{id}/name")
+ @ApiDoc(desc = "path/{id}/name")
public OrderDTO testRestFul(@PathVariable("id") final String id) {
return buildOrder(id, "hello world spring cloud restful inline " + id);
}
diff --git a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/UploadController.java b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/UploadController.java
index f2afef25a..7c30f3feb 100644
--- a/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/UploadController.java
+++ b/shenyu-examples/shenyu-examples-springcloud/src/main/java/org/apache/shenyu/examples/springcloud/controller/UploadController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springcloud.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springcloud.annotation.ShenyuSpringCloudClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
@@ -31,6 +33,7 @@ import org.springframework.web.multipart.MultipartFile;
@RestController
@RequestMapping("/upload")
@ShenyuSpringCloudClient(path = "/upload")
+@ApiModule(value = "upload")
public class UploadController {
/**
@@ -41,6 +44,7 @@ public class UploadController {
*/
@PostMapping(value = "/file", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
@ShenyuSpringCloudClient(path = "/file")
+ @ApiDoc(desc = "file")
public String post(@RequestPart("file")final MultipartFile file) {
return file.getOriginalFilename();
}
diff --git a/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java b/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
index aeb33652d..191797f2e 100644
--- a/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
+++ b/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
@@ -19,6 +19,9 @@ package org.apache.shenyu.examples.springmvc.controller;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
+
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.apache.shenyu.examples.springmvc.dto.OAuth2DTO;
import org.apache.shenyu.examples.springmvc.dto.OrderDTO;
@@ -36,6 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/order")
@ShenyuSpringMvcClient("/order")
+@ApiModule(value = "order")
public class OrderController {
/**
@@ -46,6 +50,7 @@ public class OrderController {
*/
@PostMapping("/save")
@ShenyuSpringMvcClient("/save")
+ @ApiDoc(desc = "save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world save order");
return orderDTO;
@@ -59,6 +64,7 @@ public class OrderController {
*/
@GetMapping("/findById")
@ShenyuSpringMvcClient("/findById")
+ @ApiDoc(desc = "findById")
public OrderDTO findById(@RequestParam("id") final String id) {
return build(id, "hello world findById");
}
@@ -72,6 +78,7 @@ public class OrderController {
*/
@GetMapping("/path/{id}/{name}")
@ShenyuSpringMvcClient("/path/**")
+ @ApiDoc(desc = "path/{id}/{name}")
public OrderDTO getPathVariable(@PathVariable("id") final String id, @PathVariable("name") final String name) {
return build(id, "hello world restful: " + name);
}
@@ -84,6 +91,7 @@ public class OrderController {
*/
@GetMapping("/path/{id}/name")
@ShenyuSpringMvcClient("/path/**/name")
+ @ApiDoc(desc = "path/{id}/name")
public OrderDTO testRestFul(@PathVariable("id") final String id) {
return build(id, "hello world restful inline " + id);
}
@@ -95,6 +103,7 @@ public class OrderController {
*/
@GetMapping("/oauth2/test")
@ShenyuSpringMvcClient("/oauth2/test")
+ @ApiDoc(desc = "oauth2/test")
public OAuth2DTO testRestFul(final HttpServletRequest request) {
final String token = request.getHeader("Authorization");
final OAuth2DTO oAuth2DTO = new OAuth2DTO();
diff --git a/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java b/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
index 9c77dc934..1d6d905e7 100644
--- a/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
+++ b/shenyu-examples/shenyu-examples-springmvc-tomcat/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springmvc.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -32,7 +34,8 @@ import java.util.stream.Collectors;
*/
@RestController
@RequestMapping("/upload")
-@ShenyuSpringMvcClient("/upload/**")
+@ShenyuSpringMvcClient("/upload")
+@ApiModule(value = "upload")
public class UploadController {
/**
@@ -41,6 +44,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/singleFile")
+ @ApiDoc(desc = "singleFile")
public String singleFile(@RequestParam("file") final MultipartFile file) {
return file.getOriginalFilename();
}
@@ -51,6 +55,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/files")
+ @ApiDoc(desc = "files")
public String files(@RequestParam("files") final MultipartFile[] files) {
return Arrays.stream(files).map(MultipartFile::getOriginalFilename).collect(Collectors.joining(","));
}
diff --git a/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java b/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
index d410bf5e3..cba3e5965 100644
--- a/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
+++ b/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/OrderController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springmvc.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuGetMapping;
import org.apache.shenyu.client.springmvc.annotation.ShenyuPostMapping;
import org.apache.shenyu.client.springmvc.annotation.ShenyuRequestMapping;
@@ -35,6 +37,7 @@ import java.util.Objects;
*/
@RestController
@ShenyuRequestMapping("/order")
+@ApiModule(value = "order")
public class OrderController {
/**
@@ -44,6 +47,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuPostMapping("/save")
+ @ApiDoc(desc = "save")
public OrderDTO save(@RequestBody final OrderDTO orderDTO) {
orderDTO.setName("hello world save order");
return orderDTO;
@@ -56,6 +60,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuGetMapping("/findById")
+ @ApiDoc(desc = "findById")
public OrderDTO findById(@RequestParam("id") final String id) {
return build(id, "hello world findById");
}
@@ -68,6 +73,7 @@ public class OrderController {
* @return the path variable
*/
@ShenyuGetMapping("/path/{id}/{name}")
+ @ApiDoc(desc = "path/{id}/{name}")
public OrderDTO getPathVariable(@PathVariable("id") final String id, @PathVariable("name") final String name) {
return build(id, "hello world restful: " + name);
}
@@ -79,6 +85,7 @@ public class OrderController {
* @return the order dto
*/
@ShenyuGetMapping("/path/{id}/name")
+ @ApiDoc(desc = "path/{id}/name")
public OrderDTO testRestFul(@PathVariable("id") final String id) {
return build(id, "hello world restful inline " + id);
}
@@ -89,6 +96,7 @@ public class OrderController {
* @return the oauth2 dto
*/
@ShenyuGetMapping("/oauth2/test")
+ @ApiDoc(desc = "oauth2/test")
public OAuth2DTO testRestFul(final HttpServletRequest request) {
final String token = request.getHeader("Authorization");
final OAuth2DTO oAuth2DTO = new OAuth2DTO();
diff --git a/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java b/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
index a5ba7fd88..5b242bdb7 100644
--- a/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
+++ b/shenyu-examples/shenyu-examples-springmvc/src/main/java/org/apache/shenyu/examples/springmvc/controller/UploadController.java
@@ -17,6 +17,8 @@
package org.apache.shenyu.examples.springmvc.controller;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.springmvc.annotation.ShenyuSpringMvcClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -31,7 +33,8 @@ import java.util.stream.Collectors;
*/
@RestController
@RequestMapping("/upload")
-@ShenyuSpringMvcClient("/upload/**")
+@ShenyuSpringMvcClient("/upload")
+@ApiModule(value = "upload")
public class UploadController {
/**
@@ -40,6 +43,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/singleFile")
+ @ApiDoc(desc = "singleFile")
public String singleFile(@RequestParam("file") final MultipartFile file) {
return file.getOriginalFilename();
}
@@ -50,6 +54,7 @@ public class UploadController {
* @return response
*/
@PostMapping(value = "/files")
+ @ApiDoc(desc = "files")
public String files(@RequestParam("files") final MultipartFile[] files) {
return Arrays.stream(files).map(MultipartFile::getOriginalFilename).collect(Collectors.joining(","));
}
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
index d73535d19..42c16b538 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
+++ b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/HelloServantImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.tars.servant.testapp.impl;
import com.qq.tars.spring.annotation.TarsServant;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
import org.apache.shenyu.examples.common.aop.Log;
@@ -25,10 +27,12 @@ import org.apache.shenyu.examples.tars.servant.testapp.HelloServant;
@TarsServant("HelloObj")
@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.HelloObj")
+@ApiModule(value = "HelloObj")
public class HelloServantImpl implements HelloServant {
@Override
@ShenyuTarsClient("/hello")
+ @ApiDoc(desc = "hello")
public String hello(final int no, final String name) {
return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
}
@@ -36,6 +40,7 @@ public class HelloServantImpl implements HelloServant {
@Log
@Override
@ShenyuTarsClient("/helloInt")
+ @ApiDoc(desc = "helloInt")
public int helloInt(final int no, final String name) {
return 1;
}
diff --git a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
index 2a1b4ac6c..f39a711a6 100644
--- a/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
+++ b/shenyu-examples/shenyu-examples-tars/src/main/java/org/apache/shenyu/examples/tars/servant/testapp/impl/OrderServantImpl.java
@@ -18,6 +18,8 @@
package org.apache.shenyu.examples.tars.servant.testapp.impl;
import com.qq.tars.spring.annotation.TarsServant;
+import org.apache.shenyu.client.apidocs.annotations.ApiDoc;
+import org.apache.shenyu.client.apidocs.annotations.ApiModule;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsClient;
import org.apache.shenyu.client.tars.common.annotation.ShenyuTarsService;
import org.apache.shenyu.examples.tars.servant.testapp.OrderServant;
@@ -25,16 +27,19 @@ import org.apache.shenyu.examples.tars.servant.testapp.OrderServant;
@TarsServant("OrderObj")
@ShenyuTarsClient("/order")
@ShenyuTarsService(serviceName = "ShenyuExampleServer.ShenyuExampleApp.OrderObj")
+@ApiModule(value = "order")
public class OrderServantImpl implements OrderServant {
@Override
@ShenyuTarsClient("/hello")
+ @ApiDoc(desc = "hello")
public String hello(final int no, final String name) {
return String.format("hello no=%s, name=%s, time=%s", no, name, System.currentTimeMillis());
}
@Override
@ShenyuTarsClient("/helloInt")
+ @ApiDoc(desc = "helloInt")
public int helloInt(final int no, final String name) {
return 1;
}