审查视图

pkg/port/beego/routers/evaluation_template_router.go 1.1 KB
1 2 3 4 5 6 7 8 9 10 11
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-template",
郑周 authored
12
		web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
13 14 15 16 17 18
		web.NSRouter("/", &controllers.TemplateController{}, "Post:CreateTemplate"),
		web.NSRouter("/", &controllers.TemplateController{}, "Put:UpdateTemplate"),
		web.NSRouter("/", &controllers.TemplateController{}, "Delete:RemoveTemplate"),
		web.NSRouter("/:Id", &controllers.TemplateController{}, "Get:GetTemplate"),
		web.NSRouter("/list", &controllers.TemplateController{}, "Post:ListTemplate"),
		web.NSRouter("/list-enable", &controllers.TemplateController{}, "Post:ListEnableTemplate"),
郑周 authored
19
		web.NSRouter("/copy", &controllers.TemplateController{}, "Post:CopyTemplate"),
郑周 authored
20
		web.NSRouter("/state", &controllers.TemplateController{}, "Post:StateTemplate"),
21 22 23
	)
	web.AddNamespace(ns)
}