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

club.zhcs.openapi.SpringdocConfigurationProperties Maven / Gradle / Ivy

There is a newer version: 3.3.4
Show newest version
package club.zhcs.openapi;

import java.util.Arrays;

import org.springdoc.core.utils.Constants;
import org.springframework.boot.context.properties.ConfigurationProperties;

import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

@Data
@ConfigurationProperties(prefix = Constants.SPRINGDOC_PREFIX)
public class SpringdocConfigurationProperties {

    Info info;

    Server server;

    Customer customer = new Customer();

    @Data
    public static class Customer {

        String title;

        String url;

        String logo;

        String configUrl; // /v3/api-docs/swagger-config

        Theme theme = Theme.MONOKAI;

        @Getter
        @AllArgsConstructor
        public enum Theme {
            /**
             * 
             */
            FEELING_BLUE("theme-feeling-blue", "蓝色"),
            /**
             * 
             */
            MATERIAL("theme-material", "质感"),
            /**
             * 
             */
            MONOKAI("theme-monokai", "莫洛凯"),
            /**
             * 
             */
            FLATTOP("theme-flattop", "扁平"),
            /**
             * 
             */
            MUTED("theme-muted", "柔和"),
            /**
             * 
             */
            NEWSPAPER("theme-newspaper", "黑白"),
            /**
             * 
             */
            OUTLINE("theme-outline", "框线");

            String code;
            String description;

            public static Theme from(String code) {
                return Arrays.stream(values())
                             .filter(theme -> theme.getCode().equalsIgnoreCase(code))
                             .findAny()
                             .orElse(null);
            }

        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy