basePath: /
definitions:
  handlers.DeeplTranslateRequest:
    properties:
      context:
        type: string
      enable_beta_languages:
        type: boolean
      formality:
        example: default
        type: string
      glossary_id:
        type: string
      ignore_tags:
        items:
          type: string
        type: array
      model_type:
        example: quality_optimized
        type: string
      non_splitting_tags:
        items:
          type: string
        type: array
      outline_detection:
        example: "1"
        type: string
      preserve_formatting:
        example: "0"
        type: string
      source_lang:
        example: EN
        type: string
      split_sentences:
        example: "1"
        type: string
      splitting_tags:
        items:
          type: string
        type: array
      tag_handling:
        example: xml
        type: string
      target_lang:
        example: DE
        type: string
      text:
        example:
        - Hello
        - ' world!'
        items:
          type: string
        type: array
    required:
    - target_lang
    - text
    type: object
  handlers.DeeplTranslateResponse:
    properties:
      translations:
        items:
          $ref: '#/definitions/handlers.DeeplTranslation'
        type: array
    type: object
  handlers.DeeplTranslation:
    properties:
      detected_source_language:
        example: EN
        type: string
      text:
        example: Hallo, Welt!
        type: string
    type: object
  handlers.GoogleTranslateRequest:
    properties:
      format:
        example: text
        type: string
      q:
        example: The Great Pyramid of Giza
        type: string
      source:
        example: en
        type: string
      target:
        example: zh-Hans
        type: string
    required:
    - q
    - source
    - target
    type: object
  handlers.GoogleTranslateResponse:
    properties:
      data:
        properties:
          translations:
            items:
              properties:
                translatedText:
                  example: 吉萨大金字塔
                  type: string
              type: object
            type: array
        type: object
    type: object
  handlers.HcfyDict:
    properties:
      pos:
        example: n.
        type: string
      terms:
        example:
        - 你好
        - 问候
        items:
          type: string
        type: array
    type: object
  handlers.HcfyPhonetic:
    properties:
      name:
        example: 美
        type: string
      ttsURI:
        example: https://...
        type: string
      value:
        example: həˈloʊ
        type: string
    type: object
  handlers.HcfyTranslateRequest:
    properties:
      destination:
        example:
        - 中文(简体)
        - 英语
        items:
          type: string
        type: array
      name:
        example: 翻译一
        type: string
      source:
        example: 英语
        type: string
      text:
        example: Hello, word translation.
        type: string
    required:
    - destination
    - name
    - text
    type: object
  handlers.HcfyTranslateResponse:
    properties:
      dict:
        items:
          $ref: '#/definitions/handlers.HcfyDict'
        type: array
      from:
        example: 英语
        type: string
      link:
        example: https://...
        type: string
      phonetic:
        items:
          $ref: '#/definitions/handlers.HcfyPhonetic'
        type: array
      result:
        example:
        - 你好，划词翻译。
        items:
          type: string
        type: array
      text:
        example: Hello, word translation.
        type: string
      to:
        example: 中文(简体)
        type: string
      ttsURI:
        example: https://...
        type: string
    type: object
  handlers.ImmeTranslateRequest:
    properties:
      source_lang:
        example: en
        type: string
      target_lang:
        example: zh-CN
        type: string
      text_list:
        example:
        - Hello
        - ' world!'
        - Good morning!
        items:
          type: string
        type: array
    required:
    - source_lang
    - target_lang
    - text_list
    type: object
  handlers.ImmeTranslateResponse:
    properties:
      translations:
        items:
          $ref: '#/definitions/handlers.ImmeTranslation'
        type: array
    type: object
  handlers.ImmeTranslation:
    properties:
      detected_source_lang:
        example: en
        type: string
      text:
        example: 你好，世界！
        type: string
    type: object
  handlers.KissTranslateRequest:
    properties:
      from:
        example: en
        type: string
      text:
        example: Hello, world!
        type: string
      to:
        example: zh-CN
        type: string
    required:
    - from
    - text
    - to
    type: object
  handlers.KissTranslateResponse:
    properties:
      src:
        example: en
        type: string
      text:
        example: 你好，世界！
        type: string
    type: object
  handlers.TranslateBatchRequest:
    properties:
      from:
        example: en
        type: string
      html:
        example: false
        type: boolean
      texts:
        example:
        - Hello
        - ' world!'
        - Good morning!
        items:
          type: string
        type: array
      to:
        example: zh-Hans
        type: string
    required:
    - from
    - texts
    - to
    type: object
  handlers.TranslateBatchResponse:
    properties:
      results:
        example:
        - 你好，世界！
        - 早上好！
        items:
          type: string
        type: array
    type: object
  handlers.TranslateRequest:
    properties:
      from:
        example: en
        type: string
      html:
        example: false
        type: boolean
      text:
        example: Hello, world!
        type: string
      to:
        example: zh-Hans
        type: string
    required:
    - from
    - text
    - to
    type: object
  handlers.TranslateResponse:
    properties:
      result:
        example: 你好，世界！
        type: string
    type: object
host: localhost:8989
info:
  contact:
    name: API Support
    url: https://github.com/xxnuo/MTranServer/issues
  description: 超低资源消耗超快的离线翻译服务器 API
  license:
    name: Apache 2.0
    url: https://github.com/xxnuo/MTranServer/blob/main/LICENSE
  termsOfService: https://github.com/xxnuo/MTranServer
  title: MTranServer API
  version: 3.0.0
paths:
  /__heartbeat__:
    get:
      description: 返回服务状态
      produces:
      - text/plain
      responses:
        "200":
          description: Ready
          schema:
            type: string
      summary: 心跳检查
      tags:
      - 系统
  /__lbheartbeat__:
    get:
      description: 返回负载均衡器心跳状态
      produces:
      - text/plain
      responses:
        "200":
          description: Ready
          schema:
            type: string
      summary: 负载均衡心跳检查
      tags:
      - 系统
  /deepl:
    post:
      consumes:
      - application/json
      description: 兼容 DeepL API v2 的翻译接口
      parameters:
      - description: API Token
        in: query
        name: token
        type: string
      - description: DeepL 翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.DeeplTranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.DeeplTranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: DeepL 翻译兼容接口
      tags:
      - 插件
  /google/language/translate/v2:
    post:
      consumes:
      - application/json
      description: 兼容 Google Translate API v2 的翻译接口
      parameters:
      - description: API Key
        in: query
        name: key
        type: string
      - description: Google 翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.GoogleTranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.GoogleTranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: Google 翻译兼容接口
      tags:
      - 插件
  /google/translate_a/single:
    get:
      consumes:
      - application/json
      description: 兼容 Google translate_a/single 的翻译接口
      parameters:
      - default: gtx
        description: 客户端类型
        in: query
        name: client
        type: string
      - description: 源语言代码
        example: en
        in: query
        name: sl
        required: true
        type: string
      - description: 目标语言代码
        example: zh-CN
        in: query
        name: tl
        required: true
        type: string
      - default: t
        description: 数据类型
        in: query
        name: dt
        type: string
      - description: 待翻译文本
        example: Hello, world!
        in: query
        name: q
        required: true
        type: string
      - description: API Key
        in: query
        name: key
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            items: {}
            type: array
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: Google translate_a/single 兼容接口
      tags:
      - 插件
  /hcfy:
    post:
      consumes:
      - application/json
      description: 兼容划词翻译自定义翻译源接口
      parameters:
      - description: API Token
        in: query
        name: token
        type: string
      - description: 划词翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.HcfyTranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.HcfyTranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: 划词翻译兼容接口
      tags:
      - 插件
  /health:
    get:
      description: 检查服务是否正常运行
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties:
              type: string
            type: object
      summary: 健康检查
      tags:
      - 系统
  /imme:
    post:
      consumes:
      - application/json
      description: 为沉浸式翻译插件提供的翻译接口
      parameters:
      - description: API Token
        in: query
        name: token
        type: string
      - description: 沉浸式翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.ImmeTranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.ImmeTranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: 沉浸式翻译插件接口
      tags:
      - 插件
  /kiss:
    post:
      consumes:
      - application/json
      description: 为简约翻译插件提供的单文本翻译接口
      parameters:
      - description: API Token
        in: header
        name: KEY
        type: string
      - description: 简约翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.KissTranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.KissTranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "401":
          description: Unauthorized
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      summary: 简约翻译插件接口（非聚合）
      tags:
      - 插件
  /languages:
    get:
      description: 返回所有支持的翻译语言代码
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties:
              items:
                type: string
              type: array
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      summary: 获取支持的语言列表
      tags:
      - 翻译
  /translate:
    post:
      consumes:
      - application/json
      description: 翻译单个文本
      parameters:
      - description: 翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.TranslateRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.TranslateResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      summary: 单文本翻译
      tags:
      - 翻译
  /translate/batch:
    post:
      consumes:
      - application/json
      description: 批量翻译多个文本
      parameters:
      - description: 批量翻译请求
        in: body
        name: request
        required: true
        schema:
          $ref: '#/definitions/handlers.TranslateBatchRequest'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/handlers.TranslateBatchResponse'
        "400":
          description: Bad Request
          schema:
            additionalProperties:
              type: string
            type: object
        "500":
          description: Internal Server Error
          schema:
            additionalProperties:
              type: string
            type: object
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      summary: 批量翻译
      tags:
      - 翻译
  /version:
    get:
      description: 返回当前服务的版本号
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            additionalProperties:
              type: string
            type: object
      summary: 获取服务版本
      tags:
      - 系统
securityDefinitions:
  ApiKeyAuth:
    in: header
    name: Authorization
    type: apiKey
  ApiKeyQuery:
    in: query
    name: token
    type: apiKey
swagger: "2.0"
