🐛 Fix metadata missing author info
This commit is contained in:
parent
03f08f1ff6
commit
a696b13837
@ -4,9 +4,7 @@
|
|||||||
<option name="autoReloadType" value="ALL" />
|
<option name="autoReloadType" value="ALL" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="18dd0d68-b4b8-40db-9734-9119b5c848bd" name="更改" comment=":recycle: Moved onto dealer">
|
<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>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
@ -45,7 +43,7 @@
|
|||||||
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
||||||
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
||||||
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "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.import.settings.migrated": "true",
|
||||||
"go.sdk.automatically.set": "true",
|
"go.sdk.automatically.set": "true",
|
||||||
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Paperclip/pkg/internal/grpc",
|
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Paperclip/pkg/internal/grpc",
|
||||||
|
@ -80,11 +80,11 @@ func getAttachmentMeta(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createAttachment(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 {
|
if err := gap.H.EnsureAuthenticated(c); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
user = lo.ToPtr(c.Locals("user").(models.Account))
|
user = c.Locals("user").(models.Account)
|
||||||
|
|
||||||
usage := c.FormValue("usage")
|
usage := c.FormValue("usage")
|
||||||
if !lo.Contains(viper.GetStringSlice("accepts_usage"), usage) {
|
if !lo.Contains(viper.GetStringSlice("accepts_usage"), usage) {
|
||||||
@ -126,6 +126,7 @@ func createAttachment(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
tx.Commit()
|
tx.Commit()
|
||||||
|
|
||||||
|
metadata.Account = user
|
||||||
services.PublishAnalyzeTask(metadata)
|
services.PublishAnalyzeTask(metadata)
|
||||||
|
|
||||||
return c.JSON(metadata)
|
return c.JSON(metadata)
|
||||||
|
@ -48,7 +48,7 @@ func GetAttachmentByHash(hash string) (models.Attachment, error) {
|
|||||||
return attachment, nil
|
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.Uuid = uuid.NewString()
|
||||||
attachment.Size = file.Size
|
attachment.Size = file.Size
|
||||||
attachment.Name = file.Filename
|
attachment.Name = file.Filename
|
||||||
|
@ -33,10 +33,5 @@ type = "local"
|
|||||||
path = "uploads"
|
path = "uploads"
|
||||||
|
|
||||||
[destinations.permanent]
|
[destinations.permanent]
|
||||||
type = "s3"
|
type = "local"
|
||||||
bucket = "bucket"
|
path = "uploads/permanent"
|
||||||
endpoint = "s3.ap-east-1.amazonaws.com"
|
|
||||||
secret_id = "secret"
|
|
||||||
secret_key = "secret"
|
|
||||||
access_baseurl = "https://raw.sn.solsynth.dev"
|
|
||||||
enable_ssl = true
|
|
||||||
|
Loading…
Reference in New Issue
Block a user