Java 17
SpringBoot 3.1.1
Mysql
ElasticSearch
Webflux
if you need to volume mounting
edit docker-compose.yml(mysql, elasticsearch)
remove comment and change path(/Users/Eomjihwan <- this part)
데이터 수집이 필요없다면 WeatherDataCollectService의 @PostConstruct를 주석처리 하세요.
공공API(OPEN API)의 최대 요청 횟수 제한으로 인하여 data gathering function이 동작하지
못할 경우를 대비하여 7월 7일자 data는 넣어놨습니다.
공공API(OPEN API) 에러로 인하여 데이터가 없을 경우 해당 7월 7일자 기준으로 날씨 데이터를 제공합니다.
remember this project need JAVA17 !!
./gradlew build && docker-compose build && docker-compose up -d
db_password -> stephano-tri(infer docker-compose.yml)
docker exec -it mysql bin/bash
cd docker-entrypoint-initdb.d
mysql -u root -p --port 3306 < init.sql
Jasync not support caching_sha2_password
docker exec -it mysql bin/bash
mysql -u root -p
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'stephano-tri';
@PostConstructor를 통하여 Spring Application 시작시 공공API에서 날씨 정보를 수집합니다(-> MYSQL)
Spring Webflux를 통하여 비동기적으로 날씨 정보를 제공합니다(<- MYSQL)
SpringBoot(log4j2)를 통하여 로그를 수집합니다(-> FILESYSTEM)
실패한 Request들에 대하여 로그를 수집합니다(-> ELASTICSEARCH)
docker exec -it weather-service bin/bash
tail -f logs/weather-service.log
curl --location --request GET 'localhost:9200/request.log/_search'
OR
localhost:9200/request.log/_search
If you want to daily backup , use this command in cron, crontab
docker exec mysql bash -c 'exec mysqldump --databases "weather" -h mysql -u"root" -p"stephano-tri"' > gzip > backup/snapshot-001
RequestParam
type : short, mid, mid_temp
regionName : 지역명(시,도 단위로 검색해주세요 e.g. 인천,서울 )
Example
curl --location --request GET 'localhost:8080/api/v1/forecast/address/search?type=short®ionName=인천'
RequestParam
regionCode : 지역 코드(주소 코드 조회에서 불러온 코드를 사용합니다.)
Example
curl --location --request GET 'localhost:8080/api/v1/today/forecast/load?regionCode=4148039000'
RequestParam
regionCode : 지역 코드(주소 코드 조회에서 불러온 코드를 사용합니다.)
Example
curl --location --request GET 'localhost:8080/api/v1/midterm/forecast/load?regionCode=11B00000'
RequestParam
regionCode : 지역 코드(주소 코드 조회에서 불러온 코드를 사용합니다.)
Example
curl --location --request GET 'localhost:8080/api/v1/midterm/temperature/forecast/load?regionCode=11G00401'
