package com.its.onvif.cmra.server.config;


import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SwaggerConfig {

    @Bean
    public GroupedOpenApi onvifApi() {
        return GroupedOpenApi.builder()
                .group("Onvif Control API All")
                .pathsToMatch("/api/camera/**")
                .build();
    }

    @Bean
    public GroupedOpenApi ptzApi() {
        return GroupedOpenApi.builder()
                .group("PTZ 제어 API")
                .pathsToMatch("/api/camera/ptz/**")
                .build();
    }

    @Bean
    public GroupedOpenApi infoApi() {
        return GroupedOpenApi.builder()
                .group("카메라 정보 API")
                .pathsToMatch("/api/camera/info/**", "/api/camera/streams/**")
                .build();
    }

    @Bean
    public OpenAPI baseOpenApi() {
        return new OpenAPI()
                .info(new Info()
                        .title("Onvif IP Camera Management REST API")
                        .description("Intelligent Traffic System Onvif IP Camera Control API")
                        .version("0.0.1")
                );
    }

}
