package com.ozs.gateway.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

@Component
@Primary
public class DocumentationConfig implements SwaggerResourcesProvider {

	@Override
	public List<SwaggerResource> get() {
		List resources = new ArrayList<>();
		resources.add(swaggerResource("数据中心->数据管理接口", "/mdm/v2/api-docs", "1.0"));
		resources.add(swaggerResource("数据中心->KPI配置管理接口", "/kpim/v2/api-docs", "1.0"));
		resources.add(swaggerResource("数据中心->报表配置接口", "/rpm/v2/api-docs", "1.0"));
		resources.add(swaggerResource("数据中心->用户登录相关接口", "/account/v2/api-docs", "1.0"));
		resources.add(swaggerResource("数据中心->数据采集接口", "/da/v2/api-docs", "1.0"));
		resources.add(swaggerResource("数据中心->应用展示接口", "/appshow/v2/api-docs", "1.0"));



		return resources;
	}

	private SwaggerResource swaggerResource(String name, String location, String version) {
		SwaggerResource swaggerResource = new SwaggerResource();
		swaggerResource.setName(name);
		swaggerResource.setLocation(location);
		swaggerResource.setSwaggerVersion(version);
		return swaggerResource;
	}
}