|
|
@@ -1,6 +1,5 @@
|
|
|
package org.jetlinks.community.standalone.configuration.doc;
|
|
|
|
|
|
-
|
|
|
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
|
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
|
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
|
|
@@ -20,6 +19,7 @@ import org.springframework.core.ResolvableType;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import reactor.core.publisher.Flux;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
+
|
|
|
import java.lang.reflect.ParameterizedType;
|
|
|
import java.lang.reflect.Type;
|
|
|
import java.util.List;
|
|
|
@@ -29,8 +29,8 @@ import java.util.List;
|
|
|
info = @Info(
|
|
|
title = "物联网平台",
|
|
|
description = "物联网平台接口文档",
|
|
|
- contact = @Contact(name = "admin",url = "http://doc.jetlinks.cn/dev-guide/start.html"),
|
|
|
- version = "1.0.0"
|
|
|
+ contact = @Contact(name = "admin",url = "https://github.com/jetlinks"),
|
|
|
+ version = "1.12.0-SNAPSHOT"
|
|
|
)
|
|
|
)
|
|
|
@SecuritySchemes(
|
|
|
@@ -47,26 +47,10 @@ import java.util.List;
|
|
|
@AutoConfigureBefore(SpringDocWebFluxConfiguration.class)
|
|
|
public class SwaggerConfiguration {
|
|
|
|
|
|
-// @Bean
|
|
|
-// public Docket docker(){
|
|
|
-// // 构造函数传入初始化规范,这是swagger2规范
|
|
|
-// return new Docket(DocumentationType.SWAGGER_2)
|
|
|
-// //apiInfo: 添加api详情信息,参数为ApiInfo类型的参数,这个参数包含了第二部分的所有信息比如标题、描述、版本之类的,开发中一般都会自定义这些信息
|
|
|
-//// .apiInfo(apiInfo())
|
|
|
-// .groupName("lifang")
|
|
|
-// //配置是否启用Swagger,如果是false,在浏览器将无法访问,默认是true
|
|
|
-// .enable(true)
|
|
|
-// .select()
|
|
|
-// //apis: 添加过滤条件,
|
|
|
-//// .apis(RequestHandlerSelectors.basePackage("com.yichun.swagger_boot_demo.controller"))
|
|
|
-// //paths: 这里是控制哪些路径的api会被显示出来,比如下方的参数就是除了/user以外的其它路径都会生成api文档
|
|
|
-// .paths(Objects::nonNull)
|
|
|
-// .build();
|
|
|
-// }
|
|
|
+
|
|
|
@Bean
|
|
|
public ReturnTypeParser operationCustomizer() {
|
|
|
|
|
|
-
|
|
|
return new ReturnTypeParser() {
|
|
|
@Override
|
|
|
public Type getReturnType(MethodParameter methodParameter) {
|