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
-163
View File
@@ -129,34 +129,6 @@ func (_c *AttachmentCreate) SetNillableUploadedBy(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 "archived_at" field.
func (_c *AttachmentCreate) SetArchivedAt(v int64) *AttachmentCreate {
_c.mutation.SetArchivedAt(v)
return _c
}
// SetNillableArchivedAt sets the "archived_at" 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)
@@ -294,10 +266,6 @@ func (_c *AttachmentCreate) defaults() {
v := attachment.DefaultFileSize
_c.mutation.SetFileSize(v)
}
if _, ok := _c.mutation.Archived(); !ok {
v := attachment.DefaultArchived
_c.mutation.SetArchived(v)
}
if _, ok := _c.mutation.Deleted(); !ok {
v := attachment.DefaultDeleted
_c.mutation.SetDeleted(v)
@@ -325,9 +293,6 @@ func (_c *AttachmentCreate) check() error {
if _, ok := _c.mutation.FileSize(); !ok {
return &ValidationError{Name: "file_size", err: errors.New(`ent: missing required field "Attachment.file_size"`)}
}
if _, ok := _c.mutation.Archived(); !ok {
return &ValidationError{Name: "archived", err: errors.New(`ent: missing required field "Attachment.archived"`)}
}
if _, ok := _c.mutation.Deleted(); !ok {
return &ValidationError{Name: "deleted", err: errors.New(`ent: missing required field "Attachment.deleted"`)}
}
@@ -401,14 +366,6 @@ func (_c *AttachmentCreate) createSpec() (*Attachment, *sqlgraph.CreateSpec) {
_spec.SetField(attachment.FieldUploadedBy, field.TypeString, value)
_node.UploadedBy = 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
@@ -645,42 +602,6 @@ func (u *AttachmentUpsert) ClearUploadedBy() *AttachmentUpsert {
return u
}
// SetArchived sets the "archived" field.
func (u *AttachmentUpsert) SetArchived(v bool) *AttachmentUpsert {
u.Set(attachment.FieldArchived, v)
return u
}
// UpdateArchived sets the "archived" field to the value that was provided on create.
func (u *AttachmentUpsert) UpdateArchived() *AttachmentUpsert {
u.SetExcluded(attachment.FieldArchived)
return u
}
// SetArchivedAt sets the "archived_at" field.
func (u *AttachmentUpsert) SetArchivedAt(v int64) *AttachmentUpsert {
u.Set(attachment.FieldArchivedAt, v)
return u
}
// UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.
func (u *AttachmentUpsert) UpdateArchivedAt() *AttachmentUpsert {
u.SetExcluded(attachment.FieldArchivedAt)
return u
}
// AddArchivedAt adds v to the "archived_at" field.
func (u *AttachmentUpsert) AddArchivedAt(v int64) *AttachmentUpsert {
u.Add(attachment.FieldArchivedAt, v)
return u
}
// ClearArchivedAt clears the value of the "archived_at" field.
func (u *AttachmentUpsert) ClearArchivedAt() *AttachmentUpsert {
u.SetNull(attachment.FieldArchivedAt)
return u
}
// SetDeleted sets the "deleted" field.
func (u *AttachmentUpsert) SetDeleted(v bool) *AttachmentUpsert {
u.Set(attachment.FieldDeleted, v)
@@ -1035,48 +956,6 @@ func (u *AttachmentUpsertOne) ClearUploadedBy() *AttachmentUpsertOne {
})
}
// SetArchived sets the "archived" field.
func (u *AttachmentUpsertOne) SetArchived(v bool) *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.SetArchived(v)
})
}
// UpdateArchived sets the "archived" field to the value that was provided on create.
func (u *AttachmentUpsertOne) UpdateArchived() *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.UpdateArchived()
})
}
// SetArchivedAt sets the "archived_at" field.
func (u *AttachmentUpsertOne) SetArchivedAt(v int64) *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.SetArchivedAt(v)
})
}
// AddArchivedAt adds v to the "archived_at" field.
func (u *AttachmentUpsertOne) AddArchivedAt(v int64) *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.AddArchivedAt(v)
})
}
// UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.
func (u *AttachmentUpsertOne) UpdateArchivedAt() *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.UpdateArchivedAt()
})
}
// ClearArchivedAt clears the value of the "archived_at" field.
func (u *AttachmentUpsertOne) ClearArchivedAt() *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
s.ClearArchivedAt()
})
}
// SetDeleted sets the "deleted" field.
func (u *AttachmentUpsertOne) SetDeleted(v bool) *AttachmentUpsertOne {
return u.Update(func(s *AttachmentUpsert) {
@@ -1617,48 +1496,6 @@ func (u *AttachmentUpsertBulk) ClearUploadedBy() *AttachmentUpsertBulk {
})
}
// SetArchived sets the "archived" field.
func (u *AttachmentUpsertBulk) SetArchived(v bool) *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.SetArchived(v)
})
}
// UpdateArchived sets the "archived" field to the value that was provided on create.
func (u *AttachmentUpsertBulk) UpdateArchived() *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.UpdateArchived()
})
}
// SetArchivedAt sets the "archived_at" field.
func (u *AttachmentUpsertBulk) SetArchivedAt(v int64) *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.SetArchivedAt(v)
})
}
// AddArchivedAt adds v to the "archived_at" field.
func (u *AttachmentUpsertBulk) AddArchivedAt(v int64) *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.AddArchivedAt(v)
})
}
// UpdateArchivedAt sets the "archived_at" field to the value that was provided on create.
func (u *AttachmentUpsertBulk) UpdateArchivedAt() *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.UpdateArchivedAt()
})
}
// ClearArchivedAt clears the value of the "archived_at" field.
func (u *AttachmentUpsertBulk) ClearArchivedAt() *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {
s.ClearArchivedAt()
})
}
// SetDeleted sets the "deleted" field.
func (u *AttachmentUpsertBulk) SetDeleted(v bool) *AttachmentUpsertBulk {
return u.Update(func(s *AttachmentUpsert) {