From 595526ab155085f30555d5c612593de069f3ea67 Mon Sep 17 00:00:00 2001 From: dev02 Date: Thu, 16 Jan 2025 15:06:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E9=99=BD=E8=83=BD=E6=8E=92=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/Models/WeatherAPIJob.cs | 69 ++ .../BackendWorkerService.csproj | 1 + BackendWorkerService/Models/SolarModel.cs | 59 + BackendWorkerService/Program.cs | 30 +- BackendWorkerService/Quartz/JobSchedule.cs | 45 +- .../Quartz/Jobs/ArchiveSolarDayJob.cs | 183 +++ .../Quartz/Jobs/ArchiveSolarHourJob.cs | 113 ++ .../Quartz/Jobs/WeatherAPIJob.cs | 643 +++------- .../Services/Implement/SolarService.cs | 1060 +++++++++++++++++ .../appsettings.Development.json | 10 +- BackendWorkerService/appsettings.json | 11 +- .../BackgroundServicePostgresqlRepository.cs | 17 + .../IBackgroundServicePostgresqlRepository.cs | 12 + .../Implement/BaseRepository.cs | 7 + Repository/Helper/DatabaseHelper.cs | 18 + Repository/Models/DBConfig.cs | 9 + Repository/Models/quickType.cs | 24 + Repository/Repository.csproj | 1 + 18 files changed, 1840 insertions(+), 472 deletions(-) create mode 100644 BackendWorkerService/Models/SolarModel.cs create mode 100644 BackendWorkerService/Quartz/Jobs/ArchiveSolarDayJob.cs create mode 100644 BackendWorkerService/Quartz/Jobs/ArchiveSolarHourJob.cs create mode 100644 BackendWorkerService/Services/Implement/SolarService.cs create mode 100644 Repository/BackendRepository/Implement/BackgroundServicePostgresqlRepository.cs create mode 100644 Repository/BackendRepository/Interface/IBackgroundServicePostgresqlRepository.cs diff --git a/Backend/Models/WeatherAPIJob.cs b/Backend/Models/WeatherAPIJob.cs index 338b809..ed653e7 100644 --- a/Backend/Models/WeatherAPIJob.cs +++ b/Backend/Models/WeatherAPIJob.cs @@ -266,9 +266,78 @@ namespace Backend.Models #endregion + #region 新架構 weather api + public class Root3 + { + public string Success { get; set; } + public Records3 Records { get; set; } + } + public class Records3 + { + public string DatasetDescription { get; set; } + public string LocationsName { get; set; } + public string Dataid { get; set; } + public List Locations { get; set; } + } + public class Locations3 + { + public List Location { get; set; } + } + public class Location3 + { + public string LocationName { get; set; } + public string Geocode { get; set; } + public string Latitude { get; set; } + public string Longitude { get; set; } + public List WeatherElement { get; set; } + } + public class WeatherElement3 + { + public string ElementName { get; set; } + public List