permission_router.go 604 字节
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/permission",
		web.NSBefore(filters.AllowCors(), middlewares.CheckAdminToken()),
		web.NSRouter("/update", &controllers.PermissionController{}, "Put:UpdatePermission"),
		web.NSRouter("/get", &controllers.PermissionController{}, "Post:GetPermission"),
	)
	web.AddNamespace(ns)
}