From f2bd07089b70a9a3bbee6c3eea704d074aa3457c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E6=A2=A6?= <1101766085@qq.com> Date: Tue, 12 Nov 2024 17:37:20 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20mica-holidays=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=202025=20=E8=8A=82=E5=81=87=E6=97=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mica/holidays/impl/HolidaysApiImpl.java | 16 ++++----- .../src/main/resources/data/2025_data.json | 35 +++++++++++++++++++ 2 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 mica-holidays/src/main/resources/data/2025_data.json diff --git a/mica-holidays/src/main/java/net/dreamlu/mica/holidays/impl/HolidaysApiImpl.java b/mica-holidays/src/main/java/net/dreamlu/mica/holidays/impl/HolidaysApiImpl.java index bb8dd39db..7f332e77a 100644 --- a/mica-holidays/src/main/java/net/dreamlu/mica/holidays/impl/HolidaysApiImpl.java +++ b/mica-holidays/src/main/java/net/dreamlu/mica/holidays/impl/HolidaysApiImpl.java @@ -71,14 +71,14 @@ public DaysType getDaysType(LocalDate localDate) { @Override public void afterPropertiesSet() throws Exception { - int[] years = new int[]{2019, 2020, 2021, 2022, 2023, 2024}; - for (int year : years) { - Resource resource = resourceLoader.getResource("classpath:data/" + year + "_data.json"); - try (InputStream inputStream = resource.getInputStream()) { - Map dataMap = JsonUtil.readMap(inputStream, Byte.class); - YEAR_DATA_MAP.put(year, dataMap); - } - } + int[] years = new int[]{2019, 2020, 2021, 2022, 2023, 2024, 2025}; + for (int year : years) { + Resource resource = resourceLoader.getResource("classpath:data/" + year + "_data.json"); + try (InputStream inputStream = resource.getInputStream()) { + Map dataMap = JsonUtil.readMap(inputStream, Byte.class); + YEAR_DATA_MAP.put(year, dataMap); + } + } List extDataList = properties.getExtData(); for (HolidaysApiProperties.ExtData extData : extDataList) { String dataPath = extData.getDataPath(); diff --git a/mica-holidays/src/main/resources/data/2025_data.json b/mica-holidays/src/main/resources/data/2025_data.json new file mode 100644 index 000000000..56cf2067c --- /dev/null +++ b/mica-holidays/src/main/resources/data/2025_data.json @@ -0,0 +1,35 @@ +{ + "1001": 2, + "1002": 2, + "1003": 2, + "1004": 1, + "1005": 1, + "1006": 2, + "1007": 1, + "1008": 1, + "1011": 0, + "0101": 2, + "0128": 2, + "0129": 2, + "0130": 2, + "0131": 2, + "0201": 1, + "0202": 1, + "0203": 1, + "0204": 1, + "0404": 2, + "0405": 1, + "0406": 1, + "0501": 2, + "0502": 1, + "0503": 1, + "0504": 1, + "0505": 1, + "0531": 2, + "0601": 1, + "0602": 1, + "0126": 0, + "0208": 0, + "0427": 0, + "0928": 0 +}