From 56adcdf8acadb74fcedfa4f02bcac324bea36e65 Mon Sep 17 00:00:00 2001 From: "jay.chang" Date: Tue, 9 Jul 2024 15:21:13 +0800 Subject: [PATCH] =?UTF-8?q?[BGService]=E4=BF=AE=E6=AD=A3=E5=A4=A9=E6=B0=A3?= =?UTF-8?q?=E5=9F=B7=E8=A1=8C=E6=99=82=E9=96=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BackendWorkerService/Quartz/Jobs/WeatherAPIJob.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BackendWorkerService/Quartz/Jobs/WeatherAPIJob.cs b/BackendWorkerService/Quartz/Jobs/WeatherAPIJob.cs index 6a927ba..4de16f2 100644 --- a/BackendWorkerService/Quartz/Jobs/WeatherAPIJob.cs +++ b/BackendWorkerService/Quartz/Jobs/WeatherAPIJob.cs @@ -210,7 +210,9 @@ namespace BackendWorkerService.Quartz.Jobs { try { - await task_Detail.InsertWorkTime("WeatherAPI", "api_rain", null, new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 0, 25, 0)); + //await task_Detail.InsertWorkTime("WeatherAPI", "api_rain", null, new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 0, 25, 0)); + await task_Detail.InsertWorkTime("WeatherAPI", "api_rain"); + WebClient mywebClient = new WebClient(); mywebClient.DownloadFile("https://opendata.cwa.gov.tw/fileapi/v1/opendataapi/W-C0033-003?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80&downloadType=WEB&format=CAP", @"root/PowerfulRain.xml"); XmlDocument doc = new XmlDocument(); @@ -296,7 +298,9 @@ namespace BackendWorkerService.Quartz.Jobs { try { - await task_Detail.InsertWorkTime("WeatherAPI", "api_typhoon", null , new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 0, 25, 0)); + //await task_Detail.InsertWorkTime("WeatherAPI", "api_typhoon", null, new DateTime(DateTime.Now.AddDays(1).Year, DateTime.Now.AddDays(1).Month, DateTime.Now.AddDays(1).Day, 0, 25, 0)); + await task_Detail.InsertWorkTime("WeatherAPI", "api_typhoon"); + WebClient mywebClient = new WebClient(); mywebClient.DownloadFile("https://opendata.cwa.gov.tw/fileapi/v1/opendataapi/W-C0034-001?Authorization=CWB-EA24220B-DDCC-4188-84E5-AD37A0E03F80&downloadType=WEB&format=CAP", @"root/Typhoon.xml"); XmlDocument doc = new XmlDocument();