evaluation_rule_router.go
889 字节
package routers
import (
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/web/beego/filters"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
func init() {
ns := web.NewNamespace("/v1/evaluation-rule",
web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
web.NSRouter("/", &controllers.RuleController{}, "Post:CreateRule"),
web.NSRouter("/", &controllers.RuleController{}, "Put:UpdateRule"),
web.NSRouter("/", &controllers.RuleController{}, "Delete:RemoveRule"),
web.NSRouter("/:Id", &controllers.RuleController{}, "Get:GetRule"),
web.NSRouter("/list", &controllers.RuleController{}, "Post:ListRuleRelCreator"),
web.NSRouter("/list-creator", &controllers.RuleController{}, "Post:ListCreator"),
)
web.AddNamespace(ns)
}