审查视图

pkg/port/beego/routers/role_router.go 796 字节
郑周 authored
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/role",
郑周 authored
12
		web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
郑周 authored
13 14
		//web.NSRouter("/", &controllers.RoleController{}, "Post:CreateRole"),
		//web.NSRouter("/", &controllers.RoleController{}, "Put:UpdateRole"),
郑周 authored
15
		web.NSRouter("/", &controllers.RoleController{}, "Delete:RemoveRole"),
郑周 authored
16 17 18 19 20
		//web.NSRouter("/:Id", &controllers.RoleController{}, "Get:GetRole"),
		web.NSRouter("/all", &controllers.RoleController{}, "Post:ListForUserRole"),
	)
	web.AddNamespace(ns)
}