2024-12-05 17:44:29 +00:00
|
|
|
|
// Package docs Code generated by swaggo/swag. DO NOT EDIT
|
|
|
|
|
package docs
|
|
|
|
|
|
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
|
|
|
|
|
|
const docTemplate = `{
|
|
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
|
|
"swagger": "2.0",
|
|
|
|
|
"info": {
|
|
|
|
|
"description": "{{escape .Description}}",
|
|
|
|
|
"title": "{{.Title}}",
|
|
|
|
|
"contact": {},
|
|
|
|
|
"version": "{{.Version}}"
|
|
|
|
|
},
|
|
|
|
|
"host": "{{.Host}}",
|
|
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
|
|
"paths": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"/blocks/{block_id}": {
|
|
|
|
|
"put": {
|
|
|
|
|
"description": "更新文档块的内容",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"Document"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "更新文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档块ID",
|
|
|
|
|
"name": "block_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"description": "更新文档块请求",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.UpdateBlockRequest"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/entity.DocumentBlock"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档块不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 19:05:33 +00:00
|
|
|
|
},
|
|
|
|
|
"delete": {
|
|
|
|
|
"description": "删除指定的文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "删除文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档块ID",
|
|
|
|
|
"name": "block_id",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档块不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"/blocks/{block_id}/move": {
|
|
|
|
|
"post": {
|
|
|
|
|
"description": "移动文档块的位置",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"Document"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "移动文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档块ID",
|
|
|
|
|
"name": "block_id",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
2024-12-06 19:05:33 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"description": "移动文档块请求",
|
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.MoveBlockRequest"
|
|
|
|
|
}
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档块不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 19:05:33 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/collections": {
|
|
|
|
|
"post": {
|
|
|
|
|
"description": "在工作空间下创建新的集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Collection"
|
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "创建集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "创建集合请求",
|
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.CreateCollectionRequest"
|
|
|
|
|
}
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/leafdev_top_Leaf_leaf-library-3_internal_entity.Collection"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "工作空间不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"/collections/{collection_id}/documents": {
|
|
|
|
|
"get": {
|
|
|
|
|
"description": "获取指定集合下的文档树,如果指定了父文档ID则获取该文档下的子树",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "列出文档树",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "集合ID",
|
|
|
|
|
"name": "collection_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "父文档ID,不传则获取根文档",
|
|
|
|
|
"name": "parent_id",
|
|
|
|
|
"in": "query"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.DocumentDTO"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"403": {
|
|
|
|
|
"description": "无权访问",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "集合不存在或父文档不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"/collections/{id}": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"get": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "根据集合ID获取集合详情",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"Collection"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "获取集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集<><E99B86>ID",
|
|
|
|
|
"name": "id",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/leafdev_top_Leaf_leaf-library-3_internal_entity.Collection"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集合不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"put": {
|
|
|
|
|
"description": "更新集合的名称等信息",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"Collection"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "更新集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集合ID",
|
|
|
|
|
"name": "id",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "更新集合请求",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.UpdateCollectionRequest"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/leafdev_top_Leaf_leaf-library-3_internal_entity.Collection"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集合不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 19:05:33 +00:00
|
|
|
|
},
|
|
|
|
|
"delete": {
|
|
|
|
|
"description": "删除指定的集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"Collection"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "删除集合",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集合ID",
|
|
|
|
|
"name": "id",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
2024-12-06 19:05:33 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
2024-12-06 18:44:32 +00:00
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"404": {
|
|
|
|
|
"description": "集合不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/documents": {
|
|
|
|
|
"post": {
|
|
|
|
|
"description": "创建一个新的文档,可以是根文档或子文档",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
|
|
|
|
"summary": "创建文档",
|
|
|
|
|
"parameters": [
|
2024-12-06 18:44:32 +00:00
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "创建文档请求",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.CreateDocumentRequest"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.DocumentDTO"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"403": {
|
|
|
|
|
"description": "无权访问",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "集合不存在或父文档不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 19:05:33 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/documents/{document_id}/blocks": {
|
|
|
|
|
"get": {
|
|
|
|
|
"description": "获取指定文档下的所有文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "列出文档块列表",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档ID",
|
|
|
|
|
"name": "document_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/entity.DocumentBlock"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 19:05:33 +00:00
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"post": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "在文档中创建新的文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"summary": "创建文档块",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档ID",
|
|
|
|
|
"name": "document_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "创建文档块请求",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"$ref": "#/definitions/dto.CreateBlockRequest"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/entity.DocumentBlock"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2024-12-06 18:44:32 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"description": "文档不存在",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/documents/{id}": {
|
|
|
|
|
"get": {
|
|
|
|
|
"description": "根据文档ID获取文档详情",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
|
|
|
|
"summary": "获取文档",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/dto.DocumentDTO"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"403": {
|
|
|
|
|
"description": "无权访问",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "文档不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"put": {
|
|
|
|
|
"description": "更新文档的名称等信息",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
|
|
|
|
"summary": "更新文档",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"description": "更新文档请求",
|
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.UpdateDocumentRequest"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/entity.Document"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "文档不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"delete": {
|
|
|
|
|
"description": "删除指定的文档",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Document"
|
|
|
|
|
],
|
|
|
|
|
"summary": "删除文档",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "文档ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "文档不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/workspaces": {
|
|
|
|
|
"get": {
|
|
|
|
|
"description": "获取当前用户的所有工作空间",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "列出工作空间列表",
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"post": {
|
|
|
|
|
"description": "创建一个新的工作空间",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "创建工作空间",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"description": "创建工作空间请求",
|
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.CreateWorkspaceRequest"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/workspaces/{id}": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"get": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"description": "根据工作空间ID获取工作空间详情",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "获取工作空间",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "工作空间ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "工作空间不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"delete": {
|
|
|
|
|
"description": "删除指定的工作空间",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "删除工作空间",
|
|
|
|
|
"parameters": [
|
2024-12-05 17:44:29 +00:00
|
|
|
|
{
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "工作空间ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
2024-12-05 17:44:29 +00:00
|
|
|
|
}
|
|
|
|
|
],
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "工作空间不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/workspaces/{id}/members": {
|
|
|
|
|
"post": {
|
|
|
|
|
"description": "向工作空间添加新成员",
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "添加工作空间成员",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "工作空间ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"description": "添加成员请求",
|
|
|
|
|
"name": "request",
|
|
|
|
|
"in": "body",
|
|
|
|
|
"required": true,
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.AddWorkspaceMemberRequest"
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-05 17:44:29 +00:00
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
2024-12-05 17:44:29 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"$ref": "#/definitions/entity.WorkspaceMember"
|
2024-12-05 17:44:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"400": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"description": "参数验证失败",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/dto.ValidateError"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "工作空间不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"409": {
|
|
|
|
|
"description": "成员已存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/workspaces/{id}/members/{user_id}": {
|
|
|
|
|
"delete": {
|
|
|
|
|
"description": "从工作空间移除成员",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Workspace"
|
|
|
|
|
],
|
|
|
|
|
"summary": "移除工作空间成员",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "工作空间ID",
|
|
|
|
|
"name": "id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "用户ID",
|
|
|
|
|
"name": "user_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "工作空间不存在或成员不存在",
|
|
|
|
|
"schema": {
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"/workspaces/{workspace_id}/collections": {
|
|
|
|
|
"get": {
|
|
|
|
|
"description": "获取指定工作空间下的所有集合",
|
|
|
|
|
"consumes": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"produces": [
|
|
|
|
|
"application/json"
|
|
|
|
|
],
|
|
|
|
|
"tags": [
|
|
|
|
|
"Collection"
|
|
|
|
|
],
|
|
|
|
|
"summary": "列出集合列表",
|
|
|
|
|
"parameters": [
|
|
|
|
|
{
|
|
|
|
|
"type": "integer",
|
|
|
|
|
"description": "工作空间ID",
|
|
|
|
|
"name": "workspace_id",
|
|
|
|
|
"in": "path",
|
|
|
|
|
"required": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"responses": {
|
|
|
|
|
"200": {
|
|
|
|
|
"description": "OK",
|
|
|
|
|
"schema": {
|
|
|
|
|
"allOf": [
|
|
|
|
|
{
|
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"data": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"$ref": "#/definitions/leafdev_top_Leaf_leaf-library-3_internal_entity.Collection"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"404": {
|
|
|
|
|
"description": "工作空间不存在",
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"schema": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"$ref": "#/definitions/dto.Response"
|
2024-12-05 17:44:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"definitions": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"dto.AddWorkspaceMemberRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"required": [
|
|
|
|
|
"user_id"
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"user_id": {
|
|
|
|
|
"$ref": "#/definitions/user.ID"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.CreateBlockRequest": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "object",
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"required": [
|
|
|
|
|
"content",
|
|
|
|
|
"type"
|
|
|
|
|
],
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"properties": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"after_block_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"content": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"type": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.CreateCollectionRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"required": [
|
|
|
|
|
"workspace_id"
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.CreateDocumentRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"required": [
|
|
|
|
|
"collection_id",
|
|
|
|
|
"workspace_id"
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"collection_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"parent_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.CreateWorkspaceRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.DocumentDTO": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"collection_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"created_at": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"has_children": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "boolean"
|
2024-12-06 18:44:32 +00:00
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"parent_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.MoveBlockRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"after_block_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.Response": {
|
|
|
|
|
"type": "object"
|
|
|
|
|
},
|
|
|
|
|
"dto.UpdateBlockRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"required": [
|
|
|
|
|
"content"
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"content": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 19:05:33 +00:00
|
|
|
|
"dto.UpdateCollectionRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"dto.UpdateDocumentRequest": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"dto.ValidateError": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"message": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"entity.Document": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"collection": {
|
|
|
|
|
"$ref": "#/definitions/leafdev_top_Leaf_leaf-library-3_internal_entity.Collection"
|
|
|
|
|
},
|
|
|
|
|
"collection_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"created_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"deleted_at": {
|
|
|
|
|
"$ref": "#/definitions/gorm.DeletedAt"
|
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"parent": {
|
|
|
|
|
"$ref": "#/definitions/entity.Document"
|
|
|
|
|
},
|
|
|
|
|
"parent_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"workspace": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"entity.DocumentBlock": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"content": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"created_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"document": {
|
|
|
|
|
"$ref": "#/definitions/entity.Document"
|
|
|
|
|
},
|
|
|
|
|
"document_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"hash": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"order": {
|
|
|
|
|
"type": "number"
|
|
|
|
|
},
|
|
|
|
|
"type": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
|
|
|
|
"type": "string"
|
2024-12-05 17:44:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"entity.Workspace": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"created_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"deleted_at": {
|
|
|
|
|
"$ref": "#/definitions/gorm.DeletedAt"
|
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"user_id": {
|
|
|
|
|
"$ref": "#/definitions/user.ID"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"entity.WorkspaceMember": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"created_at": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"user_id": {
|
|
|
|
|
"$ref": "#/definitions/user.ID"
|
|
|
|
|
},
|
|
|
|
|
"workspace": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"gorm.DeletedAt": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"time": {
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"valid": {
|
2024-12-06 18:44:32 +00:00
|
|
|
|
"description": "Valid is true if Time is not NULL",
|
2024-12-05 17:44:29 +00:00
|
|
|
|
"type": "boolean"
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-12-06 18:44:32 +00:00
|
|
|
|
},
|
|
|
|
|
"leafdev_top_Leaf_leaf-library-3_internal_entity.Collection": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"created_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"deleted_at": {
|
|
|
|
|
"$ref": "#/definitions/gorm.DeletedAt"
|
|
|
|
|
},
|
|
|
|
|
"id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"updated_at": {
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
"workspace": {
|
|
|
|
|
"$ref": "#/definitions/entity.Workspace"
|
|
|
|
|
},
|
|
|
|
|
"workspace_id": {
|
|
|
|
|
"type": "integer"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"user.ID": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"enum": [
|
|
|
|
|
"anonymous"
|
|
|
|
|
],
|
|
|
|
|
"x-enum-varnames": [
|
|
|
|
|
"AnonymousUser"
|
|
|
|
|
]
|
2024-12-05 17:44:29 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"securityDefinitions": {
|
|
|
|
|
"ApiKeyAuth": {
|
|
|
|
|
"type": "apiKey",
|
|
|
|
|
"name": "Authorization",
|
|
|
|
|
"in": "header"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
|
|
Version: "1.0",
|
|
|
|
|
Host: "",
|
|
|
|
|
BasePath: "",
|
|
|
|
|
Schemes: []string{},
|
|
|
|
|
Title: "API Docs",
|
|
|
|
|
Description: "",
|
|
|
|
|
InfoInstanceName: "swagger",
|
|
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
|
|
LeftDelim: "{{",
|
|
|
|
|
RightDelim: "}}",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
|
|
}
|