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