This is an automated email from the ASF dual-hosted git repository.

casion pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-linkis-website.git


The following commit(s) were added to refs/heads/dev by this push:
     new 3a711c264f app kinif4j document (#443)
3a711c264f is described below

commit 3a711c264fbe21118c657262478aa827e4d0dee0
Author: fanwenxiang <[email protected]>
AuthorDate: Tue Jul 19 22:02:55 2022 +0800

    app kinif4j document (#443)
---
 docs/deployment/involve_knife4j_into_linkis.md     |  64 +++++++++++++++++++++
 .../deployment/involve_knife4j_into_linkis.md      |  63 ++++++++++++++++++++
 .../deployment/knife4j/Knife4j_addcookie.png       | Bin 0 -> 236988 bytes
 .../Images-zh/deployment/knife4j/Knife4j_debug.png | Bin 0 -> 218641 bytes
 .../Images-zh/deployment/knife4j/Knife4j_home.png  | Bin 0 -> 240110 bytes
 .../deployment/knife4j/Knife4j_interface.png       | Bin 0 -> 218641 bytes
 .../deployment/knife4j/Knife4j_addcookie.png       | Bin 0 -> 236988 bytes
 static/Images/deployment/knife4j/Knife4j_debug.png | Bin 0 -> 218641 bytes
 static/Images/deployment/knife4j/Knife4j_home.png  | Bin 0 -> 240110 bytes
 .../deployment/knife4j/Knife4j_interface.png       | Bin 0 -> 218641 bytes
 10 files changed, 127 insertions(+)

diff --git a/docs/deployment/involve_knife4j_into_linkis.md 
b/docs/deployment/involve_knife4j_into_linkis.md
new file mode 100644
index 0000000000..badddfe774
--- /dev/null
+++ b/docs/deployment/involve_knife4j_into_linkis.md
@@ -0,0 +1,64 @@
+---
+title: Involve Knife4j into Linkis
+sidebar_position: 12
+---
+
+## Knife4j introduced
+knife4j is an enhanced solution for generating API documentation for the Java 
MVC framework integration Swapper, formerly known as swagger-bootstrap-ui, 
named knife4j in the hope that it will be as small, lightweight, and powerful 
as a dagger! Its underlying layer is the encapsulation of Springfox, which is 
used in the same way as Springfox, but the interface document UI is optimized.
+
+**Core functionality:**
+
+- Document Description: According to the specification of Swagger, the 
description of the interface document is listed in detail, including the 
interface address, type, request example, request parameter, response example, 
response parameter, response code and other information, and the use of the 
interface is clear at a glance.
+- Online debugging: Provides the powerful function of online interface joint 
debugging, automatically parses the current interface parameters, and includes 
form verification, and the call parameters can return the interface response 
content, headers, response time, response status codes and other information to 
help developers debug online.
+## Linkis integrates knif4j
+### Start knif4j in test mode
+Modify the application-linkis.yml file setting to knife4j.production=false
+```shell
+knife4j:
+  enable: true
+  production: false
+```
+Modify the linkis.properties file to open test mode
+```shell
+wds.linkis.test.mode=true
+wds.linkis.test.user=hadoop
+```
+After restarting all services, you can access the knife4j page via 
http://ip:port/api/rest_j/v1/doc .html
+```shell
+http://ip:port/api/rest_j/v1/doc.html 
+```
+### Start knif4j in normal mode
+Modify the application-linkis.yml file setting to knife4j.production=false
+```shell
+knife4j:
+  enable: true
+  production: false
+```
+Modify the linkis.properties file to add 
wds.linkis.server.user.restful.uri.pass.auth
+```shell
+wds.linkis.server.user.restful.uri.pass.auth=/api/rest_j/v1/doc.html,/api/rest_j/v1/swagger-resources,/api/rest_j/v1/webjars,/api/rest_j/v1/v2/api-docs
+```
+After restarting all services, you can access the knife4j page via 
http://ip:port/api/rest_j/v1/doc .html
+```shell
+http://ip:port/api/rest_j/v1/doc.html 
+```
+Since identity authentication is required when knife4j debugs each interface, 
the following cookie information needs to be manually added to the browser.
+```shell
+#User login ticket-id
+bdp-user-ticket-id=
+#Workspace ID
+workspaceId=
+#Internal request switch
+dataworkcloud_inner_request=true
+```
+Take the Chrome browser as an example
+![](/Images/deployment/knife4j/Knife4j_addcookie.png)
+## Go to the Knife4j page
+Access knife4j page via http://ip:port/api/rest_j/v1/doc.html
+![](/Images/deployment/knife4j/Knife4j_home.png)
+Click the interface name to display detailed interface documentation
+![](/Images/deployment/knife4j/Knife4j_interface.png)
+Click "Debug" and enter parameters to debug the interface
+![](/Images/deployment/knife4j/Knife4j_debug.png)
+
+For detailed usage guidelines, please visit the knife4j official website to 
view:[https://doc.xiaominfo.com/knife4j/](https://doc.xiaominfo.com/knife4j/)
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/involve_knife4j_into_linkis.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/involve_knife4j_into_linkis.md
new file mode 100644
index 0000000000..6307d5b743
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/involve_knife4j_into_linkis.md
@@ -0,0 +1,63 @@
+---
+title: 启用 Knife4j
+sidebar_position: 12
+---
+
+## knife4j介绍
+knife4j是为Java 
MVC框架集成Swagger生成Api文档的增强解决方案,前身是swagger-bootstrap-ui,取名knife4j是希望它能像一把匕首一样小巧,轻量,并且功能强悍!其底层是对Springfox的封装,使用方式也和Springfox一致,只是对接口文档UI进行了优化
+**核心功能:**
+
+- 
文档说明:根据Swagger的规范说明,详细列出接口文档的说明,包括接口地址、类型、请求示例、请求参数、响应示例、响应参数、响应码等信息,对该接口的使用情况一目了然。
+- 
在线调试:提供在线接口联调的强大功能,自动解析当前接口参数,同时包含表单验证,调用参数可返回接口响应内容、headers、响应时间、响应状态码等信息,帮助开发者在线调试。
+## Linkis集成knif4j
+### 测试模式下启动knif4j
+修改application-linkis.yml文件设置knife4j.production=false
+```shell
+knife4j:
+  enable: true
+  production: false
+```
+修改 linkis.properties文件打开测试模式
+```shell
+wds.linkis.test.mode=true
+wds.linkis.test.user=hadoop
+```
+重启所有服务后,可以通过http://ip:port/api/rest_j/v1/doc.html 访问knife4j页面
+```shell
+http://ip:port/api/rest_j/v1/doc.html 
+```
+### 非测试模式下启动knif4j
+修改application-linkis.yml文件设置knife4j.production=false
+```shell
+knife4j:
+  enable: true
+  production: false
+```
+修改 linkis.properties文件添加wds.linkis.server.user.restful.uri.pass.auth
+```shell
+wds.linkis.server.user.restful.uri.pass.auth=/api/rest_j/v1/doc.html,/api/rest_j/v1/swagger-resources,/api/rest_j/v1/webjars,/api/rest_j/v1/v2/api-docs
+```
+重启所有服务后,可以通过http://ip:port/api/rest_j/v1/doc.html 访问knife4j页面
+```shell
+http://ip:port/api/rest_j/v1/doc.html 
+```
+由于knife4j调试各接口时,需要进行身份认证,需手工在浏览器添加如下cookie信息
+```shell
+#用户登录ticket-id
+bdp-user-ticket-id=
+#工作空间ID
+workspaceId=
+#内部请求开关
+dataworkcloud_inner_request=true
+```
+以Chrome浏览器为例
+![](/Images-zh/deployment/knife4j/Knife4j_addcookie.png)
+## 进入Knife4j页面
+通过http://ip:port/api/rest_j/v1/doc.html 访问knife4j页面
+![](/Images-zh/deployment/knife4j/Knife4j_home.png)
+点击接口名称可展示详细的接口文档
+![](/Images-zh/deployment/knife4j/Knife4j_interface.png)
+点击“调试”并录入参数可对接口进行调试
+![](/Images-zh/deployment/knife4j/Knife4j_debug.png)
+
+详细使用指南可浏览knife4j官网查看:[https://doc.xiaominfo.com/knife4j/](https://doc.xiaominfo.com/knife4j/)
diff --git a/static/Images-zh/deployment/knife4j/Knife4j_addcookie.png 
b/static/Images-zh/deployment/knife4j/Knife4j_addcookie.png
new file mode 100644
index 0000000000..89f693ba38
Binary files /dev/null and 
b/static/Images-zh/deployment/knife4j/Knife4j_addcookie.png differ
diff --git a/static/Images-zh/deployment/knife4j/Knife4j_debug.png 
b/static/Images-zh/deployment/knife4j/Knife4j_debug.png
new file mode 100644
index 0000000000..928dc4838d
Binary files /dev/null and 
b/static/Images-zh/deployment/knife4j/Knife4j_debug.png differ
diff --git a/static/Images-zh/deployment/knife4j/Knife4j_home.png 
b/static/Images-zh/deployment/knife4j/Knife4j_home.png
new file mode 100644
index 0000000000..8203d5a762
Binary files /dev/null and 
b/static/Images-zh/deployment/knife4j/Knife4j_home.png differ
diff --git a/static/Images-zh/deployment/knife4j/Knife4j_interface.png 
b/static/Images-zh/deployment/knife4j/Knife4j_interface.png
new file mode 100644
index 0000000000..928dc4838d
Binary files /dev/null and 
b/static/Images-zh/deployment/knife4j/Knife4j_interface.png differ
diff --git a/static/Images/deployment/knife4j/Knife4j_addcookie.png 
b/static/Images/deployment/knife4j/Knife4j_addcookie.png
new file mode 100644
index 0000000000..89f693ba38
Binary files /dev/null and 
b/static/Images/deployment/knife4j/Knife4j_addcookie.png differ
diff --git a/static/Images/deployment/knife4j/Knife4j_debug.png 
b/static/Images/deployment/knife4j/Knife4j_debug.png
new file mode 100644
index 0000000000..928dc4838d
Binary files /dev/null and b/static/Images/deployment/knife4j/Knife4j_debug.png 
differ
diff --git a/static/Images/deployment/knife4j/Knife4j_home.png 
b/static/Images/deployment/knife4j/Knife4j_home.png
new file mode 100644
index 0000000000..8203d5a762
Binary files /dev/null and b/static/Images/deployment/knife4j/Knife4j_home.png 
differ
diff --git a/static/Images/deployment/knife4j/Knife4j_interface.png 
b/static/Images/deployment/knife4j/Knife4j_interface.png
new file mode 100644
index 0000000000..928dc4838d
Binary files /dev/null and 
b/static/Images/deployment/knife4j/Knife4j_interface.png differ


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to