{ "schemes": [], "swagger": "2.0", "info": { "description": "", "title": "", "contact": {}, "version": "" }, "host": "", "basePath": "/api/v1", "paths": { "/admin/gitfiles": { "get": { "summary": "Get Git File List", "parameters": [ { "type": "string", "description": "Git link", "name": "link", "in": "query" }, { "type": "integer", "description": "Filter, 0: no filter, 1: success, 2: fail, 3: never success", "name": "filter", "in": "query" }, { "type": "integer", "description": "Skip count", "name": "skip", "in": "query" }, { "type": "integer", "description": "Take count", "name": "take", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PageDTO-model_GitFileDTO" } } } } }, "/admin/gitfiles/manual": { "post": { "consumes": [ "application/json" ], "summary": "Append to collector manual list", "parameters": [ { "description": "Append manual request", "name": "req", "in": "body", "required": true, "schema": { "$ref": "#/definitions/model.GitFileAppendManualReq" } } ], "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "400": { "description": "Bad Request", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/admin/gitfiles/start": { "post": { "description": "Starts the Git File collection process", "summary": "Start Git File Collector", "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/admin/gitfiles/status": { "get": { "summary": "Get git files statistics and collector status", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.GitFileStatusResp" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/admin/gitfiles/stop": { "post": { "description": "Stops the Git File collection process", "summary": "Stop Git File Collector", "responses": { "204": { "description": "No Content", "schema": { "type": "string" } }, "500": { "description": "Internal Server Error", "schema": { "type": "string" } } } } }, "/histories": { "get": { "description": "Get score histories by git link", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Get score histories", "parameters": [ { "type": "string", "description": "Git link", "name": "link", "in": "query", "required": true }, { "type": "integer", "description": "Skip count", "name": "start", "in": "query" }, { "type": "integer", "description": "Take count", "name": "take", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PageDTO-model_ResultDTO" } } } } }, "/rankings": { "get": { "description": "Get ranking results, optionally including all details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Get ranking results", "parameters": [ { "type": "integer", "description": "Skip count", "name": "start", "in": "query" }, { "type": "integer", "description": "Take count", "name": "take", "in": "query" }, { "type": "boolean", "description": "Include details", "name": "detail", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PageDTO-model_RankingResultDTO" } } } } }, "/results": { "get": { "description": "Search score results by git link\nNOTE: All details are ignored, should use /results/:scoreid to get details\nNOTE: Maxium take count is 1000", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Search score results by git link", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true }, { "type": "integer", "description": "Skip count", "name": "start", "in": "query" }, { "type": "integer", "description": "Take count", "name": "take", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.PageDTO-model_ResultDTO" } } } } }, "/results/{scoreid}": { "get": { "description": "Get score results, including all details by scoreid", "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Get score results", "parameters": [ { "type": "integer", "description": "Score ID", "name": "scoreid", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/model.ResultDTO" } } } } } }, "definitions": { "model.GitFileAppendManualReq": { "type": "object", "properties": { "gitLink": { "type": "string" } } }, "model.GitFileDTO": { "type": "object", "properties": { "failedTimes": { "type": "integer" }, "filePath": { "type": "string" }, "gitLink": { "type": "string" }, "lastSuccess": { "type": "string" }, "message": { "type": "string" }, "success": { "type": "boolean" }, "takeStorage": { "type": "integer" }, "takeTimeMs": { "type": "integer" }, "updateTime": { "type": "string" } } }, "model.GitFileStatisticsResultDTO": { "type": "object", "properties": { "fail": { "type": "integer" }, "neverSuccess": { "type": "integer" }, "success": { "type": "integer" }, "total": { "type": "integer" } } }, "model.GitFileStatusResp": { "type": "object", "properties": { "collector": { "$ref": "#/definitions/rpc.StatusResp" }, "gitFile": { "$ref": "#/definitions/model.GitFileStatisticsResultDTO" } } }, "model.PageDTO-model_GitFileDTO": { "type": "object", "properties": { "count": { "type": "integer" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.GitFileDTO" } }, "start": { "type": "integer" }, "total": { "type": "integer" } } }, "model.PageDTO-model_RankingResultDTO": { "type": "object", "properties": { "count": { "type": "integer" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.RankingResultDTO" } }, "start": { "type": "integer" }, "total": { "type": "integer" } } }, "model.PageDTO-model_ResultDTO": { "type": "object", "properties": { "count": { "type": "integer" }, "items": { "type": "array", "items": { "$ref": "#/definitions/model.ResultDTO" } }, "start": { "type": "integer" }, "total": { "type": "integer" } } }, "model.RankingResultDTO": { "type": "object", "properties": { "distDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultDistDetailDTO" } }, "distroScore": { "type": "number" }, "gitDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultGitMetadataDTO" } }, "gitScore": { "type": "number" }, "langDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultLangDetailDTO" } }, "langScore": { "type": "number" }, "link": { "type": "string" }, "ranking": { "type": "integer" }, "score": { "type": "number" }, "scoreID": { "type": "integer" }, "updateTime": { "type": "string" } } }, "model.ResultDTO": { "type": "object", "properties": { "distDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultDistDetailDTO" } }, "distroScore": { "type": "number" }, "gitDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultGitMetadataDTO" } }, "gitScore": { "type": "number" }, "langDetail": { "type": "array", "items": { "$ref": "#/definitions/model.ResultLangDetailDTO" } }, "langScore": { "type": "number" }, "link": { "type": "string" }, "score": { "type": "number" }, "scoreID": { "type": "integer" }, "updateTime": { "type": "string" } } }, "model.ResultDistDetailDTO": { "type": "object", "properties": { "count": { "type": "integer" }, "impact": { "type": "number" }, "pageRank": { "type": "number" }, "type": { "type": "integer" }, "updateTime": { "type": "string" } } }, "model.ResultGitMetadataDTO": { "type": "object", "properties": { "commitFrequency": { "type": "number" }, "contributorCount": { "type": "integer" }, "createdSince": { "type": "string" }, "language": { "type": "array", "items": { "type": "string" } }, "license": { "type": "array", "items": { "type": "string" } }, "orgCount": { "type": "integer" }, "updateTime": { "type": "string" }, "updatedSince": { "type": "string" } } }, "model.ResultLangDetailDTO": { "type": "object", "properties": { "depCount": { "type": "integer" }, "langEcoImpact": { "type": "number" }, "type": { "type": "integer" }, "updateTime": { "type": "string" } } }, "rpc.RunningTaskDTO": { "type": "object", "properties": { "link": { "type": "string" }, "progress": { "type": "string" }, "start": { "type": "string" } } }, "rpc.StatusResp": { "type": "object", "properties": { "currentTasks": { "type": "array", "items": { "$ref": "#/definitions/rpc.RunningTaskDTO" } }, "isRunning": { "type": "boolean" }, "pendingTasks": { "type": "array", "items": { "type": "string" } } } } } }