From 3de09285dc54d39b79a4b4a3b39bdca82335e03b Mon Sep 17 00:00:00 2001 From: panda Date: Mon, 1 Jul 2024 08:12:20 +0000 Subject: [PATCH 1/4] openapi: add quotaAvailable --- openapi/_api.yaml | 4 +++ openapi/judge.yaml | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/openapi/_api.yaml b/openapi/_api.yaml index 306b8f9..b282260 100644 --- a/openapi/_api.yaml +++ b/openapi/_api.yaml @@ -111,9 +111,13 @@ components: tags: - name: 评测 description: 提交代码以使用洛谷题库评测 + - name: 查询 + description: 查询开放平台账户状态 paths: /judge/problem: $ref: './judge.yaml#/paths/~1problem' /judge/result: $ref: './judge.yaml#/paths/~1result' + /judge/quotaAvailable: + $ref: './judge.yaml#/paths/~1quotaAvailable' diff --git a/openapi/judge.yaml b/openapi/judge.yaml index 8edba12..a3ff509 100644 --- a/openapi/judge.yaml +++ b/openapi/judge.yaml @@ -273,3 +273,64 @@ paths: $ref: '#/components/schemas/JudgeCallback' '204': description: 评测尚未完成,还没有任何结果产生 + + /quotaAvailable: + get: + summary: 查询账户计费点 + description: 查询当前账户的计费点情况 + tags: [ 查询 ] + responses: + '200': + description: 查询成功 + content: + application/json: + schema: + type: object + properties: + quotas: + type: array + description: 计费点列表 + items: + type: object + properties: + availablePoints: + type: integer + description: 可用计费点 + createTime: + type: integer + description: 计费点创建时间 + format: int64 + example: 1620000000 + validAfter: + type: integer + description: 计费点生效时间 + format: int64 + example: 1620000000 + expireTime: + type: integer + description: 计费点过期时间 + format: int64 + example: 1620000000 + points: + type: object + description: 计费套餐详情 + properties: + max: + type: integer + description: 套餐最大计费点 + used: + type: integer + description: 已使用计费点 + orgs: + type: object + description: 机构信息 + properties: + id: + type: integer + description: 机构 ID + slug: + type: string + description: 机构标识 + name: + type: string + description: 机构名称 From 98fb80cda53db1264d1a140c48bbd8e466cfd5d2 Mon Sep 17 00:00:00 2001 From: panda Date: Mon, 1 Jul 2024 16:21:32 +0800 Subject: [PATCH 2/4] =?UTF-8?q?"=E5=8F=AF=E7=94=A8=E8=AE=A1=E8=B4=B9?= =?UTF-8?q?=E7=82=B9"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi/judge.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/judge.yaml b/openapi/judge.yaml index a3ff509..9074a36 100644 --- a/openapi/judge.yaml +++ b/openapi/judge.yaml @@ -276,8 +276,8 @@ paths: /quotaAvailable: get: - summary: 查询账户计费点 - description: 查询当前账户的计费点情况 + summary: 查询账户可用计费点 + description: 查询当前账户的可用计费点情况 tags: [ 查询 ] responses: '200': @@ -289,7 +289,7 @@ paths: properties: quotas: type: array - description: 计费点列表 + description: 可用计费点列表 items: type: object properties: From d9757d619d5c875a0aca4b4a9b12ee43213f6868 Mon Sep 17 00:00:00 2001 From: panda Date: Wed, 3 Jul 2024 03:56:36 +0000 Subject: [PATCH 3/4] add point example --- openapi/judge.yaml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/openapi/judge.yaml b/openapi/judge.yaml index 9074a36..2b956c8 100644 --- a/openapi/judge.yaml +++ b/openapi/judge.yaml @@ -276,8 +276,8 @@ paths: /quotaAvailable: get: - summary: 查询账户可用计费点 - description: 查询当前账户的可用计费点情况 + summary: 查询账户评测可用计费点 + description: 查询当前账户的评测可用计费点情况 tags: [ 查询 ] responses: '200': @@ -296,21 +296,22 @@ paths: availablePoints: type: integer description: 可用计费点 + example: 30000 createTime: type: integer description: 计费点创建时间 format: int64 - example: 1620000000 + example: 1697620471 validAfter: type: integer description: 计费点生效时间 format: int64 - example: 1620000000 + example: 1713542400 expireTime: type: integer description: 计费点过期时间 format: int64 - example: 1620000000 + example: 1721491199 points: type: object description: 计费套餐详情 @@ -318,19 +319,8 @@ paths: max: type: integer description: 套餐最大计费点 + example: 30000 used: type: integer description: 已使用计费点 - orgs: - type: object - description: 机构信息 - properties: - id: - type: integer - description: 机构 ID - slug: - type: string - description: 机构标识 - name: - type: string - description: 机构名称 + example: 0 From 4cdb19a7869fa9e48f672e6bf3768362ea8d588f Mon Sep 17 00:00:00 2001 From: panda Date: Wed, 3 Jul 2024 07:51:00 +0000 Subject: [PATCH 4/4] fix tag --- openapi/judge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/judge.yaml b/openapi/judge.yaml index 2b956c8..0a3b2e6 100644 --- a/openapi/judge.yaml +++ b/openapi/judge.yaml @@ -278,7 +278,7 @@ paths: get: summary: 查询账户评测可用计费点 description: 查询当前账户的评测可用计费点情况 - tags: [ 查询 ] + tags: [ 查询, 评测 ] responses: '200': description: 查询成功