1
0
api/ent/runtime.go

105 lines
5.0 KiB
Go
Raw Normal View History

2022-08-31 06:18:14 +00:00
// Code generated by entc, DO NOT EDIT.
package ent
import (
"t/ent/schema"
"t/ent/users"
"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() {
usersFields := schema.Users{}.Fields()
_ = usersFields
// usersDescUser is the schema descriptor for user field.
usersDescUser := usersFields[0].Descriptor()
// users.UserValidator is a validator for the "user" field. It is called by the builders before save.
users.UserValidator = func() func(string) error {
validators := usersDescUser.Validators
fns := [...]func(string) error{
validators[0].(func(string) error),
validators[1].(func(string) error),
validators[2].(func(string) error),
}
return func(user string) error {
for _, fn := range fns {
if err := fn(user); err != nil {
return err
}
}
return nil
}
}()
// usersDescChara is the schema descriptor for chara field.
usersDescChara := usersFields[1].Descriptor()
// users.DefaultChara holds the default value on creation for the chara field.
users.DefaultChara = usersDescChara.Default.(string)
// usersDescSkill is the schema descriptor for skill field.
usersDescSkill := usersFields[2].Descriptor()
// users.DefaultSkill holds the default value on creation for the skill field.
users.DefaultSkill = usersDescSkill.Default.(int)
// usersDescHp is the schema descriptor for hp field.
usersDescHp := usersFields[3].Descriptor()
// users.DefaultHp holds the default value on creation for the hp field.
users.DefaultHp = usersDescHp.Default.(int)
// usersDescAttack is the schema descriptor for attack field.
usersDescAttack := usersFields[4].Descriptor()
// users.DefaultAttack holds the default value on creation for the attack field.
users.DefaultAttack = usersDescAttack.Default.(int)
// usersDescDefense is the schema descriptor for defense field.
usersDescDefense := usersFields[5].Descriptor()
// users.DefaultDefense holds the default value on creation for the defense field.
users.DefaultDefense = usersDescDefense.Default.(int)
// usersDescCritical is the schema descriptor for critical field.
usersDescCritical := usersFields[6].Descriptor()
// users.DefaultCritical holds the default value on creation for the critical field.
users.DefaultCritical = usersDescCritical.Default.(int)
// usersDescBattle is the schema descriptor for battle field.
usersDescBattle := usersFields[7].Descriptor()
// users.DefaultBattle holds the default value on creation for the battle field.
users.DefaultBattle = usersDescBattle.Default.(int)
// usersDescWin is the schema descriptor for win field.
usersDescWin := usersFields[8].Descriptor()
// users.DefaultWin holds the default value on creation for the win field.
users.DefaultWin = usersDescWin.Default.(int)
// usersDescDay is the schema descriptor for day field.
usersDescDay := usersFields[9].Descriptor()
// users.DefaultDay holds the default value on creation for the day field.
users.DefaultDay = usersDescDay.Default.(int)
// usersDescPercentage is the schema descriptor for percentage field.
usersDescPercentage := usersFields[10].Descriptor()
// users.DefaultPercentage holds the default value on creation for the percentage field.
users.DefaultPercentage = usersDescPercentage.Default.(float64)
// usersDescLimit is the schema descriptor for limit field.
usersDescLimit := usersFields[11].Descriptor()
// users.DefaultLimit holds the default value on creation for the limit field.
users.DefaultLimit = usersDescLimit.Default.(bool)
// usersDescStatus is the schema descriptor for status field.
usersDescStatus := usersFields[12].Descriptor()
// users.DefaultStatus holds the default value on creation for the status field.
users.DefaultStatus = usersDescStatus.Default.(string)
// usersDescComment is the schema descriptor for comment field.
usersDescComment := usersFields[13].Descriptor()
// users.DefaultComment holds the default value on creation for the comment field.
users.DefaultComment = usersDescComment.Default.(string)
// usersDescCreatedAt is the schema descriptor for created_at field.
usersDescCreatedAt := usersFields[14].Descriptor()
// users.DefaultCreatedAt holds the default value on creation for the created_at field.
users.DefaultCreatedAt = usersDescCreatedAt.Default.(func() time.Time)
// usersDescNext is the schema descriptor for next field.
usersDescNext := usersFields[15].Descriptor()
// users.DefaultNext holds the default value on creation for the next field.
users.DefaultNext = usersDescNext.Default.(string)
// usersDescUpdatedAt is the schema descriptor for updated_at field.
usersDescUpdatedAt := usersFields[16].Descriptor()
// users.DefaultUpdatedAt holds the default value on creation for the updated_at field.
users.DefaultUpdatedAt = usersDescUpdatedAt.Default.(func() time.Time)
// usersDescURL is the schema descriptor for url field.
usersDescURL := usersFields[17].Descriptor()
// users.DefaultURL holds the default value on creation for the url field.
users.DefaultURL = usersDescURL.Default.(string)
}