Skip to content

Commit d59f142

Browse files
authored
[ISSUE polarismesh#1071] refactor: service governance rule not bind service instance (polarismesh#1065)
1 parent 6fdd8a8 commit d59f142

File tree

91 files changed

+1920
-4817
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1920
-4817
lines changed

.github/workflows/benchmark.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
echo "[BENCHMARK TEST] begin"
109109
export BENCHMARK_SERVER_ADDRESS=127.0.0.1:8091
110110
pushd ./test/benchmark/grpc
111-
go test -bench .
111+
go test -v -bench .
112112
popd
113113
echo "[BENCHMARK TEST] end"
114114
cd $work_dir

.github/workflows/codecov.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Go Test
8383
run: |
8484
# bash coverage.sh
85-
go mod vendor && go test -timeout 80m ./... -v -covermode=count -coverprofile=coverage_1.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common/model
85+
go mod vendor && go test -timeout 80m ./... -v -covermode=count -coverprofile=coverage_1.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common
8686
8787
# Run unit tests
8888
- name: Go Test With DB
@@ -101,7 +101,7 @@ jobs:
101101
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set GLOBAL max_connections = 3000;"
102102
103103
pushd ./config
104-
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_2.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common/model
104+
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_2.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common
105105
mv coverage_sqldb_2.cover ../
106106
popd
107107
@@ -121,7 +121,7 @@ jobs:
121121
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set GLOBAL max_connections = 3000;"
122122
123123
pushd ./service
124-
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_3.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common/model
124+
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_3.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common
125125
mv coverage_sqldb_3.cover ../
126126
popd
127127
@@ -141,7 +141,7 @@ jobs:
141141
mysql -h127.0.0.1 -P3306 -uroot -p"polaris" -e "set GLOBAL max_connections = 3000;"
142142
143143
pushd ./auth/defaultauth
144-
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_1.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common/model
144+
go mod vendor && go test -v -timeout 80m -v -covermode=count -coverprofile=coverage_sqldb_1.cover -coverpkg=github.com/polarismesh/polaris/apiserver,github.com/polarismesh/polaris/auth/defaultauth,github.com/polarismesh/polaris/service,github.com/polarismesh/polaris/service/batch,github.com/polarismesh/polaris/service/healthcheck,github.com/polarismesh/polaris/cache,github.com/polarismesh/polaris/store/boltdb,github.com/polarismesh/polaris/store/mysql,github.com/polarismesh/polaris/plugin,github.com/polarismesh/polaris/config,github.com/polarismesh/polaris/common
145145
mv coverage_sqldb_1.cover ../../
146146
popd
147147

admin/job/delete_empty_service_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ func Test_DeleteEmptyAutoCreatedServiceJobConfigInitErr(t *testing.T) {
5555
}
5656

5757
func Test_FilterToDeletedServices(t *testing.T) {
58-
5958
job := deleteEmptyAutoCreatedServiceJob{}
6059
t1, _ := time.Parse("2006-01-02 15:04:05", "2023-03-20 12:01:00")
6160
t2, _ := time.Parse("2006-01-02 15:04:05", "2023-03-20 12:02:00")

apiserver/eurekaserver/eureka_suit_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
"github.com/polarismesh/polaris/plugin"
3636
_ "github.com/polarismesh/polaris/plugin/cmdb/memory"
3737
_ "github.com/polarismesh/polaris/plugin/discoverevent/local"
38-
_ "github.com/polarismesh/polaris/plugin/discoverstat/discoverlocal"
3938
_ "github.com/polarismesh/polaris/plugin/healthchecker/heartbeatmemory"
4039
_ "github.com/polarismesh/polaris/plugin/healthchecker/heartbeatredis"
4140
_ "github.com/polarismesh/polaris/plugin/history/logger"

apiserver/httpserver/maintain_access.go apiserver/httpserver/admin_access.go

+15-14
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import (
2828
apiservice "github.com/polarismesh/specification/source/go/api/v1/service_manage"
2929

3030
"github.com/polarismesh/polaris/admin"
31-
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/http"
31+
"github.com/polarismesh/polaris/apiserver/httpserver/docs"
32+
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/utils"
3233
api "github.com/polarismesh/polaris/common/api/v1"
3334
"github.com/polarismesh/polaris/common/model"
3435
"github.com/polarismesh/polaris/common/utils"
@@ -39,19 +40,19 @@ func (h *HTTPServer) GetAdminAccessServer() *restful.WebService {
3940
ws := new(restful.WebService)
4041
ws.Path("/maintain/v1").Consumes(restful.MIME_JSON).Produces(restful.MIME_JSON)
4142

42-
ws.Route(enrichGetServerConnectionsApiDocs(ws.GET("/apiserver/conn").To(h.GetServerConnections)))
43-
ws.Route(enrichGetServerConnStatsApiDocs(ws.GET("/apiserver/conn/stats").To(h.GetServerConnStats)))
44-
ws.Route(enrichCloseConnectionsApiDocs(ws.POST("apiserver/conn/close").To(h.CloseConnections)))
45-
ws.Route(enrichFreeOSMemoryApiDocs(ws.POST("/memory/free").To(h.FreeOSMemory)))
46-
ws.Route(enrichCleanInstanceApiDocs(ws.POST("/instance/clean").To(h.CleanInstance)))
47-
ws.Route(enrichBatchCleanInstancesApiDocs(ws.POST("/instance/batchclean").To(h.BatchCleanInstances)))
48-
ws.Route(enrichGetLastHeartbeatApiDocs(ws.GET("/instance/heartbeat").To(h.GetLastHeartbeat)))
49-
ws.Route(enrichGetLogOutputLevelApiDocs(ws.GET("/log/outputlevel").To(h.GetLogOutputLevel)))
50-
ws.Route(enrichSetLogOutputLevelApiDocs(ws.PUT("/log/outputlevel").To(h.SetLogOutputLevel)))
51-
ws.Route(enrichListLeaderElectionsApiDocs(ws.GET("/leaders").To(h.ListLeaderElections)))
52-
ws.Route(enrichReleaseLeaderElectionApiDocs(ws.POST("/leaders/release").To(h.ReleaseLeaderElection)))
53-
ws.Route(enrichGetCMDBInfoApiDocs(ws.GET("/cmdb/info").To(h.GetCMDBInfo)))
54-
ws.Route(enrichGetReportClientsApiDocs(ws.GET("/report/clients").To(h.GetReportClients)))
43+
ws.Route(docs.EnrichGetServerConnectionsApiDocs(ws.GET("/apiserver/conn").To(h.GetServerConnections)))
44+
ws.Route(docs.EnrichGetServerConnStatsApiDocs(ws.GET("/apiserver/conn/stats").To(h.GetServerConnStats)))
45+
ws.Route(docs.EnrichCloseConnectionsApiDocs(ws.POST("apiserver/conn/close").To(h.CloseConnections)))
46+
ws.Route(docs.EnrichFreeOSMemoryApiDocs(ws.POST("/memory/free").To(h.FreeOSMemory)))
47+
ws.Route(docs.EnrichCleanInstanceApiDocs(ws.POST("/instance/clean").To(h.CleanInstance)))
48+
ws.Route(docs.EnrichBatchCleanInstancesApiDocs(ws.POST("/instance/batchclean").To(h.BatchCleanInstances)))
49+
ws.Route(docs.EnrichGetLastHeartbeatApiDocs(ws.GET("/instance/heartbeat").To(h.GetLastHeartbeat)))
50+
ws.Route(docs.EnrichGetLogOutputLevelApiDocs(ws.GET("/log/outputlevel").To(h.GetLogOutputLevel)))
51+
ws.Route(docs.EnrichSetLogOutputLevelApiDocs(ws.PUT("/log/outputlevel").To(h.SetLogOutputLevel)))
52+
ws.Route(docs.EnrichListLeaderElectionsApiDocs(ws.GET("/leaders").To(h.ListLeaderElections)))
53+
ws.Route(docs.EnrichReleaseLeaderElectionApiDocs(ws.POST("/leaders/release").To(h.ReleaseLeaderElection)))
54+
ws.Route(docs.EnrichGetCMDBInfoApiDocs(ws.GET("/cmdb/info").To(h.GetCMDBInfo)))
55+
ws.Route(docs.EnrichGetReportClientsApiDocs(ws.GET("/report/clients").To(h.GetReportClients)))
5556
return ws
5657
}
5758

apiserver/httpserver/auth.go

+27-26
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,41 @@ import (
2626
apisecurity "github.com/polarismesh/specification/source/go/api/v1/security"
2727
apiservice "github.com/polarismesh/specification/source/go/api/v1/service_manage"
2828

29-
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/http"
29+
"github.com/polarismesh/polaris/apiserver/httpserver/docs"
30+
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/utils"
3031
api "github.com/polarismesh/polaris/common/api/v1"
3132
"github.com/polarismesh/polaris/common/utils"
3233
)
3334

3435
// GetAuthServer 运维接口
3536
func (h *HTTPServer) GetAuthServer(ws *restful.WebService) error {
36-
ws.Route(enrichAuthStatusApiDocs(ws.GET("/auth/status").To(h.AuthStatus)))
37+
ws.Route(docs.EnrichAuthStatusApiDocs(ws.GET("/auth/status").To(h.AuthStatus)))
3738
//
38-
ws.Route(enrichLoginApiDocs(ws.POST("/user/login").To(h.Login)))
39-
ws.Route(enrichGetUsersApiDocs(ws.GET("/users").To(h.GetUsers)))
40-
ws.Route(enrichCreateUsersApiDocs(ws.POST("/users").To(h.CreateUsers)))
41-
ws.Route(enrichDeleteUsersApiDocs(ws.POST("/users/delete").To(h.DeleteUsers)))
42-
ws.Route(enrichUpdateUserApiDocs(ws.PUT("/user").To(h.UpdateUser)))
43-
ws.Route(enrichUpdateUserPasswordApiDocs(ws.PUT("/user/password").To(h.UpdateUserPassword)))
44-
ws.Route(enrichGetUserTokenApiDocs(ws.GET("/user/token").To(h.GetUserToken)))
45-
ws.Route(enrichUpdateUserTokenApiDocs(ws.PUT("/user/token/status").To(h.UpdateUserToken)))
46-
ws.Route(enrichResetUserTokenApiDocs(ws.PUT("/user/token/refresh").To(h.ResetUserToken)))
39+
ws.Route(docs.EnrichLoginApiDocs(ws.POST("/user/login").To(h.Login)))
40+
ws.Route(docs.EnrichGetUsersApiDocs(ws.GET("/users").To(h.GetUsers)))
41+
ws.Route(docs.EnrichCreateUsersApiDocs(ws.POST("/users").To(h.CreateUsers)))
42+
ws.Route(docs.EnrichDeleteUsersApiDocs(ws.POST("/users/delete").To(h.DeleteUsers)))
43+
ws.Route(docs.EnrichUpdateUserApiDocs(ws.PUT("/user").To(h.UpdateUser)))
44+
ws.Route(docs.EnrichUpdateUserPasswordApiDocs(ws.PUT("/user/password").To(h.UpdateUserPassword)))
45+
ws.Route(docs.EnrichGetUserTokenApiDocs(ws.GET("/user/token").To(h.GetUserToken)))
46+
ws.Route(docs.EnrichUpdateUserTokenApiDocs(ws.PUT("/user/token/status").To(h.UpdateUserToken)))
47+
ws.Route(docs.EnrichResetUserTokenApiDocs(ws.PUT("/user/token/refresh").To(h.ResetUserToken)))
4748
//
48-
ws.Route(enrichCreateGroupApiDocs(ws.POST("/usergroup").To(h.CreateGroup)))
49-
ws.Route(enrichUpdateGroupsApiDocs(ws.PUT("/usergroups").To(h.UpdateGroups)))
50-
ws.Route(enrichGetGroupsApiDocs(ws.GET("/usergroups").To(h.GetGroups)))
51-
ws.Route(enrichDeleteGroupsApiDocs(ws.POST("/usergroups/delete").To(h.DeleteGroups)))
52-
ws.Route(enrichGetGroupApiDocs(ws.GET("/usergroup/detail").To(h.GetGroup)))
53-
ws.Route(enrichGetGroupTokenApiDocs(ws.GET("/usergroup/token").To(h.GetGroupToken)))
54-
ws.Route(enrichUpdateGroupTokenApiDocs(ws.PUT("/usergroup/token/status").To(h.UpdateGroupToken)))
55-
ws.Route(enrichResetGroupTokenApiDocs(ws.PUT("/usergroup/token/refresh").To(h.ResetGroupToken)))
56-
57-
ws.Route(enrichCreateStrategyApiDocs(ws.POST("/auth/strategy").To(h.CreateStrategy)))
58-
ws.Route(enrichGetStrategyApiDocs(ws.GET("/auth/strategy/detail").To(h.GetStrategy)))
59-
ws.Route(enrichUpdateStrategiesApiDocs(ws.PUT("/auth/strategies").To(h.UpdateStrategies)))
60-
ws.Route(enrichDeleteStrategiesApiDocs(ws.POST("/auth/strategies/delete").To(h.DeleteStrategies)))
61-
ws.Route(enrichGetStrategiesApiDocs(ws.GET("/auth/strategies").To(h.GetStrategies)))
62-
ws.Route(enrichGetPrincipalResourcesApiDocs(ws.GET("/auth/principal/resources").To(h.GetPrincipalResources)))
49+
ws.Route(docs.EnrichCreateGroupApiDocs(ws.POST("/usergroup").To(h.CreateGroup)))
50+
ws.Route(docs.EnrichUpdateGroupsApiDocs(ws.PUT("/usergroups").To(h.UpdateGroups)))
51+
ws.Route(docs.EnrichGetGroupsApiDocs(ws.GET("/usergroups").To(h.GetGroups)))
52+
ws.Route(docs.EnrichDeleteGroupsApiDocs(ws.POST("/usergroups/delete").To(h.DeleteGroups)))
53+
ws.Route(docs.EnrichGetGroupApiDocs(ws.GET("/usergroup/detail").To(h.GetGroup)))
54+
ws.Route(docs.EnrichGetGroupTokenApiDocs(ws.GET("/usergroup/token").To(h.GetGroupToken)))
55+
ws.Route(docs.EnrichUpdateGroupTokenApiDocs(ws.PUT("/usergroup/token/status").To(h.UpdateGroupToken)))
56+
ws.Route(docs.EnrichResetGroupTokenApiDocs(ws.PUT("/usergroup/token/refresh").To(h.ResetGroupToken)))
57+
58+
ws.Route(docs.EnrichCreateStrategyApiDocs(ws.POST("/auth/strategy").To(h.CreateStrategy)))
59+
ws.Route(docs.EnrichGetStrategyApiDocs(ws.GET("/auth/strategy/detail").To(h.GetStrategy)))
60+
ws.Route(docs.EnrichUpdateStrategiesApiDocs(ws.PUT("/auth/strategies").To(h.UpdateStrategies)))
61+
ws.Route(docs.EnrichDeleteStrategiesApiDocs(ws.POST("/auth/strategies/delete").To(h.DeleteStrategies)))
62+
ws.Route(docs.EnrichGetStrategiesApiDocs(ws.GET("/auth/strategies").To(h.GetStrategies)))
63+
ws.Route(docs.EnrichGetPrincipalResourcesApiDocs(ws.GET("/auth/principal/resources").To(h.GetPrincipalResources)))
6364

6465
return nil
6566
}

apiserver/httpserver/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ package httpserver
2020
import (
2121
"github.com/emicklei/go-restful/v3"
2222

23-
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/http"
23+
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/utils"
2424
)
2525

2626
func (h *HTTPServer) GetClientServer(ws *restful.WebService) error {

apiserver/httpserver/config_client_access.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
apimodel "github.com/polarismesh/specification/source/go/api/v1/model"
2626
"google.golang.org/protobuf/types/known/wrapperspb"
2727

28-
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/http"
28+
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/utils"
2929
api "github.com/polarismesh/polaris/common/api/v1"
3030
)
3131

apiserver/httpserver/config_console_access.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
apimodel "github.com/polarismesh/specification/source/go/api/v1/model"
2929
"go.uber.org/zap"
3030

31-
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/http"
31+
httpcommon "github.com/polarismesh/polaris/apiserver/httpserver/utils"
3232
api "github.com/polarismesh/polaris/common/api/v1"
3333
"github.com/polarismesh/polaris/common/utils"
3434
)

apiserver/httpserver/config_server.go

+22-20
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"fmt"
2222

2323
"github.com/emicklei/go-restful/v3"
24+
25+
"github.com/polarismesh/polaris/apiserver/httpserver/docs"
2426
)
2527

2628
const (
@@ -60,38 +62,38 @@ func (h *HTTPServer) GetConfigAccessServer(include []string) (*restful.WebServic
6062

6163
func (h *HTTPServer) bindConfigConsoleEndpoint(ws *restful.WebService) {
6264
// 配置文件组
63-
ws.Route(enrichCreateConfigFileGroupApiDocs(ws.POST("/configfilegroups").To(h.CreateConfigFileGroup)))
64-
ws.Route(enrichQueryConfigFileGroupsApiDocs(ws.GET("/configfilegroups").To(h.QueryConfigFileGroups)))
65-
ws.Route(enrichDeleteConfigFileGroupApiDocs(ws.DELETE("/configfilegroups").To(h.DeleteConfigFileGroup)))
66-
ws.Route(enrichUpdateConfigFileGroupApiDocs(ws.PUT("/configfilegroups").To(h.UpdateConfigFileGroup)))
65+
ws.Route(docs.EnrichCreateConfigFileGroupApiDocs(ws.POST("/configfilegroups").To(h.CreateConfigFileGroup)))
66+
ws.Route(docs.EnrichQueryConfigFileGroupsApiDocs(ws.GET("/configfilegroups").To(h.QueryConfigFileGroups)))
67+
ws.Route(docs.EnrichDeleteConfigFileGroupApiDocs(ws.DELETE("/configfilegroups").To(h.DeleteConfigFileGroup)))
68+
ws.Route(docs.EnrichUpdateConfigFileGroupApiDocs(ws.PUT("/configfilegroups").To(h.UpdateConfigFileGroup)))
6769

6870
// 配置文件
69-
ws.Route(enrichCreateConfigFileApiDocs(ws.POST("/configfiles").To(h.CreateConfigFile)))
70-
ws.Route(enrichGetConfigFileApiDocs(ws.GET("/configfiles").To(h.GetConfigFile)))
71-
ws.Route(enrichQueryConfigFilesByGroupApiDocs(ws.GET("/configfiles/by-group").To(h.QueryConfigFilesByGroup)))
72-
ws.Route(enrichSearchConfigFileApiDocs(ws.GET("/configfiles/search").To(h.SearchConfigFile)))
73-
ws.Route(enrichUpdateConfigFileApiDocs(ws.PUT("/configfiles").To(h.UpdateConfigFile)))
74-
ws.Route(enrichDeleteConfigFileApiDocs(ws.DELETE("/configfiles").To(h.DeleteConfigFile)))
75-
ws.Route(enrichBatchDeleteConfigFileApiDocs(ws.POST("/configfiles/batchdelete").To(h.BatchDeleteConfigFile)))
76-
ws.Route(enrichExportConfigFileApiDocs(ws.POST("/configfiles/export").To(h.ExportConfigFile)))
77-
ws.Route(enrichImportConfigFileApiDocs(ws.POST("/configfiles/import").To(h.ImportConfigFile)))
71+
ws.Route(docs.EnrichCreateConfigFileApiDocs(ws.POST("/configfiles").To(h.CreateConfigFile)))
72+
ws.Route(docs.EnrichGetConfigFileApiDocs(ws.GET("/configfiles").To(h.GetConfigFile)))
73+
ws.Route(docs.EnrichQueryConfigFilesByGroupApiDocs(ws.GET("/configfiles/by-group").To(h.QueryConfigFilesByGroup)))
74+
ws.Route(docs.EnrichSearchConfigFileApiDocs(ws.GET("/configfiles/search").To(h.SearchConfigFile)))
75+
ws.Route(docs.EnrichUpdateConfigFileApiDocs(ws.PUT("/configfiles").To(h.UpdateConfigFile)))
76+
ws.Route(docs.EnrichDeleteConfigFileApiDocs(ws.DELETE("/configfiles").To(h.DeleteConfigFile)))
77+
ws.Route(docs.EnrichBatchDeleteConfigFileApiDocs(ws.POST("/configfiles/batchdelete").To(h.BatchDeleteConfigFile)))
78+
ws.Route(docs.EnrichExportConfigFileApiDocs(ws.POST("/configfiles/export").To(h.ExportConfigFile)))
79+
ws.Route(docs.EnrichImportConfigFileApiDocs(ws.POST("/configfiles/import").To(h.ImportConfigFile)))
7880

7981
// 配置文件发布
80-
ws.Route(enrichPublishConfigFileApiDocs(ws.POST("/configfiles/release").To(h.PublishConfigFile)))
81-
ws.Route(enrichGetConfigFileReleaseApiDocs(ws.GET("/configfiles/release").To(h.GetConfigFileRelease)))
82+
ws.Route(docs.EnrichPublishConfigFileApiDocs(ws.POST("/configfiles/release").To(h.PublishConfigFile)))
83+
ws.Route(docs.EnrichGetConfigFileReleaseApiDocs(ws.GET("/configfiles/release").To(h.GetConfigFileRelease)))
8284

8385
// 配置文件发布历史
84-
ws.Route(enrichGetConfigFileReleaseHistoryApiDocs(ws.GET("/configfiles/releasehistory").
86+
ws.Route(docs.EnrichGetConfigFileReleaseHistoryApiDocs(ws.GET("/configfiles/releasehistory").
8587
To(h.GetConfigFileReleaseHistory)))
8688

8789
// config file template
88-
ws.Route(enrichGetAllConfigFileTemplatesApiDocs(ws.GET("/configfiletemplates").To(h.GetAllConfigFileTemplates)))
89-
ws.Route(enrichCreateConfigFileTemplateApiDocs(ws.POST("/configfiletemplates").To(h.CreateConfigFileTemplate)))
90+
ws.Route(docs.EnrichGetAllConfigFileTemplatesApiDocs(ws.GET("/configfiletemplates").To(h.GetAllConfigFileTemplates)))
91+
ws.Route(docs.EnrichCreateConfigFileTemplateApiDocs(ws.POST("/configfiletemplates").To(h.CreateConfigFileTemplate)))
9092
}
9193

9294
func (h *HTTPServer) bindConfigClientEndpoint(ws *restful.WebService) {
93-
ws.Route(enrichGetConfigFileForClientApiDocs(ws.GET("/GetConfigFile").To(h.getConfigFile)))
94-
ws.Route(enrichWatchConfigFileForClientApiDocs(ws.POST("/WatchConfigFile").To(h.watchConfigFile)))
95+
ws.Route(docs.EnrichGetConfigFileForClientApiDocs(ws.GET("/GetConfigFile").To(h.getConfigFile)))
96+
ws.Route(docs.EnrichWatchConfigFileForClientApiDocs(ws.POST("/WatchConfigFile").To(h.watchConfigFile)))
9597
}
9698

9799
// StopConfigServer 停止配置中心模块

0 commit comments

Comments
 (0)