简化数据库查询代码

This commit is contained in:
刘祥超
2020-12-09 20:44:05 +08:00
parent 415539df93
commit 82543e9fde
56 changed files with 164 additions and 141 deletions

View File

@@ -111,7 +111,7 @@ func (this *HTTPFirewallPolicyDAO) CreateFirewallPolicy(isOn bool, name string,
if len(outboundJSON) > 0 {
op.Outbound = outboundJSON
}
_, err := this.Save(op)
err := this.Save(op)
return types.Int64(op.Id), err
}
@@ -132,7 +132,7 @@ func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicyInboundAndOutbound(policy
} else {
op.Outbound = "null"
}
_, err := this.Save(op)
err := this.Save(op)
return err
}
@@ -148,7 +148,7 @@ func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicyInbound(policyId int64, i
} else {
op.Inbound = "null"
}
_, err := this.Save(op)
err := this.Save(op)
return err
}
@@ -175,7 +175,7 @@ func (this *HTTPFirewallPolicyDAO) UpdateFirewallPolicy(policyId int64, isOn boo
if len(blockOptionsJSON) > 0 {
op.BlockOptions = blockOptionsJSON
}
_, err := this.Save(op)
err := this.Save(op)
return err
}