add swagger endpoint
This commit is contained in:
1 parent
83e7fe9152
commit
57b0f7ed99
2 files changed
+19
No files matched your search
@@ -0,0 +1,9 @@
|
||||
package docs
|
||||
|
||||
import _ "embed"
|
||||
|
||||
// Embedded swagger files.
|
||||
var (
|
||||
//go:embed swagger.yaml
|
||||
SwaggerYaml []byte
|
||||
)
|
||||
@@ -2,8 +2,10 @@ package routes
|
||||
|
||||
import (
|
||||
"isp-system-service/controller"
|
||||
"isp-system-service/docs"
|
||||
|
||||
"github.com/txix-open/isp-kit/cluster"
|
||||
"github.com/txix-open/isp-kit/common_endpoints"
|
||||
"github.com/txix-open/isp-kit/grpc"
|
||||
"github.com/txix-open/isp-kit/grpc/endpoint"
|
||||
)
|
||||
@@ -39,6 +41,7 @@ func endpointDescriptors(c Controllers) []cluster.EndpointDescriptor {
|
||||
applicationCluster(c),
|
||||
tokenCluster(c),
|
||||
applicationGroupCluster(c),
|
||||
commonEndpoints(),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -253,6 +256,13 @@ func applicationGroupCluster(c Controllers) []cluster.EndpointDescriptor {
|
||||
}
|
||||
}
|
||||
|
||||
func commonEndpoints() []cluster.EndpointDescriptor {
|
||||
return common_endpoints.CommonEndpoints(
|
||||
"system",
|
||||
common_endpoints.WithSwaggerEndpoint(docs.SwaggerYaml),
|
||||
)
|
||||
}
|
||||
|
||||
func concatCluster(clusters ...[]cluster.EndpointDescriptor) []cluster.EndpointDescriptor {
|
||||
var result []cluster.EndpointDescriptor
|
||||
for _, c := range clusters {
|
||||
|
||||
Reference in new issue
Block a user