evaluation_project_router.go 1.1 KB
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-project",
		web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
		web.NSRouter("/", &controllers.ProjectController{}, "Post:CreateProject"),
		web.NSRouter("/", &controllers.ProjectController{}, "Put:UpdateProject"),
		web.NSRouter("/", &controllers.ProjectController{}, "Delete:RemoveProject"),
		web.NSRouter("/:Id", &controllers.ProjectController{}, "Get:GetProject"),
		web.NSRouter("/list", &controllers.ProjectController{}, "Post:ListProject"),
		web.NSRouter("/detail", &controllers.ProjectController{}, "Put:UpdateProjectForTemplate"),
		web.NSRouter("/check-recipients", &controllers.ProjectController{}, "Post:CheckRecipients"),
		web.NSRouter("/copy", &controllers.ProjectController{}, "Post:CopyProject"),
	)
	web.AddNamespace(ns)
}