From cbf0005d793f6a9c2420206abc4c13d6c82e5954 Mon Sep 17 00:00:00 2001 From: Andre Urbani Date: Tue, 1 Nov 2022 16:49:06 +0000 Subject: [PATCH] add related content --- models/metadata.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/models/metadata.go b/models/metadata.go index 58a533a7..7f6cc75a 100644 --- a/models/metadata.go +++ b/models/metadata.go @@ -42,6 +42,7 @@ type Metadata struct { CSVHeader []string `json:"headers,omitempty"` Version int `json:"version,omitempty"` DatasetLinks *DatasetLinks `json:"dataset_links,omitempty"` + RelatedContent []GeneralDetails `json:"related_content,omitempty"` } // MetadataLinks represents a link object to list of metadata relevant to a version @@ -134,19 +135,20 @@ func CreateMetaDataDoc(datasetDoc *Dataset, versionDoc *Version, urlBuilder *url // note: logic to retrieve the newly-added Cantabular-specific fields to the Metadata model will be created at a later date func CreateCantabularMetaDataDoc(d *Dataset, v *Version, urlBuilder *url.Builder) *Metadata { m := &Metadata{ - CSVHeader: v.Headers, - Description: d.Description, - Dimensions: v.Dimensions, - Downloads: v.Downloads, - Keywords: d.Keywords, - ReleaseDate: v.ReleaseDate, - Title: d.Title, - UnitOfMeasure: d.UnitOfMeasure, - Contacts: d.Contacts, - URI: d.URI, - QMI: d.QMI, - Version: v.Version, - DatasetLinks: d.Links, + CSVHeader: v.Headers, + Description: d.Description, + Dimensions: v.Dimensions, + Downloads: v.Downloads, + Keywords: d.Keywords, + ReleaseDate: v.ReleaseDate, + Title: d.Title, + UnitOfMeasure: d.UnitOfMeasure, + Contacts: d.Contacts, + URI: d.URI, + QMI: d.QMI, + Version: v.Version, + DatasetLinks: d.Links, + RelatedContent: d.RelatedContent, } m.Distribution = getDistribution(m.Downloads)