DirectAccess in filekit

This commit is contained in:
2025-03-29 17:56:38 +08:00
parent aa52aa73fe
commit 8f91649d25
6 changed files with 260 additions and 358 deletions

View File

@@ -1,11 +1,8 @@
package models
import (
"strconv"
"time"
"git.solsynth.dev/hypernet/paperclip/pkg/proto"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cachekit"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
@@ -79,23 +76,6 @@ type Attachment struct {
IsMature bool `json:"is_mature" gorm:"-"`
}
func (v *Attachment) ToAttachmentInfo() *proto.AttachmentInfo {
if v == nil {
return nil
}
return &proto.AttachmentInfo{
Id: v.Uuid,
Rid: v.Rid,
Name: v.Name,
Type: v.MimeType,
Size: strconv.FormatInt(v.Size, 10),
Hash: v.HashCode,
Mime: v.MimeType,
IsIndexable: v.IsIndexable,
}
}
func (v *Attachment) AfterUpdate(tx *gorm.DB) error {
cachekit.FKey(cachekit.DAAttachment, v.Rid)