🐛 Fix metadata missing author info

This commit is contained in:
LittleSheep 2024-08-02 21:38:47 +08:00
parent 03f08f1ff6
commit a696b13837
4 changed files with 8 additions and 14 deletions

View File

@ -4,9 +4,7 @@
<option name="autoReloadType" value="ALL" />
</component>
<component name="ChangeListManager">
<list default="true" id="18dd0d68-b4b8-40db-9734-9119b5c848bd" name="更改" comment=":recycle: Moved onto dealer">
<change beforePath="$PROJECT_DIR$/settings.toml" beforeDir="false" afterPath="$PROJECT_DIR$/settings.toml" afterDir="false" />
</list>
<list default="true" id="18dd0d68-b4b8-40db-9734-9119b5c848bd" name="更改" comment=":recycle: Moved onto dealer" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -45,7 +43,7 @@
"RunOnceActivity.go.migrated.go.modules.settings": "true",
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
"git-widget-placeholder": "features/calc-in-backend",
"git-widget-placeholder": "master",
"go.import.settings.migrated": "true",
"go.sdk.automatically.set": "true",
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Paperclip/pkg/internal/grpc",

View File

@ -80,11 +80,11 @@ func getAttachmentMeta(c *fiber.Ctx) error {
}
func createAttachment(c *fiber.Ctx) error {
var user *models.Account
var user models.Account
if err := gap.H.EnsureAuthenticated(c); err != nil {
return err
}
user = lo.ToPtr(c.Locals("user").(models.Account))
user = c.Locals("user").(models.Account)
usage := c.FormValue("usage")
if !lo.Contains(viper.GetStringSlice("accepts_usage"), usage) {
@ -126,6 +126,7 @@ func createAttachment(c *fiber.Ctx) error {
tx.Commit()
metadata.Account = user
services.PublishAnalyzeTask(metadata)
return c.JSON(metadata)

View File

@ -48,7 +48,7 @@ func GetAttachmentByHash(hash string) (models.Attachment, error) {
return attachment, nil
}
func NewAttachmentMetadata(tx *gorm.DB, user *models.Account, file *multipart.FileHeader, attachment models.Attachment) (models.Attachment, error) {
func NewAttachmentMetadata(tx *gorm.DB, user models.Account, file *multipart.FileHeader, attachment models.Attachment) (models.Attachment, error) {
attachment.Uuid = uuid.NewString()
attachment.Size = file.Size
attachment.Name = file.Filename

View File

@ -33,10 +33,5 @@ type = "local"
path = "uploads"
[destinations.permanent]
type = "s3"
bucket = "bucket"
endpoint = "s3.ap-east-1.amazonaws.com"
secret_id = "secret"
secret_key = "secret"
access_baseurl = "https://raw.sn.solsynth.dev"
enable_ssl = true
type = "local"
path = "uploads/permanent"