mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2026-01-06 23:45:47 +08:00
路径规则改成路由规则
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package models
|
||||
|
||||
// 路径规则配置
|
||||
// HTTPLocation 路由规则配置
|
||||
type HTTPLocation struct {
|
||||
Id uint32 `field:"id"` // ID
|
||||
TemplateId uint32 `field:"templateId"` // 模版ID
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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{} // 域名跳转
|
||||
|
||||
Reference in New Issue
Block a user