From 185a7fdb4be0202b1881e4f90afa006729264b65 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 13 Jul 2021 14:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=A7=84=E5=88=99=E6=94=B9?= =?UTF-8?q?=E6=88=90=E8=B7=AF=E7=94=B1=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/db/models/http_location_dao.go | 4 ++-- internal/db/models/http_location_model.go | 2 +- internal/db/models/http_web_dao.go | 4 ++-- internal/db/models/http_web_model.go | 4 ++-- internal/rpc/services/service_http_location.go | 10 +++++----- internal/rpc/services/service_http_web.go | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/db/models/http_location_dao.go b/internal/db/models/http_location_dao.go index 3c64868f..222e2350 100644 --- a/internal/db/models/http_location_dao.go +++ b/internal/db/models/http_location_dao.go @@ -83,7 +83,7 @@ func (this *HTTPLocationDAO) FindHTTPLocationName(tx *dbs.Tx, id int64) (string, FindStringCol("") } -// CreateLocation 创建路径规则 +// CreateLocation 创建路由规则 func (this *HTTPLocationDAO) CreateLocation(tx *dbs.Tx, parentId int64, name string, pattern string, description string, isBreak bool, condsJSON []byte) (int64, error) { op := NewHTTPLocationOperator() op.IsOn = true @@ -105,7 +105,7 @@ func (this *HTTPLocationDAO) CreateLocation(tx *dbs.Tx, parentId int64, name str return types.Int64(op.Id), nil } -// UpdateLocation 修改路径规则 +// UpdateLocation 修改路由规则 func (this *HTTPLocationDAO) UpdateLocation(tx *dbs.Tx, locationId int64, name string, pattern string, description string, isOn bool, isBreak bool, condsJSON []byte) error { if locationId <= 0 { return errors.New("invalid locationId") diff --git a/internal/db/models/http_location_model.go b/internal/db/models/http_location_model.go index abf4c30a..22895524 100644 --- a/internal/db/models/http_location_model.go +++ b/internal/db/models/http_location_model.go @@ -1,6 +1,6 @@ package models -// 路径规则配置 +// HTTPLocation 路由规则配置 type HTTPLocation struct { Id uint32 `field:"id"` // ID TemplateId uint32 `field:"templateId"` // 模版ID diff --git a/internal/db/models/http_web_dao.go b/internal/db/models/http_web_dao.go index 6f74eda5..54df8dea 100644 --- a/internal/db/models/http_web_dao.go +++ b/internal/db/models/http_web_dao.go @@ -247,7 +247,7 @@ func (this *HTTPWebDAO) ComposeWebConfig(tx *dbs.Tx, webId int64) (*serverconfig } } - // 路径规则 + // 路由规则 if IsNotNull(web.Locations) { refs := []*serverconfigs.HTTPLocationRef{} err = json.Unmarshal([]byte(web.Locations), &refs) @@ -563,7 +563,7 @@ func (this *HTTPWebDAO) UpdateWebFirewall(tx *dbs.Tx, webId int64, firewallJSON return this.NotifyUpdate(tx, webId) } -// UpdateWebLocations 更改路径规则配置 +// UpdateWebLocations 更改路由规则配置 func (this *HTTPWebDAO) UpdateWebLocations(tx *dbs.Tx, webId int64, locationsJSON []byte) error { if webId <= 0 { return errors.New("invalid webId") diff --git a/internal/db/models/http_web_model.go b/internal/db/models/http_web_model.go index 65968faf..7249ed72 100644 --- a/internal/db/models/http_web_model.go +++ b/internal/db/models/http_web_model.go @@ -23,7 +23,7 @@ type HTTPWeb struct { Gzip string `field:"gzip"` // Gzip配置 Cache string `field:"cache"` // 缓存配置 Firewall string `field:"firewall"` // 防火墙设置 - Locations string `field:"locations"` // 路径规则配置 + Locations string `field:"locations"` // 路由规则配置 Websocket string `field:"websocket"` // Websocket设置 RewriteRules string `field:"rewriteRules"` // 重写规则配置 HostRedirects string `field:"hostRedirects"` // 域名跳转 @@ -53,7 +53,7 @@ type HTTPWebOperator struct { Gzip interface{} // Gzip配置 Cache interface{} // 缓存配置 Firewall interface{} // 防火墙设置 - Locations interface{} // 路径规则配置 + Locations interface{} // 路由规则配置 Websocket interface{} // Websocket设置 RewriteRules interface{} // 重写规则配置 HostRedirects interface{} // 域名跳转 diff --git a/internal/rpc/services/service_http_location.go b/internal/rpc/services/service_http_location.go index 7eaeed91..94e5390a 100644 --- a/internal/rpc/services/service_http_location.go +++ b/internal/rpc/services/service_http_location.go @@ -9,12 +9,12 @@ import ( "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" ) -// HTTPLocationService 路径规则相关服务 +// HTTPLocationService 路由规则相关服务 type HTTPLocationService struct { BaseService } -// CreateHTTPLocation 创建路径规则 +// CreateHTTPLocation 创建路由规则 func (this *HTTPLocationService) CreateHTTPLocation(ctx context.Context, req *pb.CreateHTTPLocationRequest) (*pb.CreateHTTPLocationResponse, error) { // 校验请求 _, err := this.ValidateAdmin(ctx, 0) @@ -32,7 +32,7 @@ func (this *HTTPLocationService) CreateHTTPLocation(ctx context.Context, req *pb return &pb.CreateHTTPLocationResponse{LocationId: locationId}, nil } -// UpdateHTTPLocation 修改路径规则 +// UpdateHTTPLocation 修改路由规则 func (this *HTTPLocationService) UpdateHTTPLocation(ctx context.Context, req *pb.UpdateHTTPLocationRequest) (*pb.RPCSuccess, error) { // 校验请求 _, err := this.ValidateAdmin(ctx, 0) @@ -50,7 +50,7 @@ func (this *HTTPLocationService) UpdateHTTPLocation(ctx context.Context, req *pb return this.Success() } -// FindEnabledHTTPLocationConfig 查找路径规则配置 +// FindEnabledHTTPLocationConfig 查找路由规则配置 func (this *HTTPLocationService) FindEnabledHTTPLocationConfig(ctx context.Context, req *pb.FindEnabledHTTPLocationConfigRequest) (*pb.FindEnabledHTTPLocationConfigResponse, error) { // 校验请求 _, err := this.ValidateAdmin(ctx, 0) @@ -71,7 +71,7 @@ func (this *HTTPLocationService) FindEnabledHTTPLocationConfig(ctx context.Conte return &pb.FindEnabledHTTPLocationConfigResponse{LocationJSON: configJSON}, nil } -// DeleteHTTPLocation 删除路径规则 +// DeleteHTTPLocation 删除路由规则 func (this *HTTPLocationService) DeleteHTTPLocation(ctx context.Context, req *pb.DeleteHTTPLocationRequest) (*pb.RPCSuccess, error) { // 校验请求 _, err := this.ValidateAdmin(ctx, 0) diff --git a/internal/rpc/services/service_http_web.go b/internal/rpc/services/service_http_web.go index 56c48cba..4c7a5177 100644 --- a/internal/rpc/services/service_http_web.go +++ b/internal/rpc/services/service_http_web.go @@ -376,7 +376,7 @@ func (this *HTTPWebService) UpdateHTTPWebFirewall(ctx context.Context, req *pb.U return this.Success() } -// UpdateHTTPWebLocations 更改路径规则设置 +// UpdateHTTPWebLocations 更改路由规则设置 func (this *HTTPWebService) UpdateHTTPWebLocations(ctx context.Context, req *pb.UpdateHTTPWebLocationsRequest) (*pb.RPCSuccess, error) { // 校验请求 _, userId, err := this.ValidateAdminAndUser(ctx, 0, 0)