/*
|
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
*
|
* https://www.mall4j.com/
|
*
|
* 未经允许,不可做商业用途!
|
*
|
* 版权所有,侵权必究!
|
*/
|
package com.yami.shop.api.config;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.StrUtil;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.yami.shop.common.util.PageParam;
|
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.info.Info;
|
import io.swagger.v3.oas.models.info.License;
|
import jodd.util.ArraysUtil;
|
import org.apache.commons.lang3.reflect.FieldUtils;
|
import org.springdoc.api.annotations.ParameterObject;
|
import org.springdoc.core.*;
|
import org.springdoc.core.customizers.DelegatingMethodParameterCustomizer;
|
import org.springdoc.core.providers.ObjectMapperProvider;
|
import org.springdoc.core.providers.WebConversionServiceProvider;
|
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Configuration;
|
import org.springframework.core.MethodParameter;
|
|
import java.lang.annotation.Annotation;
|
import java.lang.reflect.Field;
|
import java.util.Arrays;
|
import java.util.List;
|
import java.util.Objects;
|
import java.util.Optional;
|
import java.util.stream.Collectors;
|
import java.util.stream.Stream;
|
|
/**
|
* Swagger文档,只有在测试环境才会使用
|
* @author LGH
|
*/
|
@Configuration
|
public class SwaggerConfiguration {
|
|
|
@Bean
|
public GroupedOpenApi publicApi() {
|
return GroupedOpenApi.builder()
|
.group("公共接口")
|
.packagesToScan("com.yami.shop.api")
|
.pathsToMatch("/**")
|
.build();
|
}
|
|
@Bean
|
public OpenAPI springShopOpenAPI() {
|
return new OpenAPI()
|
.info(new Info().title("Mall4j接口文档")
|
.description("Mall4j宇宙版接口文档,openapi3.0 接口,用于前端对接")
|
.version("v0.0.1")
|
.license(new License().name("使用请遵守商用授权协议").url("https://www.mall4j.com")));
|
}
|
|
}
|