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/28 08:26:55 UTC

[GitHub] [incubator-linkis] aleneZeng opened a new pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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


   ### What is the purpose of the change
   add knife4j to linkis  so that user can use apiDoc during development and debugging code.
   
   ### Brief change log
   (for example:)
   1,add maven depedency on knife4j 2.0.9
   2,add knife4jConfig class
   3,add related config param in application-linkis.yml
   
   ### Verifying this change
   (Please pick either of the following options)  
   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): yes
   - Anything that affects deployment: no
   - The MGS(Microservice Governance Services), i.e., Spring Cloud Gateway, OpenFeign, Eureka.: no
   
   ### Documentation
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? JavaDoc in class file Knife4jConfig


-- 
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] peacewong commented on a change in pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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
+import org.springframework.beans.factory.annotation.Value
+
+/**
+ * it is very easy to enable knife when you want to use apiDoc(based on swagger2)
+ * 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

Review comment:
       ok,thanks




-- 
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] peacewong commented on a change in pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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
+import org.springframework.beans.factory.annotation.Value
+
+/**
+ * it is very easy to enable knife when you want to use apiDoc(based on swagger2)
+ * 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

Review comment:
       ok,thanks




-- 
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] peacewong commented on a change in pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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
+import org.springframework.beans.factory.annotation.Value
+
+/**
+ * it is very easy to enable knife when you want to use apiDoc(based on swagger2)
+ * 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

Review comment:
       “ds.linkis.test.mode”  the `wds` prefix will be removed in subsequent versions, and the references here still need to be correct ‘wds.linkis.test.mode'




-- 
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] peacewong merged pull request #1339: [feature]add knife4j to linkis services(issue 1319)

Posted by GitBox <gi...@apache.org>.
peacewong merged pull request #1339:
URL: https://github.com/apache/incubator-linkis/pull/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 commented on a change in pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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



##########
File path: linkis-commons/linkis-module/src/main/scala/org/apache/linkis/server/conf/Knife4jConfig.scala
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+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
+import org.springframework.beans.factory.annotation.Value
+
+/**
+ * it is very easy to enable knife when you want to use apiDoc(based on swagger2)
+ * 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

Review comment:
       correct the typo




-- 
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