package com.bbd.bpm.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.ResponseEntity;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.time.LocalDate;


@EnableSwagger2
@Configuration
public class SwaggerConfig {

    @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.bbd.bpm.controller"))
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("业务流程管理（BPM）接口API文档")
                .description("API接口文档结合组织架构模块和流程图模块，即可实现可视化流程管理和公司业务管理")
                .version("1.0")
                .build();
    }




    /**
     * @ApiImplicitParams({
     @ApiImplicitParam(name = "page", value = "当前页数1开始",  dataType = "int",paramType = "query"),
     @ApiImplicitParam(name = "pageSize", value = "每页的大小",  dataType = "int",paramType = "query"),
     @ApiImplicitParam(name = "userId", value = "当前登录的用户id", dataType = "int",paramType = "query")
     })

     * */



}