feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间
This commit is contained in:
@@ -39,10 +39,6 @@ type Attachment struct {
|
||||
FileMd5 string `json:"fileMd5,omitempty"`
|
||||
// MIME类型
|
||||
MimeType string `json:"mimeType,omitempty"`
|
||||
// 是否已归档
|
||||
Archived bool `json:"archived,omitempty"`
|
||||
// 归档时间(unix秒)
|
||||
ArchivedAt int64 `json:"archivedAt,omitempty"`
|
||||
// 逻辑删除
|
||||
Deleted bool `json:"deleted,omitempty"`
|
||||
// 删除时间(unix秒)
|
||||
@@ -63,9 +59,9 @@ func (*Attachment) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case attachment.FieldArchived, attachment.FieldDeleted:
|
||||
case attachment.FieldDeleted:
|
||||
values[i] = new(sql.NullBool)
|
||||
case attachment.FieldID, attachment.FieldFileSize, attachment.FieldArchivedAt, attachment.FieldDeletedAt, attachment.FieldPurgedAt:
|
||||
case attachment.FieldID, attachment.FieldFileSize, attachment.FieldDeletedAt, attachment.FieldPurgedAt:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case attachment.FieldBizType, attachment.FieldBizId, attachment.FieldFileName, attachment.FieldFilePath, attachment.FieldUploader, attachment.FieldFileType, attachment.FieldFileExt, attachment.FieldFileMd5, attachment.FieldMimeType, attachment.FieldDeletedBy, attachment.FieldDeletedReason, attachment.FieldPurgedBy:
|
||||
values[i] = new(sql.NullString)
|
||||
@@ -158,18 +154,6 @@ func (_m *Attachment) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.MimeType = value.String
|
||||
}
|
||||
case attachment.FieldArchived:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field archived", values[i])
|
||||
} else if value.Valid {
|
||||
_m.Archived = value.Bool
|
||||
}
|
||||
case attachment.FieldArchivedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field archivedAt", values[i])
|
||||
} else if value.Valid {
|
||||
_m.ArchivedAt = value.Int64
|
||||
}
|
||||
case attachment.FieldDeleted:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field deleted", values[i])
|
||||
@@ -275,12 +259,6 @@ func (_m *Attachment) String() string {
|
||||
builder.WriteString("mimeType=")
|
||||
builder.WriteString(_m.MimeType)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("archived=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Archived))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("archivedAt=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.ArchivedAt))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("deleted=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Deleted))
|
||||
builder.WriteString(", ")
|
||||
|
||||
Reference in New Issue
Block a user