fix: fix docs cannot request to the real server

This commit is contained in:
wzp 2024-12-25 20:17:25 +08:00
parent 324b7f7fcb
commit 74053a95df

View File

@ -0,0 +1,20 @@
package org.blue.club.configuration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.servers.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
@Configuration
public class CustomDocsConfiguration {
@Bean
@Primary
public OpenAPI myApi(@Autowired OpenAPI api) {
api.addServersItem(new Server().url("https://wzpmc.cn:18080/").description("外网开放API"));
api.addServersItem(new Server().url("http://172.16.114.84:58082/").description("开发用API"));
api.addServersItem(new Server().url("http://127.0.0.1:58082/").description("调试用API"));
return api;
}
}