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)
}
