Files
likedream/internal/ent/sysuser/sysuser.go
T
sugarBecomer a22f559889 ✨ 消费日志
2025-12-02 16:42:08 +08:00

563 lines
22 KiB
Go

// ENT数据库文件,请勿编辑。
package sysuser
import (
"likedream-goframe/internal/framework/ent2"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/shopspring/decimal"
)
const (
// Label holds the string label denoting the sysuser type in the database.
Label = "sys_user"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreateTime holds the string denoting the create_time field in the database.
FieldCreateTime = "create_time"
// FieldUpdateTime holds the string denoting the update_time field in the database.
FieldUpdateTime = "update_time"
// FieldUsername holds the string denoting the username field in the database.
FieldUsername = "username"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldEmail holds the string denoting the email field in the database.
FieldEmail = "email"
// FieldInviteCode holds the string denoting the invite_code field in the database.
FieldInviteCode = "invite_code"
// FieldBalance holds the string denoting the balance field in the database.
FieldBalance = "balance"
// FieldBlock holds the string denoting the block field in the database.
FieldBlock = "block"
// FieldVerify holds the string denoting the verify field in the database.
FieldVerify = "verify"
// FieldInviteCashback holds the string denoting the invite_cashback field in the database.
FieldInviteCashback = "invite_cashback"
// EdgeParent holds the string denoting the parent edge name in mutations.
EdgeParent = "parent"
// EdgeChildren holds the string denoting the children edge name in mutations.
EdgeChildren = "children"
// EdgeRoles holds the string denoting the roles edge name in mutations.
EdgeRoles = "roles"
// EdgeAgent holds the string denoting the agent edge name in mutations.
EdgeAgent = "agent"
// EdgeImages holds the string denoting the images edge name in mutations.
EdgeImages = "images"
// EdgeCpuser holds the string denoting the cpuser edge name in mutations.
EdgeCpuser = "cpuser"
// EdgeCpTask holds the string denoting the cp_task edge name in mutations.
EdgeCpTask = "cp_task"
// EdgeCpLeave holds the string denoting the cp_leave edge name in mutations.
EdgeCpLeave = "cp_leave"
// EdgeCourseEntity holds the string denoting the course_entity edge name in mutations.
EdgeCourseEntity = "course_entity"
// EdgeCpTaskLogs holds the string denoting the cp_task_logs edge name in mutations.
EdgeCpTaskLogs = "cp_task_logs"
// EdgeCreatedCards holds the string denoting the created_cards edge name in mutations.
EdgeCreatedCards = "created_cards"
// EdgeUsedCards holds the string denoting the used_cards edge name in mutations.
EdgeUsedCards = "used_cards"
// EdgeCashbackCards holds the string denoting the cashback_cards edge name in mutations.
EdgeCashbackCards = "cashback_cards"
// EdgeBalanceRecords holds the string denoting the balance_records edge name in mutations.
EdgeBalanceRecords = "balance_records"
// Table holds the table name of the sysuser in the database.
Table = "sys_user"
// ParentTable is the table that holds the parent relation/edge.
ParentTable = "sys_user"
// ParentColumn is the table column denoting the parent relation/edge.
ParentColumn = "sys_user_children"
// ChildrenTable is the table that holds the children relation/edge.
ChildrenTable = "sys_user"
// ChildrenColumn is the table column denoting the children relation/edge.
ChildrenColumn = "sys_user_children"
// RolesTable is the table that holds the roles relation/edge. The primary key declared below.
RolesTable = "sys_user_roles"
// RolesInverseTable is the table name for the SysRole entity.
// It exists in this package in order to avoid circular dependency with the "sysrole" package.
RolesInverseTable = "sys_role"
// AgentTable is the table that holds the agent relation/edge.
AgentTable = "sys_agent"
// AgentInverseTable is the table name for the SysAgent entity.
// It exists in this package in order to avoid circular dependency with the "sysagent" package.
AgentInverseTable = "sys_agent"
// AgentColumn is the table column denoting the agent relation/edge.
AgentColumn = "sys_user_agent"
// ImagesTable is the table that holds the images relation/edge.
ImagesTable = "cp_image"
// ImagesInverseTable is the table name for the CpImage entity.
// It exists in this package in order to avoid circular dependency with the "cpimage" package.
ImagesInverseTable = "cp_image"
// ImagesColumn is the table column denoting the images relation/edge.
ImagesColumn = "user_id"
// CpuserTable is the table that holds the cpuser relation/edge.
CpuserTable = "cp_users"
// CpuserInverseTable is the table name for the CpUser entity.
// It exists in this package in order to avoid circular dependency with the "cpuser" package.
CpuserInverseTable = "cp_users"
// CpuserColumn is the table column denoting the cpuser relation/edge.
CpuserColumn = "user_id"
// CpTaskTable is the table that holds the cp_task relation/edge.
CpTaskTable = "cp_tasks"
// CpTaskInverseTable is the table name for the CpTask entity.
// It exists in this package in order to avoid circular dependency with the "cptask" package.
CpTaskInverseTable = "cp_tasks"
// CpTaskColumn is the table column denoting the cp_task relation/edge.
CpTaskColumn = "user_id"
// CpLeaveTable is the table that holds the cp_leave relation/edge.
CpLeaveTable = "cp_leaves"
// CpLeaveInverseTable is the table name for the CpLeave entity.
// It exists in this package in order to avoid circular dependency with the "cpleave" package.
CpLeaveInverseTable = "cp_leaves"
// CpLeaveColumn is the table column denoting the cp_leave relation/edge.
CpLeaveColumn = "user_id"
// CourseEntityTable is the table that holds the course_entity relation/edge.
CourseEntityTable = "course_entity"
// CourseEntityInverseTable is the table name for the CourseEntity entity.
// It exists in this package in order to avoid circular dependency with the "courseentity" package.
CourseEntityInverseTable = "course_entity"
// CourseEntityColumn is the table column denoting the course_entity relation/edge.
CourseEntityColumn = "user_id"
// CpTaskLogsTable is the table that holds the cp_task_logs relation/edge.
CpTaskLogsTable = "cp_task_logs"
// CpTaskLogsInverseTable is the table name for the CpTaskLog entity.
// It exists in this package in order to avoid circular dependency with the "cptasklog" package.
CpTaskLogsInverseTable = "cp_task_logs"
// CpTaskLogsColumn is the table column denoting the cp_task_logs relation/edge.
CpTaskLogsColumn = "system_user_id"
// CreatedCardsTable is the table that holds the created_cards relation/edge.
CreatedCardsTable = "sys_card"
// CreatedCardsInverseTable is the table name for the SysCard entity.
// It exists in this package in order to avoid circular dependency with the "syscard" package.
CreatedCardsInverseTable = "sys_card"
// CreatedCardsColumn is the table column denoting the created_cards relation/edge.
CreatedCardsColumn = "creator_id"
// UsedCardsTable is the table that holds the used_cards relation/edge.
UsedCardsTable = "sys_card"
// UsedCardsInverseTable is the table name for the SysCard entity.
// It exists in this package in order to avoid circular dependency with the "syscard" package.
UsedCardsInverseTable = "sys_card"
// UsedCardsColumn is the table column denoting the used_cards relation/edge.
UsedCardsColumn = "used_id"
// CashbackCardsTable is the table that holds the cashback_cards relation/edge.
CashbackCardsTable = "sys_card"
// CashbackCardsInverseTable is the table name for the SysCard entity.
// It exists in this package in order to avoid circular dependency with the "syscard" package.
CashbackCardsInverseTable = "sys_card"
// CashbackCardsColumn is the table column denoting the cashback_cards relation/edge.
CashbackCardsColumn = "cash_user_id"
// BalanceRecordsTable is the table that holds the balance_records relation/edge.
BalanceRecordsTable = "sys_balance_record"
// BalanceRecordsInverseTable is the table name for the SysBalanceRecord entity.
// It exists in this package in order to avoid circular dependency with the "sysbalancerecord" package.
BalanceRecordsInverseTable = "sys_balance_record"
// BalanceRecordsColumn is the table column denoting the balance_records relation/edge.
BalanceRecordsColumn = "user_id"
)
// Columns holds all SQL columns for sysuser fields.
var Columns = []string{
FieldID,
FieldCreateTime,
FieldUpdateTime,
FieldUsername,
FieldPassword,
FieldEmail,
FieldInviteCode,
FieldBalance,
FieldBlock,
FieldVerify,
FieldInviteCashback,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "sys_user"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"sys_user_children",
}
var (
// RolesPrimaryKey and RolesColumn2 are the table columns denoting the
// primary key for the roles relation (M2M).
RolesPrimaryKey = []string{"sys_user_id", "sys_role_id"}
)
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "likedream-goframe/internal/ent/runtime"
var (
Hooks [1]ent.Hook
// DefaultCreateTime holds the default value on creation for the "create_time" field.
DefaultCreateTime func() *ent2.CustomTime
// DefaultUpdateTime holds the default value on creation for the "update_time" field.
DefaultUpdateTime func() *ent2.CustomTime
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
EmailValidator func(string) error
// DefaultBalance holds the default value on creation for the "balance" field.
DefaultBalance func() decimal.Decimal
// DefaultBlock holds the default value on creation for the "block" field.
DefaultBlock bool
// DefaultVerify holds the default value on creation for the "verify" field.
DefaultVerify bool
// DefaultInviteCashback holds the default value on creation for the "invite_cashback" field.
DefaultInviteCashback func() decimal.Decimal
)
// OrderOption defines the ordering options for the SysUser queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByCreateTime orders the results by the create_time field.
func ByCreateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreateTime, opts...).ToFunc()
}
// ByUpdateTime orders the results by the update_time field.
func ByUpdateTime(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdateTime, opts...).ToFunc()
}
// ByUsername orders the results by the username field.
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUsername, opts...).ToFunc()
}
// ByPassword orders the results by the password field.
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPassword, opts...).ToFunc()
}
// ByEmail orders the results by the email field.
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEmail, opts...).ToFunc()
}
// ByInviteCode orders the results by the invite_code field.
func ByInviteCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInviteCode, opts...).ToFunc()
}
// ByBalance orders the results by the balance field.
func ByBalance(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBalance, opts...).ToFunc()
}
// ByBlock orders the results by the block field.
func ByBlock(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBlock, opts...).ToFunc()
}
// ByVerify orders the results by the verify field.
func ByVerify(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVerify, opts...).ToFunc()
}
// ByInviteCashback orders the results by the invite_cashback field.
func ByInviteCashback(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldInviteCashback, opts...).ToFunc()
}
// ByParentField orders the results by parent field.
func ByParentField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newParentStep(), sql.OrderByField(field, opts...))
}
}
// ByChildrenCount orders the results by children count.
func ByChildrenCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newChildrenStep(), opts...)
}
}
// ByChildren orders the results by children terms.
func ByChildren(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newChildrenStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByRolesCount orders the results by roles count.
func ByRolesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newRolesStep(), opts...)
}
}
// ByRoles orders the results by roles terms.
func ByRoles(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newRolesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByAgentField orders the results by agent field.
func ByAgentField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newAgentStep(), sql.OrderByField(field, opts...))
}
}
// ByImagesCount orders the results by images count.
func ByImagesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newImagesStep(), opts...)
}
}
// ByImages orders the results by images terms.
func ByImages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newImagesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCpuserCount orders the results by cpuser count.
func ByCpuserCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCpuserStep(), opts...)
}
}
// ByCpuser orders the results by cpuser terms.
func ByCpuser(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCpuserStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCpTaskCount orders the results by cp_task count.
func ByCpTaskCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCpTaskStep(), opts...)
}
}
// ByCpTask orders the results by cp_task terms.
func ByCpTask(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCpTaskStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCpLeaveCount orders the results by cp_leave count.
func ByCpLeaveCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCpLeaveStep(), opts...)
}
}
// ByCpLeave orders the results by cp_leave terms.
func ByCpLeave(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCpLeaveStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCourseEntityCount orders the results by course_entity count.
func ByCourseEntityCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCourseEntityStep(), opts...)
}
}
// ByCourseEntity orders the results by course_entity terms.
func ByCourseEntity(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCourseEntityStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCpTaskLogsCount orders the results by cp_task_logs count.
func ByCpTaskLogsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCpTaskLogsStep(), opts...)
}
}
// ByCpTaskLogs orders the results by cp_task_logs terms.
func ByCpTaskLogs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCpTaskLogsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCreatedCardsCount orders the results by created_cards count.
func ByCreatedCardsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCreatedCardsStep(), opts...)
}
}
// ByCreatedCards orders the results by created_cards terms.
func ByCreatedCards(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCreatedCardsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByUsedCardsCount orders the results by used_cards count.
func ByUsedCardsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newUsedCardsStep(), opts...)
}
}
// ByUsedCards orders the results by used_cards terms.
func ByUsedCards(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUsedCardsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByCashbackCardsCount orders the results by cashback_cards count.
func ByCashbackCardsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newCashbackCardsStep(), opts...)
}
}
// ByCashbackCards orders the results by cashback_cards terms.
func ByCashbackCards(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newCashbackCardsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByBalanceRecordsCount orders the results by balance_records count.
func ByBalanceRecordsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newBalanceRecordsStep(), opts...)
}
}
// ByBalanceRecords orders the results by balance_records terms.
func ByBalanceRecords(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newBalanceRecordsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newParentStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, ParentTable, ParentColumn),
)
}
func newChildrenStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ChildrenTable, ChildrenColumn),
)
}
func newRolesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(RolesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, RolesTable, RolesPrimaryKey...),
)
}
func newAgentStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(AgentInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2O, false, AgentTable, AgentColumn),
)
}
func newImagesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ImagesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, ImagesTable, ImagesColumn),
)
}
func newCpuserStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CpuserInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CpuserTable, CpuserColumn),
)
}
func newCpTaskStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CpTaskInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CpTaskTable, CpTaskColumn),
)
}
func newCpLeaveStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CpLeaveInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CpLeaveTable, CpLeaveColumn),
)
}
func newCourseEntityStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CourseEntityInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CourseEntityTable, CourseEntityColumn),
)
}
func newCpTaskLogsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CpTaskLogsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CpTaskLogsTable, CpTaskLogsColumn),
)
}
func newCreatedCardsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CreatedCardsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CreatedCardsTable, CreatedCardsColumn),
)
}
func newUsedCardsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UsedCardsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, UsedCardsTable, UsedCardsColumn),
)
}
func newCashbackCardsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(CashbackCardsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, CashbackCardsTable, CashbackCardsColumn),
)
}
func newBalanceRecordsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(BalanceRecordsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, BalanceRecordsTable, BalanceRecordsColumn),
)
}