ApiActionFactory.class.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. class ApiActionFactory {
  3. public function build() {
  4. $apiTreeAction = UrlHelper::getApiTree()[0];
  5. switch($apiTreeAction) {
  6. case "help":
  7. return new ApiDocumentationAction();
  8. case "login":
  9. return new LoginAction();
  10. case "logout":
  11. return new LogoutAction();
  12. case "getprojects":
  13. return new GetProjectsAction();
  14. case "getfileaccesstoken":
  15. return new GetFileAccessTokenAction();
  16. case "adduser":
  17. return new AddUserAction();
  18. case "edituser":
  19. return new EditUserAction();
  20. case "addusertoaccount":
  21. return new AddUserToAccountAction();
  22. case "removeuserfromaccount":
  23. return new RemoveUserFromAccountAction();
  24. case "addaccount":
  25. return new AddAccountAction();
  26. case "editaccount":
  27. return new EditAccountAction();
  28. case "uploaddata":
  29. return new UploadDataAction();
  30. case "addnewbucket":
  31. return new AddDataBucketAction();
  32. case "adddatatoaccount":
  33. return new AddDataToAccountAction();
  34. case "removedatafromaccount":
  35. return new RemoveDataFromAccountAction();
  36. case "":
  37. $apiTreeAction = "null";
  38. default:
  39. return new NullAction($apiTreeAction);
  40. }
  41. }
  42. }