content: package fun.cmgraph.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 lombok.extern.slf4j.Slf4j;
  import org.springdoc.core.models.GroupedOpenApi;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.Configuration;
  
  /**
   * ClassName: Knife4jConfig
   * Package: fun.cmgraph.config
   * Description:
   *
   * @Author: robin
   * @Version: v1.0
   */
  @Configuration
  public class Knife4jConfig {
  
      @Bean
      public GroupedOpenApi adminApi() {      // 创建了一个api接口的分组
          return GroupedOpenApi.builder()
                  .group("admin-api")         // 分组名称
                  .pathsToMatch("/admin/**")  // 接口请求路径规则
                  .build();
      }
  
      @Bean
      public GroupedOpenApi userApi() {
          return GroupedOpenApi.builder()
                  .group("user-api")
                  .pathsToMatch("/user/**")
                  .build();
      }
  
      @Bean
      public OpenAPI openAPI(){
          return new OpenAPI()
                  .info(new Info()
                          .title("接口文档")
                          .description("说明")
                          .version("v1")
                          .contact(new Contact().name("robin").email("robin@gmail.com"))
                          .license(new License().name("Apache 2.0").url("http://springdoc.org"))
                  );
      }
  }