You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by GitBox <gi...@apache.org> on 2022/01/27 10:30:40 UTC

[GitHub] [incubator-linkis] aleneZeng opened a new pull request #1336: Release 1.0.3 rc1

aleneZeng opened a new pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336


   ### What is the purpose of the change
   集成knife4j以提供apidoc,除了eureka和gateway服务之外,其他的服务都可通过http://ip:port/api/rest_j/v1/doc.html访问apidoc
   add knife4j support to linkis to supply api document for all micro services except eureka and gateway
   
   ### Brief change log
   1,在模块linkis-module增加knife4j的配置类knife4jConfig
   2. 在模块linkis-module增加必要的maven依赖
   3. 选择了相对稳定的knife4j 2.0.9版本,此版本还是依赖于swagger2实现
   1,add knife4jConfig to module: linkis-module
   2,add necessary maven dpendencies for knife4j
   3,use knife4j 2.0.9 which is based on swagger2 
   
   ### Verifying this change
   (Please pick either of the following options)  
   没有写testcase,但是在测试环境测试过
   This change is a trivial rework / code cleanup without any test coverage.  
   
   
   ### Does this pull request potentially affect one of the following parts:
   - Dependencies (does it add or upgrade a dependency): 是的,增加了knife4j的相关依赖
   - Anything that affects deployment: (yes / no / don't know) 没有
   - The MGS(Microservice Governance Services), 不是
   
   ### Documentation
   - Does this pull request introduce a new feature? (yes / no)  不是
   - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented) 还没有
   - 需要提供使用文档,步骤很简单
   - 1,打开application-linkis.yml,配置knife4j.enable=true
   - 2,打开linkis.properties,配置ds.linkis.test.mode=true
   - 启动服务之后,通过微服务地址http://ip:port/api/rest_j/v1/doc.html访问


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] casionone commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
casionone commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r793581653



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,70 @@
+package org.apache.linkis.server.conf

Review comment:
       Missing  ASF header 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] casionone commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
casionone commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r793579348



##########
File path: assembly-combined-package/assembly-combined/conf/application-linkis.yml
##########
@@ -35,4 +35,14 @@ pagehelper:
 
 #ribbon:
 #  ReadTimeout: 10000
-#  ConnectTimeout: 10000
\ No newline at end of file
+#  ConnectTimeout: 10000
+
+#  enable for knife4j used by all micro services except gateway and eureka
+#knife4j:
+#  enable: true
+#  basic:
+#    enable: false
+#    # Basic认证用户名
+#    username: test
+#    # Basic认证密码
+#    password: 123

Review comment:
       If a password is used, the password should not be too simple,eg:#1105.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] aleneZeng commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
aleneZeng commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r794273059



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,70 @@
+package org.apache.linkis.server.conf
+
+import org.springframework.context.annotation.Bean
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+import springfox.documentation.builders.ApiInfoBuilder
+import springfox.documentation.builders.PathSelectors
+import springfox.documentation.builders.RequestHandlerSelectors
+import springfox.documentation.service.ApiInfo
+import springfox.documentation.spi.DocumentationType
+import springfox.documentation.spring.web.plugins.Docket
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
+
+/**
+- 启动knife的apidoc的步骤很简单
+- 1,打开application-linkis.yml,配置knife4j.enable=true
+- 2,打开linkis.properties,配置ds.linkis.test.mode=true
+- 3,启动服务之后,通过微服务地址http://ip:port/api/rest_j/v1/doc.html访问
+ */
+@EnableSwagger2WebMvc

Review comment:
       there are two ways to enable knife4j:
    * it is very easy to enable knife when you want to check the apiDoc
    * you can follow these steps to enable
    * 1, open application-linkis.yml and set knife4j.production=false
    * 2, open linkis.properties and set ds.linkis.test.mode=true
    * 3, restart the service and you can visit http://ip:port/api/rest_j/v1/doc.html
    *
    * or you can use apidoc by following steps  without enable ds.linkis.test.mode
    * 1, open application-linkis.yml and set knife4j.production=false
    * 2,vi linkis.propertes ,and set 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
    * 3, in your browser,add dataworkcloud_inner_request=true, bdp-user-ticket-id's value and  workspaceId's value
    * 4, restart the service and you can visit http://ip:port/api/rest_j/v1/doc.html




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] casionone commented on pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
casionone commented on pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#issuecomment-1023167286


   The branch of apache:release-1.0.3-rc1 is no longer updated,please commit into dev-1.1.0.
   The pr title should use the feature description as much as possible,“Release 1.0.3 rc1” has no meaning, in addition please use english as much as possible.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] casionone commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
casionone commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r793583043



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,70 @@
+package org.apache.linkis.server.conf
+
+import org.springframework.context.annotation.Bean
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j
+import org.springframework.context.annotation.Bean
+import org.springframework.context.annotation.Configuration
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
+import springfox.documentation.builders.ApiInfoBuilder
+import springfox.documentation.builders.PathSelectors
+import springfox.documentation.builders.RequestHandlerSelectors
+import springfox.documentation.service.ApiInfo
+import springfox.documentation.spi.DocumentationType
+import springfox.documentation.spring.web.plugins.Docket
+import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc
+
+/**
+- 启动knife的apidoc的步骤很简单
+- 1,打开application-linkis.yml,配置knife4j.enable=true
+- 2,打开linkis.properties,配置ds.linkis.test.mode=true
+- 3,启动服务之后,通过微服务地址http://ip:port/api/rest_j/v1/doc.html访问
+ */
+@EnableSwagger2WebMvc

Review comment:
       Is wds.linkis.test.mode not used?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] aleneZeng commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
aleneZeng commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r794239352



##########
File path: assembly-combined-package/assembly-combined/conf/application-linkis.yml
##########
@@ -35,4 +35,14 @@ pagehelper:
 
 #ribbon:
 #  ReadTimeout: 10000
-#  ConnectTimeout: 10000
\ No newline at end of file
+#  ConnectTimeout: 10000
+
+#  enable for knife4j used by all micro services except gateway and eureka
+#knife4j:
+#  enable: true
+#  basic:
+#    enable: false
+#    # Basic认证用户名
+#    username: test
+#    # Basic认证密码
+#    password: 123

Review comment:
       ok,I will remove this username/password 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] aleneZeng commented on a change in pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
aleneZeng commented on a change in pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#discussion_r794273958



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,70 @@
+package org.apache.linkis.server.conf

Review comment:
       I will add it and submit another pull request




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] aleneZeng commented on pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
aleneZeng commented on pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336#issuecomment-1023991048


   please review pull request 1339


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org


[GitHub] [incubator-linkis] aleneZeng closed pull request #1336: Release 1.0.3 rc1

Posted by GitBox <gi...@apache.org>.
aleneZeng closed pull request #1336:
URL: https://github.com/apache/incubator-linkis/pull/1336


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org