chore: update dependencies and add OpenAPI support

- Added github.com/getkin/kin-openapi v0.130.0 to go.mod and updated go.sum for improved OpenAPI integration.
- Introduced DefaultOpenAPIUrl constant in config.go for easier configuration of OpenAPI URL.
- Implemented GetOpenAPIUrl function to retrieve the OpenAPI URL from configuration, enhancing flexibility in API documentation handling.
This commit is contained in:
Marvin Zhang
2025-03-17 18:17:32 +08:00
parent ea12568eae
commit a43f0cc5da
4 changed files with 29 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ const (
DefaultNodeModulesPath = "/usr/lib/node_modules"
DefaultGoPath = "/root/go"
DefaultMcpServerBaseUrl = "http://localhost:9000/sse"
DefaultOpenAPIUrl = "http://localhost:8000/openapi.json"
)
func IsDev() bool {
@@ -293,3 +294,10 @@ func GetMcpServerBaseUrl() string {
}
return DefaultMcpServerBaseUrl
}
func GetOpenAPIUrl() string {
if res := viper.GetString("openapi.url"); res != "" {
return res
}
return DefaultOpenAPIUrl
}