创建用户上下级相关表结构

This commit is contained in:
2025-07-05 09:16:53 +08:00
parent db9f182226
commit 0c6de3db61
4 changed files with 178 additions and 0 deletions

View File

@ -0,0 +1,97 @@
// ==========================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// ==========================================================================
package internal
import (
"context"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
// StoreClientSessionsDao is the data access object for the table store_client_sessions.
type StoreClientSessionsDao struct {
table string // table is the underlying table name of the DAO.
group string // group is the database configuration group name of the current DAO.
columns StoreClientSessionsColumns // columns contains all the column names of Table for convenient usage.
}
// StoreClientSessionsColumns defines and stores column names for the table store_client_sessions.
type StoreClientSessionsColumns struct {
Id string // 记录ID
StoreId string // 所属门店ID
ClientId string // 客户机ID
AreaId string // 所属区域ID
XyUserId string // 系统唯一用户ID
LevelId string // 会员等级ID如0表示临时卡
LevelName string // 会员等级名称
StartTime string // 上机时间
EndTime string // 下机时间
UsedTime string // 使用时长(分钟)
CreatedAt string // 创建时间
UpdatedAt string // 更新时间
DeletedAt string // 软删除时间戳
}
// storeClientSessionsColumns holds the columns for the table store_client_sessions.
var storeClientSessionsColumns = StoreClientSessionsColumns{
Id: "id",
StoreId: "store_id",
ClientId: "client_id",
AreaId: "area_id",
XyUserId: "xy_user_id",
LevelId: "level_id",
LevelName: "level_name",
StartTime: "start_time",
EndTime: "end_time",
UsedTime: "used_time",
CreatedAt: "created_at",
UpdatedAt: "updated_at",
DeletedAt: "deleted_at",
}
// NewStoreClientSessionsDao creates and returns a new DAO object for table data access.
func NewStoreClientSessionsDao() *StoreClientSessionsDao {
return &StoreClientSessionsDao{
group: "default",
table: "store_client_sessions",
columns: storeClientSessionsColumns,
}
}
// DB retrieves and returns the underlying raw database management object of the current DAO.
func (dao *StoreClientSessionsDao) DB() gdb.DB {
return g.DB(dao.group)
}
// Table returns the table name of the current DAO.
func (dao *StoreClientSessionsDao) Table() string {
return dao.table
}
// Columns returns all column names of the current DAO.
func (dao *StoreClientSessionsDao) Columns() StoreClientSessionsColumns {
return dao.columns
}
// Group returns the database configuration group name of the current DAO.
func (dao *StoreClientSessionsDao) Group() string {
return dao.group
}
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
func (dao *StoreClientSessionsDao) Ctx(ctx context.Context) *gdb.Model {
return dao.DB().Model(dao.table).Safe().Ctx(ctx)
}
// Transaction wraps the transaction logic using function f.
// It rolls back the transaction and returns the error if function f returns a non-nil error.
// It commits the transaction and returns nil if function f returns nil.
//
// Note: Do not commit or roll back the transaction in function f,
// as it is automatically handled by this function.
func (dao *StoreClientSessionsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
return dao.Ctx(ctx).Transaction(ctx, f)
}

View File

@ -0,0 +1,27 @@
// =================================================================================
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
// =================================================================================
package dao
import (
"server/internal/dao/internal"
)
// internalStoreClientSessionsDao is an internal type for wrapping the internal DAO implementation.
type internalStoreClientSessionsDao = *internal.StoreClientSessionsDao
// storeClientSessionsDao is the data access object for the table store_client_sessions.
// You can define custom methods on it to extend its functionality as needed.
type storeClientSessionsDao struct {
internalStoreClientSessionsDao
}
var (
// StoreClientSessions is a globally accessible object for table store_client_sessions operations.
StoreClientSessions = storeClientSessionsDao{
internal.NewStoreClientSessionsDao(),
}
)
// Add your custom methods and functionality below.

View File

@ -0,0 +1,28 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package do
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
)
// StoreClientSessions is the golang structure of table store_client_sessions for DAO operations like Where/Data.
type StoreClientSessions struct {
g.Meta `orm:"table:store_client_sessions, do:true"`
Id interface{} // 记录ID
StoreId interface{} // 所属门店ID
ClientId interface{} // 客户机ID
AreaId interface{} // 所属区域ID
XyUserId interface{} // 系统唯一用户ID
LevelId interface{} // 会员等级ID如0表示临时卡
LevelName interface{} // 会员等级名称
StartTime *gtime.Time // 上机时间
EndTime *gtime.Time // 下机时间
UsedTime interface{} // 使用时长(分钟)
CreatedAt *gtime.Time // 创建时间
UpdatedAt *gtime.Time // 更新时间
DeletedAt *gtime.Time // 软删除时间戳
}

View File

@ -0,0 +1,26 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package entity
import (
"github.com/gogf/gf/v2/os/gtime"
)
// StoreClientSessions is the golang structure for table store_client_sessions.
type StoreClientSessions struct {
Id int64 `json:"id" orm:"id" description:"记录ID"` // 记录ID
StoreId int64 `json:"storeId" orm:"store_id" description:"所属门店ID"` // 所属门店ID
ClientId int64 `json:"clientId" orm:"client_id" description:"客户机ID"` // 客户机ID
AreaId int64 `json:"areaId" orm:"area_id" description:"所属区域ID"` // 所属区域ID
XyUserId string `json:"xyUserId" orm:"xy_user_id" description:"系统唯一用户ID"` // 系统唯一用户ID
LevelId int `json:"levelId" orm:"level_id" description:"会员等级ID如0表示临时卡"` // 会员等级ID如0表示临时卡
LevelName string `json:"levelName" orm:"level_name" description:"会员等级名称"` // 会员等级名称
StartTime *gtime.Time `json:"startTime" orm:"start_time" description:"上机时间"` // 上机时间
EndTime *gtime.Time `json:"endTime" orm:"end_time" description:"下机时间"` // 下机时间
UsedTime int `json:"usedTime" orm:"used_time" description:"使用时长(分钟)"` // 使用时长(分钟)
CreatedAt *gtime.Time `json:"createdAt" orm:"created_at" description:"创建时间"` // 创建时间
UpdatedAt *gtime.Time `json:"updatedAt" orm:"updated_at" description:"更新时间"` // 更新时间
DeletedAt *gtime.Time `json:"deletedAt" orm:"deleted_at" description:"软删除时间戳"` // 软删除时间戳
}