Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
NameIsBad committed Dec 7, 2020
1 parent c416d37 commit 3c65439
Show file tree
Hide file tree
Showing 19 changed files with 483 additions and 236 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,4 @@ build/html/convert/ConvertToPdf.html
build/doctrees/convert/ConvertToPdf.doctree
build/html/_sources/convert/ConvertToPdf.rst.txt
build/html/_static/css/custom.css
.vscode/settings.json
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"restructuredtext.linter.disabled": true
"restructuredtext.linter.disabled": true,
"restructuredtext.confPath": "${workspaceFolder}\\source"
}
4 changes: 2 additions & 2 deletions source/auth/AccessToken.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ access_token,开发者需要进行妥善保存。

::

GET https://coresite.ctcfile.com/OAuth/AccessToken?clientId=CLIENTID&clientSecret=CLIENTSECRET
GET https://coresite.ctcfile.com/oAuth/accessToken?clientId=CLIENTID&clientSecret=CLIENTSECRET

**请求参数**

Expand Down Expand Up @@ -79,4 +79,4 @@ errmsg string 错误信息

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E5%87%AD%E8%AF%81/get_OAuth_AccessToken" target="_blank">网页调试工具</a>
<a href="https://coresite.ctcfile.com/swagger/index.html#/%E6%8E%A5%E5%8F%A3%E8%B0%83%E7%94%A8%E5%87%AD%E8%AF%81/get_oAuth_accessToken" target="_blank">网页调试工具</a>
6 changes: 3 additions & 3 deletions source/convert/ConvertToPdf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

::

POST https://coresite.ctcfile.com/Convert/ConvertToPdf
POST https://coresite.ctcfile.com/conversion/fileToPdf

**请求参数**

Expand Down Expand Up @@ -42,5 +42,5 @@ X-User-Pages int 当前使用的页数
开发者可以使用 |网页调试工具| 调试该接口

.. |网页调试工具| raw:: html
<a href="https://coresite.ctcfile.com/%E8%BD%AC%E6%8D%A2%E6%9C%8D%E5%8A%A1%E6%8E%A5%E5%8F%A3/post_Convert_ConvertToPdf" target="_blank">网页调试工具</a>

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E8%BD%AC%E6%8D%A2%E6%9C%8D%E5%8A%A1%E6%8E%A5%E5%8F%A3/post_conversion_fileToPdf" target="_blank">网页调试工具</a>
4 changes: 2 additions & 2 deletions source/convert/PdfConvertToType.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

::

POST https://coresite.ctcfile.com/Convert/PdfConvert
POST https://coresite.ctcfile.com/conversion/pdfToFile

**请求参数**

Expand Down Expand Up @@ -54,4 +54,4 @@ X-User-Pages int 当前使用的页数

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/%E8%BD%AC%E6%8D%A2%E6%9C%8D%E5%8A%A1%E6%8E%A5%E5%8F%A3/post_Convert_PdfConvert" target="_blank">网页调试工具</a>
<a href="https://coresite.ctcfile.com/swagger/index.html#/%E8%BD%AC%E6%8D%A2%E6%9C%8D%E5%8A%A1%E6%8E%A5%E5%8F%A3/post_conversion_pdfToFile" target="_blank">网页调试工具</a>
89 changes: 89 additions & 0 deletions source/file/history.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
**翻译历史文件**
=================

**请求地址**

::

GET https://coresite.ctcfile.com/file

**请求参数**

========= ====== ====== ==== =====================================================================================
属性 类型 默认值 必填 说明
========= ====== ====== ==== =====================================================================================
name string 否 文件名
fileTypes array 否 文件类型,包括 0:pdf,10:txt,20:docx,30:xlsx,40:pptx,50:odt,60:image,70:html,80:folder
pageIndex int 0 否 当前页数,默认从 0 开始
pageSize int 是 每页显示多少条
========= ====== ====== ==== =====================================================================================

**返回值**

=========== ====== ====================================
属性 类型 说明
=========== ====== ====================================
result array 数据
toltalCount int 总数量
=========== ====== ====================================

*result的结构*

======================== ========= ====================================
属性 类型 说明
======================== ========= ====================================
id int id
name string 文件名称
secretLevel string 文件机密级别,包括 0:未设置密级,10:非密,20:内部,30:秘密,40:Confidential
fileType string 文件类型
downFileTypes array 提供下载的文件类型
createTime datetime 创建时间
srcLanguageType string 源语种( :doc:`../overview/LanguageType`)
tgtLanguageType string 目标语种( :doc:`../overview/LanguageType`)
tgtFileSize int 翻译后文件大小
consumeWordsTotalCount int 消费字数
isCollect int 0:未收藏,1:收藏
======================== ========= ====================================


**返回数据示例**

正常返回

.. code:: json
{
"result": [
{
"id": 1,
"name": "002-英译中PDF.pdf",
"fileType": "pdf",
"secretLevel": "notSet",
"downFileTypes": [
"docx",
"pdf"
],
"createTime": "2020-12-07T02:54:20.090822+00:00",
"srcLanguageType": "en",
"tgtLanguageType": "zs",
"tgtFileSize": 163125,
"createTimeDesc": "2020-12-07 02:54:20",
"consumeWordsTotalCount": 3210,
"isCollect": 0
}
],
"toltalCount": 8
}
错误时返回

:doc:`../overview/StatusCode`

**在线调试**

开发者可以使用 |网页调试工具| 调试该接口

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/post_translation_texts" target="_blank">网页调试工具</a>
40 changes: 40 additions & 0 deletions source/file/tgtDownUrls.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
**译文下载地址**
=================

**请求地址**

::

GET https://coresite.ctcfile.com/file/tgtDownUrls

**请求参数**

========= ====== ====== ==== ====================================
属性 类型 默认值 必填 说明
========= ====== ====== ==== ====================================
id string 是 文件ID
========= ====== ====== ==== ====================================

**返回数据示例**

正常返回

.. code:: json
{
"docx": "https://coresite.ctcfile.com/file/GetFile/BAgfRvGEHSm3CN0yRcCYj3stair",
"pdf": "https://coresite.ctcfile.com/file/GetFile/BAgfRvGEHSm3CN0yRcCYj7MnrYFs"
}
错误时返回

:doc:`../overview/StatusCode`

**在线调试**

开发者可以使用 |网页调试工具| 调试该接口

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E6%96%87%E4%BB%B6%E6%8E%A5%E5%8F%A3/get_file_tgtDownUrls" target="_blank">网页调试工具</a>
23 changes: 18 additions & 5 deletions source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,36 @@ TranslateDoc

.. toctree::
:maxdepth: 1
:caption: 2.翻译
:caption: 2.用户信息

user/userinfo
user/domainTypes
user/languages

.. toctree::
:maxdepth: 1
:caption: 3.翻译

translate/TranslateText
translate/TranslateFile
translate/OpenLink
translate/TgtDownUrls

.. toctree::
:maxdepth: 1
:caption: 3.智能校对
:caption: 4.翻译历史

file/history
file/tgtDownUrls

.. toctree::
:maxdepth: 1
:caption: 5.智能校对

proofreading/TranslatedEditUrl
proofreading/CheckProgress

.. toctree::
:maxdepth: 1
:caption: 4.文档转换
:caption: 6.文档转换

convert/PdfConvertToType
convert/ConvertToPdf
Expand Down
22 changes: 22 additions & 0 deletions source/overview/ErrorCode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
| 错误码| 英文描述 | 中文描述 |
| ----- | ------------------------------------------------------------- | ------------------------------ |
| 0 | system error | 系统繁忙,此时请开发者稍候再试 |
| 4001 | the account has been logged in elsewhere | 账户已在别处登录 |
| 4003 | not enough words | 字数不够 |
| 4004 | number of word has expired | 字数已经过期 |
| 4005 | language selection Error | 语言选择错误 |
| 4006 | file has no words | 文件里没有字 |
| 4007 | pdf has Encrypted | pdf文件已加密 |
| 4008 | file too large | 文件太大 |
| 4009 | you do not have this type of document translation permissions | 没有该类型文档翻译权限 |
| 40010 | translation timeout | 翻译超时 |
| 40011 | not enaugh pages | 页数不够 |
| 40012 | document handling error | 文档处理出错 |
| 40013 | the task has been canceled | 任务已经取消 |
| 40014 | the operation has been canceled | 操作已经取消 |
| 40015 | some arguments is empty | 部分参数为空 |
| 40016 | invalid args | 参数错误 |
| 40017 | file data not exist | 文件数据不存在 |
| 40018 | file item not exist | 文件项不存在 |
| 40019 | task not exist | 任务不存在或已完成 |
| 40020 | not support ocr | 不支持ocr |
77 changes: 63 additions & 14 deletions source/overview/StatusCode.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,65 @@
**HTTP状态码**
**状态码说明**
==============

+--------+-----------------------+-----------------------------+
| 状态码 | 状态码英文名称 | 说明 |
+========+=======================+=============================+
| 200 | OK | 请求成功。 |
+--------+-----------------------+-----------------------------+
| 400 | Bad Request | 请求错误。{ “errorCode”: 0, |
| | | “message”: “错误信息” } |
+--------+-----------------------+-----------------------------+
| 401 | Unauthorized | 请求要求用户的身份认证 |
+--------+-----------------------+-----------------------------+
| 500 | Internal Server Error ||
| | | 务器内部错误,无法完成请求 |
+--------+-----------------------+-----------------------------+
+--------+-----------------------+---------------------------------------+
| 状态码 | 状态码英文名称 | 说明 |
+========+=======================+=======================================+
| 200 | OK | 请求成功。 |
+--------+-----------------------+---------------------------------------+
| 401 | Unauthorized | 请求要求用户的身份认证 |
+--------+-----------------------+---------------------------------------+
| 500 | Internal Server Error | 服务器内部错误,查看 :ref:`error-core` |
+--------+-----------------------+---------------------------------------+

.. _error-core:

错误码
--------

+--------+-----------------------------+-----------------------------+
| 错误码 | 英文描述 | 中文描述 |
+========+=============================+=============================+
| 0 | system error | 系统 |
| | | 繁忙,此时请开发者稍候再试 |
+--------+-----------------------------+-----------------------------+
| 40001 | the account has been logged | 账户已在别处登录 |
| | in elsewhere | |
+--------+-----------------------------+-----------------------------+
| 40003 | not enough words | 字数不够 |
+--------+-----------------------------+-----------------------------+
| 40004 | number of word has expired | 字数已经过期 |
+--------+-----------------------------+-----------------------------+
| 40005 | language selection Error | 语言选择错误 |
+--------+-----------------------------+-----------------------------+
| 40006 | file has no words | 文件里没有字 |
+--------+-----------------------------+-----------------------------+
| 40007 | pdf has Encrypted | pdf文件已加密 |
+--------+-----------------------------+-----------------------------+
| 40008 | file too large | 文件太大 |
+--------+-----------------------------+-----------------------------+
| 40009 | do not have this translation| 没有该类型文档翻译权限 |
| | permissions | |
+--------+-----------------------------+-----------------------------+
| 400010 | translation timeout | 翻译超时 |
+--------+-----------------------------+-----------------------------+
| 400011 | not enaugh pages | 页数不够 |
+--------+-----------------------------+-----------------------------+
| 400012 | document handling error | 文档处理出错 |
+--------+-----------------------------+-----------------------------+
| 400013 | the task has been canceled | 任务已经取消 |
+--------+-----------------------------+-----------------------------+
| 400014 | the operation has been | 操作已经取消 |
| | canceled | |
+--------+-----------------------------+-----------------------------+
| 400015 | some arguments is empty | 部分参数为空 |
+--------+-----------------------------+-----------------------------+
| 400016 | invalid args | 参数错误 |
+--------+-----------------------------+-----------------------------+
| 400017 | file data not exist | 文件数据不存在 |
+--------+-----------------------------+-----------------------------+
| 400018 | file item not exist | 文件项不存在 |
+--------+-----------------------------+-----------------------------+
| 400019 | task not exist | 任务不存在或已完成 |
+--------+-----------------------------+-----------------------------+
| 400020 | not support ocr | 不支持ocr |
+--------+-----------------------------+-----------------------------+
4 changes: 2 additions & 2 deletions source/proofreading/CheckProgress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

::

GET https://coresite.ctcfile.com/Translate/GetCheckProgress/[fileLibId]
GET https://coresite.ctcfile.com/translation/proofread/[fileLibId]

**请求参数**

Expand Down Expand Up @@ -45,4 +45,4 @@ progress double 进度值

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/get_Translate_GetCheckProgress__fileLibId_" target="_blank">网页调试工具</a>
<a href="https://coresite.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/get_translation_proofread__fileLibId_" target="_blank">网页调试工具</a>
4 changes: 2 additions & 2 deletions source/proofreading/TranslatedEditUrl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

::

GET https://coresite.ctcfile.com/Translate/GetTranslatedEditUrl
GET https://coresite.ctcfile.com/translation/proofreadUrl/[fileLibId]

**请求参数**

Expand Down Expand Up @@ -42,4 +42,4 @@ url string 智能校对URL地址

.. |网页调试工具| raw:: html

<a href="https://coresite.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/get_Translate_GetTranslatedEditUrl__fileLibId_" target="_blank">网页调试工具</a>
<a href="https://coresite.ctcfile.com/swagger/index.html#/%E7%BF%BB%E8%AF%91%E6%8E%A5%E5%8F%A3/get_translation_proofreadUrl__fileLibId_" target="_blank">网页调试工具</a>
File renamed without changes.
Loading

0 comments on commit 3c65439

Please sign in to comment.