From c3a97efb29fc7136f334b9ce86be9946872cac59 Mon Sep 17 00:00:00 2001 From: rot1024 Date: Wed, 7 Feb 2024 17:41:47 +0900 Subject: [PATCH] fix(server): treat 2021 related data in datacatalog v2 as 2020 in datacatalogv3 --- .../datacatalogv2/datacatalogv2adapter/type.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/datacatalog/datacatalogv2/datacatalogv2adapter/type.go b/server/datacatalog/datacatalogv2/datacatalogv2adapter/type.go index 75519b2df..25e2d3bdc 100644 --- a/server/datacatalog/datacatalogv2/datacatalogv2adapter/type.go +++ b/server/datacatalog/datacatalogv2/datacatalogv2adapter/type.go @@ -195,6 +195,13 @@ func relatedDatasetFrom(d datacatalogv2.DataCatalogItem) (plateauapi.RelatedData return plateauapi.RelatedDataset{}, false } + year := d.Year + if year == 2021 { + // 2021年のデータは2020年のデータとして扱うことで + // マージ後のデータカタログではPLATEAU-2023以降のデータが優先表示されるようにする + year = 2020 + } + id := datasetIDFrom(d, nil) items := d.MainOrConfigItems() return plateauapi.RelatedDataset{ @@ -207,7 +214,7 @@ func relatedDatasetFrom(d datacatalogv2.DataCatalogItem) (plateauapi.RelatedData CityCode: cityCodeFrom(d), WardID: wardIDFrom(d), WardCode: wardCodeFrom(d), - Year: d.Year, + Year: year, TypeID: datasetTypeIDFrom(d), TypeCode: datasetTypeCodeFrom(d), Groups: groupsFrom(d),