UserController.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <?php
  2. namespace PetstoreIO;
  3. class UserController
  4. {
  5. /**
  6. * @SWG\Post(path="/user",
  7. * tags={"user"},
  8. * summary="Create user",
  9. * description="This can only be done by the logged in user.",
  10. * operationId="createUser",
  11. * produces={"application/xml", "application/json"},
  12. * @SWG\Parameter(
  13. * in="body",
  14. * name="body",
  15. * description="Created user object",
  16. * required=true,
  17. * @SWG\Schema(ref="#/definitions/User")
  18. * ),
  19. * @SWG\Response(response="default", description="successful operation")
  20. * )
  21. */
  22. public function createUser()
  23. {
  24. }
  25. /**
  26. * @SWG\Post(path="/user/createWithArray",
  27. * tags={"user"},
  28. * summary="Creates list of users with given input array",
  29. * description="",
  30. * operationId="createUsersWithArrayInput",
  31. * produces={"application/xml", "application/json"},
  32. * @SWG\Parameter(
  33. * in="body",
  34. * name="body",
  35. * description="List of user object",
  36. * required=true,
  37. * @SWG\Schema(
  38. * type="array",
  39. * @SWG\Items(ref="#/definitions/User")
  40. * )
  41. * ),
  42. * @SWG\Response(response="default", description="successful operation")
  43. * )
  44. */
  45. public function createUsersWithArrayInput()
  46. {
  47. }
  48. /**
  49. * @SWG\Post(path="/user/createWithList",
  50. * tags={"user"},
  51. * summary="Creates list of users with given input array",
  52. * description="",
  53. * operationId="createUsersWithListInput",
  54. * produces={"application/xml", "application/json"},
  55. * @SWG\Parameter(
  56. * in="body",
  57. * name="body",
  58. * description="List of user object",
  59. * required=true,
  60. * @SWG\Schema(
  61. * type="array",
  62. * @SWG\Items(ref="#/definitions/User")
  63. * )
  64. * ),
  65. * @SWG\Response(response="default", description="successful operation")
  66. * )
  67. */
  68. /**
  69. * @SWG\Get(path="/user/login",
  70. * tags={"user"},
  71. * summary="Logs user into the system",
  72. * description="",
  73. * operationId="loginUser",
  74. * produces={"application/xml", "application/json"},
  75. * @SWG\Parameter(
  76. * name="username",
  77. * in="query",
  78. * description="The user name for login",
  79. * required=true,
  80. * type="string"
  81. * ),
  82. * @SWG\Parameter(
  83. * name="password",
  84. * in="query",
  85. * description="The password for login in clear text",
  86. * required=true,
  87. * type="string"
  88. * ),
  89. * @SWG\Response(
  90. * response=200,
  91. * description="successful operation",
  92. * @SWG\Schema(type="string"),
  93. * @SWG\Header(
  94. * header="X-Rate-Limit",
  95. * type="integer",
  96. * format="int32",
  97. * description="calls per hour allowed by the user"
  98. * ),
  99. * @SWG\Header(
  100. * header="X-Expires-After",
  101. * type="string",
  102. * format="date-time",
  103. * description="date in UTC when token expires"
  104. * )
  105. * ),
  106. * @SWG\Response(response=400, description="Invalid username/password supplied")
  107. * )
  108. */
  109. public function loginUser()
  110. {
  111. }
  112. /**
  113. * @SWG\Get(path="/user/logout",
  114. * tags={"user"},
  115. * summary="Logs out current logged in user session",
  116. * description="",
  117. * operationId="logoutUser",
  118. * produces={"application/xml", "application/json"},
  119. * parameters={},
  120. * @SWG\Response(response="default", description="successful operation")
  121. * )
  122. */
  123. public function logoutUser()
  124. {
  125. }
  126. /**
  127. * @SWG\Get(path="/user/{username}",
  128. * tags={"user"},
  129. * summary="Get user by user name",
  130. * description="",
  131. * operationId="getUserByName",
  132. * produces={"application/xml", "application/json"},
  133. * @SWG\Parameter(
  134. * name="username",
  135. * in="path",
  136. * description="The name that needs to be fetched. Use user1 for testing. ",
  137. * required=true,
  138. * type="string"
  139. * ),
  140. * @SWG\Response(response=200, description="successful operation", @SWG\Schema(ref="#/definitions/User")),
  141. * @SWG\Response(response=400, description="Invalid username supplied"),
  142. * @SWG\Response(response=404, description="User not found")
  143. * )
  144. */
  145. public function getUserByName($username)
  146. {
  147. }
  148. /**
  149. * @SWG\Put(path="/user/{username}",
  150. * tags={"user"},
  151. * summary="Updated user",
  152. * description="This can only be done by the logged in user.",
  153. * operationId="updateUser",
  154. * produces={"application/xml", "application/json"},
  155. * @SWG\Parameter(
  156. * name="username",
  157. * in="path",
  158. * description="name that need to be updated",
  159. * required=true,
  160. * type="string"
  161. * ),
  162. * @SWG\Parameter(
  163. * in="body",
  164. * name="body",
  165. * description="Updated user object",
  166. * required=true,
  167. * @SWG\Schema(ref="#/definitions/User")
  168. * ),
  169. * @SWG\Response(response=400, description="Invalid user supplied"),
  170. * @SWG\Response(response=404, description="User not found")
  171. * )
  172. */
  173. public function updateUser()
  174. {
  175. }
  176. /**
  177. * @SWG\Delete(path="/user/{username}",
  178. * tags={"user"},
  179. * summary="Delete user",
  180. * description="This can only be done by the logged in user.",
  181. * operationId="deleteUser",
  182. * produces={"application/xml", "application/json"},
  183. * @SWG\Parameter(
  184. * name="username",
  185. * in="path",
  186. * description="The name that needs to be deleted",
  187. * required=true,
  188. * type="string"
  189. * ),
  190. * @SWG\Response(response=400, description="Invalid username supplied"),
  191. * @SWG\Response(response=404, description="User not found")
  192. * )
  193. */
  194. public function deleteUser()
  195. {
  196. }
  197. }