mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-07 10:40:25 +08:00
域名服务集群创建时可以选择开启访问日志
This commit is contained in:
@@ -73,9 +73,14 @@ func (this *NSClusterDAO) FindEnabledNSClusterName(tx *dbs.Tx, id int64) (string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CreateCluster 创建集群
|
// CreateCluster 创建集群
|
||||||
func (this *NSClusterDAO) CreateCluster(tx *dbs.Tx, name string) (int64, error) {
|
func (this *NSClusterDAO) CreateCluster(tx *dbs.Tx, name string, accessLogRefJSON []byte) (int64, error) {
|
||||||
op := NewNSClusterOperator()
|
op := NewNSClusterOperator()
|
||||||
op.Name = name
|
op.Name = name
|
||||||
|
|
||||||
|
if len(accessLogRefJSON) > 0 {
|
||||||
|
op.AccessLog = accessLogRefJSON
|
||||||
|
}
|
||||||
|
|
||||||
op.IsOn = true
|
op.IsOn = true
|
||||||
op.State = NSClusterStateEnabled
|
op.State = NSClusterStateEnabled
|
||||||
return this.SaveInt64(tx, op)
|
return this.SaveInt64(tx, op)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func (this *NSClusterService) CreateNSCluster(ctx context.Context, req *pb.Creat
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
var tx = this.NullTx()
|
var tx = this.NullTx()
|
||||||
clusterId, err := nameservers.SharedNSClusterDAO.CreateCluster(tx, req.Name)
|
clusterId, err := nameservers.SharedNSClusterDAO.CreateCluster(tx, req.Name, req.AccessLogJSON)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user