evaluation_rule_router.go 800 字节
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.CheckToken()),
		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.AddNamespace(ns)
}