This commit is contained in:
oneao committed 2025-11-26 17:31:56 +08:00
1 parent a57070f860
commit b9f728812d
22 files changed
+2892 -391

No files matched your search

@@ -60,8 +60,6 @@ func init() {
userinfoDescUpdateTime := userinfoFields[8].Descriptor()
// userinfo.DefaultUpdateTime holds the default value on creation for the update_time field.
userinfo.DefaultUpdateTime = userinfoDescUpdateTime.Default.(func() time.Time)
// userinfo.UpdateDefaultUpdateTime holds the default value on update for the update_time field.
userinfo.UpdateDefaultUpdateTime = userinfoDescUpdateTime.UpdateDefault.(func() time.Time)
// userinfoDescID is the schema descriptor for id field.
userinfoDescID := userinfoFields[0].Descriptor()
// userinfo.DefaultID holds the default value on creation for the id field.
@@ -71,7 +71,6 @@ func (UserInfo) Fields() []ent.Field {
// 自动更新时间
field.Time("update_time").
Default(time.Now).
UpdateDefault(time.Now).
Comment("更新时间"),
field.Time("last_login_time").
@@ -76,8 +76,6 @@ var (
DefaultCreateTime func() time.Time
// DefaultUpdateTime holds the default value on creation for the "update_time" field.
DefaultUpdateTime func() time.Time
// UpdateDefaultUpdateTime holds the default value on update for the "update_time" field.
UpdateDefaultUpdateTime func() time.Time
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() int64
)
@@ -132,6 +132,14 @@ func (_u *UserInfoUpdate) SetUpdateTime(v time.Time) *UserInfoUpdate {
return _u
}
// SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (_u *UserInfoUpdate) SetNillableUpdateTime(v *time.Time) *UserInfoUpdate {
if v != nil {
_u.SetUpdateTime(*v)
}
return _u
}
// SetLastLoginTime sets the "last_login_time" field.
func (_u *UserInfoUpdate) SetLastLoginTime(v time.Time) *UserInfoUpdate {
_u.mutation.SetLastLoginTime(v)
@@ -159,7 +167,6 @@ func (_u *UserInfoUpdate) Mutation() *UserInfoMutation {
// Save executes the query and returns the number of nodes affected by the update operation.
func (_u *UserInfoUpdate) Save(ctx context.Context) (int, error) {
_u.defaults()
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
}
@@ -185,14 +192,6 @@ func (_u *UserInfoUpdate) ExecX(ctx context.Context) {
}
}
// defaults sets the default values of the builder before save.
func (_u *UserInfoUpdate) defaults() {
if _, ok := _u.mutation.UpdateTime(); !ok {
v := userinfo.UpdateDefaultUpdateTime()
_u.mutation.SetUpdateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (_u *UserInfoUpdate) check() error {
if v, ok := _u.mutation.Email(); ok {
@@ -387,6 +386,14 @@ func (_u *UserInfoUpdateOne) SetUpdateTime(v time.Time) *UserInfoUpdateOne {
return _u
}
// SetNillableUpdateTime sets the "update_time" field if the given value is not nil.
func (_u *UserInfoUpdateOne) SetNillableUpdateTime(v *time.Time) *UserInfoUpdateOne {
if v != nil {
_u.SetUpdateTime(*v)
}
return _u
}
// SetLastLoginTime sets the "last_login_time" field.
func (_u *UserInfoUpdateOne) SetLastLoginTime(v time.Time) *UserInfoUpdateOne {
_u.mutation.SetLastLoginTime(v)
@@ -427,7 +434,6 @@ func (_u *UserInfoUpdateOne) Select(field string, fields ...string) *UserInfoUpd
// Save executes the query and returns the updated UserInfo entity.
func (_u *UserInfoUpdateOne) Save(ctx context.Context) (*UserInfo, error) {
_u.defaults()
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
}
@@ -453,14 +459,6 @@ func (_u *UserInfoUpdateOne) ExecX(ctx context.Context) {
}
}
// defaults sets the default values of the builder before save.
func (_u *UserInfoUpdateOne) defaults() {
if _, ok := _u.mutation.UpdateTime(); !ok {
v := userinfo.UpdateDefaultUpdateTime()
_u.mutation.SetUpdateTime(v)
}
}
// check runs all checks and user-defined validators on the builder.
func (_u *UserInfoUpdateOne) check() error {
if v, ok := _u.mutation.Email(); ok {