路径规则改成路由规则

This commit is contained in:
刘祥超
2021-07-13 14:28:06 +08:00
parent daf8257a1f
commit 9669c0ddda
23 changed files with 69 additions and 43 deletions

View File

@@ -12,7 +12,7 @@ import (
"strings"
)
// 创建路规则
// CreateAction 创建路规则
type CreateAction struct {
actionutils.ParentAction
}

View File

@@ -11,7 +11,7 @@ import (
"strings"
)
// 路径规则详情
// IndexAction 路由规则详情
type IndexAction struct {
actionutils.ParentAction
}
@@ -52,11 +52,11 @@ func (this *IndexAction) RunPost(params struct {
Must *actions.Must
}) {
defer this.CreateLogInfo("修改路规则 %d 设置", params.LocationId)
defer this.CreateLogInfo("修改路规则 %d 设置", params.LocationId)
params.Must.
Field("pattern", params.Pattern).
Require("请输入路匹配规则")
Require("请输入路匹配规则")
// 校验正则
if params.PatternType == serverconfigs.HTTPLocationPatternTypeRegexp {

View File

@@ -7,7 +7,7 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
)
// 查找路规则配置
// FindLocationConfig 查找路规则配置
func FindLocationConfig(parentAction *actionutils.ParentAction, locationId int64) (locationConfig *serverconfigs.HTTPLocationConfig, isOk bool) {
locationConfigResp, err := parentAction.RPC().HTTPLocationRPC().FindEnabledHTTPLocationConfig(parentAction.AdminContext(), &pb.FindEnabledHTTPLocationConfigRequest{LocationId: locationId})
if err != nil {

View File

@@ -52,7 +52,7 @@ func (this *SettingAction) RunPost(params struct {
Must *actions.Must
}) {
defer this.CreateLogInfo("修改路规则 %d 的反向代理设置", params.LocationId)
defer this.CreateLogInfo("修改路规则 %d 的反向代理设置", params.LocationId)
// TODO 校验配置