Changed enum from [1,7] to [0,6] and in FileToDatabaseMigrator changed WeekDay.getDay(day - 1)

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-08-29 11:46:40 +02:00
parent fb09e9caff
commit c64d08a5d2
2 changed files with 3 additions and 24 deletions

View File

@ -10,7 +10,7 @@ Nastepnie w `restservice/src/main/resources/application.properties` nalezy podac
```
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.datasource.url=jdbc:mysql://<nasze-ip>:3306/test
spring.datasource.url=jdbc:mysql://localhost:3306/test
spring.datasource.username=root
spring.datasource.password=example
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
@ -19,28 +19,7 @@ spring.jpa.hibernate.ddl-auto=create
server.port=1285
```
Bywa, ze te ip sie zmienia np o 1 wiec zeby sprawdzic jakie jest obecne ip robimy `docker ps`, ktory nam pokaze wszystkie kontenery na naszym komputerze
np>
```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ebff6c560e06 mariadb "docker-entrypoint.s…" 10 days ago Up 18 minutes 3306/tcp backend_db_1
9370827a43fe adminer "entrypoint.sh docke…" 10 days ago Up 18 minutes 0.0.0.0:8080->8080/tcp backend_adminer_1
958c2793699c mongo "docker-entrypoint.s…" 4 weeks ago Up 46 minutes 127.0.0.1:27030->27017/tcp i-par_db_1
```
I nastepnie wpisujemy te komende ktora nam zwroci ip podanego kontenera
```
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
```
W tym przykladzie `container_name_or_id` to backend_db_1
Nastepnie
Następnym krokiem jest odpalenie poniższych komend w terminalu.
```
cd restservice
mvn spring-boot:run

View File

@ -77,7 +77,7 @@ public class FileToDatabaseMigrator {
String sym_str = sym.toString().trim();
int day = (int) Double.parseDouble(day_cell.toString());
WeekDay group_day = WeekDay.getDay(day);
WeekDay group_day = WeekDay.getDay(day - 1);
String room = room_cell.toString().trim();
int time = this.parseTimeToInt(time_cell.toString());