Преглед на файлове

:memo: Etude des routes possibles

DricomDragon преди 1 месец
родител
ревизия
8bedd6a1c6
променени са 1 файла, в които са добавени 49 реда и са изтрити 0 реда
  1. 49 0
      README.md

+ 49 - 0
README.md

@@ -1,3 +1,52 @@
 # Squad Composer
 
 SpringBoot project to make squads.
+
+## Back
+
+### Endpoints
+
+#### Full CRUD version
+
++ Benefits
+    + Simple
+    + Everything doable via REST
+- Bad
+    - Mix player and squad in a route
+    - Many routes
+    - Should be modified a lot to take JWT into account
+
+GET `/players` : list all players.
+
+PUT `/players` : create a player.
+
+DELETE 
+
+GET `/players/{p_id}` : get a specific player
+
+GET `/players/{p_id}/squads` : get squads of this player.
+
+POST `/players/{p_id}/squads` : create a new squad ; return created s_id.
+
+PUT `/players/{p_id}/squads/{s_id}` : update a squad.
+
+GET `/players/{p_id}/squads/{s_id}` : get a specific squad.
+
+GET `/squads` : get all squads.
+
+#### Separated version
+
+GET `/players` : list all players.
+
+GET `/players/{p_id}` : get a specific player
+
+GET `/players/{p_id}/squads` : get squads of this player.
+
+
+GET `/squads` : get all squads.
+
+GET `/squads/{s_id}` : get a specific squad.
+
+POST `/squads` : create a new squad attached to the connected player; return created s_id.
+
+PUT `/squads/{s_id}` : update a squad.