ソースを参照

: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.