2018-12-24 11:58:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2018-2028, lengleng (wangiegie@gmail.com).
|
|
|
|
|
* <p>
|
2018-12-29 18:46:01 +08:00
|
|
|
|
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0;
|
2018-12-24 11:58:45 +08:00
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
* <p>
|
|
|
|
|
* http://www.gnu.org/licenses/lgpl.html
|
|
|
|
|
* <p>
|
|
|
|
|
* 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.springblade.core.swagger;
|
|
|
|
|
|
|
|
|
|
import lombok.Data;
|
|
|
|
|
import lombok.NoArgsConstructor;
|
2019-07-05 23:21:07 +08:00
|
|
|
|
import org.springblade.core.launch.constant.AppConstant;
|
2018-12-24 11:58:45 +08:00
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
2019-07-05 23:21:07 +08:00
|
|
|
|
import java.util.Collections;
|
2018-12-24 11:58:45 +08:00
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* SwaggerProperties
|
2018-12-27 13:29:11 +08:00
|
|
|
|
*
|
2018-12-29 18:43:11 +08:00
|
|
|
|
* @author Chill
|
2018-12-24 11:58:45 +08:00
|
|
|
|
*/
|
|
|
|
|
@Data
|
|
|
|
|
@ConfigurationProperties("swagger")
|
|
|
|
|
public class SwaggerProperties {
|
|
|
|
|
/**
|
|
|
|
|
* swagger会解析的包路径
|
|
|
|
|
**/
|
2019-07-05 23:21:07 +08:00
|
|
|
|
private List<String> basePackages = new ArrayList<>(Collections.singletonList(AppConstant.BASE_PACKAGES));
|
2018-12-24 11:58:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* swagger会解析的url规则
|
|
|
|
|
**/
|
|
|
|
|
private List<String> basePath = new ArrayList<>();
|
|
|
|
|
/**
|
|
|
|
|
* 在basePath基础上需要排除的url规则
|
|
|
|
|
**/
|
|
|
|
|
private List<String> excludePath = new ArrayList<>();
|
|
|
|
|
/**
|
|
|
|
|
* 标题
|
|
|
|
|
**/
|
|
|
|
|
private String title = "SpringBlade 接口文档系统";
|
|
|
|
|
/**
|
|
|
|
|
* 描述
|
|
|
|
|
**/
|
|
|
|
|
private String description = "SpringBlade 接口文档系统";
|
|
|
|
|
/**
|
|
|
|
|
* 版本
|
|
|
|
|
**/
|
2022-10-13 00:43:30 +08:00
|
|
|
|
private String version = "3.5.0";
|
2018-12-24 11:58:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* 许可证
|
|
|
|
|
**/
|
|
|
|
|
private String license = "";
|
|
|
|
|
/**
|
|
|
|
|
* 许可证URL
|
|
|
|
|
**/
|
|
|
|
|
private String licenseUrl = "";
|
|
|
|
|
/**
|
|
|
|
|
* 服务条款URL
|
|
|
|
|
**/
|
|
|
|
|
private String termsOfServiceUrl = "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* host信息
|
|
|
|
|
**/
|
|
|
|
|
private String host = "";
|
|
|
|
|
/**
|
|
|
|
|
* 联系人信息
|
|
|
|
|
*/
|
|
|
|
|
private Contact contact = new Contact();
|
|
|
|
|
/**
|
|
|
|
|
* 全局统一鉴权配置
|
|
|
|
|
**/
|
|
|
|
|
private Authorization authorization = new Authorization();
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
public static class Contact {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 联系人
|
|
|
|
|
**/
|
|
|
|
|
private String name = "chillzhuang";
|
|
|
|
|
/**
|
|
|
|
|
* 联系人url
|
|
|
|
|
**/
|
|
|
|
|
private String url = "";
|
|
|
|
|
/**
|
|
|
|
|
* 联系人email
|
|
|
|
|
**/
|
|
|
|
|
private String email = "smallchill@163.com";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
public static class Authorization {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鉴权策略ID,需要和SecurityReferences ID保持一致
|
|
|
|
|
*/
|
|
|
|
|
private String name = "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 需要开启鉴权URL的正则
|
|
|
|
|
*/
|
|
|
|
|
private String authRegex = "^.*$";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 鉴权作用域列表
|
|
|
|
|
*/
|
|
|
|
|
private List<AuthorizationScope> authorizationScopeList = new ArrayList<>();
|
|
|
|
|
|
2022-07-19 12:24:42 +08:00
|
|
|
|
/**
|
|
|
|
|
* 鉴权请求头参数列表
|
|
|
|
|
*/
|
|
|
|
|
private List<AuthorizationApiKey> authorizationApiKeyList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 接口匹配地址
|
|
|
|
|
*/
|
2018-12-24 11:58:45 +08:00
|
|
|
|
private List<String> tokenUrlList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
public static class AuthorizationScope {
|
|
|
|
|
|
2022-07-19 12:24:42 +08:00
|
|
|
|
/**
|
|
|
|
|
* 鉴权策略名, 需要和ApiKey的name保持一致
|
|
|
|
|
*/
|
|
|
|
|
private String name = "";
|
2018-12-24 11:58:45 +08:00
|
|
|
|
/**
|
|
|
|
|
* 作用域名称
|
|
|
|
|
*/
|
|
|
|
|
private String scope = "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 作用域描述
|
|
|
|
|
*/
|
|
|
|
|
private String description = "";
|
|
|
|
|
|
|
|
|
|
}
|
2022-07-19 12:24:42 +08:00
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
@NoArgsConstructor
|
|
|
|
|
public static class AuthorizationApiKey {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 参数名
|
|
|
|
|
*/
|
|
|
|
|
private String name = "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 参数值
|
|
|
|
|
*/
|
|
|
|
|
private String keyName = "";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 参数作用域
|
|
|
|
|
*/
|
|
|
|
|
private String passAs = "";
|
|
|
|
|
|
|
|
|
|
}
|
2018-12-24 11:58:45 +08:00
|
|
|
|
}
|