feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间

This commit is contained in:
SunYF
2026-10-31 15:41:27 +08:00
parent 11dbdaae75
commit 0c03d32682
107 changed files with 10790 additions and 1844 deletions
-50
View File
@@ -142,34 +142,6 @@ func (_c *AttachmentCreate) SetNillableMimeType(v *string) *AttachmentCreate {
return _c
}
// SetArchived sets the "archived" field.
func (_c *AttachmentCreate) SetArchived(v bool) *AttachmentCreate {
_c.mutation.SetArchived(v)
return _c
}
// SetNillableArchived sets the "archived" field if the given value is not nil.
func (_c *AttachmentCreate) SetNillableArchived(v *bool) *AttachmentCreate {
if v != nil {
_c.SetArchived(*v)
}
return _c
}
// SetArchivedAt sets the "archivedAt" field.
func (_c *AttachmentCreate) SetArchivedAt(v int64) *AttachmentCreate {
_c.mutation.SetArchivedAt(v)
return _c
}
// SetNillableArchivedAt sets the "archivedAt" field if the given value is not nil.
func (_c *AttachmentCreate) SetNillableArchivedAt(v *int64) *AttachmentCreate {
if v != nil {
_c.SetArchivedAt(*v)
}
return _c
}
// SetDeleted sets the "deleted" field.
func (_c *AttachmentCreate) SetDeleted(v bool) *AttachmentCreate {
_c.mutation.SetDeleted(v)
@@ -323,14 +295,6 @@ func (_c *AttachmentCreate) defaults() {
v := attachment.DefaultMimeType
_c.mutation.SetMimeType(v)
}
if _, ok := _c.mutation.Archived(); !ok {
v := attachment.DefaultArchived
_c.mutation.SetArchived(v)
}
if _, ok := _c.mutation.ArchivedAt(); !ok {
v := attachment.DefaultArchivedAt
_c.mutation.SetArchivedAt(v)
}
if _, ok := _c.mutation.Deleted(); !ok {
v := attachment.DefaultDeleted
_c.mutation.SetDeleted(v)
@@ -437,12 +401,6 @@ func (_c *AttachmentCreate) check() error {
return &ValidationError{Name: "mimeType", err: fmt.Errorf(`ent: validator failed for field "Attachment.mimeType": %w`, err)}
}
}
if _, ok := _c.mutation.Archived(); !ok {
return &ValidationError{Name: "archived", err: errors.New(`ent: missing required field "Attachment.archived"`)}
}
if _, ok := _c.mutation.ArchivedAt(); !ok {
return &ValidationError{Name: "archivedAt", err: errors.New(`ent: missing required field "Attachment.archivedAt"`)}
}
if _, ok := _c.mutation.Deleted(); !ok {
return &ValidationError{Name: "deleted", err: errors.New(`ent: missing required field "Attachment.deleted"`)}
}
@@ -557,14 +515,6 @@ func (_c *AttachmentCreate) createSpec() (*Attachment, *sqlgraph.CreateSpec) {
_spec.SetField(attachment.FieldMimeType, field.TypeString, value)
_node.MimeType = value
}
if value, ok := _c.mutation.Archived(); ok {
_spec.SetField(attachment.FieldArchived, field.TypeBool, value)
_node.Archived = value
}
if value, ok := _c.mutation.ArchivedAt(); ok {
_spec.SetField(attachment.FieldArchivedAt, field.TypeInt64, value)
_node.ArchivedAt = value
}
if value, ok := _c.mutation.Deleted(); ok {
_spec.SetField(attachment.FieldDeleted, field.TypeBool, value)
_node.Deleted = value