feiyu02
2025-04-11 635d762aef37b5de6cd2e34f4a076ab56d9a239d
src/main/kotlin/com/flightfeather/uav/config/Swagger2Configuration.kt
@@ -16,20 +16,22 @@
 */
@Configuration
@EnableSwagger2
class Swagger2Configuration {
class Swagger2Configuration(
    @Value("\${springfox.documentation.swagger.v2.enabled}") var swagger2Enable: Boolean,
) {
    companion object {
        const val SWAGGER_SCAN_BASE_PACKAGE = "cn.flightfeather.uav"
        const val SWAGGER_SCAN_BASE_PACKAGE = "com.flightfeather.uav"
        const val VERSION = "1.0.0"
    }
    @Value("\${springfox.documentation.swagger.v2.enabled}")
    private val swagger2Enable: Boolean = true
//    @Value("\${springfox.documentation.swagger.v2.enabled}")
//    private val swagger2Enable: Boolean = true
    @Bean
    fun createRestApi(): Docket =
            Docket(DocumentationType.SWAGGER_2)
            Docket(DocumentationType.OAS_30)
                    .enable(swagger2Enable)
                    .apiInfo(apiInfo())
                    .select()