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

com.xwc1125.security.swagger.SwaggerProperties Maven / Gradle / Ivy

Go to download

安全的使用swagger3。在prod环境下强制关闭swagger3,只能在dev和test环境下才能使用swagger3。

The newest version!
package com.xwc1125.security.swagger;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.headers.Header;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.parameters.Parameter;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @Description: springdoc open api 文档:https://springdoc.org/#properties
 * @Author: xwc1125
 * @Date: 2022/6/20 10:09
 * @Copyright Copyright@2022
 */
@ConfigurationProperties("swagger")
public class SwaggerProperties {

    /**
     * 是否开启swagger
     */
    private Boolean enabled = false;
    /**
     * 应用信息(title,desc,contact等)
     */
    private Info info = new Info();
    /**
     * 扩展文档
     */
    private ExternalDocumentation externalDoc = new ExternalDocumentation();

    private Map securitySchemes = new TreeMap<>();
    private Map headers = new TreeMap<>();
    private Map parameters = new TreeMap<>();

    /**
     * 接口调试列表
     */
    private List servers = new ArrayList<>();

    public SwaggerProperties() {
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Info getInfo() {
        return info;
    }

    public void setInfo(Info info) {
        this.info = info;
    }

    public ExternalDocumentation getExternalDoc() {
        return externalDoc;
    }

    public void setExternalDoc(ExternalDocumentation externalDoc) {
        this.externalDoc = externalDoc;
    }

    public Map getSecuritySchemes() {
        return securitySchemes;
    }

    public void setSecuritySchemes(
            Map securitySchemes) {
        this.securitySchemes = securitySchemes;
    }

    public Map getHeaders() {
        return headers;
    }

    public void setHeaders(Map headers) {
        this.headers = headers;
    }

    public Map getParameters() {
        return parameters;
    }

    public void setParameters(Map parameters) {
        this.parameters = parameters;
    }

    public List getServers() {
        return servers;
    }

    public void setServers(List servers) {
        this.servers = servers;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy