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:54:28 UTC

[GitHub] [incubator-linkis] peacewong commented on a change in pull request #1339: [feature]add knife4j to linkis services(issue 1319)

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