merge upstream main
This commit is contained in:
@@ -7,6 +7,8 @@ import (
|
||||
|
||||
"github.com/Wei-Shaw/sub2api/ent/account"
|
||||
"github.com/Wei-Shaw/sub2api/ent/accountgroup"
|
||||
"github.com/Wei-Shaw/sub2api/ent/announcement"
|
||||
"github.com/Wei-Shaw/sub2api/ent/announcementread"
|
||||
"github.com/Wei-Shaw/sub2api/ent/apikey"
|
||||
"github.com/Wei-Shaw/sub2api/ent/group"
|
||||
"github.com/Wei-Shaw/sub2api/ent/promocode"
|
||||
@@ -15,6 +17,7 @@ import (
|
||||
"github.com/Wei-Shaw/sub2api/ent/redeemcode"
|
||||
"github.com/Wei-Shaw/sub2api/ent/schema"
|
||||
"github.com/Wei-Shaw/sub2api/ent/setting"
|
||||
"github.com/Wei-Shaw/sub2api/ent/usagecleanuptask"
|
||||
"github.com/Wei-Shaw/sub2api/ent/usagelog"
|
||||
"github.com/Wei-Shaw/sub2api/ent/user"
|
||||
"github.com/Wei-Shaw/sub2api/ent/userallowedgroup"
|
||||
@@ -209,6 +212,56 @@ func init() {
|
||||
accountgroupDescCreatedAt := accountgroupFields[3].Descriptor()
|
||||
// accountgroup.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
accountgroup.DefaultCreatedAt = accountgroupDescCreatedAt.Default.(func() time.Time)
|
||||
announcementFields := schema.Announcement{}.Fields()
|
||||
_ = announcementFields
|
||||
// announcementDescTitle is the schema descriptor for title field.
|
||||
announcementDescTitle := announcementFields[0].Descriptor()
|
||||
// announcement.TitleValidator is a validator for the "title" field. It is called by the builders before save.
|
||||
announcement.TitleValidator = func() func(string) error {
|
||||
validators := announcementDescTitle.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(title string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(title); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// announcementDescContent is the schema descriptor for content field.
|
||||
announcementDescContent := announcementFields[1].Descriptor()
|
||||
// announcement.ContentValidator is a validator for the "content" field. It is called by the builders before save.
|
||||
announcement.ContentValidator = announcementDescContent.Validators[0].(func(string) error)
|
||||
// announcementDescStatus is the schema descriptor for status field.
|
||||
announcementDescStatus := announcementFields[2].Descriptor()
|
||||
// announcement.DefaultStatus holds the default value on creation for the status field.
|
||||
announcement.DefaultStatus = announcementDescStatus.Default.(string)
|
||||
// announcement.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
announcement.StatusValidator = announcementDescStatus.Validators[0].(func(string) error)
|
||||
// announcementDescCreatedAt is the schema descriptor for created_at field.
|
||||
announcementDescCreatedAt := announcementFields[8].Descriptor()
|
||||
// announcement.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
announcement.DefaultCreatedAt = announcementDescCreatedAt.Default.(func() time.Time)
|
||||
// announcementDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
announcementDescUpdatedAt := announcementFields[9].Descriptor()
|
||||
// announcement.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
announcement.DefaultUpdatedAt = announcementDescUpdatedAt.Default.(func() time.Time)
|
||||
// announcement.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
announcement.UpdateDefaultUpdatedAt = announcementDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
announcementreadFields := schema.AnnouncementRead{}.Fields()
|
||||
_ = announcementreadFields
|
||||
// announcementreadDescReadAt is the schema descriptor for read_at field.
|
||||
announcementreadDescReadAt := announcementreadFields[2].Descriptor()
|
||||
// announcementread.DefaultReadAt holds the default value on creation for the read_at field.
|
||||
announcementread.DefaultReadAt = announcementreadDescReadAt.Default.(func() time.Time)
|
||||
// announcementreadDescCreatedAt is the schema descriptor for created_at field.
|
||||
announcementreadDescCreatedAt := announcementreadFields[3].Descriptor()
|
||||
// announcementread.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
announcementread.DefaultCreatedAt = announcementreadDescCreatedAt.Default.(func() time.Time)
|
||||
groupMixin := schema.Group{}.Mixin()
|
||||
groupMixinHooks1 := groupMixin[1].Hooks()
|
||||
group.Hooks[0] = groupMixinHooks1[0]
|
||||
@@ -499,6 +552,43 @@ func init() {
|
||||
setting.DefaultUpdatedAt = settingDescUpdatedAt.Default.(func() time.Time)
|
||||
// setting.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
setting.UpdateDefaultUpdatedAt = settingDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
usagecleanuptaskMixin := schema.UsageCleanupTask{}.Mixin()
|
||||
usagecleanuptaskMixinFields0 := usagecleanuptaskMixin[0].Fields()
|
||||
_ = usagecleanuptaskMixinFields0
|
||||
usagecleanuptaskFields := schema.UsageCleanupTask{}.Fields()
|
||||
_ = usagecleanuptaskFields
|
||||
// usagecleanuptaskDescCreatedAt is the schema descriptor for created_at field.
|
||||
usagecleanuptaskDescCreatedAt := usagecleanuptaskMixinFields0[0].Descriptor()
|
||||
// usagecleanuptask.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
usagecleanuptask.DefaultCreatedAt = usagecleanuptaskDescCreatedAt.Default.(func() time.Time)
|
||||
// usagecleanuptaskDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
usagecleanuptaskDescUpdatedAt := usagecleanuptaskMixinFields0[1].Descriptor()
|
||||
// usagecleanuptask.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
usagecleanuptask.DefaultUpdatedAt = usagecleanuptaskDescUpdatedAt.Default.(func() time.Time)
|
||||
// usagecleanuptask.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
usagecleanuptask.UpdateDefaultUpdatedAt = usagecleanuptaskDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// usagecleanuptaskDescStatus is the schema descriptor for status field.
|
||||
usagecleanuptaskDescStatus := usagecleanuptaskFields[0].Descriptor()
|
||||
// usagecleanuptask.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
usagecleanuptask.StatusValidator = func() func(string) error {
|
||||
validators := usagecleanuptaskDescStatus.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(status string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(status); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// usagecleanuptaskDescDeletedRows is the schema descriptor for deleted_rows field.
|
||||
usagecleanuptaskDescDeletedRows := usagecleanuptaskFields[3].Descriptor()
|
||||
// usagecleanuptask.DefaultDeletedRows holds the default value on creation for the deleted_rows field.
|
||||
usagecleanuptask.DefaultDeletedRows = usagecleanuptaskDescDeletedRows.Default.(int64)
|
||||
usagelogFields := schema.UsageLog{}.Fields()
|
||||
_ = usagelogFields
|
||||
// usagelogDescRequestID is the schema descriptor for request_id field.
|
||||
@@ -702,6 +792,10 @@ func init() {
|
||||
userDescNotes := userFields[7].Descriptor()
|
||||
// user.DefaultNotes holds the default value on creation for the notes field.
|
||||
user.DefaultNotes = userDescNotes.Default.(string)
|
||||
// userDescTotpEnabled is the schema descriptor for totp_enabled field.
|
||||
userDescTotpEnabled := userFields[9].Descriptor()
|
||||
// user.DefaultTotpEnabled holds the default value on creation for the totp_enabled field.
|
||||
user.DefaultTotpEnabled = userDescTotpEnabled.Default.(bool)
|
||||
userallowedgroupFields := schema.UserAllowedGroup{}.Fields()
|
||||
_ = userallowedgroupFields
|
||||
// userallowedgroupDescCreatedAt is the schema descriptor for created_at field.
|
||||
|
||||
Reference in New Issue
Block a user