swagger: '2.0'
info:
  version: v2
  title: CheckApi
host: check.wanfangdata.com.cn
basePath: /api/v2
schemes:
  - https
paths:
  /Check:
    post:
      tags:
        - Check
      summary: 检测
      consumes:
        - application/json
      produces:
        - application/json
      security:
        - apiKey: []
      parameters:
        - name: checkRequest
          in: body
          description: 检测请求
          required: true
          schema:
            $ref: '#/definitions/v2.CheckRequest'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/v2.CheckResponse'
  /CheckResult:
    get:
      tags:
        - Check
      summary: 获取检测结果
      operationId: V2CheckResultGet
      consumes: []
      produces:
        - application/json
      security:
        - apiKey: []
      parameters:
        - name: checkId
          in: query
          description: 检测Id
          required: false
          type: string
          format: uuid
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/v2.CheckResultResponse'
  /Balance:
    get:
      tags:
        - Check
      summary: 获取余额
      operationId: V2BalanceGet
      consumes: []
      produces:
        - application/json
      parameters: []
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/v2.BalanceResponse'
definitions:
  v2.CheckRequest:
    description: 检测请求
    type: object
    properties:
      fileName:
        description: 文件名
        type: string
      publishDate:
        format: date-time
        description: 比对库限定日期
        type: string
      content:
        description: 检测文本
        type: string
  v2.CheckResponse:
    description: 提交检测Response
    type: object
    properties:
      status:
        description: 状态
        enum:
          - Success
          - Error
          - WordsCountOutOfRange
          - ServiceNotOpen
          - OutOfMoney
          - AuthenticateFailed
          - TransFailed
        type: string
      message:
        description: 消息
        type: string
      checkId:
        format: uuid
        description: "检测标识\r\n用于查询检测结果"
        type: string
      textLength:
        format: int32
        description: "文本长度\r\n用于计费"
        type: integer
      cost:
        format: double
        description: 检测费用
        type: number
      waitTime:
        format: int32
        description: "预计需等待的检测时长\r\n单位：秒"
        type: integer
  v2.CheckResultResponse:
    description: ''
    type: object
    properties:
      status:
        description: 状态
        enum:
          - Success
          - Error
          - NotFound
        type: string
      message:
        description: 消息
        type: string
      checkState:
        description: ''
        type: string
      data:
        $ref: '#/definitions/v2.CheckApiResult'
        description: 数据
  v2.CheckApiResult:
    description: 检测结果
    type: object
    properties:
      copyPercent:
        format: float
        description: 抄袭相似比
        type: number
      simpleReport:
        format: byte
        description: 简明报告
        type: string
      detailReport:
        format: byte
        description: 详细报告
        type: string
  v2.BalanceResponse:
    type: object
    properties:
      beginDateTime:
        format: date-time
        description: 账号有效期开始时间
        type: string
      endDateTime:
        format: date-time
        description: 账号有效期结束时间
        type: string
      count:
        format: int32
        description: 剩余篇数
        type: integer
securityDefinitions:
  apiKey:
    name: token
    in: header
    type: apiKey
    description: API Key Authentication
