package com.ecep.contract.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;

import java.util.List;

/**
 * OpenAPI配置类，用于配置Swagger文档
 */
@Configuration
public class OpenApiConfig {
    
    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("合同管理系统 API")
                        .version("1.0")
                        .description("合同管理系统的REST API文档")
                        .contact(new Contact()
                                .name("宋其青")
                                .email("qiqing.song@ecep.com"))
                        .license(new License()
                                .name("内部使用")
                                .url("http://10.84.210.110")))
                .servers(List.of(
                        new Server().url("http://localhost:8080").description("开发环境"),
                        new Server().url("http://10.84.210.110:8080").description("测试环境")
                ));
    }
}