initial commit = working code

develop
bvn13 2020-04-03 02:05:42 +03:00
commit bd6fc3e7bd
73 changed files with 4358 additions and 0 deletions

6
.gitignore vendored 100644
View File

@ -0,0 +1,6 @@
.ideaDataSources
dataSources
*.iml
*.ipr
*.iws

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
#Thu Apr 02 12:41:23 MSK 2020
gradle.version=5.2.1

Binary file not shown.

View File

98
build.gradle 100644
View File

@ -0,0 +1,98 @@
buildscript {
ext {
springBootVersion = '2.2.6.RELEASE'
springBootDependenciesVersion = '1.0.9.RELEASE'
}
repositories {
maven { url 'https://repo.spring.io/milestone' }
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}"
classpath "io.spring.gradle:dependency-management-plugin:${springBootDependenciesVersion}"
}
}
plugins {
id 'org.springframework.boot' version '2.2.6.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'java'
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
project.ext {
camelVersion = '3.1.0'
springBootDependenciesVersion = '2.2.2.RELEASE'
fasterxmlJacksonVersion = '2.10.0'
apacheCommonsCollectionsVersion = '4.4'
apacheCommonsLangVersion = '3.9'
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.bvn13.covid19'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven { url 'https://repo.spring.io/milestone' }
mavenCentral()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
dependencyManagement {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
annotationProcessor 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
// https://mvnrepository.com/artifact/org.apache.commons/commons-collections4
implementation "org.apache.commons:commons-collections4:${apacheCommonsCollectionsVersion}"
// https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
implementation "org.apache.commons:commons-lang3:${apacheCommonsLangVersion}"
}
test {
useJUnitPlatform()
testLogging {
events 'started', 'passed', 'failed', 'skipped', 'standard_out', 'standard_error'
}
}
}
defaultTasks('clean', 'compileTestJava', 'jar')

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="covid19:main" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/build/classes/java/main" />
<exclude-output />
<content url="file://$MODULE_DIR$/src/main" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="covid19:test" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.type="sourceSet" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output-test url="file://$MODULE_DIR$/build/classes/java/test" />
<exclude-output />
<content url="file://$MODULE_DIR$/src/test" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="bvn13.develop.covid19.main" />
</component>
<component name="TestModuleProperties" production-module="covid19.main" />
</module>

32
covid19-api/.gitignore vendored 100644
View File

@ -0,0 +1,32 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/

View File

@ -0,0 +1,15 @@
version = '0.0.1'
dependencies {
compile(project(':covid19-model'))
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'com.github.ben-manes.caffeine:caffeine:2.8.1'
runtimeOnly 'org.postgresql:postgresql'
}

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
covid19-api/gradlew vendored 100755
View File

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG=$(dirname "$PRG")"/$link"
fi
done
SAVED="$(pwd)"
cd "$(dirname \"$PRG\")/" >/dev/null
APP_HOME="$(pwd -P)"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=$(basename "$0")
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn() {
echo "$*"
}
die() {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$(uname)" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
MINGW*)
msys=true
;;
NONSTOP*)
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
MAX_FD_LIMIT=$(ulimit -H -n)
if [ $? -eq 0 ]; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ]; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ]; then
APP_HOME=$(cygpath --path --mixed "$APP_HOME")
CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
JAVACMD=$(cygpath --unix "$JAVACMD")
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
SEP=""
for dir in $ROOTDIRSRAW; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ]; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@"; do
CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
else
eval $(echo args$i)="\"$arg\""
fi
i=$(expr $i + 1)
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save() {
for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

103
covid19-api/gradlew.bat vendored 100644
View File

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,20 @@
package com.bvn13.covid19.api;
import com.bvn13.covid19.model.Covid19ModelConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Import;
@EnableCaching
@SpringBootApplication
@Import({
Covid19ModelConfig.class
})
public class Covid19ApiApplication {
public static void main(String[] args) {
SpringApplication.run(Covid19ApiApplication.class, args);
}
}

View File

@ -0,0 +1,57 @@
package com.bvn13.covid19.api.controllers;
import com.bvn13.covid19.api.model.CovidStatsInfo;
import com.bvn13.covid19.api.model.CovidStatsResponse;
import com.bvn13.covid19.api.service.CovidStatsMaker;
import com.bvn13.covid19.model.entities.CovidStat;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.time.ZoneId;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@RestController
@RequestMapping("/")
public class MainController {
private final CovidStatsMaker covidStatsMaker;
@Value("${app.zone-id}")
private String zoneIdStr;
private ZoneId zoneId;
@PostConstruct
public void init() {
zoneId = ZoneId.of(zoneIdStr);
}
@GetMapping
public CovidStatsResponse getStatistics() {
return covidStatsMaker.findLastUpdateInfo()
.map(updateInfo -> CovidStatsResponse.builder()
.datetime(updateInfo.getDatetime())
.updatedOn(updateInfo.getCreatedOn().atZone(zoneId))
.stats(convertStats(covidStatsMaker.findCovidStatsByUpdateInfoId(updateInfo.getId())))
.build())
.orElse(CovidStatsResponse.builder().build());
}
private List<CovidStatsInfo> convertStats(Collection<CovidStat> stats) {
return stats.stream()
.map(stat -> CovidStatsInfo.builder()
.region(stat.getRegion().getName())
.sick(stat.getSick())
.healed(stat.getHealed())
.died(stat.getDied())
.build())
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,15 @@
package com.bvn13.covid19.api.converters;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
@Component
public class ZonedDateTimeToStringConverter implements Converter<ZonedDateTime, String> {
@Override
public String convert(ZonedDateTime source) {
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(source);
}
}

View File

@ -0,0 +1,10 @@
package com.bvn13.covid19.api.dtos;
import lombok.Value;
import java.time.LocalDateTime;
@Value
public class CovidUpdateInfoDto {
LocalDateTime createdOn;
}

View File

@ -0,0 +1,25 @@
package com.bvn13.covid19.api.model;
import lombok.Builder;
import lombok.Value;
import java.time.ZonedDateTime;
@Builder
@Value
public class CovidStatsInfo {
String region;
long sick;
long healed;
long died;
@Builder
@Value
public static class Delta {
long sick;
long healed;
long died;
}
}

View File

@ -0,0 +1,19 @@
package com.bvn13.covid19.api.model;
import lombok.Builder;
import lombok.Singular;
import lombok.Value;
import java.time.ZonedDateTime;
import java.util.List;
@Builder
@Value
public class CovidStatsResponse {
ZonedDateTime updatedOn;
ZonedDateTime datetime;
@Singular(value = "stats")
List<CovidStatsInfo> stats;
}

View File

@ -0,0 +1,16 @@
package com.bvn13.covid19.api.repositories;
import com.bvn13.covid19.model.entities.CovidStat;
import com.bvn13.covid19.model.entities.CovidUpdateInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Collection;
@Repository
public interface CovidStatsRepository extends JpaRepository<CovidStat, Long> {
Collection<CovidStat> findAllByUpdateInfo(CovidUpdateInfo updateInfo);
Collection<CovidStat> findAllByUpdateInfo_Id(long updateInfoId);
}

View File

@ -0,0 +1,20 @@
package com.bvn13.covid19.api.repositories;
import com.bvn13.covid19.api.dtos.CovidUpdateInfoDto;
import com.bvn13.covid19.model.entities.CovidUpdateInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.time.LocalDateTime;
import java.util.Optional;
@Repository
public interface CovidUpdateInfosRepository extends JpaRepository<CovidUpdateInfo, Long> {
@Query("select new com.bvn13.covid19.api.dtos.CovidUpdateInfoDto(max(U.createdOn)) from CovidUpdateInfo U")
Optional<CovidUpdateInfoDto> findLastUpdateInfo();
Optional<CovidUpdateInfo> findFirstByCreatedOn(LocalDateTime createdOn);
}

View File

@ -0,0 +1,50 @@
package com.bvn13.covid19.api.service;
import com.bvn13.covid19.api.repositories.CovidStatsRepository;
import com.bvn13.covid19.api.repositories.CovidUpdateInfosRepository;
import com.bvn13.covid19.model.entities.CovidStat;
import com.bvn13.covid19.model.entities.CovidUpdateInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;
import javax.transaction.Transactional;
import java.util.Collection;
import java.util.Collections;
import java.util.Optional;
@RequiredArgsConstructor
@Component
public class CovidStatsMaker {
private final CovidStatsRepository covidRepository;
private final CovidUpdateInfosRepository updatesRepository;
@Transactional
public Collection<CovidStat> getLastCovidStats() {
return updatesRepository.findLastUpdateInfo()
.flatMap(updateInfo -> updatesRepository.findFirstByCreatedOn(updateInfo.getCreatedOn()))
.map(covidRepository::findAllByUpdateInfo)
.orElse(Collections.emptyList());
}
@Cacheable(
cacheNames = "covid-last-update-info",
unless = "#result == null"
)
@Transactional
public Optional<CovidUpdateInfo> findLastUpdateInfo() {
return updatesRepository.findLastUpdateInfo()
.flatMap(updateInfo -> updatesRepository.findFirstByCreatedOn(updateInfo.getCreatedOn()));
}
@Cacheable(
cacheNames = "covid-stats-by-update-info-id",
condition = "#updateInfoId > 0",
unless = "#result == null || #result.size() <= 0"
)
public Collection<CovidStat> findCovidStatsByUpdateInfoId(long updateInfoId) {
return covidRepository.findAllByUpdateInfo_Id(updateInfoId);
}
}

View File

@ -0,0 +1,49 @@
app:
zone-id: Europe/Moscow
spring:
application:
name: covid19-api
cache:
type: caffeine
caffeine:
spec: expireAfterWrite=15m
cache-names: covid-last-update-info, covid-stats-by-update-info-id
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/covid19
username: <covid19>
password: <covid19pass>
jpa:
show-sql: true
hibernate:
dialect: org.hibernate.dialect.PostgreSQL
ddl-auto: update
properties:
hibernate:
use_sql_comments: true
format_sql: true
show_sql: true
jdbc:
lob:
non_contextual_creation: true
logging:
level:
root: info
com:
bvn13:
covid19: debug
org:
springframework: warn
hibernate:
SQL: debug
type:
descriptor:
sql:
BasicBinder: trace
pattern:
console: "%d{dd-MM-yyyy HH:mm:ss.SSS} %highlight(%-5level) %magenta([%thread]) %yellow(%logger.%M) - %msg%n"

View File

@ -0,0 +1,13 @@
package com.bvn13.covid19.covid19api;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class Covid19ApiApplicationTests {
@Test
void contextLoads() {
}
}

32
covid19-model/.gitignore vendored 100644
View File

@ -0,0 +1,32 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/

View File

@ -0,0 +1,11 @@
//apply plugin: 'org.springframework.boot.gradle.plugin.SpringBootPlugin'
version = '0.0.1'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
}
bootJar { enabled = false }
jar { enabled = true }

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
covid19-model/gradlew vendored 100755
View File

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG=$(dirname "$PRG")"/$link"
fi
done
SAVED="$(pwd)"
cd "$(dirname \"$PRG\")/" >/dev/null
APP_HOME="$(pwd -P)"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=$(basename "$0")
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn() {
echo "$*"
}
die() {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$(uname)" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
MINGW*)
msys=true
;;
NONSTOP*)
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
MAX_FD_LIMIT=$(ulimit -H -n)
if [ $? -eq 0 ]; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ]; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ]; then
APP_HOME=$(cygpath --path --mixed "$APP_HOME")
CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
JAVACMD=$(cygpath --unix "$JAVACMD")
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
SEP=""
for dir in $ROOTDIRSRAW; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ]; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@"; do
CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
else
eval $(echo args$i)="\"$arg\""
fi
i=$(expr $i + 1)
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save() {
for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

103
covid19-model/gradlew.bat vendored 100644
View File

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,12 @@
package com.bvn13.covid19.model;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@Configuration
//@ComponentScan("com.bvn13.covid19.model")
@EntityScan("com.bvn13.covid19.model.entities")
public class Covid19ModelConfig {
}

View File

@ -0,0 +1,36 @@
package com.bvn13.covid19.model.entities;
import lombok.Data;
import javax.persistence.*;
import java.time.LocalDateTime;
@Data
@Entity
@Table(name = "covid_statistics")
public class CovidStat {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private long id;
private LocalDateTime createdOn;
@ManyToOne
@JoinColumn(name = "region_id")
private Region region;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "update_info_id")
private CovidUpdateInfo updateInfo;
private long sick;
private long healed;
private long died;
@PrePersist
public void prePersist() {
this.createdOn = LocalDateTime.now();
}
}

View File

@ -0,0 +1,23 @@
package com.bvn13.covid19.model.entities;
import lombok.Data;
import javax.persistence.*;
import java.time.LocalDateTime;
import java.time.ZonedDateTime;
@Data
@Entity
@Table(name = "update_info", uniqueConstraints = {
@UniqueConstraint(columnNames = {"createdOn"})
})
public class CovidUpdateInfo {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private long id;
private LocalDateTime createdOn;
private ZonedDateTime datetime;
}

View File

@ -0,0 +1,20 @@
package com.bvn13.covid19.model.entities;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
@Data
@Entity
@Table(name = "regions", uniqueConstraints = {
@UniqueConstraint(columnNames = "name")
})
public class Region {
@Id
private String name;
}

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,13 @@
package com.bvn13.covid19.model;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class Covid19ModelApplicationTests {
@Test
void contextLoads() {
}
}

32
covid19-scheduler/.gitignore vendored 100644
View File

@ -0,0 +1,32 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/

View File

@ -0,0 +1,18 @@
version = '0.0.1'
dependencies {
compile(project(':covid19-model'))
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.apache.camel.springboot:camel-spring-boot-starter:3.1.0'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.jsoup:jsoup:1.13.1'
runtimeOnly 'org.postgresql:postgresql'
}
springBoot {
mainClassName = 'com.bvn13.covid19.scheduler.Covid19SchedulerApplication'
}

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
covid19-scheduler/gradlew vendored 100755
View File

@ -0,0 +1,183 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG=$(dirname "$PRG")"/$link"
fi
done
SAVED="$(pwd)"
cd "$(dirname \"$PRG\")/" >/dev/null
APP_HOME="$(pwd -P)"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=$(basename "$0")
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn() {
echo "$*"
}
die() {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$(uname)" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
MINGW*)
msys=true
;;
NONSTOP*)
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ]; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ]; then
MAX_FD_LIMIT=$(ulimit -H -n)
if [ $? -eq 0 ]; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ]; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ]; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ]; then
APP_HOME=$(cygpath --path --mixed "$APP_HOME")
CLASSPATH=$(cygpath --path --mixed "$CLASSPATH")
JAVACMD=$(cygpath --unix "$JAVACMD")
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=$(find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null)
SEP=""
for dir in $ROOTDIRSRAW; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ]; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@"; do
CHECK=$(echo "$arg" | egrep -c "$OURCYGPATTERN" -)
CHECK2=$(echo "$arg" | egrep -c "^-") ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ]; then ### Added a condition
eval $(echo args$i)=$(cygpath --path --ignore --mixed "$arg")
else
eval $(echo args$i)="\"$arg\""
fi
i=$(expr $i + 1)
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save() {
for i; do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/"; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"

103
covid19-scheduler/gradlew.bat vendored 100644
View File

@ -0,0 +1,103 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -0,0 +1,20 @@
package com.bvn13.covid19.scheduler;
import com.bvn13.covid19.model.Covid19ModelConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
@EnableJpaRepositories("com.bvn13.covid19.scheduler")
@SpringBootApplication
@Import({
Covid19ModelConfig.class
})
public class Covid19SchedulerApplication {
public static void main(String[] args) {
SpringApplication.run(Covid19SchedulerApplication.class, args);
}
}

View File

@ -0,0 +1,10 @@
package com.bvn13.covid19.scheduler;
import com.bvn13.covid19.model.entities.CovidStat;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface CovidStatsRepository extends JpaRepository<CovidStat, Long> {
}

View File

@ -0,0 +1,9 @@
package com.bvn13.covid19.scheduler;
import com.bvn13.covid19.model.entities.CovidUpdateInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface CovidUpdateInfosRepository extends JpaRepository<CovidUpdateInfo, Long> {
}

View File

@ -0,0 +1,14 @@
package com.bvn13.covid19.scheduler;
import com.bvn13.covid19.model.entities.Region;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
@Repository
public interface RegionsRepository extends JpaRepository<Region, Long> {
Optional<Region> findByName(String name);
}

View File

@ -0,0 +1,59 @@
package com.bvn13.covid19.scheduler.updater.stopcoronovirusrf;
import com.bvn13.covid19.scheduler.updater.stopcoronovirusrf.model.RowData;
import org.apache.camel.Exchange;
import org.apache.camel.Handler;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.List;
@Component
public class StopcoronovirusRfDataRetriever {
//private static final String URL = "https://стопкоронавирус.рф/";
private static final String HOST = "xn--80aesfpebagmfblc0a.xn--p1ai";
private static final String URL = "https://xn--80aesfpebagmfblc0a.xn--p1ai/";
@Value("${app.user-agent}")
private String userAgent;
@Handler
public void retrieveData(Exchange exchange) throws Exception {
Document doc = Jsoup.connect(URL)
.userAgent(userAgent)
.timeout(30*1000)
//.referrer("http://google.com")
// .header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8")
// .header("Accept-Encoding", "gzip, deflate, br")
// .header("Accept-Language", "ru-RU,ru;q=0.5")
// .header("Cache-Control", "no-cache")
// .header("Connection", "keep-alive")
// .header("Pragma", "no-cache")
// .header("Host", HOST)
.get();
Elements tableData = doc.select("div.d-map__list > table > tbody > tr");
List<RowData> rows = new ArrayList<>(tableData.size());
for (Element row : tableData) {
rows.add(RowData.builder()
.region(row.selectFirst("th").text())
.sick(row.selectFirst("td > span.d-map__indicator_sick").parent().ownText())
.healed(row.selectFirst("td > span.d-map__indicator_healed").parent().ownText())
.died(row.selectFirst("td > span.d-map__indicator_die").parent().ownText())
.build());
}
exchange.getIn().setHeader(StopcoronovirusRfUpdater.HEADER_DATE_OF_DATA, doc.selectFirst(".d-map__title > span").ownText());
exchange.getIn().setBody(rows);
}
}

View File

@ -0,0 +1,133 @@
package com.bvn13.covid19.scheduler.updater.stopcoronovirusrf;
import com.bvn13.covid19.model.entities.CovidStat;
import com.bvn13.covid19.model.entities.Region;
import com.bvn13.covid19.model.entities.CovidUpdateInfo;
import com.bvn13.covid19.scheduler.CovidStatsRepository;
import com.bvn13.covid19.scheduler.RegionsRepository;
import com.bvn13.covid19.scheduler.CovidUpdateInfosRepository;
import com.bvn13.covid19.scheduler.updater.stopcoronovirusrf.model.RowData;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.transaction.Transactional;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Collection;
import java.util.Iterator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
@RequiredArgsConstructor
public class StopcoronovirusRfService {
private static final Pattern PATTERN_DATE = Pattern.compile("[а-яА-Я\\s]*(\\d{1,2})\\s([а-яА-Я]+)\\s(\\d{1,2})\\:(\\d{1,2})", Pattern.CASE_INSENSITIVE);
private final CovidStatsRepository repository;
private final RegionsRepository regionsRepository;
private final CovidUpdateInfosRepository updatesRepository;
@Value("${app.zone-id}")
private String zoneIdStr;
private ZoneId zoneId;
@PostConstruct
public void init() {
zoneId = ZoneId.of(zoneIdStr);
}
@Transactional
public void saveRawData(String date, Collection<RowData> rawData) {
ZonedDateTime zdt = parseZonedDateTime(date);
CovidUpdateInfo updateInfo = new CovidUpdateInfo();
updateInfo.setCreatedOn(LocalDateTime.now());
updateInfo.setDatetime(zdt);
updateInfo = updatesRepository.save(updateInfo);
Iterator<RowData> iter = rawData.iterator();
while (iter.hasNext()) {
RowData row = iter.next();
Region region = regionsRepository.findByName(row.getRegion()).orElseGet(() -> {
Region r = new Region();
r.setName(row.getRegion());
return regionsRepository.save(r);
});
CovidStat covidStat = new CovidStat();
covidStat.setUpdateInfo(updateInfo);
covidStat.setRegion(region);
covidStat.setSick(Long.parseLong(row.getSick()));
covidStat.setHealed(Long.parseLong(row.getHealed()));
covidStat.setDied(Long.parseLong(row.getDied()));
repository.save(covidStat);
}
}
private ZonedDateTime parseZonedDateTime(String date) {
Matcher matcher = PATTERN_DATE.matcher(date);
if (matcher.find()) {
return ZonedDateTime.of(
2020,
detectMonth(matcher.group(2)),
Integer.parseInt(matcher.group(1)),
Integer.parseInt(matcher.group(3)),
Integer.parseInt(matcher.group(4)),
0, 0, zoneId
);
} else {
throw new IllegalArgumentException("Could not parse date: "+date);
}
}
private int detectMonth(String m) {
switch (m.trim().toLowerCase()) {
case "январь":
case "января":
return 1;
case "февраль":
case "февраля":
return 2;
case "март":
case "марта":
return 3;
case "апрель":
case "апреля":
return 4;
case "май":
case "мая":
return 5;
case "июнь":
case "июня":
return 6;
case "июль":
case "июля":
return 7;
case "август":
case "августа":
return 8;
case "сентябрь":
case "сентября":
return 9;
case "октябрь":
case "октября":
return 10;
case "ноябрь":
case "ноября":
return 11;
case "декабрь":
case "декабря":
return 12;
default: throw new IllegalArgumentException("Could not detect month: "+m);
}
}
}

View File

@ -0,0 +1,51 @@
package com.bvn13.covid19.scheduler.updater.stopcoronovirusrf;
import com.bvn13.covid19.scheduler.updater.stopcoronovirusrf.model.RowData;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.camel.*;
import org.apache.camel.builder.RouteBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Collection;
@Slf4j
@Component
@RequiredArgsConstructor
public class StopcoronovirusRfUpdater extends RouteBuilder {
public static final String HEADER_DATE_OF_DATA = "covid19-date-of-data";
private final StopcoronovirusRfDataRetriever dataRetriever;
private final StopcoronovirusRfService service;
@Value("${app.timer.stopcoronovirusrf}")
private int stopcoronovirusrfTimerSecons;
private long stopcoronovirusrfTimerMillis;
@PostConstruct
public void init() {
stopcoronovirusrfTimerMillis = stopcoronovirusrfTimerSecons * 1000;
}
@Override
public void configure() throws Exception {
from("timer:stopcoronovirusrf?delay=1000&period="+stopcoronovirusrfTimerMillis)
.log(LoggingLevel.DEBUG, log, "Start retrieving data from stopcoronovirus.rf")
.process(dataRetriever::retrieveData)
.bean(this, "saveData")
.log(LoggingLevel.DEBUG, log, "Processed data count: ${body.size}")
;
}
@Handler
public void saveData(@Header(HEADER_DATE_OF_DATA) String dataDate, @Body Collection<RowData> rawData) {
service.saveRawData(dataDate, rawData);
}
}

View File

@ -0,0 +1,15 @@
package com.bvn13.covid19.scheduler.updater.stopcoronovirusrf.model;
import lombok.Builder;
import lombok.Value;
@Builder
@Value
public class RowData {
String region;
String sick;
String healed;
String died;
}

View File

@ -0,0 +1,49 @@
app:
user-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
zone-id: Europe/Moscow
timer:
# IN SECONDS
# 1 hour
stopcoronovirusrf: 3600
spring:
application:
name: covid19-scheduler
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/covid19
username: <covid19>
password: <covid19pass>
jpa:
show-sql: true
hibernate:
dialect: org.hibernate.dialect.PostgreSQL
ddl-auto: update
properties:
hibernate:
use_sql_comments: true
format_sql: true
show_sql: true
jdbc:
lob:
non_contextual_creation: true
logging:
level:
root: info
com:
bvn13:
covid19: debug
org:
springframework: warn
hibernate:
SQL: debug
type:
descriptor:
sql:
BasicBinder: trace
pattern:
console: "%d{dd-MM-yyyy HH:mm:ss.SSS} %highlight(%-5level) %magenta([%thread]) %yellow(%logger.%M) - %msg%n"

View File

@ -0,0 +1,13 @@
package com.bvn13.covid19.scheduler;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class Covid19SchedulerApplicationTests {
@Test
void contextLoads() {
}
}

13
covid19.iml 100644
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="ExternalSystem" externalSystem="GRADLE" externalSystemModuleGroup="" externalSystemModuleVersion="unspecified" linkedProjectId="covid19" linkedProjectPath="$MODULE_DIR$" rootProjectPath="$MODULE_DIR$" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

1655
covid19.ipr 100644

File diff suppressed because it is too large Load Diff

513
covid19.iws 100644
View File

@ -0,0 +1,513 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="c797f4b8-6ef8-460b-8673-039fc9e0dfa3" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/executionHistory/executionHistory.bin" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/executionHistory/executionHistory.lock" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/fileChanges/last-build.bin" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/fileHashes/fileHashes.bin" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/fileHashes/fileHashes.lock" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/5.2.1/gc.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/cache.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/outputFiles.bin" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.gradle/vcs-1/gc.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bvn13.develop.covid19.main.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/bvn13.develop.covid19.test.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/build.gradle" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/gradle/wrapper/gradle-wrapper.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/gradlew" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/gradlew.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/Covid19ApiApplication.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/controllers/MainController.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/converters/ZonedDateTimeToStringConverter.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/dtos/CovidUpdateInfoDto.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/model/CovidStatsInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/model/CovidStatsResponse.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/repositories/CovidStatsRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/repositories/CovidUpdateInfosRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/java/com/bvn13/covid19/api/service/CovidStatsMaker.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/main/resources/application.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-api/src/test/java/com/bvn13/covid19/api/Covid19ApiApplicationTests.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/build.gradle" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/gradle/wrapper/gradle-wrapper.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/gradlew" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/gradlew.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/main/java/com/bvn13/covid19/model/Covid19ModelConfig.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/main/java/com/bvn13/covid19/model/entities/CovidStat.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/main/java/com/bvn13/covid19/model/entities/CovidUpdateInfo.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/main/java/com/bvn13/covid19/model/entities/Region.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/main/resources/application.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-model/src/test/java/com/bvn13/covid19/model/Covid19ModelApplicationTests.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/.gitignore" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/build.gradle" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/gradle/wrapper/gradle-wrapper.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/gradlew" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/gradlew.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/Covid19SchedulerApplication.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/CovidStatsRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/CovidUpdateInfosRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/RegionsRepository.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/updater/stopcoronovirusrf/StopcoronovirusRfDataRetriever.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/updater/stopcoronovirusrf/StopcoronovirusRfService.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/updater/stopcoronovirusrf/StopcoronovirusRfUpdater.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/java/com/bvn13/covid19/scheduler/updater/stopcoronovirusrf/model/RowData.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/main/resources/application.yaml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19-scheduler/src/test/java/com/bvn13/covid19/scheduler/Covid19SchedulerApplicationTests.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19.ipr" afterDir="false" />
<change afterPath="$PROJECT_DIR$/covid19.iws" afterDir="false" />
<change afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.jar" afterDir="false" />
<change afterPath="$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.properties" afterDir="false" />
<change afterPath="$PROJECT_DIR$/gradlew" afterDir="false" />
<change afterPath="$PROJECT_DIR$/gradlew.bat" afterDir="false" />
<change afterPath="$PROJECT_DIR$/settings.gradle" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CodeStyleSettingsInfer">
<option name="done" value="true" />
</component>
<component name="DatabaseView">
<option name="SHOW_INTERMEDIATE" value="true" />
<option name="GROUP_DATA_SOURCES" value="true" />
<option name="GROUP_SCHEMA" value="true" />
<option name="GROUP_CONTENTS" value="false" />
<option name="SORT_POSITIONED" value="false" />
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
<option name="HIDDEN_KINDS">
<set />
</option>
<expand>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid19: database" type="162271b6:PgImplModel$Database" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid19: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid19: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="public: schema" type="983ebcf7:PgImplModel$Schema" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid19: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="public: schema" type="983ebcf7:PgImplModel$Schema" />
<item name="tables" type="d4e8921:DatabaseStructure$FamilyGroup" />
</path>
<path>
<item name="Database" type="3277223f:DatabaseStructure$DbRootGroup" />
<item name="covid19@localhost" type="feb32156:DbDataSourceImpl" />
<item name="databases" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid19: database" type="162271b6:PgImplModel$Database" />
<item name="schemas" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="public: schema" type="983ebcf7:PgImplModel$Schema" />
<item name="tables" type="d4e8921:DatabaseStructure$FamilyGroup" />
<item name="covid_statistics: table" type="69fad909:PgImplModel$LocalTable" />
</path>
</expand>
<select />
</component>
<component name="DefaultGradleProjectSettings">
<option name="testRunner" value="GRADLE" />
<option name="delegatedBuild" value="true" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
<projectState path="$PROJECT_DIR$/covid19-api">
<ProjectState />
</projectState>
<projectState path="$PROJECT_DIR$/covid19-model">
<ProjectState />
</projectState>
<projectState path="$PROJECT_DIR$/covid19-scheduler">
<ProjectState />
</projectState>
</component>
<component name="ExternalProjectsManager">
<system id="GRADLE">
<state>
<task path="$PROJECT_DIR$/covid19-scheduler">
<activation />
</task>
<task path="$PROJECT_DIR$/covid19-model">
<activation />
</task>
<task path="$PROJECT_DIR$">
<activation />
</task>
<projects_view>
<tree_state>
<expand>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="covid19-api" type="2d1252cf:ModuleNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="covid19-scheduler" type="2d1252cf:ModuleNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="covid19-scheduler" type="2d1252cf:ModuleNode" />
<item name="Source Sets" type="e897c970:GradleViewContributor$SourceSetsNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="covid19-scheduler" type="2d1252cf:ModuleNode" />
<item name="Source Sets" type="e897c970:GradleViewContributor$SourceSetsNode" />
<item name="main" type="396b929e:GradleViewContributor$SourceSetNode" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="covid19" type="f1a62948:ProjectNode" />
<item name="covid19-scheduler" type="2d1252cf:ModuleNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
</path>
</expand>
<select />
</tree_state>
</projects_view>
</state>
</system>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Enum" />
<option value="Interface" />
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectCodeStyleSettingsMigration">
<option name="version" value="1" />
</component>
<component name="ProjectId" id="1ZynsbL9DqVEXOgO74nkw90Hccl" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="DatabaseDriversLRU" value="postgresql" />
<property name="ExpandSpringBootJavaOptionsPanel" value="true" />
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="android.sdk.path" value="$USER_HOME$/soft/android" />
<property name="aspect.path.notification.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../_thirdparty" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="project.structure.last.edited" value="Problems" />
<property name="project.structure.proportion" value="0.0" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="reference.projectsettings.compiler.annotationProcessors" />
</component>
<component name="RecentsManager">
<key name="CopyClassDialog.RECENTS_KEY">
<recent name="com.bvn13.covid19.api.repositories" />
<recent name="com.bvn13.covid19.scheduler" />
</key>
</component>
<component name="RunManager" selected="Spring Boot.Covid19ApiApplication">
<configuration name="covid19:covid19-model [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/covid19-model" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="build" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
<configuration name="covid19:covid19-model [clean]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/covid19-model" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
<configuration name="covid19:covid19-model [jar]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/covid19-model" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="jar" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
<configuration name="Covid19ApiApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="covid19.covid19-api.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.bvn13.covid19.api.Covid19ApiApplication" />
<option name="VM_PARAMETERS" value="-Dspring.datasource.username=covid19 -Dspring.datasource.password={Covid19Pass}" />
<option name="ALTERNATIVE_JRE_PATH" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Covid19SchedulerApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="covid19.covid19-scheduler.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.bvn13.covid19.scheduler.Covid19SchedulerApplication" />
<option name="VM_PARAMETERS" value="-Dspring.datasource.username=covid19 -Dspring.datasource.password={Covid19Pass}" />
<option name="ALTERNATIVE_JRE_PATH" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Gradle.covid19:covid19-model [build]" />
<item itemvalue="Gradle.covid19:covid19-model [jar]" />
<item itemvalue="Gradle.covid19:covid19-model [clean]" />
<item itemvalue="Spring Boot.Covid19ApiApplication" />
<item itemvalue="Spring Boot.Covid19SchedulerApplication" />
</list>
<recent_temporary>
<list>
<item itemvalue="Gradle.covid19:covid19-model [clean]" />
<item itemvalue="Gradle.covid19:covid19-model [jar]" />
<item itemvalue="Gradle.covid19:covid19-model [build]" />
</list>
</recent_temporary>
</component>
<component name="SbtLocalSettings">
<option name="projectSyncType">
<map>
<entry key="$PROJECT_DIR$/../_school/scala-meetup-2019-09-28/zio-workshop" value="PREVIEW" />
<entry key="$PROJECT_DIR$/../_school/scala-school" value="PREVIEW" />
</map>
</option>
</component>
<component name="ServiceViewManager">
<option name="viewStates">
<list>
<serviceView>
<treeState>
<expand>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="root:covid19@localhost" type="7427dc5b:ServiceModel$ServiceGroupNode" />
</path>
<path>
<item name="services root" type="e789fda9:ObjectUtils$Sentinel" />
<item name="root:covid19@localhost" type="7427dc5b:ServiceModel$ServiceGroupNode" />
<item name="com.intellij.database.console.session.MessageBusSession@67d2d3bf" type="9fbbdea:ServiceModel$ServiceNode" />
</path>
</expand>
<select />
</treeState>
</serviceView>
</list>
</option>
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="c797f4b8-6ef8-460b-8673-039fc9e0dfa3" name="Default Changelist" comment="" />
<created>1585820408454</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1585820408454</updated>
<workItem from="1585820411406" duration="11602000" />
<workItem from="1585841589377" duration="13368000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="2427" y="182" width="934" height="684" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1585866152130">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2427" y="182" width="934" height="684" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585866152130" />
<state x="2647" y="265" width="424" height="591" key="#com.intellij.ide.macro.MacrosDialog" timestamp="1585846027174">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2647" y="265" width="424" height="591" key="#com.intellij.ide.macro.MacrosDialog/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585846027174" />
<state x="2688" y="251" width="374" height="584" key="#com.intellij.ide.util.MemberChooser" timestamp="1585853067260">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2688" y="251" width="374" height="584" key="#com.intellij.ide.util.MemberChooser/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585853067260" />
<state x="2716" y="0" width="876" height="1080" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog" timestamp="1585865845488">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2716" y="0" width="876" height="1080" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585865845488" />
<state x="2426" y="309" width="861" height="587" key="#xdebugger.evaluate" timestamp="1585867146224">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2426" y="309" width="861" height="587" key="#xdebugger.evaluate/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867146224" />
<state width="1057" height="466" key="DebuggerActiveHint" timestamp="1585846894874">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1057" height="466" key="DebuggerActiveHint/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585846894874" />
<state x="2601" y="318" width="515" height="484" key="EnvironmentVariablesDialog" timestamp="1585846018872">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2601" y="318" width="515" height="484" key="EnvironmentVariablesDialog/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585846018872" />
<state width="1878" height="468" key="GridCell.Tab.0.bottom" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.0.bottom/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.0.center" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.0.center/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.0.left" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.0.left/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.0.right" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.0.right/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.1.bottom" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.1.bottom/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.1.center" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.1.center/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.1.left" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.1.left/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.1.right" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.1.right/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.2.bottom" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.2.bottom/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.2.center" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.2.center/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.2.left" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.2.left/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state width="1878" height="468" key="GridCell.Tab.2.right" timestamp="1585867685890">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state width="1878" height="468" key="GridCell.Tab.2.right/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585867685890" />
<state x="2376" y="175" width="1007" height="737" key="SettingsEditor" timestamp="1585842307130">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2376" y="175" width="1007" height="737" key="SettingsEditor/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585842307130" />
<state x="2747" y="432" width="327" height="237" key="com.intellij.database.actions.DdlActions$DeleteProvider2$1" timestamp="1585854238039">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2747" y="432" width="327" height="237" key="com.intellij.database.actions.DdlActions$DeleteProvider2$1/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585854238039" />
<state x="2592" y="184" width="566" height="718" key="com.intellij.database.view.ui.AbstractDbRefactoringDialog" timestamp="1585854319518">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2592" y="184" width="566" height="718" key="com.intellij.database.view.ui.AbstractDbRefactoringDialog/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585854319518" />
<state x="2345" y="26" width="919" height="777" key="find.popup" timestamp="1585865749200">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2345" y="26" width="919" height="777" key="find.popup/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585865749200" />
<state x="2312" y="245" width="1125" height="597" key="new project wizard" timestamp="1585820866694">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2312" y="245" width="1125" height="597" key="new project wizard/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585820866694" />
<state x="2544" y="245" key="run.anything.popup" timestamp="1585866633551">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2544" y="245" key="run.anything.popup/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585866633551" />
<state x="2543" y="239" width="670" height="676" key="search.everywhere.popup" timestamp="1585846260313">
<screen x="1920" y="0" width="1920" height="1080" />
</state>
<state x="2543" y="239" width="670" height="676" key="search.everywhere.popup/0.27.1920.1053/1920.0.1920.1080@1920.0.1920.1080" timestamp="1585846260313" />
</component>
</project>

BIN
gradle/wrapper/gradle-wrapper.jar vendored 100644

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

172
gradlew vendored 100755
View File

@ -0,0 +1,172 @@
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

84
gradlew.bat vendored 100644
View File

@ -0,0 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

3
settings.gradle 100644
View File

@ -0,0 +1,3 @@
include ':covid19-model'
include ':covid19-api'
include ':covid19-scheduler'