visuddhinanda 2 years ago
parent
commit
63efb80225

+ 51 - 0
openapi/public/assets/protocol/resources/corpus/corpus/data.yaml

@@ -0,0 +1,51 @@
+properties:
+  uid:
+    type: string
+  title:
+    type: string
+  title_text:
+    type: string
+  subtitle:
+    type: string
+  summary:
+    type: string
+  _summary:
+    type: string
+  content:
+    type: string
+  content_type:
+    type: string
+  html:
+    type: string
+  path:
+    type: object
+    properties:
+      key:
+        type: string
+      book:
+        type: number
+      paragraph:
+        type: number
+      title:
+        type: string
+      paliTitle:
+        type: string
+      level:
+        type: number
+  studio:
+    type: object
+    properties:
+      id:
+        type: string
+      nickName:
+        type: string
+      studioName:
+        type: string
+      realName:
+        type: string
+      avatar:
+        type: string
+  created_at:
+    type: string
+  updated_at:
+    type: string

+ 69 - 0
openapi/public/assets/protocol/resources/corpus/corpus/index.yaml

@@ -0,0 +1,69 @@
+get:
+  summary: 返回段落信息,包含原文,译文
+  tags:
+    - corpus
+  description: 支持查询多个段落。
+  parameters:
+    - name: view
+      in: query
+      required: true
+      description: 查询什么内容,目前仅支持para 段落查询
+      schema:
+        type: string
+        enum:
+          - para
+    - name: mode
+      in: query
+      required: false
+      description: 返回数据模式。阅读模式巴利原文是markdown数据,编辑模式是json逐词解析数据。
+      schema:
+        type: string
+        enum:
+          - read
+          - edit
+          - wbw
+    - name: channels
+      in: query
+      required: false
+      description: channel id列表。两个channel 之间用下划线_连接。没有channel仅返回巴利原文。
+      schema:
+        type: string
+    - name: book
+      in: query
+      required: true
+      description: 书号 1~217
+      schema:
+        type: number
+    - name: par
+      in: query
+      required: true
+      description: 段落号,两个段落之间用英文逗号连接
+      schema:
+        type: string
+    - name: format
+      in: query
+      required: false
+      description: 返回数据格式 默认react
+      schema:
+        type: string
+        enum:
+          - react
+          - unity
+          - html
+          - tex
+          - text
+  responses:
+    "200": # status code
+      description: A JSON array of user names
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              ok:
+                type: boolean
+              message:
+                type: string
+              data:
+                type: object
+                $ref: "./data.yaml"