1
0
api/ent/runtime.go

212 lines
11 KiB
Go
Raw Normal View History

2022-08-31 07:49:08 +00:00
// Code generated by ent, DO NOT EDIT.
2022-08-31 06:18:14 +00:00
package ent
import (
2024-02-21 09:16:45 +00:00
"api/ent/card"
"api/ent/group"
2024-04-02 09:57:04 +00:00
"api/ent/ma"
2024-02-21 09:16:45 +00:00
"api/ent/schema"
"api/ent/ue"
"api/ent/user"
2022-08-31 06:18:14 +00:00
"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() {
2022-08-31 07:49:08 +00:00
cardFields := schema.Card{}.Fields()
_ = cardFields
2023-04-05 06:05:14 +00:00
// cardDescPassword is the schema descriptor for password field.
cardDescPassword := cardFields[0].Descriptor()
// card.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
card.PasswordValidator = cardDescPassword.Validators[0].(func(string) error)
2022-08-31 07:49:08 +00:00
// cardDescCard is the schema descriptor for card field.
2023-04-05 06:05:14 +00:00
cardDescCard := cardFields[1].Descriptor()
2022-08-31 07:49:08 +00:00
// card.DefaultCard holds the default value on creation for the card field.
card.DefaultCard = cardDescCard.Default.(func() int)
2023-05-03 10:16:36 +00:00
// cardDescSkill is the schema descriptor for skill field.
cardDescSkill := cardFields[2].Descriptor()
// card.DefaultSkill holds the default value on creation for the skill field.
card.DefaultSkill = cardDescSkill.Default.(func() string)
2022-08-31 07:49:08 +00:00
// cardDescStatus is the schema descriptor for status field.
2023-05-03 10:16:36 +00:00
cardDescStatus := cardFields[3].Descriptor()
2022-08-31 07:49:08 +00:00
// 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.
2023-07-01 14:21:48 +00:00
cardDescCp := cardFields[5].Descriptor()
2022-08-31 07:49:08 +00:00
// 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.
2023-07-01 14:21:48 +00:00
cardDescURL := cardFields[6].Descriptor()
2022-08-31 07:49:08 +00:00
// 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.
2023-08-21 13:13:44 +00:00
cardDescCreatedAt := cardFields[9].Descriptor()
2022-08-31 07:49:08 +00:00
// card.DefaultCreatedAt holds the default value on creation for the created_at field.
card.DefaultCreatedAt = cardDescCreatedAt.Default.(func() time.Time)
2023-04-05 06:05:14 +00:00
groupFields := schema.Group{}.Fields()
_ = groupFields
// groupDescPassword is the schema descriptor for password field.
groupDescPassword := groupFields[1].Descriptor()
// group.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
group.PasswordValidator = groupDescPassword.Validators[0].(func(string) error)
2024-04-02 09:57:04 +00:00
maFields := schema.Ma{}.Fields()
_ = maFields
// maDescPassword is the schema descriptor for password field.
maDescPassword := maFields[0].Descriptor()
// ma.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
ma.PasswordValidator = maDescPassword.Validators[0].(func(string) error)
// maDescLimit is the schema descriptor for limit field.
maDescLimit := maFields[2].Descriptor()
// ma.DefaultLimit holds the default value on creation for the limit field.
ma.DefaultLimit = maDescLimit.Default.(bool)
// maDescCreatedAt is the schema descriptor for created_at field.
maDescCreatedAt := maFields[13].Descriptor()
// ma.DefaultCreatedAt holds the default value on creation for the created_at field.
ma.DefaultCreatedAt = maDescCreatedAt.Default.(func() time.Time)
2024-02-03 06:48:28 +00:00
ueFields := schema.Ue{}.Fields()
_ = ueFields
// ueDescLimit is the schema descriptor for limit field.
ueDescLimit := ueFields[0].Descriptor()
// ue.DefaultLimit holds the default value on creation for the limit field.
ue.DefaultLimit = ueDescLimit.Default.(bool)
// ueDescLimitBoss is the schema descriptor for limit_boss field.
ueDescLimitBoss := ueFields[1].Descriptor()
// ue.DefaultLimitBoss holds the default value on creation for the limit_boss field.
ue.DefaultLimitBoss = ueDescLimitBoss.Default.(bool)
// ueDescLimitItem is the schema descriptor for limit_item field.
ueDescLimitItem := ueFields[2].Descriptor()
// ue.DefaultLimitItem holds the default value on creation for the limit_item field.
ue.DefaultLimitItem = ueDescLimitItem.Default.(bool)
// ueDescPassword is the schema descriptor for password field.
ueDescPassword := ueFields[3].Descriptor()
// ue.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
ue.PasswordValidator = ueDescPassword.Validators[0].(func(string) error)
// ueDescCreatedAt is the schema descriptor for created_at field.
ueDescCreatedAt := ueFields[18].Descriptor()
// ue.DefaultCreatedAt holds the default value on creation for the created_at field.
ue.DefaultCreatedAt = ueDescCreatedAt.Default.(func() time.Time)
2022-08-31 07:49:08 +00:00
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
2022-08-31 06:18:14 +00:00
fns := [...]func(string) error{
validators[0].(func(string) error),
validators[1].(func(string) error),
}
2022-08-31 07:49:08 +00:00
return func(username string) error {
2022-08-31 06:18:14 +00:00
for _, fn := range fns {
2022-08-31 07:49:08 +00:00
if err := fn(username); err != nil {
2022-08-31 06:18:14 +00:00
return err
}
}
return nil
}
}()
2023-07-20 14:18:17 +00:00
// userDescMember is the schema descriptor for member field.
userDescMember := userFields[2].Descriptor()
// user.DefaultMember holds the default value on creation for the member field.
user.DefaultMember = userDescMember.Default.(bool)
// userDescBook is the schema descriptor for book field.
userDescBook := userFields[3].Descriptor()
// user.DefaultBook holds the default value on creation for the book field.
user.DefaultBook = userDescBook.Default.(bool)
// userDescManga is the schema descriptor for manga field.
userDescManga := userFields[4].Descriptor()
// user.DefaultManga holds the default value on creation for the manga field.
user.DefaultManga = userDescManga.Default.(bool)
// userDescBadge is the schema descriptor for badge field.
userDescBadge := userFields[5].Descriptor()
// user.DefaultBadge holds the default value on creation for the badge field.
user.DefaultBadge = userDescBadge.Default.(bool)
2023-07-10 03:43:09 +00:00
// userDescBsky is the schema descriptor for bsky field.
2023-07-20 14:18:17 +00:00
userDescBsky := userFields[6].Descriptor()
2023-07-10 03:43:09 +00:00
// user.DefaultBsky holds the default value on creation for the bsky field.
user.DefaultBsky = userDescBsky.Default.(bool)
// userDescMastodon is the schema descriptor for mastodon field.
2023-07-20 14:18:17 +00:00
userDescMastodon := userFields[7].Descriptor()
2023-07-10 03:43:09 +00:00
// user.DefaultMastodon holds the default value on creation for the mastodon field.
user.DefaultMastodon = userDescMastodon.Default.(bool)
2023-05-01 14:00:17 +00:00
// userDescDelete is the schema descriptor for delete field.
2023-07-20 14:18:17 +00:00
userDescDelete := userFields[8].Descriptor()
2023-05-01 14:00:17 +00:00
// user.DefaultDelete holds the default value on creation for the delete field.
user.DefaultDelete = userDescDelete.Default.(bool)
2023-06-21 01:17:52 +00:00
// userDescHandle is the schema descriptor for handle field.
2023-07-20 14:18:17 +00:00
userDescHandle := userFields[9].Descriptor()
2023-06-21 01:17:52 +00:00
// user.DefaultHandle holds the default value on creation for the handle field.
user.DefaultHandle = userDescHandle.Default.(bool)
2023-04-05 06:05:14 +00:00
// userDescPassword is the schema descriptor for password field.
2023-07-20 14:18:17 +00:00
userDescPassword := userFields[11].Descriptor()
2023-04-05 06:05:14 +00:00
// user.PasswordValidator is a validator for the "password" field. It is called by the builders before save.
user.PasswordValidator = userDescPassword.Validators[0].(func(string) error)
2022-08-31 07:49:08 +00:00
// userDescCreatedAt is the schema descriptor for created_at field.
2023-07-20 14:18:17 +00:00
userDescCreatedAt := userFields[12].Descriptor()
2022-08-31 07:49:08 +00:00
// 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.
2023-07-20 14:18:17 +00:00
userDescUpdatedAt := userFields[13].Descriptor()
2022-08-31 07:49:08 +00:00
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
2023-05-24 09:36:44 +00:00
// userDescRaidAt is the schema descriptor for raid_at field.
2023-07-20 14:18:17 +00:00
userDescRaidAt := userFields[14].Descriptor()
2023-05-24 09:36:44 +00:00
// user.DefaultRaidAt holds the default value on creation for the raid_at field.
user.DefaultRaidAt = userDescRaidAt.Default.(func() time.Time)
2023-09-10 08:53:30 +00:00
// userDescServerAt is the schema descriptor for server_at field.
userDescServerAt := userFields[15].Descriptor()
// user.DefaultServerAt holds the default value on creation for the server_at field.
user.DefaultServerAt = userDescServerAt.Default.(func() time.Time)
2023-07-23 14:40:24 +00:00
// userDescEggAt is the schema descriptor for egg_at field.
2023-09-10 08:53:30 +00:00
userDescEggAt := userFields[16].Descriptor()
2023-07-23 14:40:24 +00:00
// user.DefaultEggAt holds the default value on creation for the egg_at field.
user.DefaultEggAt = userDescEggAt.Default.(func() time.Time)
2023-05-24 09:36:44 +00:00
// userDescLuckAt is the schema descriptor for luck_at field.
2023-09-10 08:53:30 +00:00
userDescLuckAt := userFields[18].Descriptor()
2023-05-24 09:36:44 +00:00
// user.DefaultLuckAt holds the default value on creation for the luck_at field.
user.DefaultLuckAt = userDescLuckAt.Default.(func() time.Time)
// userDescLikeAt is the schema descriptor for like_at field.
2023-09-10 08:53:30 +00:00
userDescLikeAt := userFields[21].Descriptor()
2023-05-24 09:36:44 +00:00
// user.DefaultLikeAt holds the default value on creation for the like_at field.
user.DefaultLikeAt = userDescLikeAt.Default.(func() time.Time)
// userDescTenAt is the schema descriptor for ten_at field.
2023-09-10 08:53:30 +00:00
userDescTenAt := userFields[31].Descriptor()
2023-05-24 09:36:44 +00:00
// user.DefaultTenAt holds the default value on creation for the ten_at field.
user.DefaultTenAt = userDescTenAt.Default.(func() time.Time)
2022-08-31 07:49:08 +00:00
// userDescNext is the schema descriptor for next field.
2023-09-10 08:53:30 +00:00
userDescNext := userFields[32].Descriptor()
2022-08-31 07:49:08 +00:00
// user.DefaultNext holds the default value on creation for the next field.
user.DefaultNext = userDescNext.Default.(string)
2023-11-03 02:24:42 +00:00
// userDescModelAt is the schema descriptor for model_at field.
userDescModelAt := userFields[35].Descriptor()
// user.DefaultModelAt holds the default value on creation for the model_at field.
user.DefaultModelAt = userDescModelAt.Default.(func() time.Time)
// userDescGame is the schema descriptor for game field.
userDescGame := userFields[42].Descriptor()
// user.DefaultGame holds the default value on creation for the game field.
user.DefaultGame = userDescGame.Default.(bool)
// userDescGameTest is the schema descriptor for game_test field.
userDescGameTest := userFields[43].Descriptor()
// user.DefaultGameTest holds the default value on creation for the game_test field.
user.DefaultGameTest = userDescGameTest.Default.(bool)
// userDescGameEnd is the schema descriptor for game_end field.
userDescGameEnd := userFields[44].Descriptor()
// user.DefaultGameEnd holds the default value on creation for the game_end field.
user.DefaultGameEnd = userDescGameEnd.Default.(bool)
// userDescGameAccount is the schema descriptor for game_account field.
userDescGameAccount := userFields[45].Descriptor()
// user.DefaultGameAccount holds the default value on creation for the game_account field.
user.DefaultGameAccount = userDescGameAccount.Default.(bool)
2024-02-21 19:08:34 +00:00
// userDescCoinOpen is the schema descriptor for coin_open field.
userDescCoinOpen := userFields[48].Descriptor()
// user.DefaultCoinOpen holds the default value on creation for the coin_open field.
user.DefaultCoinOpen = userDescCoinOpen.Default.(bool)
// userDescCoinAt is the schema descriptor for coin_at field.
userDescCoinAt := userFields[49].Descriptor()
// user.DefaultCoinAt holds the default value on creation for the coin_at field.
user.DefaultCoinAt = userDescCoinAt.Default.(func() time.Time)
2022-08-31 06:18:14 +00:00
}