v2-course.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v2-course.yaml
  2. get:
  3. summary: '列出 course'
  4. tags:
  5. - course
  6. operationId: get_api_v2_course
  7. description: 实现:`CourseController@index`
  8. parameters:
  9. -
  10. name: view
  11. in: query
  12. schema:
  13. type: string
  14. enum:
  15. - new
  16. - open
  17. - close
  18. - create
  19. - study
  20. - teach
  21. -
  22. name: studio
  23. in: query
  24. schema:
  25. type: string
  26. -
  27. name: search
  28. in: query
  29. schema:
  30. type: string
  31. -
  32. name: order
  33. in: query
  34. schema:
  35. type: string
  36. default: updated_at
  37. -
  38. name: dir
  39. in: query
  40. schema:
  41. type: string
  42. default: desc
  43. -
  44. name: offset
  45. in: query
  46. schema:
  47. type: string
  48. -
  49. name: limit
  50. in: query
  51. schema:
  52. type: string
  53. responses:
  54. 200:
  55. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  56. content:
  57. application/json:
  58. schema:
  59. type: object
  60. properties:
  61. ok:
  62. type: boolean
  63. message:
  64. type: string
  65. data:
  66. type: object
  67. properties:
  68. rows:
  69. type: array
  70. items:
  71. type: object
  72. properties: { id: { type: integer }, title: { type: string }, subtitle: { type: string }, summary: { type: string }, sign_up_message: { type: string }, teacher: { type: string }, course_count: { type: integer }, publicity: { type: string }, start_at: { type: string }, end_at: { type: string }, sign_up_start_at: { type: string }, sign_up_end_at: { type: string }, content: { type: string }, content_type: { type: string }, cover: { type: string }, channel_id: { type: integer }, join: { type: string }, number: { type: string }, request_exp: { type: string }, studio: { type: string }, created_at: { type: string }, updated_at: { type: string }, member_count: { type: integer }, members: { type: string }, my_role: { type: string }, cover_url: { type: string }, anthology_id: { type: integer }, anthology_title: { type: string }, anthology_owner: { type: string }, channel_name: { type: string }, channel_owner: { type: string }, my_status: { type: string }, my_status_id: { type: integer }, count_progressing: { type: string } }
  73. count:
  74. type: integer
  75. 401:
  76. $ref: '../../main.yaml#/components/responses/Unauthorized'
  77. 422:
  78. $ref: '../../main.yaml#/components/responses/ValidationError'
  79. post:
  80. summary: '新建 course'
  81. tags:
  82. - course
  83. operationId: post_api_v2_course
  84. description: 实现:`CourseController@store`
  85. requestBody:
  86. required: false
  87. content:
  88. application/json:
  89. schema:
  90. type: object
  91. properties:
  92. studio:
  93. type: string
  94. title:
  95. type: string
  96. responses:
  97. 200:
  98. description: '成功。业务失败时 HTTP 仍可能为 200,以 ok 字段为准。'
  99. content:
  100. application/json:
  101. schema:
  102. type: object
  103. properties:
  104. ok:
  105. type: boolean
  106. message:
  107. type: string
  108. data:
  109. type: object
  110. properties:
  111. id:
  112. type: integer
  113. title:
  114. type: string
  115. subtitle:
  116. type: string
  117. summary:
  118. type: string
  119. sign_up_message:
  120. type: string
  121. teacher:
  122. type: string
  123. course_count:
  124. type: integer
  125. publicity:
  126. type: string
  127. start_at:
  128. type: string
  129. end_at:
  130. type: string
  131. sign_up_start_at:
  132. type: string
  133. sign_up_end_at:
  134. type: string
  135. content:
  136. type: string
  137. content_type:
  138. type: string
  139. cover:
  140. type: string
  141. channel_id:
  142. type: integer
  143. join:
  144. type: string
  145. number:
  146. type: string
  147. request_exp:
  148. type: string
  149. studio:
  150. type: string
  151. created_at:
  152. type: string
  153. updated_at:
  154. type: string
  155. member_count:
  156. type: integer
  157. members:
  158. type: string
  159. my_role:
  160. type: string
  161. cover_url:
  162. type: string
  163. anthology_id:
  164. type: integer
  165. anthology_title:
  166. type: string
  167. anthology_owner:
  168. type: string
  169. channel_name:
  170. type: string
  171. channel_owner:
  172. type: string
  173. my_status:
  174. type: string
  175. my_status_id:
  176. type: integer
  177. count_progressing:
  178. type: string
  179. 401:
  180. $ref: '../../main.yaml#/components/responses/Unauthorized'
  181. 422:
  182. $ref: '../../main.yaml#/components/responses/ValidationError'