浏览代码

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