chore: 更新依赖、配置和代码生成
主要更新: - 更新 go.mod/go.sum 依赖 - 重新生成 Ent ORM 代码 - 更新 Wire 依赖注入配置 - 添加 docker-compose.override.yml 到 .gitignore - 更新 README 文档(Simple Mode 说明和已知问题) - 清理调试日志 - 其他代码优化和格式修复
This commit is contained in:
@@ -25,67 +25,6 @@ import (
|
||||
// (default values, validators, hooks and policies) and stitches it
|
||||
// to their package variables.
|
||||
func init() {
|
||||
apikeyMixin := schema.APIKey{}.Mixin()
|
||||
apikeyMixinHooks1 := apikeyMixin[1].Hooks()
|
||||
apikey.Hooks[0] = apikeyMixinHooks1[0]
|
||||
apikeyMixinInters1 := apikeyMixin[1].Interceptors()
|
||||
apikey.Interceptors[0] = apikeyMixinInters1[0]
|
||||
apikeyMixinFields0 := apikeyMixin[0].Fields()
|
||||
_ = apikeyMixinFields0
|
||||
apikeyFields := schema.APIKey{}.Fields()
|
||||
_ = apikeyFields
|
||||
// apikeyDescCreatedAt is the schema descriptor for created_at field.
|
||||
apikeyDescCreatedAt := apikeyMixinFields0[0].Descriptor()
|
||||
// apikey.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
apikey.DefaultCreatedAt = apikeyDescCreatedAt.Default.(func() time.Time)
|
||||
// apikeyDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
apikeyDescUpdatedAt := apikeyMixinFields0[1].Descriptor()
|
||||
// apikey.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
apikey.DefaultUpdatedAt = apikeyDescUpdatedAt.Default.(func() time.Time)
|
||||
// apikey.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
apikey.UpdateDefaultUpdatedAt = apikeyDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// apikeyDescKey is the schema descriptor for key field.
|
||||
apikeyDescKey := apikeyFields[1].Descriptor()
|
||||
// apikey.KeyValidator is a validator for the "key" field. It is called by the builders before save.
|
||||
apikey.KeyValidator = func() func(string) error {
|
||||
validators := apikeyDescKey.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(key string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(key); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// apikeyDescName is the schema descriptor for name field.
|
||||
apikeyDescName := apikeyFields[2].Descriptor()
|
||||
// apikey.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
apikey.NameValidator = func() func(string) error {
|
||||
validators := apikeyDescName.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(name string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// apikeyDescStatus is the schema descriptor for status field.
|
||||
apikeyDescStatus := apikeyFields[4].Descriptor()
|
||||
// apikey.DefaultStatus holds the default value on creation for the status field.
|
||||
apikey.DefaultStatus = apikeyDescStatus.Default.(string)
|
||||
// apikey.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
apikey.StatusValidator = apikeyDescStatus.Validators[0].(func(string) error)
|
||||
accountMixin := schema.Account{}.Mixin()
|
||||
accountMixinHooks1 := accountMixin[1].Hooks()
|
||||
account.Hooks[0] = accountMixinHooks1[0]
|
||||
@@ -199,6 +138,67 @@ 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)
|
||||
apikeyMixin := schema.ApiKey{}.Mixin()
|
||||
apikeyMixinHooks1 := apikeyMixin[1].Hooks()
|
||||
apikey.Hooks[0] = apikeyMixinHooks1[0]
|
||||
apikeyMixinInters1 := apikeyMixin[1].Interceptors()
|
||||
apikey.Interceptors[0] = apikeyMixinInters1[0]
|
||||
apikeyMixinFields0 := apikeyMixin[0].Fields()
|
||||
_ = apikeyMixinFields0
|
||||
apikeyFields := schema.ApiKey{}.Fields()
|
||||
_ = apikeyFields
|
||||
// apikeyDescCreatedAt is the schema descriptor for created_at field.
|
||||
apikeyDescCreatedAt := apikeyMixinFields0[0].Descriptor()
|
||||
// apikey.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
apikey.DefaultCreatedAt = apikeyDescCreatedAt.Default.(func() time.Time)
|
||||
// apikeyDescUpdatedAt is the schema descriptor for updated_at field.
|
||||
apikeyDescUpdatedAt := apikeyMixinFields0[1].Descriptor()
|
||||
// apikey.DefaultUpdatedAt holds the default value on creation for the updated_at field.
|
||||
apikey.DefaultUpdatedAt = apikeyDescUpdatedAt.Default.(func() time.Time)
|
||||
// apikey.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
|
||||
apikey.UpdateDefaultUpdatedAt = apikeyDescUpdatedAt.UpdateDefault.(func() time.Time)
|
||||
// apikeyDescKey is the schema descriptor for key field.
|
||||
apikeyDescKey := apikeyFields[1].Descriptor()
|
||||
// apikey.KeyValidator is a validator for the "key" field. It is called by the builders before save.
|
||||
apikey.KeyValidator = func() func(string) error {
|
||||
validators := apikeyDescKey.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(key string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(key); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// apikeyDescName is the schema descriptor for name field.
|
||||
apikeyDescName := apikeyFields[2].Descriptor()
|
||||
// apikey.NameValidator is a validator for the "name" field. It is called by the builders before save.
|
||||
apikey.NameValidator = func() func(string) error {
|
||||
validators := apikeyDescName.Validators
|
||||
fns := [...]func(string) error{
|
||||
validators[0].(func(string) error),
|
||||
validators[1].(func(string) error),
|
||||
}
|
||||
return func(name string) error {
|
||||
for _, fn := range fns {
|
||||
if err := fn(name); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}()
|
||||
// apikeyDescStatus is the schema descriptor for status field.
|
||||
apikeyDescStatus := apikeyFields[4].Descriptor()
|
||||
// apikey.DefaultStatus holds the default value on creation for the status field.
|
||||
apikey.DefaultStatus = apikeyDescStatus.Default.(string)
|
||||
// apikey.StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
apikey.StatusValidator = apikeyDescStatus.Validators[0].(func(string) error)
|
||||
groupMixin := schema.Group{}.Mixin()
|
||||
groupMixinHooks1 := groupMixin[1].Hooks()
|
||||
group.Hooks[0] = groupMixinHooks1[0]
|
||||
|
||||
Reference in New Issue
Block a user