service.xpcool.com/internal/table/admin_menu.go
夏犀麟 8fdb25e6bd feat(admin): 后台登录/菜单/按钮级权限/RBAC管理与服务器日志监控
后端:
- 种子数据:超级管理员(admin/admin123)、super_admin 角色、22 条菜单(含按钮权限码)、角色绑定
- admin_menu 扩展 icon/component/hidden 字段(003_schema_ext.sql),手动补齐 entity/do/table
- auth 扩展:/auth/info、/auth/codes(仅登录),路由拆分公开/Profile/受保护三组
- 菜单路由:/menu/routes 返回 vben backend 动态路由树(按角色过滤、排序)
- RBAC 管理:/admins、/roles、/menus CRUD(含角色绑定、重置密码、菜单授权)
- 日志监控:/log/files、/log/tail(尾部读取+关键词过滤+路径穿越防护)
- 安全加固:接口鉴权改为「方法+路径→权限码」自动映射,杜绝任意权限码越权
- 修复:gf v2.10.2  不自动替换→cmd 注入;MySQL driver 需显式引入 contrib
- 全链路冒烟测试通过(含越权拒绝 30003)
2026-08-24 22:35:54 +08:00

164 lines
3.2 KiB
Go

// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package table
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
)
// AdminMenu defines the fields of table "admin_menu" with their properties.
// This map is used internally by GoFrame ORM to understand table structure.
var AdminMenu = map[string]*gdb.TableField{
"id": {
Index: 0,
Name: "id",
Type: "bigint unsigned",
Null: false,
Key: "PRI",
Default: nil,
Extra: "auto_increment",
Comment: "",
},
"parent_id": {
Index: 1,
Name: "parent_id",
Type: "bigint unsigned",
Null: false,
Key: "MUL",
Default: "0",
Extra: "",
Comment: "",
},
"name": {
Index: 2,
Name: "name",
Type: "varchar(64)",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"icon": {
Index: 3,
Name: "icon",
Type: "varchar(64)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "menu icon (iconify name)",
},
"type": {
Index: 4,
Name: "type",
Type: "tinyint",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "1 menu,2 api",
},
"path": {
Index: 5,
Name: "path",
Type: "varchar(255)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "",
},
"component": {
Index: 6,
Name: "component",
Type: "varchar(255)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "vue component path, empty for top-level dir",
},
"permission": {
Index: 7,
Name: "permission",
Type: "varchar(128)",
Null: false,
Key: "UNI",
Default: "",
Extra: "",
Comment: "",
},
"sort": {
Index: 8,
Name: "sort",
Type: "int",
Null: false,
Key: "",
Default: "0",
Extra: "",
Comment: "",
},
"status": {
Index: 9,
Name: "status",
Type: "tinyint",
Null: false,
Key: "",
Default: "1",
Extra: "",
Comment: "",
},
"hidden": {
Index: 10,
Name: "hidden",
Type: "tinyint",
Null: false,
Key: "",
Default: "0",
Extra: "",
Comment: "0 show,1 hide in menu",
},
"created_at": {
Index: 11,
Name: "created_at",
Type: "datetime",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"updated_at": {
Index: 12,
Name: "updated_at",
Type: "datetime",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"deleted_at": {
Index: 13,
Name: "deleted_at",
Type: "datetime",
Null: true,
Key: "MUL",
Default: nil,
Extra: "",
Comment: "",
},
}
// SetAdminMenuTableFields registers the table fields definition to the database instance.
// db: database instance that implements gdb.DB interface.
// schema: optional schema/namespace name, especially for databases that support schemas.
func SetAdminMenuTableFields(ctx context.Context, db gdb.DB, schema ...string) error {
return db.GetCore().SetTableFields(ctx, "admin_menu", AdminMenu, schema...)
}