58 lines
2.9 KiB
Go
58 lines
2.9 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"EnGin/internal/ent/role"
|
|
"EnGin/internal/ent/schema"
|
|
"EnGin/internal/ent/user"
|
|
"time"
|
|
)
|
|
|
|
// The init function reads all schema descriptors with runtime code
|
|
// (default values, validators, hooks and policies) and stitches it
|
|
// to their package variables.
|
|
func init() {
|
|
roleFields := schema.Role{}.Fields()
|
|
_ = roleFields
|
|
// roleDescCode is the schema descriptor for code field.
|
|
roleDescCode := roleFields[0].Descriptor()
|
|
// role.CodeValidator is a validator for the "code" field. It is called by the builders before save.
|
|
role.CodeValidator = roleDescCode.Validators[0].(func(string) error)
|
|
// roleDescName is the schema descriptor for name field.
|
|
roleDescName := roleFields[1].Descriptor()
|
|
// role.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
|
role.NameValidator = roleDescName.Validators[0].(func(string) error)
|
|
userMixin := schema.User{}.Mixin()
|
|
userMixinFields0 := userMixin[0].Fields()
|
|
_ = userMixinFields0
|
|
userFields := schema.User{}.Fields()
|
|
_ = userFields
|
|
// userDescCreatedAt is the schema descriptor for created_at field.
|
|
userDescCreatedAt := userMixinFields0[0].Descriptor()
|
|
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
|
|
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
|
|
// userDescUpdatedAt is the schema descriptor for updated_at field.
|
|
userDescUpdatedAt := userMixinFields0[1].Descriptor()
|
|
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
|
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
|
|
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
|
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
|
|
// userDescUsername is the schema descriptor for username field.
|
|
userDescUsername := userFields[0].Descriptor()
|
|
// user.UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
|
user.UsernameValidator = userDescUsername.Validators[0].(func(string) error)
|
|
// userDescEmail is the schema descriptor for email field.
|
|
userDescEmail := userFields[2].Descriptor()
|
|
// user.EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
user.EmailValidator = userDescEmail.Validators[0].(func(string) error)
|
|
// userDescIP is the schema descriptor for ip field.
|
|
userDescIP := userFields[3].Descriptor()
|
|
// user.IPValidator is a validator for the "ip" field. It is called by the builders before save.
|
|
user.IPValidator = userDescIP.Validators[0].(func(string) error)
|
|
// userDescAddr is the schema descriptor for addr field.
|
|
userDescAddr := userFields[4].Descriptor()
|
|
// user.AddrValidator is a validator for the "addr" field. It is called by the builders before save.
|
|
user.AddrValidator = userDescAddr.Validators[0].(func(string) error)
|
|
}
|