evaluation_cycle_router.go 895 字节
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-cycle",
		web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
		web.NSRouter("/", &controllers.CycleController{}, "Post:CreateCycle"),
		web.NSRouter("/", &controllers.CycleController{}, "Put:UpdateCycle"),
		web.NSRouter("/", &controllers.CycleController{}, "Delete:RemoveCycle"),
		web.NSRouter("/:Id", &controllers.CycleController{}, "Get:GetCycle"),
		web.NSRouter("/list", &controllers.CycleController{}, "Post:ListCycle"),
		web.NSRouter("/statistic", &controllers.CycleController{}, "Post:StatisticCycleUser"),
	)
	web.AddNamespace(ns)
}