Merge pull request 'Fix-weekday-number' (#5) from Fix-weekday-number into master
Reviewed-on: http://git.plannaplan.pl/filipizydorczyk/backend/pulls/5
This commit is contained in:
commit
070a9d5abb
25
README.md
25
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://<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
|
||||
|
@ -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());
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
39
docs/api.md
39
docs/api.md
@ -1,10 +1,11 @@
|
||||
# Dokumetacja API
|
||||
|
||||
| Api | Zadania tej klasy |
|
||||
| ---------------------------------------------- | ---------------------------------------------------------------- |
|
||||
| Api | Zadania endpointa |
|
||||
| ---------------------------------------------- | ---------------------------------------------------------- |
|
||||
| [/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 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** </br> 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** </br> required | - | id kursu dla ktorego chcemy zwrocic grupy | int |
|
||||
| Query Param | **capacity** </br> | - | 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.
|
||||
|
Loading…
Reference in New Issue
Block a user