From 9532240b75c57f3764968c64b2872f7e11c7d7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 28 Aug 2020 16:02:33 +0200 Subject: [PATCH 1/7] Auto-commit: saved api.md --- docs/api.md | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/docs/api.md b/docs/api.md index 260b179..33be0fd 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,10 +1,11 @@ # Dokumetacja API -| Api | Zadania tej klasy | +| 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 | +| [/getCoursesWithGroups](#getcourseswithgroups) | Zwrócenie wszytskich kursów (ćwiczenia, wykłady) razem z grupami | +| [/getCourseGroups](#getcoursegroups) | Zwrócenie grup dla danego kursu | +| [/getCourses](#getcourses) | Zwróenie wszystkich kursów | ## config @@ -14,17 +15,17 @@ 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 -| Type | Name | Consumes | Description | Type | +| Type | Name | Consumes | Opis | Type | | ---- | ----------------------- | ------------------- | ------------------------------- | ---- | | Body | **file**
required | multipart/form-data | Plik .xlsx z potrzebnymi danymi | file | -## getCoursesWithGroups +## getcourseswithgroups Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/getCoursesWithGroups.java) @@ -32,11 +33,11 @@ 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. -## getCourseGroups +## getcoursegroups Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/GroupController.java) @@ -44,13 +45,37 @@ Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/Grou GET /getCourseGroups ``` -#### Description +#### Opis Endpoint konfigurujacy caly system i importujacy dane do bazy. #### Parameters -| 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/getCoursesWithGroups.java) + +``` +GET /getCourses +``` + +#### Opis + +Zwraca wszystkie dostepne kursy. + +## getCourseGroups + +Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/GroupController.java) + +``` +GET /getCourse +``` + +#### Opis + +Endpoint konfigurujacy caly system i importujacy dane do bazy. From 8bc2ba4d3422b99bbbb8a253534f9b2b19ccda68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 28 Aug 2020 16:03:15 +0200 Subject: [PATCH 2/7] Auto-commit: saved api.md --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 33be0fd..aaa6728 100644 --- a/docs/api.md +++ b/docs/api.md @@ -19,7 +19,7 @@ POST /config Endpoint konfigurujacy caly system i importujacy dane do bazy. -#### Parameters +#### Parametry | Type | Name | Consumes | Opis | Type | | ---- | ----------------------- | ------------------- | ------------------------------- | ---- | @@ -49,7 +49,7 @@ GET /getCourseGroups Endpoint konfigurujacy caly system i importujacy dane do bazy. -#### Parameters +#### Parametry | Type | Name | Consumes | Opis | Type | | ----------- | --------------------- | -------- | ----------------------------------------- | ---- | From f05666d6880a76a388b1c4a17b05bddaf87e8013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 28 Aug 2020 16:09:44 +0200 Subject: [PATCH 3/7] Auto-commit: saved api.md --- docs/api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api.md b/docs/api.md index aaa6728..4c6f681 100644 --- a/docs/api.md +++ b/docs/api.md @@ -5,7 +5,7 @@ | [/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 | -| [/getCourses](#getcourses) | Zwróenie wszystkich kursów | +| [/getCourses](#getcourses) | Zwróenie wszystkich kursów | ## config @@ -21,7 +21,7 @@ Endpoint konfigurujacy caly system i importujacy dane do bazy. #### Parametry -| Type | Name | Consumes | Opis | Type | +| Type | Name | Consumes | Opis | Type | | ---- | ----------------------- | ------------------- | ------------------------------- | ---- | | Body | **file**
required | multipart/form-data | Plik .xlsx z potrzebnymi danymi | file | @@ -51,7 +51,7 @@ Endpoint konfigurujacy caly system i importujacy dane do bazy. #### Parametry -| Type | Name | Consumes | Opis | 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 | From fb09e9caff50d77fc706b0a67150d83a84fe8f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Fri, 28 Aug 2020 18:10:11 +0200 Subject: [PATCH 4/7] fix --- buisnesslogic/src/main/java/com/plannaplan/types/WeekDay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From c64d08a5d238a91fae7063f46eac2a66681047f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sat, 29 Aug 2020 11:46:40 +0200 Subject: [PATCH 5/7] Changed enum from [1,7] to [0,6] and in FileToDatabaseMigrator changed WeekDay.getDay(day - 1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- README.md | 25 ++----------------- .../configutils/FileToDatabaseMigrator.java | 2 +- 2 files changed, 3 insertions(+), 24 deletions(-) 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()); From d4abf7e6a46bb9c1fa070842800640e1254bee6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sat, 29 Aug 2020 11:56:30 +0200 Subject: [PATCH 6/7] Updated fix --- docs/api.md | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/docs/api.md b/docs/api.md index 4c6f681..10e8f2f 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,11 +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 | -| [/getCourses](#getcourses) | Zwróenie wszystkich kursów | +| 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 @@ -25,7 +25,7 @@ Endpoint konfigurujacy caly system i importujacy dane do bazy. | ---- | ----------------------- | ------------------- | ------------------------------- | ---- | | Body | **file**
required | multipart/form-data | Plik .xlsx z potrzebnymi danymi | file | -## getcourseswithgroups +## getCoursesWithGroups Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/getCoursesWithGroups.java) @@ -37,7 +37,7 @@ GET /getCoursesWithGroups Zwraca wszystkie dostepne kursy wraz z lista grup dla poszczegolnych kursow. -## getcoursegroups +## getCourseGroups Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/GroupController.java) @@ -56,9 +56,9 @@ Endpoint konfigurujacy caly system i importujacy dane do bazy. | Query Param | **id**
required | - | id kursu dla ktorego chcemy zwrocic grupy | int | | Query Param | **capacity**
| - | czy ma zwrocic pole pojemnosci grupy | bool | -## getcourses +## getCourses -Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/getCoursesWithGroups.java) +Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/CoursesController.java) ``` GET /getCourses @@ -67,15 +67,3 @@ GET /getCourses #### Opis Zwraca wszystkie dostepne kursy. - -## getCourseGroups - -Source code: [link](../restservice/src/main/java/com/plannaplan/controllers/GroupController.java) - -``` -GET /getCourse -``` - -#### Opis - -Endpoint konfigurujacy caly system i importujacy dane do bazy. From 6bdfa6ca1c65ae2c9f77a1006fad22103c0c8855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Sat, 29 Aug 2020 11:59:59 +0200 Subject: [PATCH 7/7] Updated fix --- docs/api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.md b/docs/api.md index 10e8f2f..c3f30b4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -35,7 +35,7 @@ GET /getCoursesWithGroups #### Opis -Zwraca wszystkie dostepne kursy wraz z lista grup dla poszczegolnych kursow. +Zwraca wszystkie dostepne kursy wraz z listą grup. ## getCourseGroups @@ -47,7 +47,7 @@ GET /getCourseGroups #### Opis -Endpoint konfigurujacy caly system i importujacy dane do bazy. +Zwraca wszytskie grupy dla danego kursu. #### Parametry