feat: add pinned_at field to account pins

This commit is contained in:
Derrick Hammer 2024-03-21 16:28:48 -04:00
parent 62867f26a9
commit 755aff15da
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package s5 package s5
import ( import (
"time"
"git.lumeweb.com/LumeWeb/libs5-go/encoding" "git.lumeweb.com/LumeWeb/libs5-go/encoding"
"git.lumeweb.com/LumeWeb/libs5-go/types" "git.lumeweb.com/LumeWeb/libs5-go/types"
"git.lumeweb.com/LumeWeb/portal/db/models" "git.lumeweb.com/LumeWeb/portal/db/models"
@ -126,7 +128,8 @@ type AccountPinResponse struct {
} }
type AccountPin struct { type AccountPin struct {
Hash string `json:"hash"` Hash string `json:"hash"`
Size uint64 `json:"size"` Size uint64 `json:"size"`
MimeType string `json:"mime_type"` PinnedAt time.Time `json:"pinned_at"`
MimeType string `json:"mime_type"`
} }

View File

@ -872,6 +872,7 @@ func (s *S5API) accountPins(jc jape.Context) {
pins[i] = AccountPin{ pins[i] = AccountPin{
Hash: base64Url, Hash: base64Url,
Size: pin.Upload.Size, Size: pin.Upload.Size,
PinnedAt: pin.CreatedAt,
MimeType: pin.Upload.MimeType, MimeType: pin.Upload.MimeType,
} }
} }

View File

@ -912,12 +912,15 @@ components:
required: required:
- hash - hash
- size - size
- pinned_at
- mime_type - mime_type
properties: properties:
hash: hash:
type: string type: string
size: size:
type: integer type: integer
pinned_at:
type: string
mime_type: mime_type:
type: string type: string
RegistryQueryResponse: RegistryQueryResponse: