mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 22:46:38 +08:00
[新增] 添加自动 IP 组规则测试功能,支持在保存前验证 Expr 规则命中情况
This commit is contained in:
@@ -199,6 +199,19 @@ func SyncWAFIPGroup(c *gin.Context) {
|
||||
respondSuccess(c, result)
|
||||
}
|
||||
|
||||
func TestWAFIPGroupAutoConfig(c *gin.Context) {
|
||||
var input service.WAFIPGroupAutoTestInput
|
||||
if !bindJSON(c, &input) {
|
||||
return
|
||||
}
|
||||
result, err := service.TestWAFIPGroupAutoConfig(input)
|
||||
if err != nil {
|
||||
respondFailure(c, err.Error())
|
||||
return
|
||||
}
|
||||
respondSuccess(c, result)
|
||||
}
|
||||
|
||||
func parseUintPathParam(c *gin.Context, name string) (uint, bool) {
|
||||
id, err := strconv.ParseUint(c.Param(name), 10, 64)
|
||||
if err != nil || id == 0 {
|
||||
|
||||
Reference in New Issue
Block a user