package com.dne.ems.config;

import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.security.SecurityScheme;

/**
 * OpenAPI配置类，用于配置Swagger API文档
 *
 * <p>该配置类使用SpringDoc OpenAPI实现，提供以下功能：
 * <ul>
 *   <li>配置API文档的基本信息（标题、版本等）</li>
 *   <li>配置JWT Bearer Token认证方案</li>
 *   <li>为所有API端点添加安全要求</li>
 * </ul>
 *
 * <p>通过该配置，可以在/swagger-ui.html访问API文档界面
 *
 * @author DNE开发团队
 * @version 1.0
 * @since 2024
 */
@Configuration
@OpenAPIDefinition(
    info = @Info(title = "EMS API", version = "v1"),
    security = @SecurityRequirement(name = "bearerAuth")
)
@SecurityScheme(
    name = "bearerAuth",
    type = SecuritySchemeType.HTTP,
    scheme = "bearer",
    bearerFormat = "JWT"
)
public class OpenApiConfig {
    // 配置类，无需实现内容
}