ApiActionFactory.class.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 "getfileaccesstoken2":
  17. return new GetFileAccessTokenAction2();
  18. case "adduser":
  19. return new AddUserAction();
  20. case "edituser":
  21. return new EditUserAction();
  22. case "addusertoaccount":
  23. return new AddUserToAccountAction();
  24. case "removeuserfromaccount":
  25. return new RemoveUserFromAccountAction();
  26. case "addaccount":
  27. return new AddAccountAction();
  28. case "editaccount":
  29. return new EditAccountAction();
  30. case "addproject":
  31. return new AddProjectAction();
  32. case "uploadproject":
  33. return new UploadDataAction();
  34. case "putfileaccesstoken":
  35. return new PutFileAccessTokenAction();
  36. case "addnewbucket":
  37. return new AddDataBucketAction();
  38. case "editproject":
  39. return new EditDataAction();
  40. case "addprojecttoaccount":
  41. return new AddDataToAccountAction();
  42. case "removeprojectfromaccount":
  43. return new RemoveDataFromAccountAction();
  44. case "logupload":
  45. return new LogUploadAction();
  46. case "forgetupload":
  47. return new ForgetUploadAction();
  48. case "confirmupload":
  49. return new ConfirmUploadAction();
  50. case "confirmupload2":
  51. return new ConfirmUploadAction2();
  52. case "getfilestoresume":
  53. return new GetFilesToResumeAction();
  54. case "":
  55. $apiTreeAction = "null";
  56. default:
  57. return new NullAction($apiTreeAction);
  58. }
  59. }
  60. }