1
0

first gen

This commit is contained in:
2022-08-31 16:49:08 +09:00
committed by syui
parent d40e30944b
commit 9573dc895f
89 changed files with 25861 additions and 16973 deletions

View File

@@ -1,10 +1,11 @@
// Code generated by entc, DO NOT EDIT.
// Code generated by ent, DO NOT EDIT.
package ent
import (
"t/ent/card"
"t/ent/schema"
"t/ent/users"
"t/ent/user"
"time"
)
@@ -12,93 +13,58 @@ import (
// (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
cardFields := schema.Card{}.Fields()
_ = cardFields
// cardDescCard is the schema descriptor for card field.
cardDescCard := cardFields[0].Descriptor()
// card.DefaultCard holds the default value on creation for the card field.
card.DefaultCard = cardDescCard.Default.(func() int)
// cardDescStatus is the schema descriptor for status field.
cardDescStatus := cardFields[1].Descriptor()
// card.DefaultStatus holds the default value on creation for the status field.
card.DefaultStatus = cardDescStatus.Default.(func() string)
// cardDescCp is the schema descriptor for cp field.
cardDescCp := cardFields[2].Descriptor()
// card.DefaultCp holds the default value on creation for the cp field.
card.DefaultCp = cardDescCp.Default.(func() int)
// cardDescURL is the schema descriptor for url field.
cardDescURL := cardFields[3].Descriptor()
// card.DefaultURL holds the default value on creation for the url field.
card.DefaultURL = cardDescURL.Default.(string)
// cardDescCreatedAt is the schema descriptor for created_at field.
cardDescCreatedAt := cardFields[4].Descriptor()
// card.DefaultCreatedAt holds the default value on creation for the created_at field.
card.DefaultCreatedAt = cardDescCreatedAt.Default.(func() time.Time)
userFields := schema.User{}.Fields()
_ = userFields
// 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 = func() func(string) error {
validators := userDescUsername.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 {
return func(username string) error {
for _, fn := range fns {
if err := fn(user); err != nil {
if err := fn(username); 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)
// userDescCreatedAt is the schema descriptor for created_at field.
userDescCreatedAt := userFields[1].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 := userFields[2].Descriptor()
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
// userDescNext is the schema descriptor for next field.
userDescNext := userFields[3].Descriptor()
// user.DefaultNext holds the default value on creation for the next field.
user.DefaultNext = userDescNext.Default.(string)
}