package com.mosquito.project.config;

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 org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class OpenApiConfig {

    @Bean
    public OpenAPI mosquitoOpenAPI() {
        return new OpenAPI()
            .info(new Info()
                .title("蚊子项目 API 文档")
                .description("Mosquito Propagation System - 活动推广系统")
                .version("v1.0.0")
                .contact(new Contact()
                    .name("Mosquito Team")
                    .email("dev@mosquito.example.com"))
                .license(new License()
                    .name("MIT License")
                    .url("https://opensource.org/licenses/MIT")))
            .servers(List.of(
                new Server().url("http://localhost:8080").description("本地开发环境"),
                new Server().url("https://api.mosquito.example.com").description("生产环境")
            ));
    }
}
