2025-04-01 14:13:41 +08:00

56 lines
1.1 KiB
Go

package know
import (
"context"
"fmt"
)
const (
CustomerCategory = "customer_category"
CustomerSource = "customer_source"
BudgetCategory = "budget_category"
IncomeBank = "income_bank"
IncomeCategory = "income_category"
ExpenseCategory = "expense_category"
CookieName = "authorize"
StoreName = "authorize_user"
)
var (
// pear admin 配置
PearAdmin = "m:pearjson"
// 所有类别
AllCategories = "m:category:all"
// 所有类别 简单信息
AllCategorySimple = "m:categorysimple:all"
// 类别列表 根据 父id 获取
ListCategoriesByParentID = "m:category:parent_id:%d"
// 所有部门
AllDepartments = "m:department:all"
// 所有菜单
AllMenus = "m:menus:all"
// 递归菜单
RecursiveMenus = "m:rec_menus:%d"
// 根据用户ID获取菜单
AdminMenus = "m:admin_menus:%d"
// 登陆用户的菜单
OwnerMenus = "m:owner_menus:%d"
// 登陆用户的菜单
OwnerMenusMap = "m:owner_menus_map:%d"
// 所有角色
AllRoles = "m:role:all"
)
func GetManageKey(ctx context.Context, key string, arg ...any) string {
key = fmt.Sprintf(key, arg...)
return key
}