All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tencent.devops.common.web.swagger.BkJaxrsAnnotationScanner.kt Maven / Gradle / Ivy

There is a newer version: 3.1.0-rc.4
Show newest version
package com.tencent.devops.common.web.swagger

import io.swagger.v3.jaxrs2.integration.JaxrsAnnotationScanner
import io.swagger.v3.jaxrs2.integration.JaxrsApplicationAndAnnotationScanner
import org.springframework.aop.support.AopUtils

/**
 * 被JerseySwaggerConfig使用到 , 勿删
 */
class BkJaxrsAnnotationScanner : JaxrsAnnotationScanner() {
    override fun classes(): MutableSet> {
        val classes = super.classes()

        val singletons = application.singletons
        if (singletons != null) {
            for (o in singletons) {
                val sourceClass = if (AopUtils.isAopProxy(o)) {
                    AopUtils.getTargetClass(o)
                } else {
                    o.javaClass
                }
                if (!isIgnored(sourceClass.name)) {
                    classes.add(sourceClass)
                }
            }
        }
        return classes
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy