Add node ID field to file structure

This commit is contained in:
Kleissner
2021-09-28 19:55:30 +02:00
parent 608dbf6f47
commit 2c20fa950d
6 changed files with 22 additions and 10 deletions

View File

@@ -106,7 +106,8 @@ type apiBlockRecordFile struct {
Folder string `json:"folder"` // Folder, optional
Name string `json:"name"` // Name of the file
Description string `json:"description"` // Description. This is expected to be multiline and contain hashtags!
Date time.Time `json:"date"` // Date of the virtual file
Date time.Time `json:"date"` // Date shared
NodeID []byte `json:"nodeid"` // Node ID, owner of the file
Metadata []apiFileMetadata `json:"metadata"` // Additional metadata.
}
@@ -228,7 +229,7 @@ func apiBlockchainSelfDeleteFile(w http.ResponseWriter, r *http.Request) {
// --- conversion from core to API data ---
func blockRecordFileToAPI(input core.BlockRecordFile) (output apiBlockRecordFile) {
output = apiBlockRecordFile{ID: input.ID, Hash: input.Hash, Type: input.Type, Format: input.Format, Size: input.Size, Metadata: []apiFileMetadata{}}
output = apiBlockRecordFile{ID: input.ID, Hash: input.Hash, NodeID: input.NodeID, Type: input.Type, Format: input.Format, Size: input.Size, Metadata: []apiFileMetadata{}}
for _, tag := range input.Tags {
switch tag.Type {