_apidoc.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // ------------------------------------------------------------------------------------------
  2. // General apiDoc documentation blocks and old history blocks.
  3. // ------------------------------------------------------------------------------------------
  4. // ------------------------------------------------------------------------------------------
  5. // Current Success.
  6. // ------------------------------------------------------------------------------------------
  7. // ------------------------------------------------------------------------------------------
  8. // Current Errors.
  9. // ------------------------------------------------------------------------------------------
  10. /**
  11. * @apiDefine CreateUserError
  12. * @apiVersion 0.2.0
  13. *
  14. * @apiError NoAccessRight Only authenticated Admins can access the data.
  15. * @apiError UserNameTooShort Minimum of 5 characters required.
  16. *
  17. * @apiErrorExample Response (example):
  18. * HTTP/1.1 400 Bad Request
  19. * {
  20. * "error": "UserNameTooShort"
  21. * }
  22. */
  23. // ------------------------------------------------------------------------------------------
  24. // Current Permissions.
  25. // ------------------------------------------------------------------------------------------
  26. /**
  27. * @apiDefine admin Admin access rights needed.
  28. * Optionally you can write here further Informations about the permission.
  29. *
  30. * An "apiDefinePermission"-block can have an "apiVersion", so you can attach the block to a specific version.
  31. *
  32. * @apiVersion 0.3.0
  33. */
  34. // ------------------------------------------------------------------------------------------
  35. // History.
  36. // ------------------------------------------------------------------------------------------
  37. /**
  38. * @apiDefine admin This title is visible in version 0.1.0 and 0.2.0
  39. * @apiVersion 0.1.0
  40. */
  41. /**
  42. * @api {get} /user/:id Read data of a User
  43. * @apiVersion 0.2.0
  44. * @apiName GetUser
  45. * @apiGroup User
  46. * @apiPermission admin
  47. *
  48. * @apiDescription Here you can describe the function.
  49. * Multilines are possible.
  50. *
  51. * @apiParam {String} id The Users-ID.
  52. *
  53. * @apiSuccess {String} id The Users-ID.
  54. * @apiSuccess {Date} name Fullname of the User.
  55. *
  56. * @apiError UserNotFound The <code>id</code> of the User was not found.
  57. */
  58. /**
  59. * @api {get} /user/:id Read data of a User
  60. * @apiVersion 0.1.0
  61. * @apiName GetUser
  62. * @apiGroup User
  63. * @apiPermission admin
  64. *
  65. * @apiDescription Here you can describe the function.
  66. * Multilines are possible.
  67. *
  68. * @apiParam {String} id The Users-ID.
  69. *
  70. * @apiSuccess {String} id The Users-ID.
  71. * @apiSuccess {Date} name Fullname of the User.
  72. *
  73. * @apiError UserNotFound The error description text in version 0.1.0.
  74. */
  75. /**
  76. * @api {post} /user Create a User
  77. * @apiVersion 0.2.0
  78. * @apiName PostUser
  79. * @apiGroup User
  80. * @apiPermission none
  81. *
  82. * @apiDescription In this case "apiErrorStructure" is defined and used.
  83. * Define blocks with params that will be used in several functions, so you dont have to rewrite them.
  84. *
  85. * @apiParam {String} name Name of the User.
  86. *
  87. * @apiSuccess {String} id The Users-ID.
  88. *
  89. * @apiUse CreateUserError
  90. */