package com.seer.teach.iot.controller.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.servers.Server;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;


@Configuration
@Profile({"local","dev","test"})
public class IotApiConfig {

    @Bean
    public OpenAPI iotOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("Seer Teach IoT端API")
                        .description("此文档详细说明了IoT模块接口规范")
                        .version("v1.0.0")
                        .contact(new Contact()
                                .name("广东用嘉研发部")))
                .addServersItem(new Server().url("/"));
    }
    
    @Bean
    public GroupedOpenApi iotApi() {
        return GroupedOpenApi.builder()
                .group("seer-iot")
                .pathsToMatch("/**")
                .build();
    }

}