service.xpcool.com/internal/table/user.go
夏犀麟 4aca0c7f6f
Some checks failed
Build and Deploy (service.xpcool.com) / build-and-deploy (push) Failing after 5m7s
feat(house): 实现看房模块后端功能
- 新增 9 张房屋相关数据表(社区/楼宇/房源/价格快照/交易/设施/社区设施/学区/偏好)
- 添加菜单权限种子数据并绑定超级管理员角色
- 生成 DAO 层代码和实体对象
- 实现房屋模块 API 接口(社区/房源/看板)和控制器服务层
- 支持多平台软关联匹配、笋盘标记和低可信度标记功能
- 更新超级管理员账号为 xxcool/xxCool@2026
- 调整 RBAC 菜单结构,移除管理员管理功能,新增日志管理菜单
- 修复 RBAC 安全漏洞,确保禁用角色权限失效
- 重构认证模块,将登录相关接口迁移到统一包结构下
- 移除废弃的管理模块和工具类接口定义
- 为通用工具包添加中文注释和文档说明
2026-08-26 23:42:38 +08:00

154 lines
2.9 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// =================================================================================
// 本文件由 GoFrame CLI 工具自动生成,可按需修改。
// =================================================================================
package table
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
)
// User 定义表 "user" 的字段及其属性。
// 该映射由 GoFrame ORM 内部使用,用于理解表结构。
var User = map[string]*gdb.TableField{
"id": {
Index: 0,
Name: "id",
Type: "bigint unsigned",
Null: false,
Key: "PRI",
Default: nil,
Extra: "auto_increment",
Comment: "",
},
"union_id": {
Index: 1,
Name: "union_id",
Type: "varchar(64)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "",
},
"open_id": {
Index: 2,
Name: "open_id",
Type: "varchar(64)",
Null: false,
Key: "UNI",
Default: "",
Extra: "",
Comment: "",
},
"mobile": {
Index: 3,
Name: "mobile",
Type: "varchar(20)",
Null: false,
Key: "UNI",
Default: "",
Extra: "",
Comment: "",
},
"account": {
Index: 4,
Name: "account",
Type: "varchar(64)",
Null: false,
Key: "UNI",
Default: "",
Extra: "",
Comment: "",
},
"password_hash": {
Index: 5,
Name: "password_hash",
Type: "varchar(100)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "",
},
"nickname": {
Index: 6,
Name: "nickname",
Type: "varchar(64)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "",
},
"avatar": {
Index: 7,
Name: "avatar",
Type: "varchar(512)",
Null: false,
Key: "",
Default: "",
Extra: "",
Comment: "",
},
"status": {
Index: 8,
Name: "status",
Type: "tinyint",
Null: false,
Key: "MUL",
Default: "1",
Extra: "",
Comment: "",
},
"last_login_at": {
Index: 9,
Name: "last_login_at",
Type: "datetime",
Null: true,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"created_at": {
Index: 10,
Name: "created_at",
Type: "datetime",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"updated_at": {
Index: 11,
Name: "updated_at",
Type: "datetime",
Null: false,
Key: "",
Default: nil,
Extra: "",
Comment: "",
},
"deleted_at": {
Index: 12,
Name: "deleted_at",
Type: "datetime",
Null: true,
Key: "MUL",
Default: nil,
Extra: "",
Comment: "",
},
}
// UserTableFields 将表字段定义注册到数据库实例。
// db实现 gdb.DB 接口的数据库实例。
// schema可选的 schema/命名空间名,尤其适用于支持 schema 的数据库。
func SetUserTableFields(ctx context.Context, db gdb.DB, schema ...string) error {
return db.GetCore().SetTableFields(ctx, "user", User, schema...)
}