56 lines
1.2 KiB
Go
56 lines
1.2 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 (
|
|
// PearAdmin 配置
|
|
PearAdmin = "m:pear_json"
|
|
|
|
// AllCategories 所有类别
|
|
AllCategories = "m:category:all"
|
|
// AllCategorySimple 所有类别 简单信息
|
|
AllCategorySimple = "m:category_simple:all"
|
|
// ListCategoriesByParentID 类别列表 根据 父id 获取
|
|
ListCategoriesByParentID = "m:category:parent_id:%d"
|
|
|
|
// AllDepartments 所有部门
|
|
AllDepartments = "m:department:all"
|
|
|
|
// AllMenus 所有菜单
|
|
AllMenus = "m:menus:all"
|
|
// RecursiveMenus 递归菜单
|
|
RecursiveMenus = "m:rec_menus:%d"
|
|
// AdminMenus 根据用户ID获取菜单
|
|
AdminMenus = "m:admin_menus:%d"
|
|
// OwnerMenus 登陆用户的菜单
|
|
OwnerMenus = "m:owner_menus:%d"
|
|
// OwnerMenusMap 登陆用户的菜单
|
|
OwnerMenusMap = "m:owner_menus_map:%d"
|
|
|
|
// AllRoles 所有角色
|
|
AllRoles = "m:role:all"
|
|
)
|
|
|
|
func GetManageKey(_ context.Context, key string, arg ...any) string {
|
|
key = fmt.Sprintf(key, arg...)
|
|
return key
|
|
}
|