Files
MonkeyCode/backend/docs/swagger.json

5562 lines
189 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"swagger": "2.0",
"info": {
"description": "MonkeyCode API",
"title": "MonkeyCode API",
"contact": {},
"version": "1.0"
},
"paths": {
"/api/v1/admin/create": {
"post": {
"description": "创建管理员",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "创建管理员",
"operationId": "create-admin",
"parameters": [
{
"description": "创建管理员参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CreateAdminReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.AdminUser"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/delete": {
"delete": {
"description": "删除管理员",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "删除管理员",
"operationId": "delete-admin",
"parameters": [
{
"type": "string",
"description": "管理员ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/export-completion-data": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "管理员导出所有补全相关数据",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"admin"
],
"summary": "导出补全数据",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/domain.ExportCompletionDataResp"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/web.Resp"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/admin/list": {
"get": {
"description": "获取管理员用户列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "获取管理员用户列表",
"operationId": "list-admin-user",
"parameters": [
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListAdminUserResp"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/login": {
"post": {
"description": "管理员登录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "管理员登录",
"operationId": "admin-login",
"parameters": [
{
"description": "登录参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.LoginReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.AdminUser"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/login-history": {
"get": {
"description": "获取管理员登录历史",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "获取管理员登录历史",
"operationId": "admin-login-history",
"parameters": [
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListAdminLoginHistoryResp"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/logout": {
"post": {
"description": "管理员登出",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "管理员登出",
"operationId": "admin-logout",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/admin/profile": {
"get": {
"description": "管理员信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "管理员信息",
"operationId": "admin-profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.AdminUser"
}
}
}
]
}
}
}
}
},
"/api/v1/admin/setting": {
"get": {
"description": "获取系统设置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "获取系统设置",
"operationId": "get-setting",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Setting"
}
}
}
]
}
}
}
},
"put": {
"description": "更新系统设置",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Admin"
],
"summary": "更新系统设置",
"operationId": "update-setting",
"parameters": [
{
"description": "更新系统设置参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateSettingReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Setting"
}
}
}
]
}
}
}
}
},
"/api/v1/billing/chat/info": {
"get": {
"description": "获取对话内容",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Billing"
],
"summary": "获取对话内容",
"operationId": "chat-info",
"parameters": [
{
"type": "string",
"description": "对话记录ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ChatInfo"
}
}
}
]
}
}
}
}
},
"/api/v1/billing/chat/record": {
"get": {
"description": "获取对话记录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Billing"
],
"summary": "获取对话记录",
"operationId": "list-chat-record",
"parameters": [
{
"type": "string",
"description": "作者",
"name": "author",
"in": "query"
},
{
"type": "boolean",
"description": "是否接受筛选",
"name": "is_accept",
"in": "query"
},
{
"type": "string",
"description": "语言",
"name": "language",
"in": "query"
},
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
},
{
"type": "string",
"description": "工作模式",
"name": "work_mode",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListChatRecordResp"
}
}
}
]
}
}
}
}
},
"/api/v1/billing/completion/info": {
"get": {
"description": "获取补全内容",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Billing"
],
"summary": "获取补全内容",
"operationId": "completion-info",
"parameters": [
{
"type": "string",
"description": "补全记录ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CompletionInfo"
}
}
}
]
}
}
}
}
},
"/api/v1/billing/completion/record": {
"get": {
"description": "获取补全记录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Billing"
],
"summary": "获取补全记录",
"operationId": "list-completion-record",
"parameters": [
{
"type": "string",
"description": "作者",
"name": "author",
"in": "query"
},
{
"type": "boolean",
"description": "是否接受筛选",
"name": "is_accept",
"in": "query"
},
{
"type": "string",
"description": "语言",
"name": "language",
"in": "query"
},
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
},
{
"type": "string",
"description": "工作模式",
"name": "work_mode",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListCompletionRecordResp"
}
}
}
]
}
}
}
}
},
"/api/v1/cli/{command}": {
"post": {
"description": "运行monkeycode-cli命令",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"CLI"
],
"summary": "运行monkeycode-cli命令",
"parameters": [
{
"type": "string",
"description": "命令",
"name": "command",
"in": "path",
"required": true
},
{
"type": "string",
"description": "标志",
"name": "flag",
"in": "query"
},
{
"description": "代码文件信息",
"name": "codeFiles",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CodeFiles"
}
}
],
"responses": {
"200": {
"description": "输出结果",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.IndexResult"
}
}
},
"500": {
"description": "内部错误",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/dashboard/category-stat": {
"get": {
"description": "获取分类统计信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "获取分类统计信息",
"operationId": "category-stat-dashboard",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CategoryStat"
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/statistics": {
"get": {
"description": "获取统计信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "获取统计信息",
"operationId": "statistics-dashboard",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Statistics"
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/time-stat": {
"get": {
"description": "获取时间统计信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "获取时间统计信息",
"operationId": "time-stat-dashboard",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.TimeStat"
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/user-code-rank": {
"get": {
"description": "用户贡献榜",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "用户贡献榜",
"operationId": "user-code-rank-dashboard",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.UserCodeRank"
}
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/user-events": {
"get": {
"description": "获取用户事件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "获取用户事件",
"operationId": "user-events-dashboard",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.UserEvent"
}
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/user-heatmap": {
"get": {
"description": "用户热力图",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "用户热力图",
"operationId": "user-heatmap-dashboard",
"parameters": [
{
"type": "string",
"description": "用户ID",
"name": "user_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.UserHeatmapResp"
}
}
}
]
}
}
}
}
},
"/api/v1/dashboard/user-stat": {
"get": {
"description": "获取用户统计信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Dashboard"
],
"summary": "获取用户统计信息",
"operationId": "user-stat-dashboard",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.UserStat"
}
}
}
]
}
}
}
}
},
"/api/v1/model": {
"get": {
"description": "获取模型列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "获取模型列表",
"operationId": "list-model",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.AllModelResp"
}
}
}
]
}
}
}
},
"put": {
"description": "更新模型",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "更新模型",
"operationId": "update-model",
"parameters": [
{
"description": "模型",
"name": "model",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateModelReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Model"
}
}
}
]
}
}
}
},
"post": {
"description": "创建模型",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "创建模型",
"operationId": "create-model",
"parameters": [
{
"description": "模型",
"name": "model",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CreateModelReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Model"
}
}
}
]
}
}
}
},
"delete": {
"description": "删除模型",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "删除模型",
"operationId": "delete-model",
"parameters": [
{
"type": "string",
"description": "模型ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/model/check": {
"post": {
"description": "检查模型",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "检查模型",
"operationId": "check-model",
"parameters": [
{
"description": "模型",
"name": "model",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CheckModelReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.Model"
}
}
}
]
}
}
}
}
},
"/api/v1/model/my": {
"get": {
"description": "获取我的模型列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "获取我的模型列表",
"operationId": "my-model-list",
"parameters": [
{
"enum": [
"llm",
"coder",
"embedding",
"audio",
"reranker"
],
"type": "string",
"x-enum-varnames": [
"ModelTypeLLM",
"ModelTypeCoder",
"ModelTypeEmbedding",
"ModelTypeAudio",
"ModelTypeReranker"
],
"description": "模型类型 llm:对话模型 coder:代码模型",
"name": "model_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.Model"
}
}
}
}
]
}
}
}
}
},
"/api/v1/model/provider/supported": {
"get": {
"description": "获取供应商支持的模型列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "获取供应商支持的模型列表",
"operationId": "get-provider-model-list",
"parameters": [
{
"type": "string",
"name": "api_header",
"in": "query"
},
{
"type": "string",
"name": "api_key",
"in": "query"
},
{
"type": "string",
"name": "base_url",
"in": "query",
"required": true
},
{
"enum": [
"SiliconFlow",
"OpenAI",
"Ollama",
"DeepSeek",
"Moonshot",
"AzureOpenAI",
"BaiZhiCloud",
"Hunyuan",
"BaiLian",
"Volcengine"
],
"type": "string",
"x-enum-varnames": [
"ModelProviderSiliconFlow",
"ModelProviderOpenAI",
"ModelProviderOllama",
"ModelProviderDeepSeek",
"ModelProviderMoonshot",
"ModelProviderAzureOpenAI",
"ModelProviderBaiZhiCloud",
"ModelProviderHunyuan",
"ModelProviderBaiLian",
"ModelProviderVolcengine"
],
"name": "provider",
"in": "query",
"required": true
},
{
"enum": [
"llm",
"coder",
"embedding",
"audio",
"reranker"
],
"type": "string",
"x-enum-varnames": [
"ModelTypeLLM",
"ModelTypeCoder",
"ModelTypeEmbedding",
"ModelTypeAudio",
"ModelTypeReranker"
],
"name": "type",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.GetProviderModelListResp"
}
}
}
]
}
}
}
}
},
"/api/v1/model/token-usage": {
"get": {
"description": "获取模型token使用情况",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Model"
],
"summary": "获取模型token使用情况",
"operationId": "get-token-usage",
"parameters": [
{
"enum": [
"llm",
"coder",
"embedding",
"audio",
"reranker"
],
"type": "string",
"x-enum-varnames": [
"ModelTypeLLM",
"ModelTypeCoder",
"ModelTypeEmbedding",
"ModelTypeAudio",
"ModelTypeReranker"
],
"description": "模型类型 llm:对话模型 coder:代码模型",
"name": "model_type",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ModelTokenUsageResp"
}
}
}
]
}
}
}
}
},
"/api/v1/static/vsix": {
"get": {
"description": "下载VSCode插件",
"consumes": [
"application/json"
],
"produces": [
"application/octet-stream"
],
"tags": [
"User"
],
"summary": "下载VSCode插件",
"operationId": "vsix-download",
"responses": {}
}
},
"/api/v1/user/chat/info": {
"get": {
"description": "获取对话内容",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Record"
],
"summary": "获取对话内容",
"operationId": "user-chat-info",
"parameters": [
{
"type": "string",
"description": "对话记录ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ChatInfo"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/chat/record": {
"get": {
"description": "获取用户对话记录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Record"
],
"summary": "获取用户对话记录",
"operationId": "user-list-chat-record",
"parameters": [
{
"type": "string",
"description": "作者",
"name": "author",
"in": "query"
},
{
"type": "boolean",
"description": "是否接受筛选",
"name": "is_accept",
"in": "query"
},
{
"type": "string",
"description": "语言",
"name": "language",
"in": "query"
},
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
},
{
"type": "string",
"description": "工作模式",
"name": "work_mode",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListChatRecordResp"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/completion/info": {
"get": {
"description": "获取补全内容",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Record"
],
"summary": "获取补全内容",
"operationId": "user-completion-info",
"parameters": [
{
"type": "string",
"description": "补全记录ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.CompletionInfo"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/completion/record": {
"get": {
"description": "获取补全记录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Record"
],
"summary": "获取补全记录",
"operationId": "user-list-completion-record",
"parameters": [
{
"type": "string",
"description": "作者",
"name": "author",
"in": "query"
},
{
"type": "boolean",
"description": "是否接受筛选",
"name": "is_accept",
"in": "query"
},
{
"type": "string",
"description": "语言",
"name": "language",
"in": "query"
},
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
},
{
"type": "string",
"description": "工作模式",
"name": "work_mode",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListCompletionRecordResp"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/dashboard/events": {
"get": {
"description": "获取用户事件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Dashboard"
],
"summary": "获取用户事件",
"operationId": "user-dashboard-events",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.UserEvent"
}
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/dashboard/heatmap": {
"get": {
"description": "用户热力图",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Dashboard"
],
"summary": "用户热力图",
"operationId": "user-dashboard-heatmap",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.UserHeatmapResp"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/dashboard/stat": {
"get": {
"description": "获取用户统计信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Dashboard"
],
"summary": "获取用户统计信息",
"operationId": "user-dashboard-stat",
"parameters": [
{
"maximum": 90,
"minimum": 24,
"type": "integer",
"default": 90,
"description": "持续时间 (小时或天数)`",
"name": "duration",
"in": "query"
},
{
"enum": [
"hour",
"day"
],
"type": "string",
"default": "day",
"description": "精度: \"hour\", \"day\"",
"name": "precision",
"in": "query",
"required": true
},
{
"type": "string",
"description": "用户ID可选参数",
"name": "user_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.UserStat"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/user/delete": {
"delete": {
"description": "删除用户",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "删除用户",
"operationId": "delete-user",
"parameters": [
{
"type": "string",
"description": "用户ID",
"name": "id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "object"
}
}
}
]
}
}
}
}
},
"/api/v1/user/invite": {
"get": {
"description": "获取用户邀请码",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "获取用户邀请码",
"operationId": "invite",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.InviteResp"
}
}
}
]
}
}
}
}
},
"/api/v1/user/list": {
"get": {
"description": "获取用户列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "获取用户列表",
"operationId": "list-user",
"parameters": [
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListUserResp"
}
}
}
]
}
}
}
}
},
"/api/v1/user/login": {
"post": {
"description": "用户登录",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "用户登录",
"operationId": "login",
"parameters": [
{
"description": "登录参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.LoginReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.LoginResp"
}
}
}
]
}
}
}
}
},
"/api/v1/user/login-history": {
"get": {
"description": "获取用户登录历史",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "获取用户登录历史",
"operationId": "login-history",
"parameters": [
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListLoginHistoryResp"
}
}
}
]
}
}
}
}
},
"/api/v1/user/logout": {
"post": {
"description": "用户登出",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "用户登出",
"operationId": "logout",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/user/oauth/callback": {
"get": {
"description": "用户 OAuth 回调",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "用户 OAuth 回调",
"operationId": "user-oauth-callback",
"parameters": [
{
"type": "string",
"name": "code",
"in": "query",
"required": true
},
{
"type": "string",
"name": "state",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "string"
}
}
}
]
}
}
}
}
},
"/api/v1/user/oauth/signup-or-in": {
"get": {
"description": "用户 OAuth 登录或注册",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "用户 OAuth 登录或注册",
"operationId": "user-oauth-signup-or-in",
"parameters": [
{
"type": "string",
"description": "邀请码",
"name": "inviate_code",
"in": "query"
},
{
"enum": [
"email",
"dingtalk",
"custom"
],
"type": "string",
"x-enum-varnames": [
"UserPlatformEmail",
"UserPlatformDingTalk",
"UserPlatformCustom"
],
"description": "第三方平台 dingtalk",
"name": "platform",
"in": "query",
"required": true
},
{
"type": "string",
"description": "登录成功后跳转的 URL",
"name": "redirect_url",
"in": "query"
},
{
"type": "string",
"description": "会话ID",
"name": "session_id",
"in": "query"
},
{
"enum": [
"plugin",
"browser"
],
"type": "string",
"default": "plugin",
"x-enum-varnames": [
"LoginSourcePlugin",
"LoginSourceBrowser"
],
"description": "登录来源 plugin: 插件 browser: 浏览器; 默认为 plugin",
"name": "source",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.OAuthURLResp"
}
}
}
]
}
}
}
}
},
"/api/v1/user/profile": {
"get": {
"description": "获取用户信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Manage"
],
"summary": "获取用户信息",
"operationId": "user-profile",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.User"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
},
"put": {
"description": "更新用户信息",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User Manage"
],
"summary": "更新用户信息",
"operationId": "user-update-profile",
"parameters": [
{
"description": "param",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.ProfileUpdateReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.User"
}
}
}
]
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/user/register": {
"post": {
"description": "注册用户",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "注册用户",
"operationId": "register",
"parameters": [
{
"description": "注册参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.RegisterReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.User"
}
}
}
]
}
}
}
}
},
"/api/v1/user/update": {
"put": {
"description": "更新用户",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "更新用户",
"operationId": "update-user",
"parameters": [
{
"description": "更新用户参数",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateUserReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.User"
}
}
}
]
}
}
}
}
},
"/api/v1/workspace/files": {
"get": {
"description": "分页获取工作区文件列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "获取工作区文件列表",
"operationId": "list-workspace-files",
"parameters": [
{
"type": "string",
"description": "编程语言筛选",
"name": "language",
"in": "query"
},
{
"type": "string",
"description": "下一页标识",
"name": "next_token",
"in": "query"
},
{
"type": "integer",
"description": "分页",
"name": "page",
"in": "query"
},
{
"type": "string",
"description": "搜索关键词(文件路径)",
"name": "search",
"in": "query"
},
{
"type": "integer",
"description": "每页多少条记录",
"name": "size",
"in": "query"
},
{
"type": "string",
"description": "用户ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "工作区ID",
"name": "workspace_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ListWorkspaceFileResp"
}
}
}
]
}
}
}
},
"post": {
"description": "创建一个新的工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "创建工作区文件",
"operationId": "create-workspace-file",
"parameters": [
{
"description": "文件信息",
"name": "file",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.CreateWorkspaceFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
]
}
}
}
}
},
"/api/v1/workspace/files/batch": {
"put": {
"description": "批量更新多个工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "批量更新工作区文件",
"operationId": "batch-update-workspace-files",
"parameters": [
{
"description": "文件列表",
"name": "files",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.BatchUpdateWorkspaceFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
}
]
}
}
}
},
"post": {
"description": "批量创建多个工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "批量创建工作区文件",
"operationId": "batch-create-workspace-files",
"parameters": [
{
"description": "文件列表",
"name": "files",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.BatchCreateWorkspaceFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
}
]
}
}
}
}
},
"/api/v1/workspace/files/by-path": {
"get": {
"description": "根据用户ID、项目ID和文件路径获取工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "根据路径获取工作区文件",
"operationId": "get-workspace-file-by-path",
"parameters": [
{
"type": "string",
"description": "用户ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "项目ID",
"name": "project_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "文件路径",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
]
}
}
}
}
},
"/api/v1/workspace/files/get-and-save": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "获取并保存工作区文件",
"parameters": [
{
"description": "请求参数",
"name": "req",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.GetAndSaveReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/api/v1/workspace/files/sync": {
"post": {
"description": "同步本地文件到工作区,智能检测新增、修改和删除",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "同步工作区文件",
"operationId": "sync-workspace-files",
"parameters": [
{
"description": "同步信息",
"name": "sync",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.SyncWorkspaceFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.SyncWorkspaceFileResp"
}
}
}
]
}
}
}
}
},
"/api/v1/workspace/files/{id}": {
"get": {
"description": "根据文件ID获取工作区文件详情",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "根据ID获取工作区文件",
"operationId": "get-workspace-file-by-id",
"parameters": [
{
"type": "string",
"description": "文件ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
]
}
}
}
},
"put": {
"description": "更新指定的工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "更新工作区文件",
"operationId": "update-workspace-file",
"parameters": [
{
"type": "string",
"description": "文件ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "更新信息",
"name": "file",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.UpdateWorkspaceFileReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
]
}
}
}
},
"delete": {
"description": "删除指定的工作区文件",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"WorkspaceFile"
],
"summary": "删除工作区文件",
"operationId": "delete-workspace-file",
"parameters": [
{
"type": "string",
"description": "文件ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/v1/chat/completions": {
"post": {
"description": "处理聊天补全请求",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "处理聊天补全请求",
"operationId": "chat-completion",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/v1/completion/accept": {
"post": {
"description": "接受补全请求",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "接受补全请求",
"operationId": "accept-completion",
"parameters": [
{
"description": "补全请求",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.AcceptCompletionReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/v1/completions": {
"post": {
"description": "处理文本补全请求",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "处理文本补全请求",
"operationId": "completions",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/v1/embeddings": {
"post": {
"description": "处理嵌入请求",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "处理嵌入请求",
"operationId": "embeddings",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
},
"/v1/models": {
"get": {
"description": "模型列表",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "模型列表",
"operationId": "model-list",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/web.Resp"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/domain.ModelListResp"
}
}
}
]
}
}
}
}
},
"/v1/report": {
"post": {
"description": "报告支持多种操作accept接受补全、suggest建议、reject拒绝补全并记录用户输入、file_written文件写入",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"OpenAIV1"
],
"summary": "报告",
"operationId": "report",
"parameters": [
{
"description": "报告请求",
"name": "param",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/domain.ReportReq"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/web.Resp"
}
}
}
}
}
},
"definitions": {
"consts.AdminStatus": {
"type": "string",
"enum": [
"active",
"inactive"
],
"x-enum-varnames": [
"AdminStatusActive",
"AdminStatusInactive"
]
},
"consts.ChatRole": {
"type": "string",
"enum": [
"user",
"assistant",
"system"
],
"x-enum-varnames": [
"ChatRoleUser",
"ChatRoleAssistant",
"ChatRoleSystem"
]
},
"consts.LoginSource": {
"type": "string",
"enum": [
"plugin",
"browser"
],
"x-enum-varnames": [
"LoginSourcePlugin",
"LoginSourceBrowser"
]
},
"consts.ModelProvider": {
"type": "string",
"enum": [
"SiliconFlow",
"OpenAI",
"Ollama",
"DeepSeek",
"Moonshot",
"AzureOpenAI",
"BaiZhiCloud",
"Hunyuan",
"BaiLian",
"Volcengine"
],
"x-enum-varnames": [
"ModelProviderSiliconFlow",
"ModelProviderOpenAI",
"ModelProviderOllama",
"ModelProviderDeepSeek",
"ModelProviderMoonshot",
"ModelProviderAzureOpenAI",
"ModelProviderBaiZhiCloud",
"ModelProviderHunyuan",
"ModelProviderBaiLian",
"ModelProviderVolcengine"
]
},
"consts.ModelStatus": {
"type": "string",
"enum": [
"active",
"inactive"
],
"x-enum-varnames": [
"ModelStatusActive",
"ModelStatusInactive"
]
},
"consts.ModelType": {
"type": "string",
"enum": [
"llm",
"coder",
"embedding",
"audio",
"reranker"
],
"x-enum-varnames": [
"ModelTypeLLM",
"ModelTypeCoder",
"ModelTypeEmbedding",
"ModelTypeAudio",
"ModelTypeReranker"
]
},
"consts.ReportAction": {
"type": "string",
"enum": [
"accept",
"suggest",
"file_written",
"reject"
],
"x-enum-varnames": [
"ReportActionAccept",
"ReportActionSuggest",
"ReportActionFileWritten",
"ReportActionReject"
]
},
"consts.UserPlatform": {
"type": "string",
"enum": [
"email",
"dingtalk",
"custom"
],
"x-enum-varnames": [
"UserPlatformEmail",
"UserPlatformDingTalk",
"UserPlatformCustom"
]
},
"consts.UserStatus": {
"type": "string",
"enum": [
"active",
"inactive",
"locked"
],
"x-enum-varnames": [
"UserStatusActive",
"UserStatusInactive",
"UserStatusLocked"
]
},
"domain.AcceptCompletionReq": {
"type": "object",
"properties": {
"completion": {
"description": "补全内容",
"type": "string"
},
"id": {
"description": "记录ID",
"type": "string"
}
}
},
"domain.AdminLoginHistory": {
"type": "object",
"properties": {
"client_version": {
"description": "客户端版本",
"type": "string"
},
"created_at": {
"description": "登录时间",
"type": "integer"
},
"device": {
"description": "设备信息",
"type": "string"
},
"ip_info": {
"description": "IP信息",
"allOf": [
{
"$ref": "#/definitions/domain.IPInfo"
}
]
},
"user": {
"description": "用户信息",
"allOf": [
{
"$ref": "#/definitions/domain.AdminUser"
}
]
}
}
},
"domain.AdminUser": {
"type": "object",
"properties": {
"created_at": {
"description": "创建时间",
"type": "integer"
},
"id": {
"description": "用户ID",
"type": "string"
},
"last_active_at": {
"description": "最后活跃时间",
"type": "integer"
},
"status": {
"description": "用户状态 active: 正常 inactive: 禁用",
"allOf": [
{
"$ref": "#/definitions/consts.AdminStatus"
}
]
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.AllModelResp": {
"type": "object",
"properties": {
"providers": {
"description": "提供商列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.ProviderModel"
}
}
}
},
"domain.BatchCreateWorkspaceFileReq": {
"type": "object",
"required": [
"files",
"user_id",
"workspace_id"
],
"properties": {
"files": {
"description": "文件列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CreateWorkspaceFileReq"
}
},
"user_id": {
"description": "用户ID",
"type": "string"
},
"workspace_id": {
"description": "工作区ID",
"type": "string"
}
}
},
"domain.BatchUpdateWorkspaceFileReq": {
"type": "object",
"required": [
"files"
],
"properties": {
"files": {
"description": "文件列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.UpdateWorkspaceFileReq"
}
}
}
},
"domain.CategoryPoint": {
"type": "object",
"properties": {
"category": {
"description": "分类",
"type": "string"
},
"value": {
"description": "值",
"type": "integer"
}
}
},
"domain.CategoryStat": {
"type": "object",
"properties": {
"program_language": {
"description": "编程语言占比",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CategoryPoint"
}
},
"work_mode": {
"description": "工作模式占比",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CategoryPoint"
}
}
}
},
"domain.ChatContent": {
"type": "object",
"properties": {
"content": {
"description": "内容",
"type": "string"
},
"created_at": {
"type": "integer"
},
"role": {
"description": "角色如user: 用户的提问 assistant: 机器人回复",
"allOf": [
{
"$ref": "#/definitions/consts.ChatRole"
}
]
}
}
},
"domain.ChatInfo": {
"type": "object",
"properties": {
"contents": {
"description": "消息内容",
"type": "array",
"items": {
"$ref": "#/definitions/domain.ChatContent"
}
},
"id": {
"type": "string"
}
}
},
"domain.ChatRecord": {
"type": "object",
"properties": {
"created_at": {
"description": "创建时间",
"type": "integer"
},
"id": {
"description": "记录ID",
"type": "string"
},
"input_tokens": {
"description": "输入token",
"type": "integer"
},
"model": {
"description": "模型",
"allOf": [
{
"$ref": "#/definitions/domain.Model"
}
]
},
"output_tokens": {
"description": "输出token",
"type": "integer"
},
"question": {
"description": "问题",
"type": "string"
},
"user": {
"description": "用户",
"allOf": [
{
"$ref": "#/definitions/domain.User"
}
]
},
"work_mode": {
"description": "工作模式",
"type": "string"
}
}
},
"domain.CheckModelReq": {
"type": "object",
"required": [
"api_base",
"api_key",
"model_name",
"provider",
"type"
],
"properties": {
"api_base": {
"description": "接口地址",
"type": "string"
},
"api_header": {
"type": "string"
},
"api_key": {
"description": "接口密钥",
"type": "string"
},
"api_version": {
"type": "string"
},
"model_name": {
"description": "模型名称",
"type": "string"
},
"provider": {
"description": "提供商",
"allOf": [
{
"$ref": "#/definitions/consts.ModelProvider"
}
]
},
"type": {
"enum": [
"llm",
"coder",
"embedding",
"rerank"
],
"allOf": [
{
"$ref": "#/definitions/consts.ModelType"
}
]
}
}
},
"domain.CodeFiles": {
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.FileMeta"
}
}
}
},
"domain.CodeLanguageType": {
"type": "string",
"enum": [
"go",
"python",
"java",
"javascript",
"typescript",
"jsx",
"tsx",
"html",
"css",
"php",
"rust",
"swift",
"kotlin",
"c",
"cpp"
],
"x-enum-varnames": [
"CodeLanguageTypeGo",
"CodeLanguageTypePython",
"CodeLanguageTypeJava",
"CodeLanguageTypeJavaScript",
"CodeLanguageTypeTypeScript",
"CodeLanguageTypeJSX",
"CodeLanguageTypeTSX",
"CodeLanguageTypeHTML",
"CodeLanguageTypeCSS",
"CodeLanguageTypePHP",
"CodeLanguageTypeRust",
"CodeLanguageTypeSwift",
"CodeLanguageTypeKotlin",
"CodeLanguageTypeC",
"CodeLanguageTypeCpp"
]
},
"domain.CompletionData": {
"type": "object",
"properties": {
"code_lines": {
"description": "代码行数",
"type": "integer"
},
"completion": {
"description": "LLM生成的补全代码",
"type": "string"
},
"created_at": {
"description": "创建时间戳",
"type": "integer"
},
"cursor_position": {
"description": "光标位置 {\"line\": 10, \"column\": 5}",
"type": "object",
"additionalProperties": {}
},
"input_tokens": {
"description": "输入token数",
"type": "integer"
},
"is_accept": {
"description": "用户是否接受补全",
"type": "boolean"
},
"is_suggested": {
"description": "是否为建议模式",
"type": "boolean"
},
"model_id": {
"description": "模型ID",
"type": "string"
},
"model_name": {
"description": "模型名称",
"type": "string"
},
"model_type": {
"description": "模型类型",
"type": "string"
},
"output_tokens": {
"description": "输出token数",
"type": "integer"
},
"program_language": {
"description": "编程语言",
"type": "string"
},
"prompt": {
"description": "用户输入的提示",
"type": "string"
},
"request_id": {
"description": "请求ID",
"type": "string"
},
"source_code": {
"description": "当前文件原文",
"type": "string"
},
"task_id": {
"description": "任务ID",
"type": "string"
},
"updated_at": {
"description": "更新时间戳",
"type": "integer"
},
"user_id": {
"description": "用户ID",
"type": "string"
},
"user_input": {
"description": "用户最终输入的内容",
"type": "string"
},
"work_mode": {
"description": "工作模式",
"type": "string"
}
}
},
"domain.CompletionInfo": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "integer"
},
"id": {
"type": "string"
},
"prompt": {
"type": "string"
}
}
},
"domain.CompletionRecord": {
"type": "object",
"properties": {
"created_at": {
"description": "创建时间",
"type": "integer"
},
"id": {
"description": "记录ID",
"type": "string"
},
"input_tokens": {
"description": "输入token",
"type": "integer"
},
"is_accept": {
"description": "是否采纳",
"type": "boolean"
},
"output_tokens": {
"description": "输出token",
"type": "integer"
},
"program_language": {
"description": "编程语言",
"type": "string"
},
"user": {
"description": "用户",
"allOf": [
{
"$ref": "#/definitions/domain.User"
}
]
}
}
},
"domain.CreateAdminReq": {
"type": "object",
"properties": {
"password": {
"description": "密码",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.CreateModelReq": {
"type": "object",
"required": [
"api_base",
"model_name",
"provider"
],
"properties": {
"api_base": {
"description": "接口地址 如https://api.qwen.com",
"type": "string"
},
"api_header": {
"type": "string"
},
"api_key": {
"description": "接口密钥 如sk-xxxx",
"type": "string"
},
"api_version": {
"type": "string"
},
"model_name": {
"description": "模型名称 如: deepseek-v3",
"type": "string"
},
"model_type": {
"description": "模型类型 llm:对话模型 coder:代码模型",
"allOf": [
{
"$ref": "#/definitions/consts.ModelType"
}
]
},
"provider": {
"description": "提供商",
"enum": [
"SiliconFlow",
"OpenAI",
"Ollama",
"DeepSeek",
"Moonshot",
"AzureOpenAI",
"BaiZhiCloud",
"Hunyuan",
"BaiLian",
"Volcengine",
"Other"
],
"allOf": [
{
"$ref": "#/definitions/consts.ModelProvider"
}
]
},
"show_name": {
"description": "模型显示名称",
"type": "string"
}
}
},
"domain.CreateWorkspaceFileReq": {
"type": "object",
"required": [
"hash",
"path",
"user_id",
"workspace_id"
],
"properties": {
"content": {
"description": "文件内容",
"type": "string"
},
"hash": {
"description": "文件哈希",
"type": "string"
},
"language": {
"description": "编程语言",
"type": "string"
},
"path": {
"description": "文件路径",
"type": "string"
},
"size": {
"description": "文件大小",
"type": "integer"
},
"user_id": {
"description": "用户ID",
"type": "string"
},
"workspace_id": {
"description": "工作区ID",
"type": "string"
}
}
},
"domain.CustomOAuth": {
"type": "object",
"properties": {
"access_token_url": {
"description": "自定义OAuth访问令牌URL",
"type": "string"
},
"authorize_url": {
"description": "自定义OAuth授权URL",
"type": "string"
},
"avatar_field": {
"description": "用户信息回包中的头像URL字段名",
"type": "string"
},
"client_id": {
"description": "自定义客户端ID",
"type": "string"
},
"client_secret": {
"description": "自定义客户端密钥",
"type": "string"
},
"email_field": {
"description": "用户信息回包中的邮箱字段名",
"type": "string"
},
"enable": {
"description": "自定义OAuth开关",
"type": "boolean"
},
"id_field": {
"description": "用户信息回包中的ID字段名",
"type": "string"
},
"name_field": {
"description": "用户信息回包中的用户名字段名",
"type": "string"
},
"scopes": {
"description": "自定义OAuth Scope列表",
"type": "array",
"items": {
"type": "string"
}
},
"userinfo_url": {
"description": "自定义OAuth用户信息URL",
"type": "string"
}
}
},
"domain.CustomOAuthReq": {
"type": "object",
"properties": {
"access_token_url": {
"description": "自定义OAuth访问令牌URL",
"type": "string"
},
"authorize_url": {
"description": "自定义OAuth授权URL",
"type": "string"
},
"avatar_field": {
"description": "用户信息回包中的头像URL字段名",
"type": "string"
},
"client_id": {
"description": "自定义客户端ID",
"type": "string"
},
"client_secret": {
"description": "自定义客户端密钥",
"type": "string"
},
"email_field": {
"description": "用户信息回包中的邮箱字段名",
"type": "string"
},
"enable": {
"description": "自定义OAuth开关",
"type": "boolean"
},
"id_field": {
"description": "用户信息回包中的ID字段名",
"type": "string"
},
"name_field": {
"description": "用户信息回包中的用户名字段名",
"type": "string"
},
"scopes": {
"description": "自定义OAuth Scope列表",
"type": "array",
"items": {
"type": "string"
}
},
"userinfo_url": {
"description": "自定义OAuth用户信息URL",
"type": "string"
}
}
},
"domain.DingtalkOAuth": {
"type": "object",
"properties": {
"client_id": {
"description": "钉钉客户端ID",
"type": "string"
},
"client_secret": {
"description": "钉钉客户端密钥",
"type": "string"
},
"enable": {
"description": "钉钉OAuth开关",
"type": "boolean"
}
}
},
"domain.DingtalkOAuthReq": {
"type": "object",
"properties": {
"client_id": {
"description": "钉钉客户端ID",
"type": "string"
},
"client_secret": {
"description": "钉钉客户端密钥",
"type": "string"
},
"enable": {
"description": "钉钉OAuth开关",
"type": "boolean"
}
}
},
"domain.ExportCompletionDataResp": {
"type": "object",
"properties": {
"data": {
"description": "补全数据列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CompletionData"
}
},
"total_count": {
"description": "总记录数",
"type": "integer"
}
}
},
"domain.FileMeta": {
"type": "object",
"properties": {
"content": {
"description": "文件内容(可选)",
"type": "string"
},
"fileExtension": {
"type": "string"
},
"fileHash": {
"description": "文件哈希(可选)",
"type": "string"
},
"filePath": {
"type": "string"
},
"language": {
"description": "语言类型(可选)",
"allOf": [
{
"$ref": "#/definitions/domain.CodeLanguageType"
}
]
}
}
},
"domain.GetAndSaveReq": {
"type": "object",
"required": [
"code_files",
"project_id",
"user_id"
],
"properties": {
"code_files": {
"description": "代码文件信息",
"allOf": [
{
"$ref": "#/definitions/domain.CodeFiles"
}
]
},
"project_id": {
"description": "项目ID",
"type": "string"
},
"user_id": {
"description": "用户ID",
"type": "string"
}
}
},
"domain.GetProviderModelListResp": {
"type": "object",
"properties": {
"models": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.ProviderModelListItem"
}
}
}
},
"domain.IPInfo": {
"type": "object",
"properties": {
"asn": {
"description": "ASN",
"type": "string"
},
"city": {
"description": "城市",
"type": "string"
},
"country": {
"description": "国家",
"type": "string"
},
"ip": {
"description": "IP地址",
"type": "string"
},
"isp": {
"description": "运营商",
"type": "string"
},
"province": {
"description": "省份",
"type": "string"
}
}
},
"domain.IndexResult": {
"type": "object",
"properties": {
"definition": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"returnType": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"definitionText": {
"type": "string"
},
"endLine": {
"type": "integer"
},
"fileHash": {
"type": "string"
},
"filePath": {
"type": "string"
},
"implementText": {
"type": "string"
},
"language": {
"type": "string"
},
"name": {
"type": "string"
},
"rangeText": {
"type": "string"
},
"scope": {
"type": "array",
"items": {
"type": "object"
}
},
"signature": {
"type": "string"
},
"startLine": {
"type": "integer"
},
"type": {
"type": "string"
}
}
},
"domain.InviteResp": {
"type": "object",
"properties": {
"code": {
"description": "邀请码",
"type": "string"
}
}
},
"domain.ListAdminLoginHistoryResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"login_histories": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.AdminLoginHistory"
}
},
"next_token": {
"type": "string"
},
"total_count": {
"type": "integer"
}
}
},
"domain.ListAdminUserResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"next_token": {
"type": "string"
},
"total_count": {
"type": "integer"
},
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.AdminUser"
}
}
}
},
"domain.ListChatRecordResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"next_token": {
"type": "string"
},
"records": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.ChatRecord"
}
},
"total_count": {
"type": "integer"
}
}
},
"domain.ListCompletionRecordResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"next_token": {
"type": "string"
},
"records": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.CompletionRecord"
}
},
"total_count": {
"type": "integer"
}
}
},
"domain.ListLoginHistoryResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"login_histories": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.UserLoginHistory"
}
},
"next_token": {
"type": "string"
},
"total_count": {
"type": "integer"
}
}
},
"domain.ListUserResp": {
"type": "object",
"properties": {
"has_next_page": {
"type": "boolean"
},
"next_token": {
"type": "string"
},
"total_count": {
"type": "integer"
},
"users": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.User"
}
}
}
},
"domain.ListWorkspaceFileResp": {
"type": "object",
"properties": {
"files": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
},
"has_next_page": {
"type": "boolean"
},
"next_token": {
"type": "string"
},
"total_count": {
"type": "integer"
}
}
},
"domain.LoginReq": {
"type": "object",
"required": [
"source"
],
"properties": {
"password": {
"description": "密码",
"type": "string"
},
"session_id": {
"description": "会话Id插件登录时必填",
"type": "string"
},
"source": {
"description": "登录来源 plugin: 插件 browser: 浏览器; 默认为 plugin",
"default": "plugin",
"allOf": [
{
"$ref": "#/definitions/consts.LoginSource"
}
]
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.LoginResp": {
"type": "object",
"properties": {
"redirect_url": {
"description": "重定向URL",
"type": "string"
},
"user": {
"description": "用户信息",
"allOf": [
{
"$ref": "#/definitions/domain.User"
}
]
}
}
},
"domain.Model": {
"type": "object",
"properties": {
"api_base": {
"description": "接口地址 如https://api.qwen.com",
"type": "string"
},
"api_header": {
"description": "接口头 如Authorization: Bearer sk-xxxx",
"type": "string"
},
"api_key": {
"description": "接口密钥 如sk-xxxx",
"type": "string"
},
"api_version": {
"description": "接口版本 如2023-05-15",
"type": "string"
},
"created_at": {
"description": "创建时间",
"type": "integer"
},
"id": {
"description": "模型ID",
"type": "string"
},
"input": {
"description": "输入token数",
"type": "integer"
},
"is_active": {
"description": "是否启用",
"type": "boolean"
},
"is_internal": {
"description": "是否内部模型",
"type": "boolean"
},
"model_name": {
"description": "模型名称 如: deepseek-v3",
"type": "string"
},
"model_type": {
"description": "模型类型 llm:对话模型 coder:代码模型",
"allOf": [
{
"$ref": "#/definitions/consts.ModelType"
}
]
},
"output": {
"description": "输出token数",
"type": "integer"
},
"provider": {
"description": "提供商",
"allOf": [
{
"$ref": "#/definitions/consts.ModelProvider"
}
]
},
"show_name": {
"description": "模型显示名称",
"type": "string"
},
"status": {
"description": "状态 active:启用 inactive:禁用",
"allOf": [
{
"$ref": "#/definitions/consts.ModelStatus"
}
]
},
"updated_at": {
"description": "更新时间",
"type": "integer"
}
}
},
"domain.ModelBasic": {
"type": "object",
"required": [
"provider"
],
"properties": {
"api_base": {
"description": "接口地址 如https://api.qwen.com",
"type": "string"
},
"name": {
"description": "模型名称",
"type": "string"
},
"provider": {
"description": "提供商",
"enum": [
"SiliconFlow",
"OpenAI",
"Ollama",
"DeepSeek",
"Moonshot",
"AzureOpenAI",
"BaiZhiCloud",
"Hunyuan",
"BaiLian",
"Volcengine",
"Other"
],
"allOf": [
{
"$ref": "#/definitions/consts.ModelProvider"
}
]
}
}
},
"domain.ModelData": {
"type": "object",
"properties": {
"api_base": {
"type": "string"
},
"base_model": {
"type": "string"
},
"created": {
"type": "integer"
},
"id": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"object": {
"type": "string"
},
"owned_by": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"domain.ModelListResp": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.ModelData"
}
},
"object": {
"type": "string"
}
}
},
"domain.ModelTokenUsage": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"tokens": {
"description": "使用token数",
"type": "integer"
}
}
},
"domain.ModelTokenUsageResp": {
"type": "object",
"properties": {
"input_usage": {
"description": "输入token使用记录",
"type": "array",
"items": {
"$ref": "#/definitions/domain.ModelTokenUsage"
}
},
"output_usage": {
"description": "输出token使用记录",
"type": "array",
"items": {
"$ref": "#/definitions/domain.ModelTokenUsage"
}
},
"total_input": {
"description": "总输入token数",
"type": "integer"
},
"total_output": {
"description": "总输出token数",
"type": "integer"
}
}
},
"domain.OAuthURLResp": {
"type": "object",
"properties": {
"url": {
"type": "string"
}
}
},
"domain.ProfileUpdateReq": {
"type": "object",
"properties": {
"avatar": {
"description": "头像",
"type": "string"
},
"old_password": {
"description": "旧密码",
"type": "string"
},
"password": {
"description": "密码",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.ProviderModel": {
"type": "object",
"properties": {
"models": {
"description": "模型列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.ModelBasic"
}
},
"provider": {
"description": "提供商",
"type": "string"
}
}
},
"domain.ProviderModelListItem": {
"type": "object",
"properties": {
"model": {
"type": "string"
}
}
},
"domain.RegisterReq": {
"type": "object",
"required": [
"code",
"email",
"password",
"username"
],
"properties": {
"code": {
"description": "邀请码",
"type": "string"
},
"email": {
"description": "邮箱",
"type": "string"
},
"password": {
"description": "密码",
"type": "string"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.ReportReq": {
"type": "object",
"properties": {
"action": {
"$ref": "#/definitions/consts.ReportAction"
},
"content": {
"description": "内容",
"type": "string"
},
"cursor_position": {
"description": "光标位置用于reject action",
"type": "object",
"additionalProperties": {}
},
"id": {
"description": "task_id or resp_id",
"type": "string"
},
"source_code": {
"description": "当前文件的原文用于reject action",
"type": "string"
},
"tool": {
"description": "工具",
"type": "string"
},
"user_input": {
"description": "用户输入的新文本用于reject action",
"type": "string"
}
}
},
"domain.Setting": {
"type": "object",
"properties": {
"created_at": {
"description": "创建时间",
"type": "integer"
},
"custom_oauth": {
"description": "自定义OAuth接入",
"allOf": [
{
"$ref": "#/definitions/domain.CustomOAuth"
}
]
},
"dingtalk_oauth": {
"description": "钉钉OAuth接入",
"allOf": [
{
"$ref": "#/definitions/domain.DingtalkOAuth"
}
]
},
"disable_password_login": {
"description": "是否禁用密码登录",
"type": "boolean"
},
"enable_auto_login": {
"description": "是否开启自动登录",
"type": "boolean"
},
"enable_sso": {
"description": "是否开启SSO",
"type": "boolean"
},
"force_two_factor_auth": {
"description": "是否强制两步验证",
"type": "boolean"
},
"updated_at": {
"description": "更新时间",
"type": "integer"
}
}
},
"domain.Statistics": {
"type": "object",
"properties": {
"disabled_users": {
"description": "禁用用户数",
"type": "integer"
},
"total_users": {
"description": "总用户数",
"type": "integer"
}
}
},
"domain.SyncWorkspaceFileReq": {
"type": "object",
"required": [
"files",
"user_id",
"workspace_id"
],
"properties": {
"files": {
"description": "要同步的文件列表",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CreateWorkspaceFileReq"
}
},
"user_id": {
"description": "用户ID",
"type": "string"
},
"workspace_id": {
"description": "工作区ID",
"type": "string"
}
}
},
"domain.SyncWorkspaceFileResp": {
"type": "object",
"properties": {
"created": {
"description": "新创建的文件",
"type": "array",
"items": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
},
"deleted": {
"description": "删除的文件ID",
"type": "array",
"items": {
"type": "string"
}
},
"total": {
"description": "处理的文件总数",
"type": "integer"
},
"updated": {
"description": "更新的文件",
"type": "array",
"items": {
"$ref": "#/definitions/domain.WorkspaceFile"
}
}
}
},
"domain.TimeStat": {
"type": "object",
"properties": {
"accepted_per": {
"description": "接受率统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "number"
}
}
}
},
"active_users": {
"description": "活跃用户数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"chats": {
"description": "对话任务数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"code_completions": {
"description": "补全任务数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"lines_of_code": {
"description": "代码行数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"real_time_tokens": {
"description": "实时token数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"total_accepted_per": {
"description": "近90天平均接受率",
"type": "number"
},
"total_chats": {
"description": "近90天对话任务数",
"type": "integer"
},
"total_completions": {
"description": "近90天补全任务数",
"type": "integer"
},
"total_lines_of_code": {
"description": "近90天代码行数",
"type": "integer"
},
"total_users": {
"description": "近90天活跃用户数",
"type": "integer"
}
}
},
"domain.UpdateModelReq": {
"type": "object",
"required": [
"provider"
],
"properties": {
"api_base": {
"description": "接口地址 如https://api.qwen.com",
"type": "string"
},
"api_header": {
"type": "string"
},
"api_key": {
"description": "接口密钥 如sk-xxxx",
"type": "string"
},
"api_version": {
"type": "string"
},
"id": {
"description": "模型ID",
"type": "string"
},
"model_name": {
"description": "模型名称",
"type": "string"
},
"provider": {
"description": "提供商",
"enum": [
"SiliconFlow",
"OpenAI",
"Ollama",
"DeepSeek",
"Moonshot",
"AzureOpenAI",
"BaiZhiCloud",
"Hunyuan",
"BaiLian",
"Volcengine",
"Other"
],
"allOf": [
{
"$ref": "#/definitions/consts.ModelProvider"
}
]
},
"show_name": {
"description": "模型显示名称",
"type": "string"
},
"status": {
"description": "状态 active:启用 inactive:禁用",
"allOf": [
{
"$ref": "#/definitions/consts.ModelStatus"
}
]
}
}
},
"domain.UpdateSettingReq": {
"type": "object",
"properties": {
"custom_oauth": {
"description": "自定义OAuth配置",
"allOf": [
{
"$ref": "#/definitions/domain.CustomOAuthReq"
}
]
},
"dingtalk_oauth": {
"description": "钉钉OAuth配置",
"allOf": [
{
"$ref": "#/definitions/domain.DingtalkOAuthReq"
}
]
},
"disable_password_login": {
"description": "是否禁用密码登录",
"type": "boolean"
},
"enable_auto_login": {
"description": "是否开启自动登录",
"type": "boolean"
},
"enable_sso": {
"description": "是否开启SSO",
"type": "boolean"
},
"force_two_factor_auth": {
"description": "是否强制两步验证",
"type": "boolean"
}
}
},
"domain.UpdateUserReq": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"description": "用户ID",
"type": "string"
},
"password": {
"description": "重置密码",
"type": "string"
},
"status": {
"description": "用户状态 active: 正常 locked: 锁定 inactive: 禁用",
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
}
}
},
"domain.UpdateWorkspaceFileReq": {
"type": "object",
"required": [
"id"
],
"properties": {
"content": {
"description": "文件内容",
"type": "string"
},
"hash": {
"description": "文件哈希",
"type": "string"
},
"id": {
"description": "文件ID",
"type": "string"
},
"language": {
"description": "编程语言",
"type": "string"
},
"size": {
"description": "文件大小",
"type": "integer"
}
}
},
"domain.User": {
"type": "object",
"properties": {
"avatar_url": {
"description": "头像URL",
"type": "string"
},
"created_at": {
"description": "创建时间",
"type": "integer"
},
"email": {
"description": "邮箱",
"type": "string"
},
"id": {
"description": "用户ID",
"type": "string"
},
"is_deleted": {
"description": "是否删除",
"type": "boolean"
},
"last_active_at": {
"description": "最后活跃时间",
"type": "integer"
},
"status": {
"description": "用户状态 active: 正常 locked: 锁定 inactive: 禁用",
"allOf": [
{
"$ref": "#/definitions/consts.UserStatus"
}
]
},
"two_step_auth": {
"description": "是否开启两步验证",
"type": "boolean"
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.UserCodeRank": {
"type": "object",
"properties": {
"lines": {
"description": "代码行数",
"type": "integer"
},
"user": {
"description": "用户信息",
"allOf": [
{
"$ref": "#/definitions/domain.User"
}
]
},
"username": {
"description": "用户名",
"type": "string"
}
}
},
"domain.UserEvent": {
"type": "object",
"properties": {
"created_at": {
"description": "事件时间",
"type": "integer"
},
"name": {
"description": "事件名称",
"type": "string"
}
}
},
"domain.UserHeatmap": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"date": {
"type": "integer"
}
}
},
"domain.UserHeatmapResp": {
"type": "object",
"properties": {
"max_count": {
"type": "integer"
},
"points": {
"type": "array",
"items": {
"$ref": "#/definitions/domain.UserHeatmap"
}
}
}
},
"domain.UserLoginHistory": {
"type": "object",
"properties": {
"client_id": {
"description": "插件ID vscode",
"type": "string"
},
"client_version": {
"description": "客户端版本",
"type": "string"
},
"created_at": {
"description": "登录时间",
"type": "integer"
},
"device": {
"description": "设备信息",
"type": "string"
},
"hostname": {
"description": "主机名",
"type": "string"
},
"ip_info": {
"description": "IP信息",
"allOf": [
{
"$ref": "#/definitions/domain.IPInfo"
}
]
},
"user": {
"description": "用户信息",
"allOf": [
{
"$ref": "#/definitions/domain.User"
}
]
}
}
},
"domain.UserStat": {
"type": "object",
"properties": {
"accepted_per": {
"description": "接受率统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "number"
}
}
}
},
"chats": {
"description": "对话任务数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"code_completions": {
"description": "补全任务数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"lines_of_code": {
"description": "代码行数统计",
"type": "array",
"items": {
"type": "object",
"properties": {
"timestamp": {
"description": "时间戳",
"type": "integer"
},
"value": {
"description": "值",
"type": "integer"
}
}
}
},
"program_language": {
"description": "编程语言占比",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CategoryPoint"
}
},
"total_accepted_per": {
"description": "总接受率",
"type": "number"
},
"total_chats": {
"description": "总对话任务数",
"type": "integer"
},
"total_completions": {
"description": "总补全任务数",
"type": "integer"
},
"total_lines_of_code": {
"description": "总代码行数",
"type": "integer"
},
"work_mode": {
"description": "工作模式占比",
"type": "array",
"items": {
"$ref": "#/definitions/domain.CategoryPoint"
}
}
}
},
"domain.WorkspaceFile": {
"type": "object",
"properties": {
"content": {
"description": "文件内容",
"type": "string"
},
"created_at": {
"description": "创建时间",
"type": "integer"
},
"hash": {
"description": "文件哈希",
"type": "string"
},
"id": {
"description": "文件ID",
"type": "string"
},
"language": {
"description": "编程语言",
"type": "string"
},
"path": {
"description": "文件路径",
"type": "string"
},
"size": {
"description": "文件大小",
"type": "integer"
},
"updated_at": {
"description": "更新时间",
"type": "integer"
},
"user_id": {
"description": "用户ID",
"type": "string"
},
"workspace_id": {
"description": "工作区ID",
"type": "string"
}
}
},
"web.Resp": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {},
"message": {
"type": "string"
}
}
}
}
}