diff --git a/README.md b/README.md index 6d62888..3ccfb1f 100644 --- a/README.md +++ b/README.md @@ -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://: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 diff --git a/buisnesslogic/src/main/java/com/plannaplan/configutils/FileToDatabaseMigrator.java b/buisnesslogic/src/main/java/com/plannaplan/configutils/FileToDatabaseMigrator.java index 6a0513d..d2bf5ee 100644 --- a/buisnesslogic/src/main/java/com/plannaplan/configutils/FileToDatabaseMigrator.java +++ b/buisnesslogic/src/main/java/com/plannaplan/configutils/FileToDatabaseMigrator.java @@ -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()); diff --git a/buisnesslogic/src/main/java/com/plannaplan/types/WeekDay.java b/buisnesslogic/src/main/java/com/plannaplan/types/WeekDay.java index 2db8277..b752240 100644 --- a/buisnesslogic/src/main/java/com/plannaplan/types/WeekDay.java +++ b/buisnesslogic/src/main/java/com/plannaplan/types/WeekDay.java @@ -1,7 +1,7 @@ package com.plannaplan.types; public enum WeekDay { - MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6), SUNDAY(7); + MONDAY(0), TUESDAY(1), WEDNESDAY(2), THURSDAY(3), FRIDAY(4), SATURDAY(5), SUNDAY(6); public final int label; diff --git a/docs/api.md b/docs/api.md index 260b179..c3f30b4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,10 +1,11 @@ # Dokumetacja API -| Api | Zadania tej klasy | -| ---------------------------------------------- | ---------------------------------------------------------------- | -| [/config](#config) | Załadowanie konfiguracji startowej do aplikacji PlanNaPlan | -| [/getCoursesWithGroups](#getCoursesWithGroups) | Zwrócenie wszytskich kursów (ćwiczenia, wykłady) razem z grupami | -| [/getCourseGroups](#getCourseGroups) | Zwrócenie grup dla danego kursu | +| Api | Zadania endpointa | +| ---------------------------------------------- | ---------------------------------------------------------- | +| [/config](#config) | Załadowanie konfiguracji startowej do aplikacji PlanNaPlan | +| [/getCoursesWithGroups](#getcourseswithgroups) | Zwrócenie wszytskich kursów razem z grupami | +| [/getCourseGroups](#getcoursegroups) | Zwrócenie grup dla danego kursu | +| [/getCourses](#getcourses) | Zwrócenie wszystkich kursów | ## config @@ -14,13 +15,13 @@ Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/Conf POST /config ``` -#### Description +#### Opis Endpoint konfigurujacy caly system i importujacy dane do bazy. -#### Parameters +#### Parametry -| Type | Name | Consumes | Description | Type | +| Type | Name | Consumes | Opis | Type | | ---- | ----------------------- | ------------------- | ------------------------------- | ---- | | Body | **file**
required | multipart/form-data | Plik .xlsx z potrzebnymi danymi | file | @@ -32,9 +33,9 @@ Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/getC GET /getCoursesWithGroups ``` -#### Description +#### Opis -Zwraca wszystkie dostepne kursy wraz z lista grup dla poszczegolnych kursow. +Zwraca wszystkie dostepne kursy wraz z listą grup. ## getCourseGroups @@ -44,13 +45,25 @@ Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/Grou GET /getCourseGroups ``` -#### Description +#### Opis -Endpoint konfigurujacy caly system i importujacy dane do bazy. +Zwraca wszytskie grupy dla danego kursu. -#### Parameters +#### Parametry -| Type | Name | Consumes | Description | Type | +| Type | Name | Consumes | Opis | Type | | ----------- | --------------------- | -------- | ----------------------------------------- | ---- | | Query Param | **id**
required | - | id kursu dla ktorego chcemy zwrocic grupy | int | | Query Param | **capacity**
| - | czy ma zwrocic pole pojemnosci grupy | bool | + +## getCourses + +Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/CoursesController.java) + +``` +GET /getCourses +``` + +#### Opis + +Zwraca wszystkie dostepne kursy.