feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间
This commit is contained in:
@@ -66,6 +66,20 @@ func (_c *RoleCreate) SetNillableCreatedAt(v *time.Time) *RoleCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetUpdatedAt sets the "updatedAt" field.
|
||||
func (_c *RoleCreate) SetUpdatedAt(v time.Time) *RoleCreate {
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableUpdatedAt sets the "updatedAt" field if the given value is not nil.
|
||||
func (_c *RoleCreate) SetNillableUpdatedAt(v *time.Time) *RoleCreate {
|
||||
if v != nil {
|
||||
_c.SetUpdatedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetID sets the "id" field.
|
||||
func (_c *RoleCreate) SetID(v int) *RoleCreate {
|
||||
_c.mutation.SetID(v)
|
||||
@@ -115,6 +129,10 @@ func (_c *RoleCreate) defaults() {
|
||||
v := role.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
}
|
||||
if _, ok := _c.mutation.UpdatedAt(); !ok {
|
||||
v := role.DefaultUpdatedAt()
|
||||
_c.mutation.SetUpdatedAt(v)
|
||||
}
|
||||
}
|
||||
|
||||
// check runs all checks and user-defined validators on the builder.
|
||||
@@ -203,6 +221,10 @@ func (_c *RoleCreate) createSpec() (*Role, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(role.FieldCreatedAt, field.TypeTime, value)
|
||||
_node.CreatedAt = value
|
||||
}
|
||||
if value, ok := _c.mutation.UpdatedAt(); ok {
|
||||
_spec.SetField(role.FieldUpdatedAt, field.TypeTime, value)
|
||||
_node.UpdatedAt = &value
|
||||
}
|
||||
return _node, _spec
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user