Просмотр исходного кода

Merge pull request #1321 from visuddhinanda/agile

更新openapi
visuddhinanda 2 лет назад
Родитель
Сommit
7224cdf2b5

+ 11 - 5
dashboard/src/components/library/HeadBar.tsx

@@ -60,7 +60,7 @@ export const mainMenuItems: MenuProps["items"] = [
   {
     label: (
       <a
-        href="https://asset-hk.wikipali.org/help/zh-Hans"
+        href="https://assets-hk.wikipali.org/help/zh-Hans/"
         target="_blank"
         rel="noreferrer"
       >
@@ -73,7 +73,7 @@ export const mainMenuItems: MenuProps["items"] = [
   {
     label: (
       <a
-        href="https://asset-hk.wikipali.org/handbook/zh-Hans"
+        href="https://assets-hk.wikipali.org/pali-handbook/zh-Hans/"
         target="_blank"
         rel="noreferrer"
       >
@@ -84,7 +84,10 @@ export const mainMenuItems: MenuProps["items"] = [
   },
   {
     label: (
-      <Link to="/calendar">
+      <Link
+        to="https://www-hk.wikipali.org/app/calendar/index.html"
+        target={"_blank"}
+      >
         <FormattedMessage id="columns.library.calendar.title" />
       </Link>
     ),
@@ -92,7 +95,10 @@ export const mainMenuItems: MenuProps["items"] = [
   },
   {
     label: (
-      <Link to="/convertor">
+      <Link
+        to="https://www-hk.wikipali.org/app/tools/unicode.html"
+        target={"_blank"}
+      >
         <FormattedMessage id="columns.library.convertor.title" />
       </Link>
     ),
@@ -100,7 +106,7 @@ export const mainMenuItems: MenuProps["items"] = [
   },
   {
     label: (
-      <Link to="/statistics">
+      <Link to="https://www-hk.wikipali.org/app/statistics/" target={"_blank"}>
         <FormattedMessage id="columns.library.statistics.title" />
       </Link>
     ),

+ 1 - 1
dashboard/src/utils.ts

@@ -1,5 +1,5 @@
 export function fullUrl(url: string): string {
-  return process.env.REACT_APP_WEB_HOST + process.env.PUBLIC_URL + url;
+  return window.location.origin + process.env.PUBLIC_URL + url;
 }
 
 export function PaliToEn(pali: string): string {

+ 4 - 0
openapi/public/assets/protocol/main.yaml

@@ -29,3 +29,7 @@ paths:
     $ref: "./resources/io/chapter/export.yaml"
   /sentence-io:
     $ref: "./resources/io/sentence/export.yaml"
+  /progress:
+    $ref: "./resources/progress/index.yaml"
+  /sentence:
+    $ref: "./resources/sentence/index.yaml"

+ 0 - 0
openapi/public/assets/protocol/resources/discussion/discussion.yaml → openapi/public/assets/protocol/resources/discussion/data.yaml


+ 1 - 1
openapi/public/assets/protocol/resources/discussion/index.yaml

@@ -25,4 +25,4 @@ get:
                 type: boolean
               message:
                 type: string
-$ref: "./store.yaml"
+                $ref: "./data.yaml"

+ 1 - 1
openapi/public/assets/protocol/resources/discussion/store.yaml

@@ -36,4 +36,4 @@ post:
                 type: string
               data:
                 type: object
-                $ref: "./discussion.yaml"
+                $ref: "./data.yaml"

+ 1 - 1
openapi/public/assets/protocol/resources/io/channel/export.yaml

@@ -19,7 +19,7 @@ get:
         type: string
     - name: limit
       in: query
-      description: 每记录数
+      description: 每次提取记录数
       schema:
         type: number
         minimum: 1

+ 1 - 1
openapi/public/assets/protocol/resources/io/chapter/export.yaml

@@ -19,7 +19,7 @@ get:
         type: string
     - name: limit
       in: query
-      description: 每记录数
+      description: 每次提取记录数
       schema:
         type: number
         minimum: 1

+ 1 - 1
openapi/public/assets/protocol/resources/io/sentence/export.yaml

@@ -29,7 +29,7 @@ get:
         type: string
     - name: limit
       in: query
-      description: 每记录数
+      description: 每次提取记录数
       schema:
         type: number
         minimum: 1

+ 58 - 0
openapi/public/assets/protocol/resources/progress/data.yaml

@@ -0,0 +1,58 @@
+properties:
+  title:
+    type: string
+  toc:
+    type: string
+  book:
+    type: string
+  para:
+    type: string
+  path:
+    type: string
+  tags:
+    type: object
+    properties:
+      id:
+        type: string
+      name:
+        type: string
+      description:
+        type: string
+  channel:
+    type: object
+    properties:
+      name:
+        type: string
+      owner_uid:
+        type: string
+  studio:
+    type: object
+    properties:
+      id:
+        type: string
+      nickName:
+        type: string
+      studioName:
+        type: string
+      realName:
+        type: string
+      avatar:
+        type: string
+  channel_id:
+    type: string
+  summary:
+    type: string
+  view:
+    type: number
+  like:
+    type: number
+  status:
+    type: number
+  progress:
+    type: number
+  progress_line:
+    type: number
+  created_at:
+    type: string
+  updated_at:
+    type: string

+ 82 - 0
openapi/public/assets/protocol/resources/progress/index.yaml

@@ -0,0 +1,82 @@
+get:
+  summary: Returns a list of discussions.
+  tags:
+    - progress
+  description: 返回多行数据。支持关键字搜索,分页,排序
+  parameters:
+    - name: view
+      in: query
+      required: true
+      description: 查询什么内容
+      schema:
+        type: string
+        enum:
+          - chapter
+    - name: tags
+      in: query
+      required: false
+      description: 便签过滤
+      schema:
+        type: string
+    - name: studio
+      in: query
+      required: false
+      description: studio过滤
+      schema:
+        type: string
+    - name: progress
+      in: query
+      required: false
+      description: 完成度过滤,默认值0.8
+      schema:
+        type: number
+        minimum: 0
+        maximum: 1
+    - name: lang
+      in: query
+      required: true
+      description: 语言过滤 如zh
+      schema:
+        type: string
+    - name: channel
+      in: query
+      required: false
+      description: channel名称过滤
+      schema:
+        type: string
+    - name: channel_type
+      in: query
+      required: false
+      description: channel类型过滤 默认值 translation
+      schema:
+        type: string
+        enum:
+          - translation
+          - nissaya
+          - original
+          - commentary
+    - name: limit
+      in: query
+      description: 每次提取记录数
+      schema:
+        type: number
+        minimum: 1
+        maximum: 1000
+    - name: offset
+      in: query
+      description: 从第几条记录开始提取
+      schema:
+        type: number
+  responses:
+    "200": # status code
+      description: A JSON array of user names
+      content:
+        application/json:
+          schema:
+            type: object
+            properties:
+              ok:
+                type: boolean
+              message:
+                type: string
+                $ref: "./data.yaml"

+ 25 - 0
openapi/public/assets/protocol/resources/sentence/data.yaml

@@ -0,0 +1,25 @@
+properties:
+  uid:
+    type: string
+  book_id:
+    type: string
+  paragraph:
+    type: string
+  word_start:
+    type: string
+  word_end:
+    type: string
+  content:
+    type: string
+  content_type:
+    type: string
+  channel_uid:
+    type: string
+  editor_uid:
+    type: string
+  language:
+    type: string
+  updated_at:
+    type: string
+  created_at:
+    type: string

+ 72 - 0
openapi/public/assets/protocol/resources/sentence/index.yaml

@@ -0,0 +1,72 @@
+get:
+  summary: 句子信息列表
+  tags:
+    - sentence
+  description: 返回多行数据。支持分页。
+  parameters:
+    - name: view
+      in: query
+      required: true
+      description: 查询的内容
+      schema:
+        type: string
+        enum:
+          - chapter
+    - name: book
+      in: query
+      required: true
+      description: 书号
+      schema:
+        type: number
+        minimum: 1
+        maximum: 217
+    - name: para
+      in: query
+      required: true
+      description: 段落号
+      schema:
+        type: number
+    - name: channels
+      in: query
+      required: true
+      description: channel uuid 多个channel 用英文逗号分隔
+      schema:
+        type: string
+    - name: html
+      in: query
+      description: 是否由服务器渲染content 默认false
+      schema:
+        type: boolean
+    - name: limit
+      in: query
+      description: 每次提取记录数
+      schema:
+        type: number
+        minimum: 1
+        maximum: 1000
+    - name: offset
+      in: query
+      description: 从第几条记录开始提取
+      schema:
+        type: number
+  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
+                properties:
+                  rows:
+                    type: object
+                    $ref: "./data.yaml"
+                  count:
+                    type: number
+                    description: 符合要求的记录总数