{ "swagger": "2.0", "info": { "title": "Linux Do CDK", "contact": {}, "version": "0.1.0" }, "paths": { "/api/v1/dashboard/stats/all": { "get": { "produces": [ "application/json" ], "tags": [ "Dashboard" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/dashboard.DashboardDataResponse" } } } } }, "/api/v1/health": { "get": { "produces": [ "application/json" ], "tags": [ "health" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/health.HealthResponse" } } } } }, "/api/v1/oauth/callback": { "post": { "produces": [ "application/json" ], "tags": [ "oauth" ], "parameters": [ { "description": "request body", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/oauth.CallbackRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.CallbackResponse" } } } } }, "/api/v1/oauth/login": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.GetLoginURLResponse" } } } } }, "/api/v1/oauth/logout": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.LogoutResponse" } } } } }, "/api/v1/oauth/user-info": { "get": { "produces": [ "application/json" ], "tags": [ "oauth" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/oauth.UserInfoResponse" } } } } }, "/api/v1/projects": { "get": { "produces": [ "application/json" ], "tags": [ "project" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ListProjectsResponse" } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "description": "项目信息", "name": "project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project.CreateProjectRequestBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } }, "/api/v1/projects/mine": { "get": { "produces": [ "application/json" ], "tags": [ "project" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ListProjectsResponse" } } } } }, "/api/v1/projects/received": { "get": { "produces": [ "application/json" ], "tags": [ "project" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ListReceiveHistoryResponse" } } } } }, "/api/v1/projects/{id}": { "get": { "description": "获取指定项目所有信息以及领取情况 (Get all information and claim status for a specific project)", "produces": [ "application/json" ], "tags": [ "project" ], "summary": "获取指定项目信息 (Get specific project information)", "parameters": [ { "type": "string", "description": "项目ID (Project ID)", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "allOf": [ { "$ref": "#/definitions/project.ProjectResponse" }, { "type": "object", "properties": { "data": { "$ref": "#/definitions/project.GetProjectResponseData" } } } ] } } } }, "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "description": "项目信息", "name": "project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project.UpdateProjectRequestBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } }, "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } }, "/api/v1/projects/{id}/receive": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "project id", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } }, "/api/v1/projects/{id}/report": { "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "parameters": [ { "type": "string", "description": "项目ID", "name": "id", "in": "path", "required": true }, { "description": "举报信息", "name": "project", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project.ReportProjectRequestBody" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ProjectResponse" } } } } }, "/api/v1/tags": { "get": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "project" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/project.ListTagsResponse" } } } } } }, "definitions": { "dashboard.DashboardDataResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "health.HealthResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.BasicUserInfo": { "type": "object", "properties": { "avatar_url": { "type": "string" }, "id": { "type": "integer" }, "nickname": { "type": "string" }, "score": { "type": "integer" }, "trust_level": { "$ref": "#/definitions/oauth.TrustLevel" }, "username": { "type": "string" } } }, "oauth.CallbackRequest": { "type": "object", "properties": { "code": { "type": "string" }, "state": { "type": "string" } } }, "oauth.CallbackResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.GetLoginURLResponse": { "type": "object", "properties": { "data": { "type": "string" }, "error_msg": { "type": "string" } } }, "oauth.LogoutResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "oauth.TrustLevel": { "type": "integer", "enum": [ 0, 1, 2, 3, 4 ], "x-enum-varnames": [ "TrustLevelNewUser", "TrustLevelBasicUser", "TrustLevelUser", "TrustLevelActiveUser", "TrustLevelLeader" ] }, "oauth.UserInfoResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/oauth.BasicUserInfo" }, "error_msg": { "type": "string" } } }, "project.CreateProjectRequestBody": { "type": "object", "required": [ "end_time", "name", "project_items", "start_time" ], "properties": { "allow_same_ip": { "type": "boolean" }, "description": { "type": "string", "maxLength": 1024 }, "distribution_type": { "enum": [ 0, 1 ], "allOf": [ { "$ref": "#/definitions/project.DistributionType" } ] }, "end_time": { "type": "string" }, "hide_from_explore": { "type": "boolean" }, "minimum_trust_level": { "enum": [ 0, 1, 2, 3, 4 ], "allOf": [ { "$ref": "#/definitions/oauth.TrustLevel" } ] }, "name": { "type": "string", "maxLength": 32, "minLength": 1 }, "project_items": { "type": "array", "minItems": 1, "items": { "type": "string" } }, "project_tags": { "type": "array", "items": { "type": "string" } }, "risk_level": { "type": "integer", "maximum": 100, "minimum": 0 }, "start_time": { "type": "string" } } }, "project.DistributionType": { "type": "integer", "enum": [ 0, 1 ], "x-enum-varnames": [ "DistributionTypeOneForEach", "DistributionTypeInvite" ] }, "project.GetProjectResponseData": { "type": "object", "properties": { "allow_same_ip": { "type": "boolean" }, "available_items_count": { "type": "integer" }, "created_at": { "type": "string" }, "creator_id": { "type": "integer" }, "creator_nickname": { "type": "string" }, "creator_username": { "type": "string" }, "description": { "type": "string" }, "distribution_type": { "$ref": "#/definitions/project.DistributionType" }, "end_time": { "type": "string" }, "hide_from_explore": { "type": "boolean" }, "id": { "type": "string" }, "is_completed": { "type": "boolean" }, "is_received": { "type": "boolean" }, "minimum_trust_level": { "$ref": "#/definitions/oauth.TrustLevel" }, "name": { "type": "string" }, "received_content": { "type": "string" }, "report_count": { "type": "integer" }, "risk_level": { "type": "integer" }, "start_time": { "type": "string" }, "status": { "$ref": "#/definitions/project.ProjectStatus" }, "tags": { "type": "array", "items": { "type": "string" } }, "total_items": { "type": "integer" }, "updated_at": { "type": "string" } } }, "project.ListProjectsResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/project.ListProjectsResponseData" }, "error_msg": { "type": "string" } } }, "project.ListProjectsResponseData": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/project.ListProjectsResponseDataResult" } }, "total": { "type": "integer" } } }, "project.ListProjectsResponseDataResult": { "type": "object", "properties": { "allow_same_ip": { "type": "boolean" }, "created_at": { "type": "string" }, "description": { "type": "string" }, "distribution_type": { "$ref": "#/definitions/project.DistributionType" }, "end_time": { "type": "string" }, "id": { "type": "string" }, "minimum_trust_level": { "$ref": "#/definitions/oauth.TrustLevel" }, "name": { "type": "string" }, "risk_level": { "type": "integer" }, "start_time": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "total_items": { "type": "integer" } } }, "project.ListReceiveHistoryResponse": { "type": "object", "properties": { "data": { "$ref": "#/definitions/project.ListReceiveHistoryResponseData" }, "error_msg": { "type": "string" } } }, "project.ListReceiveHistoryResponseData": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/definitions/project.ListReceiveHistoryResponseDataResult" } }, "total": { "type": "integer" } } }, "project.ListReceiveHistoryResponseDataResult": { "type": "object", "properties": { "content": { "type": "string" }, "project_creator": { "type": "string" }, "project_creator_nickname": { "type": "string" }, "project_id": { "type": "string" }, "project_name": { "type": "string" }, "received_at": { "type": "string" } } }, "project.ListTagsResponse": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "string" } }, "error_msg": { "type": "string" } } }, "project.ProjectResponse": { "type": "object", "properties": { "data": {}, "error_msg": { "type": "string" } } }, "project.ProjectStatus": { "type": "integer", "enum": [ 0, 1, 2 ], "x-enum-varnames": [ "ProjectStatusNormal", "ProjectStatusHidden", "ProjectStatusViolation" ] }, "project.ReportProjectRequestBody": { "type": "object", "required": [ "reason" ], "properties": { "reason": { "type": "string", "maxLength": 255, "minLength": 1 } } }, "project.UpdateProjectRequestBody": { "type": "object", "required": [ "end_time", "name", "start_time" ], "properties": { "allow_same_ip": { "type": "boolean" }, "description": { "type": "string", "maxLength": 1024 }, "enable_filter": { "type": "boolean" }, "end_time": { "type": "string" }, "hide_from_explore": { "type": "boolean" }, "minimum_trust_level": { "enum": [ 0, 1, 2, 3, 4 ], "allOf": [ { "$ref": "#/definitions/oauth.TrustLevel" } ] }, "name": { "type": "string", "maxLength": 32, "minLength": 1 }, "project_items": { "type": "array", "items": { "type": "string" } }, "project_tags": { "type": "array", "items": { "type": "string" } }, "risk_level": { "type": "integer", "maximum": 100, "minimum": 0 }, "start_time": { "type": "string" } } } } }