瀏覽代碼

feat: Add method of adding lectures to a plan

Sean Blackburn 1 年之前
父節點
當前提交
e64b2c2509

+ 13 - 0
src/components/responses/api/me/plans/{plan}/lectures/index-get-200.yaml

@@ -0,0 +1,13 @@
+description: OK
+content:
+  application/json:
+    schema:
+      type: object
+      properties:
+        data:
+          type: array
+          items:
+            $ref: ../../../../../../schemas/relations/lecture-series-pk.yaml
+    # TODO
+    # example:
+    #   $ref: ../../../../../examples/api/me/plans/index.yaml

+ 4 - 0
src/openapi.yaml

@@ -165,3 +165,7 @@ paths:
     $ref: ./paths/api/me/plans/index.yaml
   /me/plans/{plan}:
     $ref: ./paths/api/me/plans/{plan}/index.yaml
+  /me/plans/{plan}/lectures:
+    $ref: ./paths/api/me/plans/{plan}/lectures/index.yaml
+  /me/plans/{plan}/lectures/{lecture}:
+    $ref: ./paths/api/me/plans/{plan}/lectures/{lecture}/index.yaml

+ 20 - 0
src/paths/api/me/plans/{plan}/lectures/index.yaml

@@ -0,0 +1,20 @@
+get:
+  operationId: GetPlanLectures
+  summary: |
+    Get a list of the lectures PK for a personal plan. [OPTIONAL:Storage]
+  description: |
+    **THIS IS AN OPTIONAL ENDPOINT**: This endpoint might not be implemented, as it
+    requires a server running!
+  security:
+    - authRequired: []
+  parameters:
+    - $ref: ../../../../../../components/parameters/user-plan.yaml
+  tags:
+    - Me / Plans / Lectures
+  responses:
+    "200":
+      $ref: ../../../../../../components/responses/api/me/plans/{plan}/lectures/index-get-200.yaml
+    "401":
+      $ref: ../../../../../../components/responses/401.yaml
+    "404":
+      $ref: ../../../../../../components/responses/404.yaml

+ 43 - 0
src/paths/api/me/plans/{plan}/lectures/{lecture}/index.yaml

@@ -0,0 +1,43 @@
+post:
+  operationId: PostPlanLecture
+  summary: |
+    Add a lecture to a plan. [OPTIONAL:Storage]
+  description: |
+    **THIS IS AN OPTIONAL ENDPOINT**: This endpoint might not be implemented, as it
+    requires a server running!
+  security:
+    - authRequired: []
+  parameters:
+    - $ref: ../../../../../../../components/parameters/user-plan.yaml
+    - $ref: ../../../../../../../components/parameters/lecture.yaml
+  tags:
+    - Me / Plans / Lectures
+  responses:
+    "204":
+      $ref: ../../../../../../../components/responses/204.yaml
+    "401":
+      $ref: ../../../../../../../components/responses/401.yaml
+    "404":
+      $ref: ../../../../../../../components/responses/404.yaml
+
+delete:
+  operationId: DeletePlanLecture
+  summary: |
+    Delete a lecture from a plan. [OPTIONAL:Storage]
+  description: |
+    **THIS IS AN OPTIONAL ENDPOINT**: This endpoint might not be implemented, as it
+    requires a server running!
+  security:
+    - authRequired: []
+  parameters:
+    - $ref: ../../../../../../../components/parameters/user-plan.yaml
+    - $ref: ../../../../../../../components/parameters/lecture.yaml
+  tags:
+    - Me / Plans / Lectures
+  responses:
+    "204":
+      $ref: ../../../../../../../components/responses/204.yaml
+    "401":
+      $ref: ../../../../../../../components/responses/401.yaml
+    "404":
+      $ref: ../../../../../../../components/responses/404.yaml