@@ -0,0 +1,2162 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one%0A * or more contributor license agreements. See the NOTICE file%0A * distributed with this work for additional information%0A * regarding copyright ownership. The ASF licenses this file%0A * to you under the Apache License, Version 2.0 (the%0A * %22License%22); you may not use this file except in compliance%0A * with the License. You may obtain a copy of the License at%0A *%0A *   http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing,%0A * software distributed under the License is distributed on an%0A * %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A * KIND, either express or implied. See the License for the%0A * specific language governing permissions and limitations%0A * under the License.%0A */%0Apackage com.zxy.commons.apidocs.conf;%0A%0Aimport io.swagger.annotations.ApiOperation;%0Aimport org.springframework.context.annotation.Condition;%0Aimport org.springframework.context.annotation.ConditionContext;%0Aimport org.springframework.core.type.AnnotatedTypeMetadata;%0Aimport org.springframework.util.StringUtils;%0Aimport springfox.documentation.spring.web.plugins.Docket;%0A%0A/**%0A * SwaggerConfiguareCondition%0A * %3Cp%3E%0A * %3Cp%3E%0A * %3Ca href=%22SwaggerConfiguareCondition.java%22%3E%3Ci%3EView Source%3C/i%3E%3C/a%3E%0A *%0A * @author zhaoxunyong@qq.com%0A * @version 1.0%0A * @since 1.0%0A */%0Apublic class SwaggerConfiguareCondition implements Condition %7B%0A    @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) %7B%0A        String enabled = context.getEnvironment().getProperty(%22apidocs.enabled%22);%0A        if(!StringUtils.isEmpty(enabled) && %22false%22.equalsIgnoreCase(enabled)) %7B%0A            return false;%0A        %7D%0A//        String xmlEnabled = context.getEnvironment().getProperty(%22apidocs.use.xml.enabled%22);%0A//        if(!StringUtils.isEmpty(xmlEnabled) && %22true%22.equalsIgnoreCase(xmlEnabled)) %7B%0A//            return false;%0A//        %7D%0A        try %7B%0A            // %E6%98%AF%E5%90%A6%E6%9C%89jar%E4%BE%9D%E8%B5%96, %E6%B2%A1%E6%9C%89%E7%9A%84%E8%AF%9D, %E4%B8%8D%E8%87%AA%E5%8A%A8%E5%8A%A0%E8%BD%BD%E9%85%8D%E7%BD%AE%0A            context.getClassLoader().loadClass(Docket.class.getName());%0A            return true;%0A        %7D catch (Exception ex)%7B%0A            return false;%0A        %7D%0A    %7D%0A%7D

修改自动生成文档为自动配置化。