role_router.go 2.1 KB
package routers

import (
	"github.com/beego/beego/v2/server/web"
	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/port/beego/controllers"
)

func init() {
	web.Router("/role/", &controllers.RoleController{}, "Post:CreateRole")
	web.Router("/role/:roleId", &controllers.RoleController{}, "Put:UpdateRole")
	web.Router("/role/:roleId", &controllers.RoleController{}, "Get:GetRole")
	web.Router("/role/:roleId", &controllers.RoleController{}, "Delete:RemoveRole")
	web.Router("/role/search", &controllers.RoleController{}, "Post:SearchRole")
	web.Router("/role/:roleId/related-user", &controllers.RoleController{}, "Get:GetRoleRelatedUsers")
	web.Router("/role/:roleId/related-user", &controllers.RoleController{}, "Post:RoleRelatedUsers")
	web.Router("/role/:roleId/access-menus", &controllers.RoleController{}, "Get:GetRoleAccessMenus")
	web.Router("/role/:roleId/access-menus", &controllers.RoleController{}, "Put:UpdateRoleAccessMenus")
	web.Router("/role/assign", &controllers.RoleController{}, "Post:AssginRoleToUsers")
	web.Router("/role/unassign", &controllers.RoleController{}, "Post:UnAssginRoleToUsers")
	web.Router("/role/batch-delete", &controllers.RoleController{}, "Post:BatchDeleteRole")

	web.Router("/v1/web/roles/", &controllers.RoleController{}, "Post:CreateRole")
	web.Router("/v1/web/roles/:roleId", &controllers.RoleController{}, "Put:UpdateRole")
	web.Router("/v1/web/roles/:roleId", &controllers.RoleController{}, "Get:GetRole")
	web.Router("/v1/web/roles/:roleId", &controllers.RoleController{}, "Delete:RemoveRole")
	web.Router("/v1/web/roles/search", &controllers.RoleController{}, "Post:WebSearchRole")
	web.Router("/v1/web/roles/:roleId/related-user", &controllers.RoleController{}, "Get:GetRoleRelatedUsers")
	web.Router("/v1/web/roles/:roleId/access-menus", &controllers.RoleController{}, "Get:GetRoleAccessMenus")
	web.Router("/v1/web/roles/:roleId/access-menus", &controllers.RoleController{}, "Put:UpdateRoleAccessMenus")
	web.Router("/v1/web/roles/assign", &controllers.RoleController{}, "Post:AssginRoleToUsers")
	web.Router("/v1/web/roles/unassign", &controllers.RoleController{}, "Post:UnAssginRoleToUsers")
}