-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
*-secret.yml | ||
*.Ds_Store | ||
**/data/mysql/ | ||
|
||
HELP.md | ||
.gradle | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
weather-service/src/main/java/com/waither/weatherservice/entity/Region.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.waither.weatherservice.entity; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.persistence.Table; | ||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Builder | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Getter | ||
@Entity | ||
@Table(name = "region") | ||
public class Region { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
private String stnID; | ||
private String stnKo; | ||
private String stnSp; | ||
private double longitude; | ||
private double latitude; | ||
private String fctId; | ||
private String wrnId; | ||
private String wrnKo; | ||
private String sfcStn; | ||
} |
28 changes: 28 additions & 0 deletions
28
weather-service/src/main/java/com/waither/weatherservice/scheduler/SchedulerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.waither.weatherservice.scheduler; | ||
|
||
import java.net.URISyntaxException; | ||
import java.time.LocalDateTime; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
|
||
import com.waither.weatherservice.service.WeatherService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
@Slf4j | ||
@RequiredArgsConstructor | ||
@ConfigurationProperties | ||
public class SchedulerConfig { | ||
|
||
private final WeatherService weatherService; | ||
@Scheduled(cron = "0 0 14,17,20 * * *") | ||
public void createDailyWeather() throws URISyntaxException { | ||
|
||
LocalDateTime now = LocalDateTime.now(); | ||
String[] dateTime = weatherService.convertLocalDateTimeToString(now).split("_"); | ||
// TODO 지역 DB 정리 후 변경 예정 | ||
weatherService.createDailyWeather(55, 127, dateTime[0], dateTime[1]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.