waf.go 572 Bytes
Newer Older
qiuqunfeng's avatar
qiuqunfeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
package api

import (
	"github.com/gin-gonic/gin"
	"gitlab.com/tensorsecurity-rd/waf-console/internal/controller"
	"gitlab.com/tensorsecurity-rd/waf-console/pkg/generated/clientset/versioned"
	"gorm.io/gorm"
)

func SetWafRouter(e *gin.Engine, client *versioned.Clientset, db *gorm.DB) {
	v1 := e.Group("v1/api")

	wafController := controller.NewWafController(client, db)
	v1.GET("waf/:gateway_name", wafController.Waf)
	v1.POST("waf", wafController.CreateWaf)
qiuqunfeng's avatar
commit  
qiuqunfeng committed
16
	v1.PUT("mode", wafController.UpdateMode)
qiuqunfeng's avatar
commit  
qiuqunfeng committed
17
	v1.POST("debug/savecatagory", wafController.SaveRuleCategoryToDB)
qiuqunfeng's avatar
qiuqunfeng committed
18
}