From c019c6408aaa03c37f7953c5fc8f83dedfcda3f2 Mon Sep 17 00:00:00 2001 From: hcxm <149076749@qq.com> Date: Mon, 25 Jan 2021 10:35:21 +0800 Subject: [PATCH] add search file... --- templates/swagger/v1_json.tmpl | 99 +++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 2c3161327..dbddd7762 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -21,7 +21,7 @@ }, "version": "1.1.1" }, - "basePath": "{{AppSubUrl}}/api/v1", + "basePath": "/api/v1", "paths": { "/admin/orgs": { "get": { @@ -2961,6 +2961,48 @@ } } }, + "/repos/{owner}/{repo}/count": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "Get commit quantity by branch", + "operationId": "Count", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/editorconfig/{filepath}": { "get": { "produces": [ @@ -3004,6 +3046,54 @@ } } }, + "/repos/{owner}/{repo}/find": { + "get": { + "produces": [ + "application/json" + ], + "tags": [ + "repository" + ], + "summary": "The search file contains subdirectories, which is a custom interface *****", + "operationId": "find", + "parameters": [ + { + "type": "string", + "description": "owner of the repo", + "name": "owner", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "name of the repo", + "name": "repo", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "The name of the commit/branch/tag. Default the repository’s default branch (usually master)", + "name": "ref", + "in": "query" + }, + { + "type": "string", + "description": "Search keywords", + "name": "q", + "in": "query" + } + ], + "responses": { + "200": { + "$ref": "#/responses/[]*SearchFileItem" + }, + "404": { + "$ref": "#/responses/notFound" + } + } + } + }, "/repos/{owner}/{repo}/forks": { "get": { "produces": [ @@ -7336,7 +7426,7 @@ "tags": [ "repository" ], - "summary": "Get the content of the readme.* file, which is a custom interface", + "summary": "Get the content of the readme.* file, which is a custom interface ****", "operationId": "readme", "parameters": [ { @@ -11070,6 +11160,11 @@ "_links": { "$ref": "#/definitions/FileLinksResponse" }, + "commit_count": { + "type": "integer", + "format": "int64", + "x-go-name": "CommitCount" + }, "content": { "description": "`content` is populated when `type` is `file`, otherwise null", "type": "string",