+
+
+ 📖 官方网站 | + 🙋♂️ 微信交流群 +
+ +## 👋 项目介绍 + +PandaWiki 是一款 AI 大模型驱动的**开源知识库搭建系统**,帮助你快速构建智能化的 **产品文档、技术文档、FAQ、博客系统**,借助大模型的力量为你提供 **AI 创作、AI 问答、AI 搜索** 等能力。 + +
+
+
|
|
+|
|
|
+
+## 🔥 功能与特色
+
+- AI 驱动智能化:AI 辅助创作、AI 辅助问答、AI 辅助搜索。
+- 强大的富文本编辑能力:兼容 Markdown 和 HTML,支持导出为 word、pdf、markdown 等多种格式。
+- 轻松与第三方应用进行集成:支持做成网页挂件挂在其他网站上,支持做成钉钉、飞书、企业微信等聊天机器人。
+- 通过第三方来源导入内容:根据网页 URL 导入、通过网站 Sitemap 导入、通过 RSS 订阅、通过离线文件导入等。
+
+## 🚀 上手指南
+
+### 安装 PandaWiki
+
+你需要一台支持 Docker 20.x 以上版本的 Linux 系统来安装 PandaWiki。
+
+使用 root 权限登录你的服务器,然后执行以下命令。
+
+```bash
+bash -c "$(curl -fsSLk https://release.baizhi.cloud/panda-wiki/manager.sh)"
+```
+
+根据命令提示的选项进行安装,命令执行过程将会持续几分钟,请耐心等待。
+
+> 关于安装与部署的更多细节请参考 [安装 PandaWiki](https://pandawiki.docs.baizhi.cloud/node/01971602-bb4e-7c90-99df-6d3c38cfd6d5)。
+
+### 登录 PandaWiki
+
+在上一步中,安装命令执行结束后,你的终端会输出以下内容。
+
+```
+SUCCESS 控制台信息:
+SUCCESS 访问地址(内网): http://*.*.*.*:2443
+SUCCESS 访问地址(外网): http://*.*.*.*:2443
+SUCCESS 用户名: admin
+SUCCESS 密码: **********************
+```
+
+使用浏览器打开上述内容中的 “访问地址”,你将看到 PandaWiki 的控制台登录入口,使用上述内容中的 “用户名” 和 “密码” 登录即可。
+
+### 配置 AI 模型
+
+> PandaWiki 是由 AI 大模型驱动的 Wiki 系统,在未配置大模型的情况下 AI 创作、AI 问答、AI 搜索 等功能无法正常使用。
+>
+首次登录时会提示需要先配置 AI 模型,可自行选择一键配置或手动配置。
+
+
+ 一键自动配置 AI 模型
+ +
+ 手动自定义配置 AI 模型
+
+
+### 💪 开始使用
+
+如果你顺利完成了以上步骤,那么恭喜你,属于你的 PandaWiki 搭建成功,你可以:
+
+- 访问 **控制台** 来管理你的知识库并上传文档等待学习成功
+- 访问 **Wiki 网站** 使用知识库并测试AI问答效果
+
+
+### 💬 遇到问题
+
+如在使用产品过程中遇到问题,可通过以下方式获取帮助:
+- 📘查阅官方文档:[常见问题](https://pandawiki.docs.baizhi.cloud/node/019b4952-4ed3-7514-ba57-c93a8ca13608),更多内容请参考文档目录。
+- 🤖不想翻文档?试试 [AI 问答](https://pandawiki.docs.baizhi.cloud/node/0197160c-782c-74ad-a4b7-857dae148f84),快速获取答案。
+- 🤝加入社区:扫码加入下方企业微信群,与更多用户及官方人员交流经验、获得帮助。
+
+
+## 社区交流
+
+欢迎加入我们的微信群进行交流。
+
+
+
+## 🙋♂️ 贡献
+
+欢迎提交 [Pull Request](https://github.com/chaitin/PandaWiki/pulls) 或创建 [Issue](https://github.com/chaitin/PandaWiki/issues) 来帮助改进项目。
+
+## 📝 许可证
+
+本项目采用 GNU Affero General Public License v3.0 (AGPL-3.0) 许可证。这意味着:
+
+- 你可以自由使用、修改和分发本软件
+- 你必须以相同的许可证开源你的修改
+- 如果你通过网络提供服务,也必须开源你的代码
+- 商业使用需要遵守相同的开源要求
+
+
+## Star History
+
+[](https://www.star-history.com/#chaitin/PandaWiki&Date)
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..8c9c1ae
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,12 @@
+# 安全策略
+
+## 受支持的版本
+
+PandaWiki 采用 rolling release 的方式进行发行,非最新版 release 中存在的安全问题不在本计划的考虑范围之内。
+
+## 报告安全漏洞
+说明如何报告安全问题。建议使用私下报告方式(如 GitHub Security Advisory 或专用邮箱):
+
+1. **私下报告**:请通过 [GitHub Security Advisory](https://github.com/chaitin/PandaWiki/security/advisories) 提交漏洞。
+2. 我们会在 **3 个工作日内**确认收到,并在 **7 天内**提供修复时间表。
+3. 修复完成后,我们会发布安全公告并感谢报告者(除非您希望匿名)。
diff --git a/SELF_BUILD_GUIDE.md b/SELF_BUILD_GUIDE.md
new file mode 100644
index 0000000..de65873
--- /dev/null
+++ b/SELF_BUILD_GUIDE.md
@@ -0,0 +1,405 @@
+# PandaWiki 自行构建部署指南 (功能全解锁版)
+
+## 修改说明
+
+本文档记录了将所有商业订阅限制移除的修改,改后开源版功能等同商业版。
+
+### 已修改的文件 (共 5 个)
+
+| 文件 | 修改内容 |
+|------|---------|
+| `backend/domain/license.go` | 将所有 `Allow*` 设为 `true`,所有 `Max*` 设为 999999 |
+| `backend/usecase/stat.go` | 移除统计天数的版本校验 (1/7/30/90 天全部开放) |
+| `backend/repo/pg/auth.go` | 移除 SSO 认证的速率限制 |
+| `web/admin/src/constant/version.ts` | Free 版功能映射改为等同企业版,权限数组包含 Free 版 |
+| `SELF_BUILD_GUIDE.md` | 本文档 |
+
+### 具体修改详情
+
+#### 1. `backend/domain/license.go` — 默认限制解除
+
+```go
+var baseEditionLimitationDefault = BaseEditionLimitation{
+ MaxKb: 999999, // 原 1
+ MaxNode: 999999, // 原 300
+ MaxSSOUser: 999999, // 原 0
+ MaxAdmin: 999999, // 原 1
+ AllowAdminPerm: true, // 原 false
+ AllowCustomCopyright: true, // 原 false
+ AllowCommentAudit: true, // 原 false
+ AllowAdvancedBot: true, // 原 false
+ AllowWatermark: true, // 原 false
+ AllowCopyProtection: true, // 原 false
+ AllowOpenAIBotSettings: true, // 原 false
+ AllowMCPServer: true, // 原 false
+ AllowNodeStats: true, // 原 false
+}
+```
+
+#### 2. `backend/usecase/stat.go` — 统计天数全开放
+
+移除了 `ValidateStatDay` 中的版本判断,1天/7天/30天/90天统计对所有版本开放。
+
+#### 3. `backend/repo/pg/auth.go` — SSO 速率限制移除
+
+移除了 GetOrCreateAuth 中对非企业版的速率限制。
+
+#### 4. `web/admin/src/constant/version.ts` — 前端功能映射
+
+- `PROFESSION_VERSION_PERMISSION` 和 `BUSINESS_VERSION_PERMISSION` 数组中加入 `LicenseEditionFree`
+- `VERSION_INFO[LicenseEditionFree].features` 所有功能设为 `SUPPORTED` / `ADVANCED`,数量限制设为 `Infinity`
+
+---
+
+## 架构总览
+
+```
+┌─────────────────────────────────────────────────────┐
+│ 用户浏览器 │
+├──────────────────────┬──────────────────────────────┤
+│ 管理后台 (Admin) │ 知识库网站 (App) │
+│ React + Vite │ Next.js 16 │
+│ 端口: 5173 (dev) │ 端口: 3010 (dev) │
+└──────────────────────┴──────────────────────────────┘
+ │
+ ▼
+┌─────────────────────────────────────────────────────┐
+│ 后端 API (Go / Echo) │
+│ 端口: 8000 │
+│ - /api/v1/* (管理 API) │
+│ - /share/v1/* (前端网站 API) │
+└──────────────────────┬──────────────────────────────┘
+ │ │ │ │
+ ▼ ▼ ▼ ▼
+┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
+│PostgreSQL│ │ Redis │ │ NATS │ │ MinIO │
+│ 数据库 │ │ 缓存 │ │ 消息队列 │ │ 文件存储 │
+└──────────┘ └──────────┘ └──────────┘ └──────────┘
+ │
+ ▼
+ ┌──────────────────────┐
+ │ RAG 服务 (ct_rag) │
+ │ 向量检索 / 嵌入 │
+ │ 端口: 5050 │
+ └──────────────────────┘
+ │
+ ▼
+ ┌──────────────────────┐
+ │ AI 大模型 API │
+ │ (OpenAI 兼容接口) │
+ └──────────────────────┘
+```
+
+---
+
+## 外部依赖一览
+
+| 依赖 | 用途 | 必须 | 默认地址/端口 |
+|------|------|------|--------------|
+| PostgreSQL | 主数据库 | 是 | panda-wiki-postgres:5432 |
+| Redis | 缓存 + Session | 是 | panda-wiki-redis:6379 |
+| NATS | 异步任务队列 | 是 | subnet.13:4222 |
+| MinIO (S3) | 文件存储 | 是 | panda-wiki-minio:9000 |
+| RAG 服务 | 文档向量化与语义搜索 | 是 | subnet.18:5050 |
+| AI 模型 API | AI 创作/问答/搜索 | 推荐 | 用户自行配置 |
+| Caddy | 反向代理/SSL | 推荐 | 自动管理 |
+
+所有依赖均可通过 Docker Compose 一键启动。
+
+---
+
+## 构建与运行
+
+### 环境要求
+
+- Go 1.24+
+- Node.js 20+ (推荐 22)
+- pnpm 10+
+- Docker 20.x+ (用于运行依赖服务)
+
+### 第一步:启动依赖服务
+
+创建 `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+services:
+ postgres:
+ image: postgres:16-alpine
+ container_name: panda-wiki-postgres
+ environment:
+ POSTGRES_USER: panda-wiki
+ POSTGRES_PASSWORD: panda-wiki-secret
+ POSTGRES_DB: panda-wiki
+ ports:
+ - "5432:5432"
+ volumes:
+ - pg_data:/var/lib/postgresql/data
+
+ redis:
+ image: redis:7-alpine
+ container_name: panda-wiki-redis
+ command: redis-server --appendonly yes
+ ports:
+ - "6379:6379"
+ volumes:
+ - redis_data:/data
+
+ nats:
+ image: nats:2-alpine
+ container_name: panda-wiki-nats
+ command: "-js -m 8222 --user panda-wiki --pass your-nats-password"
+ ports:
+ - "4222:4222"
+ - "8222:8222"
+
+ minio:
+ image: minio/minio:latest
+ container_name: panda-wiki-minio
+ command: server /data --console-address ":9001"
+ environment:
+ MINIO_ROOT_USER: s3panda-wiki
+ MINIO_ROOT_PASSWORD: your-s3-secret-key
+ ports:
+ - "9000:9000"
+ - "9001:9001"
+ volumes:
+ - minio_data:/data
+
+volumes:
+ pg_data:
+ redis_data:
+ minio_data:
+```
+
+```bash
+docker compose up -d
+```
+
+### 第二步:配置后端
+
+创建 `backend/config/config.yml`:
+
+```yaml
+http:
+ port: 8000
+
+pg:
+ dsn: "host=localhost user=panda-wiki password=panda-wiki-secret dbname=panda-wiki port=5432 sslmode=disable TimeZone=Asia/Shanghai"
+
+redis:
+ addr: "localhost:6379"
+ password: ""
+
+mq:
+ type: "nats"
+ nats:
+ server: "nats://localhost:4222"
+ user: "panda-wiki"
+ password: "your-nats-password"
+
+rag:
+ provider: "ct"
+ ct_rag:
+ base_url: "http://localhost:5050"
+ api_key: "sk-1234567890"
+
+auth:
+ type: "jwt"
+ jwt:
+ secret: "your-jwt-secret-key-change-in-production"
+
+s3:
+ endpoint: "localhost:9000"
+ access_key: "s3panda-wiki"
+ secret_key: "your-s3-secret-key"
+
+log:
+ level: -4 # -4=debug, 0=info, 4=warn, 8=error
+
+sentry:
+ enabled: false
+```
+
+### 第三步:构建后端
+
+```bash
+# 进入后端目录
+cd backend
+
+# 下载依赖
+go mod tidy
+
+# 安装代码生成工具
+go install github.com/google/wire/cmd/wire@latest
+go install github.com/swaggo/swag/cmd/swag@latest
+
+# 生成 wire 依赖注入代码 和 swagger 文档
+make generate
+
+# 编译
+go build -o panda-wiki-api ./cmd/api/
+
+# 运行数据库迁移
+go run ./cmd/migrate/
+
+# 启动 API 服务
+./panda-wiki-api
+```
+
+### 第四步:构建前端
+
+```bash
+# 进入前端目录
+cd web
+
+# 安装依赖
+pnpm install
+
+# 生成 API 请求客户端代码 (从 swagger 文档)
+pnpm --filter panda-wiki-admin api
+pnpm --filter panda-wiki-app api
+
+# 开发模式启动 (两个项目同时)
+pnpm dev
+
+# 或者分别构建
+pnpm --filter panda-wiki-admin build
+pnpm --filter panda-wiki-app build
+```
+
+### 第五步:访问
+
+- 管理后台: http://localhost:5173
+- 用户端 Wiki: http://localhost:3010
+- API 服务: http://localhost:8000
+- Swagger 文档: http://localhost:8000/swagger/ (设置 ENV=local)
+
+---
+
+## Docker 构建 (生产环境)
+
+### 后端 Docker 镜像
+
+```bash
+cd backend
+
+# 构建 API 镜像
+docker build -f Dockerfile.api -t panda-wiki-api:latest .
+
+# 构建 Consumer 镜像 (异步任务)
+docker build -f Dockerfile.consumer -t panda-wiki-consumer:latest .
+```
+
+### 前端 Docker 镜像
+
+```bash
+cd web/admin
+docker build -t panda-wiki-admin:latest .
+
+cd web/app
+docker build -t panda-wiki-app:latest .
+```
+
+---
+
+## 注意事项
+
+### 关于 Pro 功能
+
+`backend/pro/` 目录在当前开源仓库中为空,以下功能**需要自行实现** Pro handler 才能使用:
+
+| 功能 | 状态 | 说明 |
+|------|------|------|
+| 知识库数量无限制 | 已解锁 | 修改 `MaxKb` |
+| 文档数量无限制 | 已解锁 | 修改 `MaxNode` |
+| 管理员无限制 | 已解锁 | 修改 `MaxAdmin` |
+| 管理员分权控制 | 已解锁 | `AllowAdminPerm: true` |
+| 自定义版权信息 | 已解锁 | `AllowCustomCopyright: true` |
+| 评论审核 | 已解锁 | `AllowCommentAudit: true` |
+| 高级机器人配置 | 已解锁 | `AllowAdvancedBot: true` |
+| 水印功能 | 已解锁 | `AllowWatermark: true` |
+| 复制保护 | 已解锁 | `AllowCopyProtection: true` |
+| MCP Server | 已解锁 | `AllowMCPServer: true` |
+| 文档统计 | 已解锁 | `AllowNodeStats: true` |
+| 全周期数据统计 | 已解锁 | 移除 ValidateStatDay 版本限制 |
+| SSO 登录 (LDAP/CAS/OAuth) | 需自行开发 | Pro handler 代码缺失 |
+| API Token 管理 | 需自行开发 | Pro handler 代码缺失 |
+| 文档版本历史 | 需自行开发 | Pro handler 代码缺失 |
+| 敏感词过滤 | 需自行开发 | Pro handler 代码缺失 |
+| 文档反馈/贡献审核 | 需自行开发 | Pro handler 代码缺失 |
+
+### Windows 开发注意事项
+
+项目依赖 `bytedance/sonic` 库 (高性能 JSON 解析),该库在 Windows 上编译会失败。解决方案:
+
+1. **推荐**: 使用 WSL2 或 Linux 虚拟机进行后端开发
+2. **替代**: 在 `go.mod` 中替换 sonic 为标准库 `encoding/json`(性能较低但兼容 Windows)
+3. **只改前端**: 如果只修改前端代码,可以直接在 Windows 上 `pnpm dev`
+
+```bash
+# WSL2 方案
+wsl --install
+cd /mnt/e/code\ project/PandaWiki-3.85.0/backend
+go build ./...
+```
+
+### 键环境变量
+
+| 变量 | 说明 |
+|------|------|
+| `POSTGRES_PASSWORD` | 数据库密码 |
+| `NATS_PASSWORD` | NATS 密码 |
+| `REDIS_PASSWORD` | Redis 密码 |
+| `JWT_SECRET` | JWT 签名密钥 |
+| `S3_SECRET_KEY` | MinIO/S3 密钥 |
+| `ADMIN_PASSWORD` | 管理员初始密码 |
+| `ENV=local` | 启用 Swagger 文档和 Debug 模式 |
+| `READONLY=1` | 只读模式 |
+
+---
+
+## 快速启动脚本 (开发模式)
+
+将以下内容保存为 `start-dev.sh`:
+
+```bash
+#!/bin/bash
+set -e
+
+# 1. 启动依赖
+echo "=== 启动 Docker 依赖 ==="
+docker compose up -d postgres redis nats minio
+
+# 2. 启动后端
+echo "=== 启动后端 ==="
+cd backend
+go run ./cmd/migrate/
+go run ./cmd/api/ &
+BACKEND_PID=$!
+cd ..
+
+# 3. 启动前端
+echo "=== 启动前端 ==="
+cd web
+pnpm dev &
+FRONTEND_PID=$!
+cd ..
+
+echo "=== 启动完成 ==="
+echo "后端: http://localhost:8000"
+echo "管理: http://localhost:5173"
+echo "Wiki: http://localhost:3010"
+echo "按 Ctrl+C 停止"
+
+trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT
+wait
+```
+
+---
+
+## 版本信息
+
+- 原始项目: PandaWiki 3.85.0 (chaitin/PandaWiki)
+- 许可证: AGPL-3.0
+- 修改日期: 2026-05-21
diff --git a/backend/.dockerignore b/backend/.dockerignore
new file mode 100644
index 0000000..8541464
--- /dev/null
+++ b/backend/.dockerignore
@@ -0,0 +1 @@
+deploy
diff --git a/backend/.golangci.toml b/backend/.golangci.toml
new file mode 100644
index 0000000..2ae2543
--- /dev/null
+++ b/backend/.golangci.toml
@@ -0,0 +1,10 @@
+version = "2"
+
+linters.default = "standard"
+
+[[linters.exclusions.rules]]
+linters = [ "errcheck" ]
+source = "^\\s*defer\\s+"
+
+[formatters]
+enable = ["gofmt", "goimports"]
\ No newline at end of file
diff --git a/backend/Dockerfile.api b/backend/Dockerfile.api
new file mode 100644
index 0000000..841eac6
--- /dev/null
+++ b/backend/Dockerfile.api
@@ -0,0 +1,31 @@
+FROM --platform=$BUILDPLATFORM golang:1.24.3-alpine AS builder
+
+WORKDIR /src
+ENV CGO_ENABLED=0
+
+COPY go.mod go.sum ./
+RUN --mount=type=cache,target=/go/pkg/mod \
+ go mod download
+
+COPY . .
+
+ARG TARGETOS TARGETARCH VERSION
+RUN --mount=type=cache,target=/root/.cache/go-build \
+ --mount=type=cache,target=/go/pkg/mod \
+ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static' -X github.com/chaitin/panda-wiki/telemetry.Version=${VERSION}" -o /build/panda-wiki-api cmd/api/main.go cmd/api/wire_gen.go \
+ && GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static' -X github.com/chaitin/panda-wiki/telemetry.Version=${VERSION}" -o /build/panda-wiki-migrate cmd/migrate/main.go cmd/migrate/wire_gen.go
+FROM alpine:3.21 AS api
+
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache ca-certificates tzdata \
+ && update-ca-certificates 2>/dev/null || true \
+ && rm -rf /var/cache/apk/*
+
+WORKDIR /app
+
+COPY --from=builder /build/panda-wiki-api /app/panda-wiki-api
+COPY --from=builder /build/panda-wiki-migrate /app/panda-wiki-migrate
+COPY --from=builder /src/store/pg/migration /app/migration
+
+CMD ["sh", "-c", "/app/panda-wiki-migrate && /app/panda-wiki-api"]
diff --git a/backend/Dockerfile.api.pro b/backend/Dockerfile.api.pro
new file mode 100644
index 0000000..28c802a
--- /dev/null
+++ b/backend/Dockerfile.api.pro
@@ -0,0 +1,32 @@
+FROM --platform=$BUILDPLATFORM golang:1.24.3-alpine AS builder
+
+WORKDIR /src
+ENV CGO_ENABLED=0
+
+COPY go.mod go.sum ./
+RUN --mount=type=cache,target=/go/pkg/mod \
+ go mod download
+
+COPY . .
+
+ARG TARGETOS TARGETARCH VERSION
+RUN --mount=type=cache,target=/root/.cache/go-build \
+ --mount=type=cache,target=/go/pkg/mod \
+ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static' -X github.com/chaitin/panda-wiki/telemetry.Version=${VERSION}" -o /build/panda-wiki-api pro/cmd/api_pro/main.go pro/cmd/api_pro/wire_gen.go \
+ && GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static' -X github.com/chaitin/panda-wiki/telemetry.Version=${VERSION}" -o /build/panda-wiki-migrate cmd/migrate/main.go cmd/migrate/wire_gen.go
+
+FROM alpine:3.21 AS api
+
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache ca-certificates tzdata \
+ && update-ca-certificates 2>/dev/null || true \
+ && rm -rf /var/cache/apk/*
+
+WORKDIR /app
+
+COPY --from=builder /build/panda-wiki-api /app/panda-wiki-api
+COPY --from=builder /build/panda-wiki-migrate /app/panda-wiki-migrate
+COPY --from=builder /src/store/pg/migration /app/migration
+
+CMD ["sh", "-c", "/app/panda-wiki-migrate && /app/panda-wiki-api"]
diff --git a/backend/Dockerfile.consumer b/backend/Dockerfile.consumer
new file mode 100644
index 0000000..5948bc3
--- /dev/null
+++ b/backend/Dockerfile.consumer
@@ -0,0 +1,29 @@
+FROM --platform=$BUILDPLATFORM golang:1.24.3-alpine AS builder
+
+WORKDIR /src
+ENV CGO_ENABLED=0
+
+COPY go.mod go.sum ./
+RUN --mount=type=cache,target=/go/pkg/mod \
+ go mod download
+
+COPY . .
+
+ARG TARGETOS TARGETARCH
+RUN --mount=type=cache,target=/root/.cache/go-build \
+ --mount=type=cache,target=/go/pkg/mod \
+ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static'" -o /build/panda-wiki-consumer cmd/consumer/main.go cmd/consumer/wire_gen.go
+
+FROM alpine:3.21 AS consumer
+
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache ca-certificates tzdata \
+ && update-ca-certificates 2>/dev/null || true \
+ && rm -rf /var/cache/apk/*
+
+WORKDIR /app
+COPY --from=builder /build/panda-wiki-consumer /app/panda-wiki-consumer
+COPY --from=builder /src/store/pg/migration /app/migration
+
+CMD ["./panda-wiki-consumer"]
diff --git a/backend/Dockerfile.consumer.pro b/backend/Dockerfile.consumer.pro
new file mode 100644
index 0000000..e51ae02
--- /dev/null
+++ b/backend/Dockerfile.consumer.pro
@@ -0,0 +1,29 @@
+FROM --platform=$BUILDPLATFORM golang:1.24.3-alpine AS builder
+
+WORKDIR /src
+ENV CGO_ENABLED=0
+
+COPY go.mod go.sum ./
+RUN --mount=type=cache,target=/go/pkg/mod \
+ go mod download
+
+COPY . .
+
+ARG TARGETOS TARGETARCH
+RUN --mount=type=cache,target=/root/.cache/go-build \
+ --mount=type=cache,target=/go/pkg/mod \
+ GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w -extldflags '-static'" -o /build/panda-wiki-consumer pro/cmd/consumer_pro/main.go pro/cmd/consumer_pro/wire_gen.go
+
+FROM alpine:3.21 AS consumer
+
+RUN apk update \
+ && apk upgrade \
+ && apk add --no-cache ca-certificates tzdata \
+ && update-ca-certificates 2>/dev/null || true \
+ && rm -rf /var/cache/apk/*
+
+WORKDIR /app
+COPY --from=builder /build/panda-wiki-consumer /app/panda-wiki-consumer
+COPY --from=builder /src/store/pg/migration /app/migration
+
+CMD ["./panda-wiki-consumer"]
diff --git a/backend/Makefile b/backend/Makefile
new file mode 100644
index 0000000..70858c9
--- /dev/null
+++ b/backend/Makefile
@@ -0,0 +1,47 @@
+generate:
+ swag fmt --dir handler && swag init --exclude pro -g cmd/api/main.go --pd \
+ && wire cmd/api/wire.go \
+ && wire cmd/consumer/wire.go \
+ && wire cmd/migrate/wire.go
+
+generate_pro:
+ wire cmd/migrate/wire.go \
+ && cd pro \
+ && swag fmt --dir handler && swag init --instanceName pro -g cmd/api_pro/main.go --pd \
+ && wire cmd/api_pro/wire.go \
+ && wire cmd/consumer_pro/wire.go
+
+lint:generate generate_pro
+ go mod tidy && golangci-lint run
+
+SEQ_NAME=init
+migrate_sql:
+ migrate create -ext sql -dir store/pg/migration -seq ${SEQ_NAME}
+
+image:
+ docker buildx build \
+ --platform ${PLATFORM} \
+ --tag ${IMAGE_NAME} \
+ --build-arg VERSION=${VERSION} \
+ --output ${OUTPUT} \
+ --progress plain \
+ --file ${DOCKERFILE} \
+ .
+
+TAG=$(shell git describe --tags 2>/dev/null || echo "latest")
+push-prod-images:
+ make image PLATFORM=linux/amd64,linux/arm64 DOCKERFILE=Dockerfile.api IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-api:${TAG} OUTPUT=type=registry VERSION=${TAG} \
+ && make image PLATFORM=linux/amd64,linux/arm64 DOCKERFILE=Dockerfile.consumer IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-consumer:${TAG} OUTPUT=type=registry VERSION=${TAG}
+
+COMMIT_HASH=$(shell git rev-parse --short HEAD)
+LOCAL_PLATFORM=linux/$(shell uname -m)
+#LOCAL_PLATFORM=linux/amd64
+dev:generate
+ make image PLATFORM=${LOCAL_PLATFORM} DOCKERFILE=Dockerfile.api IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-api:latest OUTPUT=type=docker VERSION=${COMMIT_HASH} \
+ && make image PLATFORM=${LOCAL_PLATFORM} DOCKERFILE=Dockerfile.consumer IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-consumer:latest OUTPUT=type=docker VERSION=${COMMIT_HASH} \
+ && cd deploy && docker compose up -d
+
+pro:generate_pro
+ make image PLATFORM=${LOCAL_PLATFORM} DOCKERFILE=Dockerfile.api.pro IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-api:latest OUTPUT=type=docker VERSION=${COMMIT_HASH} \
+ && make image PLATFORM=${LOCAL_PLATFORM} DOCKERFILE=Dockerfile.consumer.pro IMAGE_NAME=chaitin-registry.cn-hangzhou.cr.aliyuncs.com/chaitin/panda-wiki-consumer:latest OUTPUT=type=docker VERSION=${COMMIT_HASH} \
+ && cd deploy && docker compose up -d
\ No newline at end of file
diff --git a/backend/api/auth/v1/auth.go b/backend/api/auth/v1/auth.go
new file mode 100644
index 0000000..e9f6fe7
--- /dev/null
+++ b/backend/api/auth/v1/auth.go
@@ -0,0 +1,48 @@
+package v1
+
+import (
+ "time"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type AuthGetReq struct {
+ KBID string `json:"kb_id,omitempty" query:"kb_id"`
+ SourceType consts.SourceType `query:"source_type" json:"source_type" validate:"required,oneof=github"`
+}
+
+type AuthGetResp struct {
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ Proxy string `json:"proxy"`
+ SourceType consts.SourceType `json:"source_type"`
+ Auths []AuthItem `json:"auths"`
+}
+
+type AuthItem struct {
+ ID uint `gorm:"primaryKey;column:id" json:"id,omitempty"`
+ Username string `gorm:"column:username;not null" json:"username,omitempty"`
+ AvatarUrl string `json:"avatar_url"`
+ IP string `gorm:"column:ip;not null" json:"ip,omitempty"`
+ SourceType consts.SourceType `gorm:"column:source_type;not null" json:"source_type,omitempty"`
+ LastLoginTime time.Time `gorm:"column:last_login_time" json:"last_login_time,omitempty"`
+ CreatedAt time.Time `gorm:"column:created_at;not null;default:now()" json:"created_at"`
+}
+
+type AuthSetReq struct {
+ KBID string `json:"kb_id,omitempty"`
+ SourceType consts.SourceType `query:"source_type" json:"source_type" validate:"required,oneof=github"`
+ ClientID string `json:"client_id"`
+ ClientSecret string `json:"client_secret"`
+ Proxy string `json:"proxy"`
+}
+
+type AuthSetResp struct{}
+
+type AuthDeleteReq struct {
+ ID int64 `query:"id" json:"id"`
+ KbID string `query:"kb_id" json:"kb_id"`
+}
+
+type AuthDeleteResp struct {
+}
diff --git a/backend/api/conversation/v1/conversation.go b/backend/api/conversation/v1/conversation.go
new file mode 100644
index 0000000..8decfd8
--- /dev/null
+++ b/backend/api/conversation/v1/conversation.go
@@ -0,0 +1,17 @@
+package v1
+
+type GetConversationDetailReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+ ID string `query:"id" json:"id" validate:"required"`
+}
+
+type GetConversationDetailResp struct {
+}
+
+type GetMessageDetailReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+ ID string `query:"id" json:"id" validate:"required"`
+}
+
+type GetMessageDetailResp struct {
+}
diff --git a/backend/api/crawler/v1/confluence.go b/backend/api/crawler/v1/confluence.go
new file mode 100644
index 0000000..61f47b2
--- /dev/null
+++ b/backend/api/crawler/v1/confluence.go
@@ -0,0 +1,26 @@
+package v1
+
+type ConfluenceParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+}
+
+type ConfluenceParseItem struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+}
+
+type ConfluenceParseResp struct {
+ ID string `json:"id"`
+ Docs []ConfluenceParseItem `json:"docs"`
+}
+
+type ConfluenceScrapeReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocID string `json:"doc_id" validate:"required"`
+}
+
+type ConfluenceScrapeResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/crawler.go b/backend/api/crawler/v1/crawler.go
new file mode 100644
index 0000000..d2b785c
--- /dev/null
+++ b/backend/api/crawler/v1/crawler.go
@@ -0,0 +1,55 @@
+package v1
+
+import (
+ "github.com/chaitin/panda-wiki/consts"
+ "github.com/chaitin/panda-wiki/pkg/anydoc"
+)
+
+type CrawlerParseReq struct {
+ Key string `json:"key"`
+ KbID string `json:"kb_id" validate:"required"`
+ CrawlerSource consts.CrawlerSource `json:"crawler_source" validate:"required"`
+ Filename string `json:"filename"`
+ FeishuSetting anydoc.FeishuSetting `json:"feishu_setting"`
+ DingtalkSetting anydoc.DingtalkSetting `json:"dingtalk_setting"`
+}
+
+type CrawlerParseResp struct {
+ ID string `json:"id"`
+ Docs anydoc.Child `json:"docs"`
+}
+
+type CrawlerExportReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocID string `json:"doc_id" validate:"required"`
+ SpaceId string `json:"space_id"`
+ FileType string `json:"file_type"`
+}
+
+type CrawlerExportResp struct {
+ TaskId string `json:"task_id"`
+}
+
+type CrawlerResultReq struct {
+ TaskId string `json:"task_id" query:"task_id" validate:"required"`
+}
+
+type CrawlerResultResp struct {
+ Status consts.CrawlerStatus `json:"status" validate:"required"`
+ Content string `json:"content"`
+}
+
+type CrawlerResultsReq struct {
+ TaskIds []string `json:"task_ids" validate:"required"`
+}
+
+type CrawlerResultsResp struct {
+ Status consts.CrawlerStatus `json:"status"`
+ List []CrawlerResultItem `json:"list"`
+}
+type CrawlerResultItem struct {
+ TaskId string `json:"task_id"`
+ Status consts.CrawlerStatus `json:"status"`
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/epub.go b/backend/api/crawler/v1/epub.go
new file mode 100644
index 0000000..5d400e5
--- /dev/null
+++ b/backend/api/crawler/v1/epub.go
@@ -0,0 +1,11 @@
+package v1
+
+type EpubParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ Filename string `json:"filename" validate:"required"`
+ Key string `json:"key" validate:"required"`
+}
+
+type EpubParseResp struct {
+ TaskID string `json:"task_id"`
+}
diff --git a/backend/api/crawler/v1/feishu.go b/backend/api/crawler/v1/feishu.go
new file mode 100644
index 0000000..9cc23cd
--- /dev/null
+++ b/backend/api/crawler/v1/feishu.go
@@ -0,0 +1,52 @@
+package v1
+
+type FeishuSpaceListReq struct {
+ UserAccessToken string `json:"user_access_token" validate:"required"`
+ AppID string `json:"app_id" validate:"required"`
+ AppSecret string `json:"app_secret" validate:"required"`
+}
+type FeishuSpaceListResp struct {
+ Name string `json:"name"`
+ SpaceId string `json:"space_id"`
+}
+
+type FeishuSearchWikiReq struct {
+ UserAccessToken string `json:"user_access_token" validate:"required"`
+ AppID string `json:"app_id" validate:"required"`
+ AppSecret string `json:"app_secret" validate:"required"`
+ SpaceId string `json:"space_id"`
+}
+
+type FeishuSearchWikiResp struct {
+ ID string `json:"id" validate:"required"`
+ DocId string `json:"doc_id" validate:"required"`
+ Title string `json:"title"`
+ FileType string `json:"file_type"`
+ SpaceId string `json:"space_id"`
+}
+
+type FeishuListCloudDocReq struct {
+ UserAccessToken string `json:"user_access_token" validate:"required"`
+ AppID string `json:"app_id" validate:"required"`
+ AppSecret string `json:"app_secret" validate:"required"`
+}
+
+type FeishuListCloudDocResp struct {
+ ID string `json:"id" validate:"required"`
+ DocId string `json:"doc_id" validate:"required"`
+ Title string `json:"title"`
+ FileType string `json:"file_type"`
+ SpaceId string `json:"space_id"`
+}
+
+type FeishuGetDocReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocId string `json:"doc_id" validate:"required"`
+ FileType string `json:"file_type"`
+ SpaceId string `json:"space_id"`
+}
+
+type FeishuGetDocResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/mindoc.go b/backend/api/crawler/v1/mindoc.go
new file mode 100644
index 0000000..9f42cb9
--- /dev/null
+++ b/backend/api/crawler/v1/mindoc.go
@@ -0,0 +1,26 @@
+package v1
+
+type MindocParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+}
+
+type MindocParseItem struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+}
+
+type MindocParseResp struct {
+ ID string `json:"id"`
+ Docs []MindocParseItem `json:"docs"`
+}
+
+type MindocScrapeReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocID string `json:"doc_id" validate:"required"`
+}
+
+type MindocScrapeResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/notion.go b/backend/api/crawler/v1/notion.go
new file mode 100644
index 0000000..5267e1e
--- /dev/null
+++ b/backend/api/crawler/v1/notion.go
@@ -0,0 +1,24 @@
+package v1
+
+type NotionParseReq struct {
+ Integration string `json:"integration" validate:"required"`
+}
+type NotionParseResp struct {
+ ID string `json:"id"`
+ Docs []NotionParseItem `json:"docs"`
+}
+
+type NotionParseItem struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+}
+
+type NotionScrapeReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocId string `json:"doc_id" validate:"required"`
+}
+
+type NotionScrapeResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/siyuan.go b/backend/api/crawler/v1/siyuan.go
new file mode 100644
index 0000000..f09d534
--- /dev/null
+++ b/backend/api/crawler/v1/siyuan.go
@@ -0,0 +1,26 @@
+package v1
+
+type SiyuanParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+}
+
+type SiyuanParseItem struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+}
+
+type SiyuanParseResp struct {
+ ID string `json:"id"`
+ Docs []SiyuanParseItem `json:"docs"`
+}
+
+type SiyuanScrapeReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocID string `json:"doc_id" validate:"required"`
+}
+
+type SiyuanScrapeResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/wikijs.go b/backend/api/crawler/v1/wikijs.go
new file mode 100644
index 0000000..affd0fa
--- /dev/null
+++ b/backend/api/crawler/v1/wikijs.go
@@ -0,0 +1,25 @@
+package v1
+
+type WikijsParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+}
+
+type WikijsParseItem struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+}
+
+type WikijsParseResp struct {
+ ID string `json:"id"`
+ Docs []WikijsParseItem `json:"docs"`
+}
+
+type WikijsScrapeReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ DocID string `json:"doc_id" validate:"required"`
+}
+
+type WikijsScrapeResp struct {
+ Content string `json:"content"`
+}
diff --git a/backend/api/crawler/v1/yuque.go b/backend/api/crawler/v1/yuque.go
new file mode 100644
index 0000000..0bf2855
--- /dev/null
+++ b/backend/api/crawler/v1/yuque.go
@@ -0,0 +1,16 @@
+package v1
+
+type YuqueParseReq struct {
+ KbID string `json:"kb_id" validate:"required"`
+ Filename string `json:"filename" validate:"required"`
+ Key string `json:"key" validate:"required"`
+}
+
+type YuqueParseResp struct {
+ List []YuqueParseItem `json:"list"`
+}
+
+type YuqueParseItem struct {
+ TaskID string `json:"task_id"`
+ Title string `json:"title"`
+}
diff --git a/backend/api/kb/v1/kb.go b/backend/api/kb/v1/kb.go
new file mode 100644
index 0000000..be61991
--- /dev/null
+++ b/backend/api/kb/v1/kb.go
@@ -0,0 +1,42 @@
+package v1
+
+import (
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type KBUserListReq struct {
+ KBId string `json:"kb_id" query:"kb_id"`
+}
+
+type KBUserListItemResp struct {
+ ID string `json:"id"`
+ Account string `json:"account"`
+ Role consts.UserRole `json:"role"`
+ Perm consts.UserKBPermission `json:"perms"`
+}
+
+type KBUserInviteReq struct {
+ KBId string `json:"kb_id" validate:"required"`
+ UserId string `json:"user_id" validate:"required"`
+ Perm consts.UserKBPermission `json:"perm" validate:"required,oneof=full_control doc_manage data_operate"`
+}
+
+type KBUserInviteResp struct {
+}
+
+type KBUserUpdateReq struct {
+ KBId string `json:"kb_id" validate:"required"`
+ UserId string `json:"user_id" validate:"required"`
+ Perm consts.UserKBPermission `json:"perm" validate:"required,oneof=full_control doc_manage data_operate"`
+}
+
+type KBUserUpdateResp struct {
+}
+
+type KBUserDeleteReq struct {
+ KBId string `json:"kb_id" query:"kb_id" validate:"required"`
+ UserId string `json:"user_id" query:"user_id" validate:"required"`
+}
+
+type KBUserDeleteResp struct {
+}
diff --git a/backend/api/nav/v1/nav.go b/backend/api/nav/v1/nav.go
new file mode 100644
index 0000000..e48fbc5
--- /dev/null
+++ b/backend/api/nav/v1/nav.go
@@ -0,0 +1,39 @@
+package v1
+
+import "time"
+
+type NavListReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+}
+
+type NavAddReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+ Name string `json:"name" validate:"required"`
+ Position *float64 `json:"position"`
+}
+
+type NavUpdateReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ Name string `json:"name" validate:"required"`
+}
+
+type NavDeleteReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+ ID string `json:"id" query:"id" validate:"required"`
+}
+
+type NavMoveReq struct {
+ KbId string `json:"kb_id" validate:"required"`
+ ID string `json:"id" validate:"required"`
+ PrevID string `json:"prev_id"`
+ NextID string `json:"next_id"`
+}
+
+type NavListResp struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Position float64 `json:"position"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+}
diff --git a/backend/api/node/v1/node.go b/backend/api/node/v1/node.go
new file mode 100644
index 0000000..3bc9258
--- /dev/null
+++ b/backend/api/node/v1/node.go
@@ -0,0 +1,100 @@
+package v1
+
+import (
+ "time"
+
+ "github.com/chaitin/panda-wiki/domain"
+)
+
+type GetNodeDetailReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+ ID string `query:"id" json:"id" validate:"required"`
+ Format string `query:"format" json:"format"`
+}
+
+type NodeDetailResp struct {
+ ID string `json:"id"`
+ KbID string `json:"kb_id"`
+ NavId string `json:"nav_id"`
+ Type domain.NodeType `json:"type"`
+ Status domain.NodeStatus `json:"status"`
+ Name string `json:"name"`
+ Content string `json:"content"`
+ Meta domain.NodeMeta `json:"meta"`
+ ParentID string `json:"parent_id"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ Permissions domain.NodePermissions `json:"permissions"`
+ CreatorId string `json:"creator_id"`
+ EditorId string `json:"editor_id"`
+ PublisherId string `json:"publisher_id" gorm:"-"`
+ CreatorAccount string `json:"creator_account"`
+ EditorAccount string `json:"editor_account"`
+ PublisherAccount string `json:"publisher_account" gorm:"-"`
+ PV int64 `json:"pv" gorm:"-"`
+}
+
+type NodePermissionReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+ ID string `query:"id" json:"id" validate:"required"`
+}
+
+type NodePermissionResp struct {
+ ID string `json:"id"`
+ Permissions domain.NodePermissions `json:"permissions"`
+ AnswerableGroups []domain.NodeGroupDetail `json:"answerable_groups"` // 可被问答
+ VisitableGroups []domain.NodeGroupDetail `json:"visitable_groups"` // 可被访问
+ VisibleGroups []domain.NodeGroupDetail `json:"visible_groups"` // 导航内可见
+}
+
+type NodePermissionEditReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+ IDs []string `query:"ids" json:"ids" validate:"required"`
+ Permissions *domain.NodePermissions `json:"permissions"`
+ AnswerableGroups *[]int `json:"answerable_groups"` // 可被问答
+ VisitableGroups *[]int `json:"visitable_groups"` // 可被访问
+ VisibleGroups *[]int `json:"visible_groups"` // 导航内可见
+}
+
+type NodePermissionEditResp struct {
+}
+
+type NodeRestudyReq struct {
+ NodeIds []string `json:"node_ids" validate:"required,min=1"`
+ KbId string `json:"kb_id" validate:"required"`
+}
+
+type NodeRestudyResp struct {
+}
+
+type NodeStatsReq struct {
+ KbId string `query:"kb_id" json:"kb_id" validate:"required"`
+}
+
+type NodeStatsResp struct {
+ UnpublishedCount int64 `json:"unpublished_count"` // 未发布的文档数
+ UnstudiedCount int64 `json:"unstudied_count"` // 未学习的文档数
+ UnreleasedNavCount int64 `json:"unreleased_nav_count"` // 未发布目录数量
+}
+
+type NodeMoveNavReq struct {
+ IDs []string `json:"ids" query:"[]ids" validate:"required,min=1"`
+ KbID string `json:"kb_id" validate:"required"`
+ NavID string `json:"nav_id" validate:"required"`
+}
+
+type NodeListGroupNavReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+ NavIds []string `json:"nav_ids" query:"nav_ids[]"`
+ Search string `json:"search" query:"search"`
+ Status string `json:"status" query:"status" validate:"omitempty,oneof=released unpublished unstudied"`
+}
+
+type NodeListGroupNavResp struct {
+ NavName string `json:"nav_name"`
+ NavID string `json:"nav_id"`
+ Position float64 `json:"position"`
+ Count int64 `json:"count"`
+ IsReleased bool `json:"is_released"`
+ List []domain.NodeListItemResp `json:"list"`
+}
diff --git a/backend/api/openapi/v1/openapi.go b/backend/api/openapi/v1/openapi.go
new file mode 100644
index 0000000..5cfbd06
--- /dev/null
+++ b/backend/api/openapi/v1/openapi.go
@@ -0,0 +1,9 @@
+package v1
+
+type GitHubCallbackReq struct {
+ Code string `json:"code" query:"code"`
+ State string `json:"state" query:"state"`
+}
+
+type GitHubCallbackResp struct {
+}
diff --git a/backend/api/share/v1/auth.go b/backend/api/share/v1/auth.go
new file mode 100644
index 0000000..38f05a5
--- /dev/null
+++ b/backend/api/share/v1/auth.go
@@ -0,0 +1,35 @@
+package v1
+
+import "github.com/chaitin/panda-wiki/consts"
+
+type AuthLoginSimpleReq struct {
+ Password string `json:"password" validate:"required"`
+}
+
+type AuthLoginSimpleResp struct {
+}
+
+type AuthGetReq struct {
+}
+type AuthGetResp struct {
+ AuthType consts.AuthType `json:"auth_type"`
+ SourceType consts.SourceType `json:"source_type"`
+ LicenseEdition consts.LicenseEdition `json:"license_edition"`
+}
+
+type AuthGitHubReq struct {
+ KbID string `json:"kb_id"`
+ RedirectUrl string `json:"redirect_url"`
+}
+
+type AuthGitHubResp struct {
+ Url string `json:"url"`
+}
+
+type GitHubCallbackReq struct {
+ Code string `json:"code" query:"code"`
+ State string `json:"state" query:"state"`
+}
+
+type GitHubCallbackResp struct {
+}
diff --git a/backend/api/share/v1/common.go b/backend/api/share/v1/common.go
new file mode 100644
index 0000000..8c1a5de
--- /dev/null
+++ b/backend/api/share/v1/common.go
@@ -0,0 +1,21 @@
+package v1
+
+type ShareFileUploadReq struct {
+ KbId string `json:"-"`
+ File string `form:"file"`
+ CaptchaToken string `form:"captcha_token" json:"captcha_token" validate:"required"`
+}
+
+type FileUploadResp struct {
+ Key string `json:"key"`
+}
+
+type ShareFileUploadUrlReq struct {
+ KbId string `json:"-"`
+ Url string `json:"url" validate:"required,url"`
+ CaptchaToken string `json:"captcha_token" validate:"required"`
+}
+
+type ShareFileUploadUrlResp struct {
+ Key string `json:"key"`
+}
diff --git a/backend/api/share/v1/nav.go b/backend/api/share/v1/nav.go
new file mode 100644
index 0000000..061dd02
--- /dev/null
+++ b/backend/api/share/v1/nav.go
@@ -0,0 +1,5 @@
+package v1
+
+type ShareNavListReq struct {
+ KbId string `json:"kb_id" query:"kb_id" validate:"required"`
+}
diff --git a/backend/api/share/v1/node.go b/backend/api/share/v1/node.go
new file mode 100644
index 0000000..9971610
--- /dev/null
+++ b/backend/api/share/v1/node.go
@@ -0,0 +1,37 @@
+package v1
+
+import (
+ "time"
+
+ "github.com/chaitin/panda-wiki/domain"
+)
+
+type ShareNodeDetailResp struct {
+ ID string `json:"id"`
+ KbID string `json:"kb_id"`
+ Type domain.NodeType `json:"type"`
+ Status domain.NodeStatus `json:"status"`
+ Name string `json:"name"`
+ Content string `json:"content"`
+ Meta domain.NodeMeta `json:"meta"`
+ ParentID string `json:"parent_id"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ Permissions domain.NodePermissions `json:"permissions"`
+ CreatorId string `json:"creator_id"`
+ EditorId string `json:"editor_id"`
+ PublisherId string `json:"publisher_id"`
+ CreatorAccount string `json:"creator_account"`
+ EditorAccount string `json:"editor_account"`
+ PublisherAccount string `json:"publisher_account"`
+ List []*domain.ShareNodeDetailItem `json:"list" gorm:"-"`
+ PV int64 `json:"pv" gorm:"-"`
+}
+
+type NodeListGroupNavResp struct {
+ NavName string `json:"nav_name"`
+ NavID string `json:"nav_id"`
+ Position float64 `json:"position"`
+ Count int64 `json:"count"`
+ List []domain.ShareNodeListItemResp `json:"list"`
+}
diff --git a/backend/api/share/v1/wechat.go b/backend/api/share/v1/wechat.go
new file mode 100644
index 0000000..1000ba1
--- /dev/null
+++ b/backend/api/share/v1/wechat.go
@@ -0,0 +1,8 @@
+package v1
+
+type WechatAppInfoResp struct {
+ WeChatAppIsEnabled bool `json:"wechat_app_is_enabled"`
+ FeedbackEnable bool `json:"feedback_enable"`
+ FeedbackType []string `json:"feedback_type"`
+ DisclaimerContent string `json:"disclaimer_content"`
+}
diff --git a/backend/api/stat/v1/stat.go b/backend/api/stat/v1/stat.go
new file mode 100644
index 0000000..4d536ad
--- /dev/null
+++ b/backend/api/stat/v1/stat.go
@@ -0,0 +1,56 @@
+package v1
+
+import (
+ "github.com/chaitin/panda-wiki/consts"
+ "github.com/chaitin/panda-wiki/domain"
+)
+
+type StatInstantCountReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+}
+
+type StatInstantPagesReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+}
+
+type StatHotPagesReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+}
+
+type StatCountReq struct {
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+}
+
+type StatCountResp struct {
+ IPCount int64 `json:"ip_count"`
+ SessionCount int64 `json:"session_count"`
+ PageVisitCount int64 `json:"page_visit_count"`
+ ConversationCount int64 `json:"conversation_count"`
+}
+
+type StatRefererHostsReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+}
+
+type StatBrowsersReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+}
+
+type StatGeoCountReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+}
+
+type StatConversationDistributionReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Day consts.StatDay `json:"day" query:"day" validate:"omitempty,oneof=1 7 30 90"`
+}
+
+type StatConversationDistributionResp struct {
+ AppType domain.AppType `json:"app_type"`
+ Count int64 `json:"count"`
+}
diff --git a/backend/api/user/v1/user.go b/backend/api/user/v1/user.go
new file mode 100644
index 0000000..18ef86f
--- /dev/null
+++ b/backend/api/user/v1/user.go
@@ -0,0 +1,59 @@
+package v1
+
+import (
+ "time"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type CreateUserReq struct {
+ Account string `json:"account" validate:"required"`
+ Password string `json:"password" validate:"required,min=8"`
+ Role consts.UserRole `json:"role" validate:"required,oneof=admin user"`
+}
+
+type CreateUserResp struct {
+ ID string `json:"id"`
+}
+
+type UserInfoResp struct {
+ ID string `json:"id"`
+ Account string `json:"account"`
+ Role consts.UserRole `json:"role"`
+ IsToken bool `json:"is_token"`
+ LastAccess *time.Time `json:"last_access,omitempty"`
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type UserListReq struct {
+}
+
+type UserListItemResp struct {
+ ID string `json:"id"`
+ Account string `json:"account"`
+ Role consts.UserRole `json:"role"`
+ LastAccess *time.Time `json:"last_access"`
+ CreatedAt *time.Time `json:"created_at"`
+}
+
+type LoginReq struct {
+ Account string `json:"account" validate:"required"`
+ Password string `json:"password" validate:"required"`
+}
+
+type LoginResp struct {
+ Token string `json:"token"`
+}
+
+type UserListResp struct {
+ Users []UserListItemResp `json:"users"`
+}
+
+type ResetPasswordReq struct {
+ ID string `json:"id" validate:"required"`
+ NewPassword string `json:"new_password" validate:"required,min=8"`
+}
+
+type DeleteUserReq struct {
+ UserID string `json:"user_id" query:"user_id" validate:"required"`
+}
diff --git a/backend/apm/provider.go b/backend/apm/provider.go
new file mode 100644
index 0000000..b97f69a
--- /dev/null
+++ b/backend/apm/provider.go
@@ -0,0 +1,5 @@
+package apm
+
+import "github.com/google/wire"
+
+var ProviderSet = wire.NewSet(NewTracer)
diff --git a/backend/apm/trace.go b/backend/apm/trace.go
new file mode 100644
index 0000000..66f467e
--- /dev/null
+++ b/backend/apm/trace.go
@@ -0,0 +1,65 @@
+package apm
+
+import (
+ "context"
+ "log"
+ "strings"
+
+ "go.opentelemetry.io/otel"
+ "go.opentelemetry.io/otel/attribute"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace"
+ "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
+ "go.opentelemetry.io/otel/sdk/resource"
+ sdktrace "go.opentelemetry.io/otel/sdk/trace"
+ "google.golang.org/grpc/credentials"
+
+ "github.com/chaitin/panda-wiki/config"
+)
+
+type Tracer struct {
+ Shutdown func(context.Context) error
+}
+
+func NewTracer(config *config.Config) (*Tracer, error) {
+ serviceName := config.GetString("apm.service_name")
+ collectorURL := config.GetString("apm.otel_exporter_otlp_endpoint")
+ insecure := config.GetString("apm.insecure")
+ var secureOption otlptracegrpc.Option
+
+ if strings.ToLower(insecure) == "false" || insecure == "0" || strings.ToLower(insecure) == "f" {
+ secureOption = otlptracegrpc.WithTLSCredentials(credentials.NewClientTLSFromCert(nil, ""))
+ } else {
+ secureOption = otlptracegrpc.WithInsecure()
+ }
+
+ exporter, err := otlptrace.New(
+ context.Background(),
+ otlptracegrpc.NewClient(
+ secureOption,
+ otlptracegrpc.WithEndpoint(collectorURL),
+ ),
+ )
+ if err != nil {
+ log.Fatalf("Failed to create exporter: %v", err)
+ }
+ resources, err := resource.New(
+ context.Background(),
+ resource.WithAttributes(
+ attribute.String("service.name", serviceName),
+ attribute.String("library.language", "go"),
+ ),
+ )
+ if err != nil {
+ log.Fatalf("Could not set resources: %v", err)
+ }
+
+ otel.SetTracerProvider(
+ sdktrace.NewTracerProvider(
+ sdktrace.WithSampler(sdktrace.AlwaysSample()),
+ sdktrace.WithBatcher(exporter),
+ sdktrace.WithResource(resources),
+ ),
+ )
+
+ return &Tracer{Shutdown: exporter.Shutdown}, nil
+}
diff --git a/backend/cSpell.json b/backend/cSpell.json
new file mode 100644
index 0000000..cfe64de
--- /dev/null
+++ b/backend/cSpell.json
@@ -0,0 +1,13 @@
+{
+ "$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
+ "version": "0.2",
+ "dictionaryDefinitions": [
+ {
+ "name": "project-words",
+ "path": "./project-words.txt",
+ "addWords": true
+ }
+ ],
+ "dictionaries": ["project-words"],
+ "ignorePaths": ["node_modules", "/project-words.txt"],
+}
\ No newline at end of file
diff --git a/backend/cmd/api/main.go b/backend/cmd/api/main.go
new file mode 100644
index 0000000..b796201
--- /dev/null
+++ b/backend/cmd/api/main.go
@@ -0,0 +1,28 @@
+package main
+
+import (
+ "fmt"
+
+ "github.com/chaitin/panda-wiki/setup"
+)
+
+// @title panda-wiki API
+// @version 1.0
+// @description panda-wiki API documentation
+// @BasePath /
+// @securityDefinitions.apikey bearerAuth
+// @in header
+// @name Authorization
+// @description Type "Bearer" + a space + your token to authorize
+func main() {
+ app, err := createApp()
+ if err != nil {
+ panic(err)
+ }
+ if err := setup.CheckInitCert(); err != nil {
+ panic(err)
+ }
+ port := app.Config.HTTP.Port
+ app.Logger.Info(fmt.Sprintf("Starting server on port %d", port))
+ app.HTTPServer.Echo.Logger.Fatal(app.HTTPServer.Echo.Start(fmt.Sprintf(":%d", port)))
+}
diff --git a/backend/cmd/api/wire.go b/backend/cmd/api/wire.go
new file mode 100644
index 0000000..0793584
--- /dev/null
+++ b/backend/cmd/api/wire.go
@@ -0,0 +1,39 @@
+//go:build wireinject
+
+package main
+
+import (
+ "github.com/google/wire"
+
+ "github.com/chaitin/panda-wiki/config"
+ share "github.com/chaitin/panda-wiki/handler/share"
+ v1 "github.com/chaitin/panda-wiki/handler/v1"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/server/http"
+ "github.com/chaitin/panda-wiki/telemetry"
+)
+
+func createApp() (*App, error) {
+ wire.Build(
+ wire.Struct(new(App), "*"),
+ wire.NewSet(
+ config.ProviderSet,
+ log.ProviderSet,
+ telemetry.ProviderSet,
+
+ http.ProviderSet,
+ v1.ProviderSet,
+ share.ProviderSet,
+ ),
+ )
+ return &App{}, nil
+}
+
+type App struct {
+ HTTPServer *http.HTTPServer
+ Handlers *v1.APIHandlers
+ ShareHandlers *share.ShareHandler
+ Config *config.Config
+ Logger *log.Logger
+ Telemetry *telemetry.Client
+}
diff --git a/backend/cmd/api/wire_gen.go b/backend/cmd/api/wire_gen.go
new file mode 100644
index 0000000..56b8b63
--- /dev/null
+++ b/backend/cmd/api/wire_gen.go
@@ -0,0 +1,219 @@
+// Code generated by Wire. DO NOT EDIT.
+
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
+//go:build !wireinject
+// +build !wireinject
+
+package main
+
+import (
+ "github.com/chaitin/panda-wiki/config"
+ "github.com/chaitin/panda-wiki/handler"
+ "github.com/chaitin/panda-wiki/handler/share"
+ "github.com/chaitin/panda-wiki/handler/v1"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/middleware"
+ "github.com/chaitin/panda-wiki/mq"
+ "github.com/chaitin/panda-wiki/pkg/captcha"
+ cache2 "github.com/chaitin/panda-wiki/repo/cache"
+ ipdb2 "github.com/chaitin/panda-wiki/repo/ipdb"
+ mq2 "github.com/chaitin/panda-wiki/repo/mq"
+ pg2 "github.com/chaitin/panda-wiki/repo/pg"
+ "github.com/chaitin/panda-wiki/server/http"
+ "github.com/chaitin/panda-wiki/store/cache"
+ "github.com/chaitin/panda-wiki/store/ipdb"
+ "github.com/chaitin/panda-wiki/store/pg"
+ "github.com/chaitin/panda-wiki/store/rag"
+ "github.com/chaitin/panda-wiki/store/s3"
+ "github.com/chaitin/panda-wiki/telemetry"
+ "github.com/chaitin/panda-wiki/usecase"
+)
+
+// Injectors from wire.go:
+
+func createApp() (*App, error) {
+ configConfig, err := config.NewConfig()
+ if err != nil {
+ return nil, err
+ }
+ logger := log.NewLogger(configConfig)
+ readOnlyMiddleware := middleware.NewReadonlyMiddleware(logger)
+ cacheCache, err := cache.NewCache(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ sessionMiddleware, err := middleware.NewSessionMiddleware(logger, configConfig, cacheCache)
+ if err != nil {
+ return nil, err
+ }
+ echo := http.NewEcho(logger, configConfig, readOnlyMiddleware, sessionMiddleware)
+ httpServer := &http.HTTPServer{
+ Echo: echo,
+ }
+ db, err := pg.NewDB(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ userAccessRepository := pg2.NewUserAccessRepository(db, logger)
+ apiTokenRepo := pg2.NewAPITokenRepo(db, logger, cacheCache)
+ authMiddleware, err := middleware.NewAuthMiddleware(configConfig, logger, userAccessRepository, apiTokenRepo)
+ if err != nil {
+ return nil, err
+ }
+ ragService, err := rag.NewRAGService(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ knowledgeBaseRepository := pg2.NewKnowledgeBaseRepository(db, configConfig, logger, ragService)
+ nodeRepository := pg2.NewNodeRepository(db, logger)
+ navRepository := pg2.NewNavRepository(db, logger)
+ mqProducer, err := mq.NewMQProducer(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ragRepository := mq2.NewRAGRepository(mqProducer)
+ userRepository := pg2.NewUserRepository(db, logger)
+ kbRepo := cache2.NewKBRepo(cacheCache)
+ knowledgeBaseUsecase, err := usecase.NewKnowledgeBaseUsecase(knowledgeBaseRepository, nodeRepository, navRepository, ragRepository, userRepository, ragService, kbRepo, logger, configConfig)
+ if err != nil {
+ return nil, err
+ }
+ shareAuthMiddleware := middleware.NewShareAuthMiddleware(logger, knowledgeBaseUsecase)
+ captchaCaptcha := captcha.NewCaptcha()
+ baseHandler := handler.NewBaseHandler(echo, logger, configConfig, authMiddleware, shareAuthMiddleware, captchaCaptcha)
+ userUsecase, err := usecase.NewUserUsecase(userRepository, logger, configConfig)
+ if err != nil {
+ return nil, err
+ }
+ userHandler := v1.NewUserHandler(echo, baseHandler, logger, userUsecase, authMiddleware, configConfig, cacheCache)
+ conversationRepository := pg2.NewConversationRepository(db, logger)
+ modelRepository := pg2.NewModelRepository(db, logger)
+ promptRepo := pg2.NewPromptRepo(db, logger)
+ llmUsecase := usecase.NewLLMUsecase(configConfig, ragService, conversationRepository, knowledgeBaseRepository, nodeRepository, modelRepository, promptRepo, logger)
+ knowledgeBaseHandler := v1.NewKnowledgeBaseHandler(baseHandler, echo, knowledgeBaseUsecase, llmUsecase, authMiddleware, logger)
+ appRepository := pg2.NewAppRepository(db, logger)
+ minioClient, err := s3.NewMinioClient(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ authRepo := pg2.NewAuthRepo(db, logger, cacheCache)
+ systemSettingRepo := pg2.NewSystemSettingRepo(db, logger)
+ modelUsecase := usecase.NewModelUsecase(modelRepository, nodeRepository, ragRepository, ragService, logger, configConfig, knowledgeBaseRepository, systemSettingRepo)
+ nodeUsecase := usecase.NewNodeUsecase(nodeRepository, navRepository, appRepository, ragRepository, userRepository, knowledgeBaseRepository, llmUsecase, ragService, logger, minioClient, modelRepository, authRepo, modelUsecase)
+ nodeHandler := v1.NewNodeHandler(baseHandler, echo, nodeUsecase, authMiddleware, logger)
+ geoRepo := cache2.NewGeoCache(cacheCache, db, logger)
+ ipdbIPDB, err := ipdb.NewIPDB(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ipAddressRepo := ipdb2.NewIPAddressRepo(ipdbIPDB, logger)
+ conversationUsecase := usecase.NewConversationUsecase(conversationRepository, nodeRepository, geoRepo, logger, ipAddressRepo, authRepo)
+ blockWordRepo := pg2.NewBlockWordRepo(db, logger)
+ chatUsecase, err := usecase.NewChatUsecase(llmUsecase, knowledgeBaseRepository, conversationUsecase, modelUsecase, appRepository, blockWordRepo, nodeRepository, authRepo, logger)
+ if err != nil {
+ return nil, err
+ }
+ appUsecase := usecase.NewAppUsecase(appRepository, authRepo, navRepository, nodeRepository, knowledgeBaseRepository, nodeUsecase, logger, configConfig, chatUsecase, cacheCache)
+ appHandler := v1.NewAppHandler(echo, baseHandler, logger, authMiddleware, appUsecase, modelUsecase, conversationUsecase, configConfig)
+ fileUsecase := usecase.NewFileUsecase(logger, minioClient, configConfig, systemSettingRepo)
+ fileHandler := v1.NewFileHandler(echo, baseHandler, logger, authMiddleware, minioClient, configConfig, fileUsecase)
+ modelHandler := v1.NewModelHandler(echo, baseHandler, logger, authMiddleware, modelUsecase, llmUsecase)
+ conversationHandler := v1.NewConversationHandler(echo, baseHandler, logger, authMiddleware, conversationUsecase)
+ mqConsumer, err := mq.NewMQConsumer(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ crawlerUsecase, err := usecase.NewCrawlerUsecase(logger, mqConsumer, cacheCache)
+ if err != nil {
+ return nil, err
+ }
+ crawlerHandler := v1.NewCrawlerHandler(echo, baseHandler, authMiddleware, logger, configConfig, crawlerUsecase, fileUsecase)
+ creationUsecase := usecase.NewCreationUsecase(logger, llmUsecase, modelUsecase)
+ creationHandler := v1.NewCreationHandler(echo, baseHandler, logger, creationUsecase)
+ statRepository := pg2.NewStatRepository(db, cacheCache)
+ statUseCase := usecase.NewStatUseCase(statRepository, nodeRepository, conversationRepository, appRepository, ipAddressRepo, geoRepo, authRepo, knowledgeBaseRepository, logger)
+ statHandler := v1.NewStatHandler(baseHandler, echo, statUseCase, logger, authMiddleware)
+ commentRepository := pg2.NewCommentRepository(db, logger)
+ commentUsecase := usecase.NewCommentUsecase(commentRepository, logger, nodeRepository, ipAddressRepo, authRepo)
+ commentHandler := v1.NewCommentHandler(echo, baseHandler, logger, authMiddleware, commentUsecase)
+ authUsecase, err := usecase.NewAuthUsecase(authRepo, logger, knowledgeBaseRepository, cacheCache)
+ if err != nil {
+ return nil, err
+ }
+ authV1Handler := v1.NewAuthV1Handler(echo, baseHandler, logger, authUsecase)
+ navUsecase := usecase.NewNavUsecase(navRepository, nodeRepository, ragRepository, logger)
+ navHandler := v1.NewNavHandler(baseHandler, echo, navUsecase, authMiddleware, logger)
+ apiHandlers := &v1.APIHandlers{
+ UserHandler: userHandler,
+ KnowledgeBaseHandler: knowledgeBaseHandler,
+ NodeHandler: nodeHandler,
+ AppHandler: appHandler,
+ FileHandler: fileHandler,
+ ModelHandler: modelHandler,
+ ConversationHandler: conversationHandler,
+ CrawlerHandler: crawlerHandler,
+ CreationHandler: creationHandler,
+ StatHandler: statHandler,
+ CommentHandler: commentHandler,
+ AuthV1Handler: authV1Handler,
+ NavHandler: navHandler,
+ }
+ shareNodeHandler := share.NewShareNodeHandler(baseHandler, echo, nodeUsecase, logger)
+ shareNavHandler := share.NewShareNavHandler(baseHandler, echo, navUsecase, logger)
+ shareAppHandler := share.NewShareAppHandler(echo, baseHandler, logger, appUsecase)
+ shareChatHandler := share.NewShareChatHandler(echo, baseHandler, logger, appUsecase, chatUsecase, authUsecase, conversationUsecase, modelUsecase)
+ sitemapUsecase := usecase.NewSitemapUsecase(nodeRepository, knowledgeBaseRepository, logger)
+ shareSitemapHandler := share.NewShareSitemapHandler(echo, baseHandler, sitemapUsecase, appUsecase, logger)
+ shareStatHandler := share.NewShareStatHandler(baseHandler, echo, statUseCase, logger)
+ shareCommentHandler := share.NewShareCommentHandler(echo, baseHandler, logger, commentUsecase, appUsecase)
+ shareAuthHandler := share.NewShareAuthHandler(echo, baseHandler, logger, knowledgeBaseUsecase, authUsecase)
+ shareConversationHandler := share.NewShareConversationHandler(baseHandler, echo, conversationUsecase, logger)
+ wechatRepository := pg2.NewWechatRepository(db, logger)
+ wechatServiceUsecase := usecase.NewWechatUsecase(logger, appUsecase, chatUsecase, wechatRepository, authRepo)
+ wecomUsecase := usecase.NewWecomUsecase(logger, cacheCache, appUsecase, chatUsecase, authRepo)
+ wechatAppUsecase := usecase.NewWechatAppUsecase(logger, appUsecase, chatUsecase, wechatRepository, authRepo, appRepository)
+ shareWechatHandler := share.NewShareWechatHandler(echo, baseHandler, logger, appUsecase, conversationUsecase, wechatServiceUsecase, wecomUsecase, wechatAppUsecase)
+ shareCaptchaHandler := share.NewShareCaptchaHandler(baseHandler, echo, logger)
+ openapiV1Handler := share.NewOpenapiV1Handler(echo, baseHandler, logger, authUsecase, appUsecase)
+ shareCommonHandler := share.NewShareCommonHandler(echo, baseHandler, logger, fileUsecase)
+ shareHandler := &share.ShareHandler{
+ ShareNodeHandler: shareNodeHandler,
+ ShareNavHandler: shareNavHandler,
+ ShareAppHandler: shareAppHandler,
+ ShareChatHandler: shareChatHandler,
+ ShareSitemapHandler: shareSitemapHandler,
+ ShareStatHandler: shareStatHandler,
+ ShareCommentHandler: shareCommentHandler,
+ ShareAuthHandler: shareAuthHandler,
+ ShareConversationHandler: shareConversationHandler,
+ ShareWechatHandler: shareWechatHandler,
+ ShareCaptchaHandler: shareCaptchaHandler,
+ OpenapiV1Handler: openapiV1Handler,
+ ShareCommonHandler: shareCommonHandler,
+ }
+ mcpRepository := pg2.NewMCPRepository(db, logger)
+ client, err := telemetry.NewClient(logger, knowledgeBaseRepository, modelUsecase, userUsecase, nodeRepository, conversationRepository, mcpRepository, configConfig)
+ if err != nil {
+ return nil, err
+ }
+ app := &App{
+ HTTPServer: httpServer,
+ Handlers: apiHandlers,
+ ShareHandlers: shareHandler,
+ Config: configConfig,
+ Logger: logger,
+ Telemetry: client,
+ }
+ return app, nil
+}
+
+// wire.go:
+
+type App struct {
+ HTTPServer *http.HTTPServer
+ Handlers *v1.APIHandlers
+ ShareHandlers *share.ShareHandler
+ Config *config.Config
+ Logger *log.Logger
+ Telemetry *telemetry.Client
+}
diff --git a/backend/cmd/consumer/main.go b/backend/cmd/consumer/main.go
new file mode 100644
index 0000000..431e586
--- /dev/null
+++ b/backend/cmd/consumer/main.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "context"
+)
+
+func main() {
+ app, err := createApp()
+ if err != nil {
+ panic(err)
+ }
+ if err := app.MQConsumer.StartConsumerHandlers(context.Background()); err != nil {
+ panic(err)
+ }
+ if err := app.MQConsumer.Close(); err != nil {
+ panic(err)
+ }
+}
diff --git a/backend/cmd/consumer/wire.go b/backend/cmd/consumer/wire.go
new file mode 100644
index 0000000..3a21abd
--- /dev/null
+++ b/backend/cmd/consumer/wire.go
@@ -0,0 +1,31 @@
+//go:build wireinject
+
+package main
+
+import (
+ "github.com/google/wire"
+
+ "github.com/chaitin/panda-wiki/config"
+ handler "github.com/chaitin/panda-wiki/handler/mq"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/mq"
+)
+
+func createApp() (*App, error) {
+ wire.Build(
+ wire.Struct(new(App), "*"),
+ wire.NewSet(
+ config.ProviderSet,
+ log.ProviderSet,
+ handler.ProviderSet,
+ ),
+ )
+ return &App{}, nil
+}
+
+type App struct {
+ MQConsumer mq.MQConsumer
+ Config *config.Config
+ MQHandlers *handler.MQHandlers
+ StatCronHandler *handler.CronHandler
+}
diff --git a/backend/cmd/consumer/wire_gen.go b/backend/cmd/consumer/wire_gen.go
new file mode 100644
index 0000000..ef18bd1
--- /dev/null
+++ b/backend/cmd/consumer/wire_gen.go
@@ -0,0 +1,113 @@
+// Code generated by Wire. DO NOT EDIT.
+
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
+//go:build !wireinject
+// +build !wireinject
+
+package main
+
+import (
+ "github.com/chaitin/panda-wiki/config"
+ mq3 "github.com/chaitin/panda-wiki/handler/mq"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/mq"
+ cache2 "github.com/chaitin/panda-wiki/repo/cache"
+ ipdb2 "github.com/chaitin/panda-wiki/repo/ipdb"
+ mq2 "github.com/chaitin/panda-wiki/repo/mq"
+ pg2 "github.com/chaitin/panda-wiki/repo/pg"
+ "github.com/chaitin/panda-wiki/store/cache"
+ "github.com/chaitin/panda-wiki/store/ipdb"
+ "github.com/chaitin/panda-wiki/store/pg"
+ "github.com/chaitin/panda-wiki/store/rag"
+ "github.com/chaitin/panda-wiki/store/s3"
+ "github.com/chaitin/panda-wiki/usecase"
+)
+
+// Injectors from wire.go:
+
+func createApp() (*App, error) {
+ configConfig, err := config.NewConfig()
+ if err != nil {
+ return nil, err
+ }
+ logger := log.NewLogger(configConfig)
+ mqConsumer, err := mq.NewMQConsumer(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ragService, err := rag.NewRAGService(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ db, err := pg.NewDB(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ nodeRepository := pg2.NewNodeRepository(db, logger)
+ knowledgeBaseRepository := pg2.NewKnowledgeBaseRepository(db, configConfig, logger, ragService)
+ conversationRepository := pg2.NewConversationRepository(db, logger)
+ modelRepository := pg2.NewModelRepository(db, logger)
+ promptRepo := pg2.NewPromptRepo(db, logger)
+ llmUsecase := usecase.NewLLMUsecase(configConfig, ragService, conversationRepository, knowledgeBaseRepository, nodeRepository, modelRepository, promptRepo, logger)
+ mqProducer, err := mq.NewMQProducer(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ragRepository := mq2.NewRAGRepository(mqProducer)
+ systemSettingRepo := pg2.NewSystemSettingRepo(db, logger)
+ modelUsecase := usecase.NewModelUsecase(modelRepository, nodeRepository, ragRepository, ragService, logger, configConfig, knowledgeBaseRepository, systemSettingRepo)
+ ragmqHandler, err := mq3.NewRAGMQHandler(mqConsumer, logger, ragService, nodeRepository, knowledgeBaseRepository, llmUsecase, modelUsecase)
+ if err != nil {
+ return nil, err
+ }
+ ragDocUpdateHandler, err := mq3.NewRagDocUpdateHandler(mqConsumer, logger, nodeRepository)
+ if err != nil {
+ return nil, err
+ }
+ cacheCache, err := cache.NewCache(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ statRepository := pg2.NewStatRepository(db, cacheCache)
+ appRepository := pg2.NewAppRepository(db, logger)
+ ipdbIPDB, err := ipdb.NewIPDB(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ipAddressRepo := ipdb2.NewIPAddressRepo(ipdbIPDB, logger)
+ geoRepo := cache2.NewGeoCache(cacheCache, db, logger)
+ authRepo := pg2.NewAuthRepo(db, logger, cacheCache)
+ statUseCase := usecase.NewStatUseCase(statRepository, nodeRepository, conversationRepository, appRepository, ipAddressRepo, geoRepo, authRepo, knowledgeBaseRepository, logger)
+ navRepository := pg2.NewNavRepository(db, logger)
+ userRepository := pg2.NewUserRepository(db, logger)
+ minioClient, err := s3.NewMinioClient(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ nodeUsecase := usecase.NewNodeUsecase(nodeRepository, navRepository, appRepository, ragRepository, userRepository, knowledgeBaseRepository, llmUsecase, ragService, logger, minioClient, modelRepository, authRepo, modelUsecase)
+ cronHandler, err := mq3.NewCronHandler(logger, statRepository, nodeRepository, statUseCase, nodeUsecase)
+ if err != nil {
+ return nil, err
+ }
+ mqHandlers := &mq3.MQHandlers{
+ RAGMQHandler: ragmqHandler,
+ RagDocUpdateHandler: ragDocUpdateHandler,
+ StatCronHandler: cronHandler,
+ }
+ app := &App{
+ MQConsumer: mqConsumer,
+ Config: configConfig,
+ MQHandlers: mqHandlers,
+ StatCronHandler: cronHandler,
+ }
+ return app, nil
+}
+
+// wire.go:
+
+type App struct {
+ MQConsumer mq.MQConsumer
+ Config *config.Config
+ MQHandlers *mq3.MQHandlers
+ StatCronHandler *mq3.CronHandler
+}
diff --git a/backend/cmd/migrate/main.go b/backend/cmd/migrate/main.go
new file mode 100644
index 0000000..ca13e82
--- /dev/null
+++ b/backend/cmd/migrate/main.go
@@ -0,0 +1,11 @@
+package main
+
+func main() {
+ app, err := createApp()
+ if err != nil {
+ panic(err)
+ }
+ if err := app.MigrationManager.Execute(); err != nil {
+ panic(err)
+ }
+}
diff --git a/backend/cmd/migrate/wire.go b/backend/cmd/migrate/wire.go
new file mode 100644
index 0000000..4c8cd0f
--- /dev/null
+++ b/backend/cmd/migrate/wire.go
@@ -0,0 +1,28 @@
+//go:build wireinject
+
+package main
+
+import (
+ "github.com/google/wire"
+
+ "github.com/chaitin/panda-wiki/config"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/migration"
+)
+
+func createApp() (*App, error) {
+ wire.Build(
+ wire.Struct(new(App), "*"),
+ wire.NewSet(
+ config.ProviderSet,
+ log.ProviderSet,
+ migration.ProviderSet,
+ ),
+ )
+ return &App{}, nil
+}
+
+type App struct {
+ Config *config.Config
+ MigrationManager *migration.Manager
+}
diff --git a/backend/cmd/migrate/wire_gen.go b/backend/cmd/migrate/wire_gen.go
new file mode 100644
index 0000000..52a2be5
--- /dev/null
+++ b/backend/cmd/migrate/wire_gen.go
@@ -0,0 +1,100 @@
+// Code generated by Wire. DO NOT EDIT.
+
+//go:generate go run -mod=mod github.com/google/wire/cmd/wire
+//go:build !wireinject
+// +build !wireinject
+
+package main
+
+import (
+ "github.com/chaitin/panda-wiki/config"
+ "github.com/chaitin/panda-wiki/log"
+ "github.com/chaitin/panda-wiki/migration"
+ "github.com/chaitin/panda-wiki/migration/fns"
+ "github.com/chaitin/panda-wiki/mq"
+ cache2 "github.com/chaitin/panda-wiki/repo/cache"
+ mq2 "github.com/chaitin/panda-wiki/repo/mq"
+ pg2 "github.com/chaitin/panda-wiki/repo/pg"
+ "github.com/chaitin/panda-wiki/store/cache"
+ "github.com/chaitin/panda-wiki/store/pg"
+ "github.com/chaitin/panda-wiki/store/rag"
+ "github.com/chaitin/panda-wiki/store/s3"
+ "github.com/chaitin/panda-wiki/usecase"
+)
+
+// Injectors from wire.go:
+
+func createApp() (*App, error) {
+ configConfig, err := config.NewConfig()
+ if err != nil {
+ return nil, err
+ }
+ db, err := pg.NewDB(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ logger := log.NewLogger(configConfig)
+ nodeRepository := pg2.NewNodeRepository(db, logger)
+ navRepository := pg2.NewNavRepository(db, logger)
+ appRepository := pg2.NewAppRepository(db, logger)
+ mqProducer, err := mq.NewMQProducer(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ ragRepository := mq2.NewRAGRepository(mqProducer)
+ userRepository := pg2.NewUserRepository(db, logger)
+ ragService, err := rag.NewRAGService(configConfig, logger)
+ if err != nil {
+ return nil, err
+ }
+ knowledgeBaseRepository := pg2.NewKnowledgeBaseRepository(db, configConfig, logger, ragService)
+ conversationRepository := pg2.NewConversationRepository(db, logger)
+ modelRepository := pg2.NewModelRepository(db, logger)
+ promptRepo := pg2.NewPromptRepo(db, logger)
+ llmUsecase := usecase.NewLLMUsecase(configConfig, ragService, conversationRepository, knowledgeBaseRepository, nodeRepository, modelRepository, promptRepo, logger)
+ minioClient, err := s3.NewMinioClient(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ cacheCache, err := cache.NewCache(configConfig)
+ if err != nil {
+ return nil, err
+ }
+ authRepo := pg2.NewAuthRepo(db, logger, cacheCache)
+ systemSettingRepo := pg2.NewSystemSettingRepo(db, logger)
+ modelUsecase := usecase.NewModelUsecase(modelRepository, nodeRepository, ragRepository, ragService, logger, configConfig, knowledgeBaseRepository, systemSettingRepo)
+ nodeUsecase := usecase.NewNodeUsecase(nodeRepository, navRepository, appRepository, ragRepository, userRepository, knowledgeBaseRepository, llmUsecase, ragService, logger, minioClient, modelRepository, authRepo, modelUsecase)
+ kbRepo := cache2.NewKBRepo(cacheCache)
+ knowledgeBaseUsecase, err := usecase.NewKnowledgeBaseUsecase(knowledgeBaseRepository, nodeRepository, navRepository, ragRepository, userRepository, ragService, kbRepo, logger, configConfig)
+ if err != nil {
+ return nil, err
+ }
+ migrationNodeVersion := fns.NewMigrationNodeVersion(logger, nodeUsecase, knowledgeBaseUsecase, ragRepository)
+ migrationCreateBotAuth := fns.NewMigrationCreateBotAuth(logger)
+ migrationFixGroupIds := fns.NewMigrationFixGroupIds(logger, ragRepository)
+ migrationUpdateNodeStatusUnreleased := fns.NewMigrationUpdateNodeStatusUnreleased(logger)
+ migrationCreateFirstNavs := fns.NewMigrationCreateFirstNavs(logger)
+ migrationFuncs := &migration.MigrationFuncs{
+ NodeMigration: migrationNodeVersion,
+ BotAuthMigration: migrationCreateBotAuth,
+ FixGroupIdsMigration: migrationFixGroupIds,
+ UpdateNodeStatusUnreleasedMigration: migrationUpdateNodeStatusUnreleased,
+ CreateFirstNavs: migrationCreateFirstNavs,
+ }
+ manager, err := migration.NewManager(db, logger, migrationFuncs)
+ if err != nil {
+ return nil, err
+ }
+ app := &App{
+ Config: configConfig,
+ MigrationManager: manager,
+ }
+ return app, nil
+}
+
+// wire.go:
+
+type App struct {
+ Config *config.Config
+ MigrationManager *migration.Manager
+}
diff --git a/backend/config/config.go b/backend/config/config.go
new file mode 100644
index 0000000..58d5420
--- /dev/null
+++ b/backend/config/config.go
@@ -0,0 +1,251 @@
+package config
+
+import (
+ "fmt"
+ "os"
+ "strconv"
+
+ "github.com/spf13/viper"
+)
+
+type Config struct {
+ Log LogConfig `mapstructure:"log"`
+ HTTP HTTPConfig `mapstructure:"http"`
+ AdminPassword string `mapstructure:"admin_password"`
+ PG PGConfig `mapstructure:"pg"`
+ MQ MQConfig `mapstructure:"mq"`
+ RAG RAGConfig `mapstructure:"rag"`
+ Redis RedisConfig `mapstructure:"redis"`
+ Auth AuthConfig `mapstructure:"auth"`
+ S3 S3Config `mapstructure:"s3"`
+ Sentry SentryConfig `mapstructure:"sentry"`
+ CaddyAPI string `mapstructure:"caddy_api"`
+ SubnetPrefix string `mapstructure:"subnet_prefix"`
+}
+
+type LogConfig struct {
+ Level int `mapstructure:"level"`
+}
+
+type HTTPConfig struct {
+ Port int `mapstructure:"port"`
+}
+
+type PGConfig struct {
+ DSN string `mapstructure:"dsn"`
+}
+
+type MQConfig struct {
+ Type string `mapstructure:"type"`
+ NATS NATSConfig `mapstructure:"nats"`
+}
+
+type NATSConfig struct {
+ Server string `mapstructure:"server"`
+ User string `mapstructure:"user"`
+ Password string `mapstructure:"password"`
+}
+
+type RAGConfig struct {
+ Provider string `mapstructure:"provider"`
+ CTRAG CTRAGConfig `mapstructure:"ct_rag"`
+}
+
+type CTRAGConfig struct {
+ BaseURL string `mapstructure:"base_url"`
+ APIKey string `mapstructure:"api_key"`
+}
+
+type RedisConfig struct {
+ Addr string `mapstructure:"addr"`
+ Password string `mapstructure:"password"`
+}
+
+type AuthConfig struct {
+ Type string `mapstructure:"type"`
+ JWT JWTConfig `mapstructure:"jwt"`
+}
+
+type JWTConfig struct {
+ Secret string `mapstructure:"secret"`
+}
+
+type S3Config struct {
+ Endpoint string `mapstructure:"endpoint"`
+ AccessKey string `mapstructure:"access_key"`
+ SecretKey string `mapstructure:"secret_key"`
+}
+
+type SentryConfig struct {
+ Enabled bool `mapstructure:"enabled"`
+ DSN string `mapstructure:"dsn"`
+}
+
+func NewConfig() (*Config, error) {
+ // set default config
+ SUBNET_PREFIX := os.Getenv("SUBNET_PREFIX")
+ if SUBNET_PREFIX == "" {
+ SUBNET_PREFIX = "169.254.15"
+ }
+ defaultConfig := &Config{
+ Log: LogConfig{
+ Level: 0,
+ },
+ AdminPassword: "",
+ HTTP: HTTPConfig{
+ Port: 8000,
+ },
+ PG: PGConfig{
+ DSN: "host=panda-wiki-postgres user=panda-wiki password=panda-wiki-secret dbname=panda-wiki port=5432 sslmode=disable TimeZone=Asia/Shanghai",
+ },
+ MQ: MQConfig{
+ Type: "nats",
+ NATS: NATSConfig{
+ Server: fmt.Sprintf("nats://%s.13:4222", SUBNET_PREFIX),
+ User: "panda-wiki",
+ Password: "",
+ },
+ },
+ RAG: RAGConfig{
+ Provider: "ct",
+ CTRAG: CTRAGConfig{
+ BaseURL: fmt.Sprintf("http://%s.18:5050", SUBNET_PREFIX),
+ APIKey: "sk-1234567890",
+ },
+ },
+ Redis: RedisConfig{
+ Addr: "panda-wiki-redis:6379",
+ Password: "",
+ },
+ Auth: AuthConfig{
+ Type: "jwt",
+ JWT: JWTConfig{Secret: ""},
+ },
+ S3: S3Config{
+ Endpoint: "panda-wiki-minio:9000",
+ AccessKey: "s3panda-wiki",
+ SecretKey: "",
+ },
+ Sentry: SentryConfig{
+ Enabled: true,
+ DSN: "https://2a4cff1ae04b624ffc72663f523024ff@sentry.baizhi.cloud/4",
+ },
+ CaddyAPI: "/app/run/caddy-admin.sock",
+ SubnetPrefix: "169.254.15",
+ }
+
+ viper.AddConfigPath(".")
+ viper.AddConfigPath("./config")
+ viper.SetConfigName("config")
+ viper.SetConfigType("yml")
+
+ // try to read config file
+ if err := viper.ReadInConfig(); err != nil {
+ if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
+ // if config file not found, return default config
+ return nil, err
+ }
+ }
+
+ // merge config file values to default config
+ if err := viper.Unmarshal(defaultConfig); err != nil {
+ return nil, err
+ }
+
+ // finally, override sensitive info with env variables
+ overrideWithEnv(defaultConfig)
+
+ return defaultConfig, nil
+}
+
+// overrideWithEnv override sensitive info with env variables
+func overrideWithEnv(c *Config) {
+ if env := os.Getenv("POSTGRES_PASSWORD"); env != "" {
+ c.PG.DSN = fmt.Sprintf("host=panda-wiki-postgres user=panda-wiki password=%s dbname=panda-wiki port=5432 sslmode=disable TimeZone=Asia/Shanghai", env)
+ }
+ if env := os.Getenv("NATS_PASSWORD"); env != "" {
+ c.MQ.NATS.Password = env
+ }
+ if env := os.Getenv("REDIS_PASSWORD"); env != "" {
+ c.Redis.Password = env
+ }
+ if env := os.Getenv("JWT_SECRET"); env != "" {
+ c.Auth.JWT.Secret = env
+ }
+ if env := os.Getenv("S3_SECRET_KEY"); env != "" {
+ c.S3.SecretKey = env
+ }
+ if env := os.Getenv("ADMIN_PASSWORD"); env != "" {
+ c.AdminPassword = env
+ }
+ if env := os.Getenv("SUBNET_PREFIX"); env != "" {
+ c.SubnetPrefix = env
+ }
+ // pg
+ if env := os.Getenv("PG_DSN"); env != "" {
+ c.PG.DSN = env
+ }
+ // nats
+ if env := os.Getenv("MQ_NATS_SERVER"); env != "" {
+ c.MQ.NATS.Server = env
+ }
+ // rag
+ if env := os.Getenv("RAG_CT_RAG_BASE_URL"); env != "" {
+ c.RAG.CTRAG.BaseURL = env
+ }
+ // redis
+ if env := os.Getenv("REDIS_ADDR"); env != "" {
+ c.Redis.Addr = env
+ }
+ // s3
+ if env := os.Getenv("S3_ENDPOINT"); env != "" {
+ c.S3.Endpoint = env
+ }
+ // sentry
+ if env := os.Getenv("SENTRY_ENABLED"); env != "" {
+ c.Sentry.Enabled = env == "true"
+ }
+ if env := os.Getenv("SENTRY_DSN"); env != "" {
+ c.Sentry.DSN = env
+ }
+ // caddy api
+ if env := os.Getenv("CADDY_API"); env != "" {
+ c.CaddyAPI = env
+ }
+ // log level
+ if env := os.Getenv("LOG_LEVEL"); env != "" {
+ if i, err := strconv.Atoi(env); err == nil {
+ // -4: debug
+ // 0: info
+ // 4: warn
+ // 8: error
+ c.Log.Level = i
+ } else {
+ fmt.Fprintf(os.Stderr, "Invalid log level: %s with err: %s\n", env, err)
+ }
+ }
+}
+
+func (*Config) GetString(key string) string {
+ return viper.GetString(key)
+}
+
+func (*Config) GetInt(key string) int {
+ return viper.GetInt(key)
+}
+
+func (*Config) GetUint64(key string) uint64 {
+ return viper.GetUint64(key)
+}
+
+func (*Config) GetBool(key string) bool {
+ return viper.GetBool(key)
+}
+
+func (*Config) GetStringSlice(key string) []string {
+ return viper.GetStringSlice(key)
+}
+
+func (*Config) GetFloat64(key string) float64 {
+ return viper.GetFloat64(key)
+}
diff --git a/backend/config/provider.go b/backend/config/provider.go
new file mode 100644
index 0000000..44edf35
--- /dev/null
+++ b/backend/config/provider.go
@@ -0,0 +1,5 @@
+package config
+
+import "github.com/google/wire"
+
+var ProviderSet = wire.NewSet(NewConfig)
diff --git a/backend/consts/admin.go b/backend/consts/admin.go
new file mode 100644
index 0000000..ae12689
--- /dev/null
+++ b/backend/consts/admin.go
@@ -0,0 +1,18 @@
+package consts
+
+type UserKBPermission string
+
+const (
+ UserKBPermissionNull UserKBPermission = "" // 无权限
+ UserKBPermissionNotNull UserKBPermission = "not null" // 有权限
+ UserKBPermissionFullControl UserKBPermission = "full_control" // 完全控制
+ UserKBPermissionDocManage UserKBPermission = "doc_manage" // 文档管理
+ UserKBPermissionDataOperate UserKBPermission = "data_operate" // 数据运营
+)
+
+type UserRole string
+
+const (
+ UserRoleAdmin UserRole = "admin" // 管理员
+ UserRoleUser UserRole = "user" // 普通用户
+)
diff --git a/backend/consts/app.go b/backend/consts/app.go
new file mode 100644
index 0000000..4ba3821
--- /dev/null
+++ b/backend/consts/app.go
@@ -0,0 +1,24 @@
+package consts
+
+type CopySetting string
+
+const (
+ CopySettingNone CopySetting = "" // 无限制
+ CopySettingAppend CopySetting = "append" // 增加内容尾巴
+ CopySettingDisabled CopySetting = "disabled" // 禁止复制内容
+)
+
+type WatermarkSetting string
+
+const (
+ WatermarkDisabled WatermarkSetting = "" // 未开启水印
+ WatermarkHidden WatermarkSetting = "hidden" // 隐形水印
+ WatermarkVisible WatermarkSetting = "visible" // 显性水印
+)
+
+type HomePageSetting string
+
+const (
+ HomePageSettingDoc HomePageSetting = "doc" // 文档页面
+ HomePageSettingCustom HomePageSetting = "custom" // 自定义首页
+)
diff --git a/backend/consts/auth.go b/backend/consts/auth.go
new file mode 100644
index 0000000..da4dbfc
--- /dev/null
+++ b/backend/consts/auth.go
@@ -0,0 +1,64 @@
+package consts
+
+type SourceType string
+
+var (
+ BotSourceTypes = []SourceType{SourceTypeWidget, SourceTypeDingtalkBot, SourceTypeFeishuBot, SourceTypeLarkBot, SourceTypeWechatBot, SourceTypeWechatServiceBot, SourceTypeDiscordBot, SourceTypeWechatOfficialAccount}
+)
+
+const (
+ SourceTypeDingTalk SourceType = "dingtalk"
+ SourceTypeFeishu SourceType = "feishu"
+ SourceTypeWeCom SourceType = "wecom"
+ SourceTypeOAuth SourceType = "oauth"
+ SourceTypeGitHub SourceType = "github"
+ SourceTypeCAS SourceType = "cas"
+ SourceTypeLDAP SourceType = "ldap"
+ SourceTypeWidget SourceType = "widget"
+ SourceTypeDingtalkBot SourceType = "dingtalk_bot"
+ SourceTypeFeishuBot SourceType = "feishu_bot"
+ SourceTypeLarkBot SourceType = "lark_bot"
+ SourceTypeWechatBot SourceType = "wechat_bot"
+ SourceTypeWecomAIBot SourceType = "wecom_ai_bot"
+ SourceTypeWechatServiceBot SourceType = "wechat_service_bot"
+ SourceTypeDiscordBot SourceType = "discord_bot"
+ SourceTypeWechatOfficialAccount SourceType = "wechat_official_account"
+ SourceTypeOpenAIAPI SourceType = "openai_api"
+ SourceTypeMcpServer SourceType = "mcp_server"
+)
+
+func (s SourceType) Name() string {
+ switch s {
+ case SourceTypeWidget:
+ return "网页挂件机器人"
+ case SourceTypeDingtalkBot:
+ return "钉钉机器人"
+ case SourceTypeFeishuBot:
+ return "飞书机器人"
+ case SourceTypeLarkBot:
+ return "Lark机器人"
+ case SourceTypeWechatBot:
+ return "企业微信机器人"
+ case SourceTypeWecomAIBot:
+ return "企业微信智能机器人"
+ case SourceTypeWechatServiceBot:
+ return "企业微信客服"
+ case SourceTypeDiscordBot:
+ return "Discord 机器人"
+ case SourceTypeWechatOfficialAccount:
+ return "微信公众号"
+ case SourceTypeMcpServer:
+ return "MCP 服务器"
+ default:
+ return ""
+ }
+}
+
+type AuthType string
+
+const (
+ AuthTypeNull AuthType = "" // 无认证
+ AuthTypeSimple AuthType = "simple" // 简单口令
+ AuthTypeEnterprise AuthType = "enterprise" // 企业认证
+
+)
diff --git a/backend/consts/captcha.go b/backend/consts/captcha.go
new file mode 100644
index 0000000..9db6c73
--- /dev/null
+++ b/backend/consts/captcha.go
@@ -0,0 +1,6 @@
+package consts
+
+type RedeemCaptchaReq struct {
+ Token string `json:"token"`
+ Solutions []int64 `json:"solutions"`
+}
diff --git a/backend/consts/consts.go b/backend/consts/consts.go
new file mode 100644
index 0000000..cedc0bf
--- /dev/null
+++ b/backend/consts/consts.go
@@ -0,0 +1,10 @@
+package consts
+
+type StatDay int
+
+const (
+ StatDay1 StatDay = 1
+ StatDay7 StatDay = 7
+ StatDay30 StatDay = 30
+ StatDay90 StatDay = 90
+)
diff --git a/backend/consts/contribute.go b/backend/consts/contribute.go
new file mode 100644
index 0000000..6602888
--- /dev/null
+++ b/backend/consts/contribute.go
@@ -0,0 +1,16 @@
+package consts
+
+type ContributeStatus string
+
+const (
+ ContributeStatusPending ContributeStatus = "pending"
+ ContributeStatusApproved ContributeStatus = "approved"
+ ContributeStatusRejected ContributeStatus = "rejected"
+)
+
+type ContributeType string
+
+const (
+ ContributeTypeAdd ContributeType = "add"
+ ContributeTypeEdit ContributeType = "edit"
+)
diff --git a/backend/consts/crawler.go b/backend/consts/crawler.go
new file mode 100644
index 0000000..5c5e31f
--- /dev/null
+++ b/backend/consts/crawler.go
@@ -0,0 +1,10 @@
+package consts
+
+type CrawlerStatus string
+
+const (
+ CrawlerStatusPending CrawlerStatus = "pending"
+ CrawlerStatusInProcess CrawlerStatus = "in_process"
+ CrawlerStatusCompleted CrawlerStatus = "completed"
+ CrawlerStatusFailed CrawlerStatus = "failed"
+)
diff --git a/backend/consts/license.go b/backend/consts/license.go
new file mode 100644
index 0000000..6149b38
--- /dev/null
+++ b/backend/consts/license.go
@@ -0,0 +1,26 @@
+package consts
+
+import (
+ "github.com/labstack/echo/v4"
+)
+
+type contextKey string
+
+const ContextKeyEdition contextKey = "edition"
+
+type LicenseEdition int32
+
+const (
+ LicenseEditionFree LicenseEdition = 0 // 开源版
+ LicenseEditionProfession LicenseEdition = 1 // 专业版
+ LicenseEditionEnterprise LicenseEdition = 2 // 企业版
+ LicenseEditionBusiness LicenseEdition = 3 // 商业版
+)
+
+func GetLicenseEdition(c echo.Context) LicenseEdition {
+ edition, ok := c.Get("edition").(LicenseEdition)
+ if !ok {
+ return LicenseEditionFree
+ }
+ return edition
+}
diff --git a/backend/consts/model.go b/backend/consts/model.go
new file mode 100644
index 0000000..0085e66
--- /dev/null
+++ b/backend/consts/model.go
@@ -0,0 +1,39 @@
+package consts
+
+type AutoModeDefaultModel string
+
+const (
+ AutoModeDefaultChatModel AutoModeDefaultModel = "deepseek-chat"
+ AutoModeDefaultEmbeddingModel AutoModeDefaultModel = "bge-m3"
+ AutoModeDefaultRerankModel AutoModeDefaultModel = "bge-reranker-v2-m3"
+ AutoModeDefaultAnalysisModel AutoModeDefaultModel = "qwen2.5-3b-instruct"
+ AutoModeDefaultAnalysisVLModel AutoModeDefaultModel = "qwen-vl-max-latest"
+)
+
+func GetAutoModeDefaultModel(modelType string) string {
+ switch modelType {
+ case "chat":
+ return string(AutoModeDefaultChatModel)
+ case "embedding":
+ return string(AutoModeDefaultEmbeddingModel)
+ case "rerank":
+ return string(AutoModeDefaultRerankModel)
+ case "analysis":
+ return string(AutoModeDefaultAnalysisModel)
+ case "analysis-vl":
+ return string(AutoModeDefaultAnalysisVLModel)
+ default:
+ return string(AutoModeDefaultChatModel)
+ }
+}
+
+type ModelSettingMode string
+
+const (
+ ModelSettingModeManual ModelSettingMode = "manual"
+ ModelSettingModeAuto ModelSettingMode = "auto"
+)
+
+const (
+ AutoModeBaseURL = "https://model-square.app.baizhi.cloud/v1"
+)
diff --git a/backend/consts/node.go b/backend/consts/node.go
new file mode 100644
index 0000000..966ffbf
--- /dev/null
+++ b/backend/consts/node.go
@@ -0,0 +1,27 @@
+package consts
+
+type NodeAccessPerm string
+
+const (
+ NodeAccessPermOpen NodeAccessPerm = "open" // 完全开放
+ NodeAccessPermPartial NodeAccessPerm = "partial" // 部分开放
+ NodeAccessPermClosed NodeAccessPerm = "closed" // 完全禁止
+)
+
+type NodePermName string
+
+const (
+ NodePermNameVisible NodePermName = "visible" // 导航内可见
+ NodePermNameVisitable NodePermName = "visitable" // 可被访问
+ NodePermNameAnswerable NodePermName = "answerable" // 可被问答
+)
+
+type NodeRagInfoStatus string
+
+const (
+ NodeRagStatusPending NodeRagInfoStatus = "PENDING" // 等待处理
+ NodeRagStatusRunning NodeRagInfoStatus = "RUNNING" // 正在进行处理(文本分割、向量化等)
+ NodeRagStatusFailed NodeRagInfoStatus = "FAILED" // 处理失败
+ NodeRagStatusSucceeded NodeRagInfoStatus = "SUCCEEDED" // 处理成功
+ NodeRagStatusReindexing NodeRagInfoStatus = "REINDEX" // 重新索引中
+)
diff --git a/backend/consts/parse.go b/backend/consts/parse.go
new file mode 100644
index 0000000..67d38b1
--- /dev/null
+++ b/backend/consts/parse.go
@@ -0,0 +1,43 @@
+package consts
+
+type CrawlerSource string
+
+const (
+ // CrawlerSourceUrl key或url形式 直接走parse接口
+ CrawlerSourceUrl CrawlerSource = "url"
+ CrawlerSourceRSS CrawlerSource = "rss"
+ CrawlerSourceSitemap CrawlerSource = "sitemap"
+ CrawlerSourceNotion CrawlerSource = "notion"
+ CrawlerSourceFeishu CrawlerSource = "feishu"
+ CrawlerSourceDingtalk CrawlerSource = "dingtalk"
+
+ // CrawlerSourceFile file形式 需要先走upload接口先上传文件
+ CrawlerSourceFile CrawlerSource = "file"
+ CrawlerSourceEpub CrawlerSource = "epub"
+ CrawlerSourceYuque CrawlerSource = "yuque"
+ CrawlerSourceSiyuan CrawlerSource = "siyuan"
+ CrawlerSourceMindoc CrawlerSource = "mindoc"
+ CrawlerSourceWikijs CrawlerSource = "wikijs"
+ CrawlerSourceConfluence CrawlerSource = "confluence"
+)
+
+type CrawlerSourceType string
+
+const (
+ CrawlerSourceTypeFile CrawlerSourceType = "file"
+ CrawlerSourceTypeUrl CrawlerSourceType = "url"
+ CrawlerSourceTypeKey CrawlerSourceType = "key"
+)
+
+func (c CrawlerSource) Type() CrawlerSourceType {
+ switch c {
+ case CrawlerSourceNotion, CrawlerSourceFeishu, CrawlerSourceDingtalk:
+ return CrawlerSourceTypeKey
+ case CrawlerSourceUrl, CrawlerSourceRSS, CrawlerSourceSitemap:
+ return CrawlerSourceTypeUrl
+ case CrawlerSourceFile, CrawlerSourceEpub, CrawlerSourceYuque, CrawlerSourceSiyuan, CrawlerSourceMindoc, CrawlerSourceWikijs, CrawlerSourceConfluence:
+ return CrawlerSourceTypeFile
+ default:
+ return ""
+ }
+}
diff --git a/backend/consts/system_setting.go b/backend/consts/system_setting.go
new file mode 100644
index 0000000..cef1543
--- /dev/null
+++ b/backend/consts/system_setting.go
@@ -0,0 +1,8 @@
+package consts
+
+type SystemSettingKey string
+
+const (
+ SystemSettingModelMode SystemSettingKey = "model_setting_mode"
+ SystemSettingUpload SystemSettingKey = "upload"
+)
diff --git a/backend/docs/docs.go b/backend/docs/docs.go
new file mode 100644
index 0000000..f3ed3d3
--- /dev/null
+++ b/backend/docs/docs.go
@@ -0,0 +1,9802 @@
+// 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": {
+ "/api/v1/app": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update app",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Update app",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "app",
+ "name": "app",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateAppReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Delete app",
+ "consumes": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Delete app",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "app id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/app/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get app detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Get app detail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "type",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.AppDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "删除授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "删除授权信息",
+ "operationId": "v1-OpenAuthDelete",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/get": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "获取授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "获取授权信息",
+ "operationId": "v1-OpenAuthGet",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "dingtalk",
+ "feishu",
+ "wecom",
+ "oauth",
+ "github",
+ "cas",
+ "ldap",
+ "widget",
+ "dingtalk_bot",
+ "feishu_bot",
+ "lark_bot",
+ "wechat_bot",
+ "wecom_ai_bot",
+ "wechat_service_bot",
+ "discord_bot",
+ "wechat_official_account",
+ "openai_api",
+ "mcp_server"
+ ],
+ "type": "string",
+ "x-enum-varnames": [
+ "SourceTypeDingTalk",
+ "SourceTypeFeishu",
+ "SourceTypeWeCom",
+ "SourceTypeOAuth",
+ "SourceTypeGitHub",
+ "SourceTypeCAS",
+ "SourceTypeLDAP",
+ "SourceTypeWidget",
+ "SourceTypeDingtalkBot",
+ "SourceTypeFeishuBot",
+ "SourceTypeLarkBot",
+ "SourceTypeWechatBot",
+ "SourceTypeWecomAIBot",
+ "SourceTypeWechatServiceBot",
+ "SourceTypeDiscordBot",
+ "SourceTypeWechatOfficialAccount",
+ "SourceTypeOpenAIAPI",
+ "SourceTypeMcpServer"
+ ],
+ "name": "source_type",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/set": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "设置授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "设置授权信息",
+ "operationId": "v1-OpenAuthSet",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthSetReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/comment": {
+ "get": {
+ "description": "GetCommentModeratedList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "comment"
+ ],
+ "summary": "GetCommentModeratedList",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "enum": [
+ -1,
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "format": "int32",
+ "x-enum-varnames": [
+ "CommentStatusReject",
+ "CommentStatusPending",
+ "CommentStatusAccepted"
+ ],
+ "name": "status",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "conversationList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CommentLists"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/comment/list": {
+ "delete": {
+ "description": "DeleteCommentList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "comment"
+ ],
+ "summary": "DeleteCommentList",
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "ids",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "total",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation": {
+ "get": {
+ "description": "get conversation list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "conversation"
+ ],
+ "summary": "get conversation list",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "app_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "remote_ip",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "subject",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ConversationListItems"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/detail": {
+ "get": {
+ "description": "get conversation detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "conversation"
+ ],
+ "summary": "get conversation detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ConversationDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/message/detail": {
+ "get": {
+ "description": "Get message detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Message"
+ ],
+ "summary": "Get message detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ConversationMessage"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/message/list": {
+ "get": {
+ "description": "GetMessageFeedBackList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Message"
+ ],
+ "summary": "GetMessageFeedBackList",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "MessageList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.PaginatedResult-array_domain_ConversationMessageListItem"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/export": {
+ "post": {
+ "description": "CrawlerExport",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "CrawlerExport",
+ "parameters": [
+ {
+ "description": "Scrape",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerExportReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerExportResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/parse": {
+ "post": {
+ "description": "解析文档树",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "解析文档树",
+ "parameters": [
+ {
+ "description": "Scrape",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerParseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerParseResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/result": {
+ "get": {
+ "description": "Retrieve the result of a previously started scraping task",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "Get Crawler Result",
+ "parameters": [
+ {
+ "description": "Crawler Result Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerResultReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerResultResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/results": {
+ "post": {
+ "description": "Retrieve the results of a previously started scraping task",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "Get Crawler Results",
+ "parameters": [
+ {
+ "description": "Crawler Results Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerResultsReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerResultsResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/creation/tab-complete": {
+ "post": {
+ "description": "Tab-based document completion similar to AI coding's FIM (Fill in Middle)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "creation"
+ ],
+ "summary": "Tab-based document completion",
+ "parameters": [
+ {
+ "description": "tab completion request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CompleteReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/creation/text": {
+ "post": {
+ "description": "Text creation",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "creation"
+ ],
+ "summary": "Text creation",
+ "parameters": [
+ {
+ "description": "text creation request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.TextReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload": {
+ "post": {
+ "description": "Upload File",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload File",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "formData"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.ObjectUploadResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload/anydoc": {
+ "post": {
+ "description": "Upload Anydoc File",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload Anydoc File",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "File Path",
+ "name": "path",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.AnydocUploadResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload/url": {
+ "post": {
+ "description": "Upload File By Url",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload File By Url",
+ "parameters": [
+ {
+ "description": "Request Body",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UploadByUrlReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ObjectUploadResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base": {
+ "post": {
+ "description": "CreateKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "CreateKnowledgeBase",
+ "parameters": [
+ {
+ "description": "CreateKnowledgeBase Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateKnowledgeBaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetKnowledgeBaseDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKnowledgeBaseDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.KnowledgeBaseDetail"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "put": {
+ "description": "UpdateKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "UpdateKnowledgeBase",
+ "parameters": [
+ {
+ "description": "UpdateKnowledgeBase Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateKnowledgeBaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "DeleteKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "DeleteKnowledgeBase",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/list": {
+ "get": {
+ "description": "GetKnowledgeBaseList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKnowledgeBaseList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.KnowledgeBaseListItem"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/release": {
+ "post": {
+ "description": "CreateKBRelease",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "CreateKBRelease",
+ "parameters": [
+ {
+ "description": "CreateKBRelease Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateKBReleaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/release/list": {
+ "get": {
+ "description": "GetKBReleaseList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKBReleaseList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.GetKBReleaseListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Remove user from knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserDelete",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "user_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/invite": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Invite user to knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserInvite",
+ "parameters": [
+ {
+ "description": "Invite User Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.KBUserInviteReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "KBUserList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.KBUserListItemResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/update": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update user permission in knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserUpdate",
+ "parameters": [
+ {
+ "description": "Update User Permission Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.KBUserUpdateReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model": {
+ "put": {
+ "description": "update model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "parameters": [
+ {
+ "description": "update model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "post": {
+ "description": "create model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "create model",
+ "parameters": [
+ {
+ "description": "create model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/check": {
+ "post": {
+ "description": "check model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "check model",
+ "parameters": [
+ {
+ "description": "check model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/list": {
+ "get": {
+ "description": "get model list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get model list",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelListItem"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/mode-setting": {
+ "get": {
+ "description": "get current model mode setting including mode, API key and chat model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get model mode setting",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ModelModeSetting"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/provider/supported": {
+ "post": {
+ "description": "get provider supported model list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get provider supported model list",
+ "parameters": [
+ {
+ "description": "get supported model list request",
+ "name": "params",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.GetProviderModelListReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.GetProviderModelListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/switch-mode": {
+ "post": {
+ "description": "switch model mode between manual and auto",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "switch mode",
+ "parameters": [
+ {
+ "description": "switch mode request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.SwitchModeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.SwitchModeResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/add": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Add Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "添加分栏",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavAddReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "DeleteNav Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "删除栏目",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Nav List",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "获取分栏列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.NavListResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "移动栏目",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavMoveReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/update": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "更新栏目信息",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavUpdateReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Create Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Create Node",
+ "parameters": [
+ {
+ "description": "Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/action": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Node Action",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Node Action",
+ "parameters": [
+ {
+ "description": "Action",
+ "name": "action",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeActionReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/batch_move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Batch Move Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Batch Move Node",
+ "parameters": [
+ {
+ "description": "Batch Move Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.BatchMoveReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node Detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node Detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "format",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update Node Detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Update Node Detail",
+ "parameters": [
+ {
+ "description": "Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node List",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node List",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "nav_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "search",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeListItemResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/list/group/nav": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get unpublished or unstudied document list grouped by nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node List Grouped by Nav",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "nav_ids",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "search",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "released",
+ "unpublished",
+ "unstudied"
+ ],
+ "type": "string",
+ "name": "status",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Move Node",
+ "parameters": [
+ {
+ "description": "Move Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.MoveNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/move/nav": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move node (and all its descendants if folder) to a different nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Move Node to Nav",
+ "parameters": [
+ {
+ "description": "Move Node Nav",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodeMoveNavReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/permission": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档授权信息获取",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "NodePermission"
+ ],
+ "summary": "文档授权信息获取",
+ "operationId": "v1-NodePermission",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodePermissionResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/permission/edit": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档授权信息更新",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "NodePermission"
+ ],
+ "summary": "文档授权信息更新",
+ "operationId": "v1-NodePermissionEdit",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodePermissionEditReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodePermissionEditResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/recommend_nodes": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Recommend Nodes",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Recommend Nodes",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "nav_ids",
+ "in": "query"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "node_ids",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/restudy": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档重新学习",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Node"
+ ],
+ "summary": "文档重新学习",
+ "operationId": "v1-NodeRestudy",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodeRestudyReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeRestudyResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/stats": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node Statistics",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node Statistics",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeStatsResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/summary": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Summary Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Summary Node 异步后台生成",
+ "parameters": [
+ {
+ "description": "Summary Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeSummaryReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/summary/stream": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Stream Summary Node for single document",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "text/event-stream"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Stream Summary Node",
+ "parameters": [
+ {
+ "description": "Summary Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeSummaryReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "SSE stream",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/browsers": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "客户端统计",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "客户端统计",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.HotBrowser"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/conversation_distribution": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "问答来源",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "问答来源",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.StatConversationDistributionResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "全局统计",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "全局统计",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.StatCountResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/geo_count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "用户地理分布",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "用户地理分布",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/hot_pages": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "热门文档",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "热门文档",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.HotPage"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/instant_count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetInstantCount",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "GetInstantCount",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.InstantCountResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/instant_pages": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetInstantPages",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "GetInstantPages",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.InstantPageResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/referer_hosts": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "来源域名",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "来源域名",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.HotRefererHost"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user": {
+ "get": {
+ "description": "GetUser",
+ "consumes": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "GetUser",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.UserInfoResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/create": {
+ "post": {
+ "description": "CreateUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "CreateUser",
+ "parameters": [
+ {
+ "description": "CreateUser Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CreateUserReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CreateUserResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/delete": {
+ "delete": {
+ "description": "DeleteUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "DeleteUser",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "user_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/list": {
+ "get": {
+ "description": "ListUsers",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "ListUsers",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.UserListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/login": {
+ "post": {
+ "description": "Login",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Login",
+ "parameters": [
+ {
+ "description": "Login Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.LoginReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.LoginResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/reset_password": {
+ "put": {
+ "description": "ResetPassword",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "ResetPassword",
+ "parameters": [
+ {
+ "description": "ResetPassword Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.ResetPasswordReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/web/info": {
+ "get": {
+ "description": "GetAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_app"
+ ],
+ "summary": "GetAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.AppInfoResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/wechat/info": {
+ "get": {
+ "description": "WechatAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "WechatAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.WechatAppInfoResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/wechat/service/answer": {
+ "get": {
+ "description": "GetWechatAnswer",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Wechat"
+ ],
+ "summary": "GetWechatAnswer",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "conversation id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/widget/info": {
+ "get": {
+ "description": "GetWidgetAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_app"
+ ],
+ "summary": "GetWidgetAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/get": {
+ "get": {
+ "description": "AuthGet",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_auth"
+ ],
+ "summary": "AuthGet",
+ "operationId": "v1-AuthGet",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb_id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/github": {
+ "post": {
+ "description": "GitHub登录",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareAuth"
+ ],
+ "summary": "GitHub登录",
+ "operationId": "v1-AuthGitHub",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthGitHubReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.AuthGitHubResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/login/simple": {
+ "post": {
+ "description": "AuthLoginSimple",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_auth"
+ ],
+ "summary": "AuthLoginSimple",
+ "operationId": "v1-AuthLoginSimple",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb_id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthLoginSimpleReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/captcha/challenge": {
+ "post": {
+ "description": "CreateCaptcha",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_captcha"
+ ],
+ "summary": "CreateCaptcha",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/gocap.ChallengeData"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/captcha/redeem": {
+ "post": {
+ "description": "RedeemCaptcha",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_captcha"
+ ],
+ "summary": "RedeemCaptcha",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/consts.RedeemCaptchaReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/gocap.VerificationResult"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/completions": {
+ "post": {
+ "description": "OpenAI API compatible chat completions endpoint",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "ChatCompletions",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "OpenAI API request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAICompletionsRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAICompletionsResponse"
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAIErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/feedback": {
+ "post": {
+ "description": "Process user feedback for chat conversations",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "Handle chat feedback",
+ "parameters": [
+ {
+ "description": "feedback request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.FeedbackRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/message": {
+ "post": {
+ "description": "ChatMessage",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "ChatMessage",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "app_type",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/search": {
+ "post": {
+ "description": "ChatSearch",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat_search"
+ ],
+ "summary": "ChatSearch",
+ "parameters": [
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatSearchReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ChatSearchResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/widget": {
+ "post": {
+ "description": "ChatWidget",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Widget"
+ ],
+ "summary": "ChatWidget",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "app_type",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/widget/search": {
+ "post": {
+ "description": "WidgetSearch",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Widget"
+ ],
+ "summary": "WidgetSearch",
+ "parameters": [
+ {
+ "description": "Comment",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatSearchReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ChatSearchResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/comment": {
+ "post": {
+ "description": "CreateComment",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_comment"
+ ],
+ "summary": "CreateComment",
+ "parameters": [
+ {
+ "description": "Comment",
+ "name": "comment",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CommentReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CommentID",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/comment/list": {
+ "get": {
+ "description": "GetCommentList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_comment"
+ ],
+ "summary": "GetCommentList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "nodeID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CommentList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/share.ShareCommentLists"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/common/file/upload": {
+ "post": {
+ "description": "前台用户上传文件,目前只支持图片文件上传",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareFile"
+ ],
+ "summary": "文件上传",
+ "operationId": "share-FileUpload",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "captcha_token",
+ "name": "captcha_token",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.FileUploadResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/common/file/upload/url": {
+ "post": {
+ "description": "前台用户上传文件,目前只支持图片文件上传",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareFile"
+ ],
+ "summary": "文件上传",
+ "operationId": "share-FileUploadByUrl",
+ "parameters": [
+ {
+ "description": "body",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.ShareFileUploadUrlReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ShareFileUploadUrlResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/conversation/detail": {
+ "get": {
+ "description": "GetConversationDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_conversation"
+ ],
+ "summary": "GetConversationDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "conversation id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ShareConversationDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/nav/list": {
+ "get": {
+ "description": "ShareNavList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_nav"
+ ],
+ "summary": "前台获取栏目列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/node/detail": {
+ "get": {
+ "description": "GetNodeDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_node"
+ ],
+ "summary": "GetNodeDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "node id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "format",
+ "name": "format",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ShareNodeDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/node/list": {
+ "get": {
+ "description": "ShareNodeList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_node"
+ ],
+ "summary": "ShareNodeList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/openapi/github/callback": {
+ "get": {
+ "description": "GitHub回调",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareOpenapi"
+ ],
+ "summary": "GitHub回调",
+ "operationId": "v1-GitHubCallback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "code",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "state",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/openapi/lark/bot/{kb_id}": {
+ "post": {
+ "description": "Lark机器人请求",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareOpenapi"
+ ],
+ "summary": "Lark机器人请求",
+ "operationId": "v1-LarkBot",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/stat/page": {
+ "post": {
+ "description": "RecordPage",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_stat"
+ ],
+ "summary": "RecordPage",
+ "parameters": [
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.StatPageReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "anydoc.Child": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/anydoc.Child"
+ }
+ },
+ "value": {
+ "$ref": "#/definitions/anydoc.Value"
+ }
+ }
+ },
+ "anydoc.DingtalkSetting": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "phone": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ },
+ "unionid": {
+ "type": "string"
+ }
+ }
+ },
+ "anydoc.FeishuSetting": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ },
+ "user_access_token": {
+ "type": "string"
+ }
+ }
+ },
+ "anydoc.Value": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "boolean"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "consts.AuthType": {
+ "type": "string",
+ "enum": [
+ "",
+ "simple",
+ "enterprise"
+ ],
+ "x-enum-comments": {
+ "AuthTypeEnterprise": "企业认证",
+ "AuthTypeNull": "无认证",
+ "AuthTypeSimple": "简单口令"
+ },
+ "x-enum-descriptions": [
+ "无认证",
+ "简单口令",
+ "企业认证"
+ ],
+ "x-enum-varnames": [
+ "AuthTypeNull",
+ "AuthTypeSimple",
+ "AuthTypeEnterprise"
+ ]
+ },
+ "consts.CopySetting": {
+ "type": "string",
+ "enum": [
+ "",
+ "append",
+ "disabled"
+ ],
+ "x-enum-comments": {
+ "CopySettingAppend": "增加内容尾巴",
+ "CopySettingDisabled": "禁止复制内容",
+ "CopySettingNone": "无限制"
+ },
+ "x-enum-descriptions": [
+ "无限制",
+ "增加内容尾巴",
+ "禁止复制内容"
+ ],
+ "x-enum-varnames": [
+ "CopySettingNone",
+ "CopySettingAppend",
+ "CopySettingDisabled"
+ ]
+ },
+ "consts.CrawlerSource": {
+ "type": "string",
+ "enum": [
+ "url",
+ "rss",
+ "sitemap",
+ "notion",
+ "feishu",
+ "dingtalk",
+ "file",
+ "epub",
+ "yuque",
+ "siyuan",
+ "mindoc",
+ "wikijs",
+ "confluence"
+ ],
+ "x-enum-varnames": [
+ "CrawlerSourceUrl",
+ "CrawlerSourceRSS",
+ "CrawlerSourceSitemap",
+ "CrawlerSourceNotion",
+ "CrawlerSourceFeishu",
+ "CrawlerSourceDingtalk",
+ "CrawlerSourceFile",
+ "CrawlerSourceEpub",
+ "CrawlerSourceYuque",
+ "CrawlerSourceSiyuan",
+ "CrawlerSourceMindoc",
+ "CrawlerSourceWikijs",
+ "CrawlerSourceConfluence"
+ ]
+ },
+ "consts.CrawlerStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "in_process",
+ "completed",
+ "failed"
+ ],
+ "x-enum-varnames": [
+ "CrawlerStatusPending",
+ "CrawlerStatusInProcess",
+ "CrawlerStatusCompleted",
+ "CrawlerStatusFailed"
+ ]
+ },
+ "consts.HomePageSetting": {
+ "type": "string",
+ "enum": [
+ "doc",
+ "custom"
+ ],
+ "x-enum-comments": {
+ "HomePageSettingCustom": "自定义首页",
+ "HomePageSettingDoc": "文档页面"
+ },
+ "x-enum-descriptions": [
+ "文档页面",
+ "自定义首页"
+ ],
+ "x-enum-varnames": [
+ "HomePageSettingDoc",
+ "HomePageSettingCustom"
+ ]
+ },
+ "consts.LicenseEdition": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "x-enum-comments": {
+ "LicenseEditionBusiness": "商业版",
+ "LicenseEditionEnterprise": "企业版",
+ "LicenseEditionFree": "开源版",
+ "LicenseEditionProfession": "专业版"
+ },
+ "x-enum-descriptions": [
+ "开源版",
+ "专业版",
+ "企业版",
+ "商业版"
+ ],
+ "x-enum-varnames": [
+ "LicenseEditionFree",
+ "LicenseEditionProfession",
+ "LicenseEditionEnterprise",
+ "LicenseEditionBusiness"
+ ]
+ },
+ "consts.ModelSettingMode": {
+ "type": "string",
+ "enum": [
+ "manual",
+ "auto"
+ ],
+ "x-enum-varnames": [
+ "ModelSettingModeManual",
+ "ModelSettingModeAuto"
+ ]
+ },
+ "consts.NodeAccessPerm": {
+ "type": "string",
+ "enum": [
+ "open",
+ "partial",
+ "closed"
+ ],
+ "x-enum-comments": {
+ "NodeAccessPermClosed": "完全禁止",
+ "NodeAccessPermOpen": "完全开放",
+ "NodeAccessPermPartial": "部分开放"
+ },
+ "x-enum-descriptions": [
+ "完全开放",
+ "部分开放",
+ "完全禁止"
+ ],
+ "x-enum-varnames": [
+ "NodeAccessPermOpen",
+ "NodeAccessPermPartial",
+ "NodeAccessPermClosed"
+ ]
+ },
+ "consts.NodePermName": {
+ "type": "string",
+ "enum": [
+ "visible",
+ "visitable",
+ "answerable"
+ ],
+ "x-enum-comments": {
+ "NodePermNameAnswerable": "可被问答",
+ "NodePermNameVisible": "导航内可见",
+ "NodePermNameVisitable": "可被访问"
+ },
+ "x-enum-descriptions": [
+ "导航内可见",
+ "可被访问",
+ "可被问答"
+ ],
+ "x-enum-varnames": [
+ "NodePermNameVisible",
+ "NodePermNameVisitable",
+ "NodePermNameAnswerable"
+ ]
+ },
+ "consts.NodeRagInfoStatus": {
+ "type": "string",
+ "enum": [
+ "PENDING",
+ "RUNNING",
+ "FAILED",
+ "SUCCEEDED",
+ "REINDEX"
+ ],
+ "x-enum-comments": {
+ "NodeRagStatusFailed": "处理失败",
+ "NodeRagStatusPending": "等待处理",
+ "NodeRagStatusReindexing": "重新索引中",
+ "NodeRagStatusRunning": "正在进行处理(文本分割、向量化等)",
+ "NodeRagStatusSucceeded": "处理成功"
+ },
+ "x-enum-descriptions": [
+ "等待处理",
+ "正在进行处理(文本分割、向量化等)",
+ "处理失败",
+ "处理成功",
+ "重新索引中"
+ ],
+ "x-enum-varnames": [
+ "NodeRagStatusPending",
+ "NodeRagStatusRunning",
+ "NodeRagStatusFailed",
+ "NodeRagStatusSucceeded",
+ "NodeRagStatusReindexing"
+ ]
+ },
+ "consts.RedeemCaptchaReq": {
+ "type": "object",
+ "properties": {
+ "solutions": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "consts.SourceType": {
+ "type": "string",
+ "enum": [
+ "dingtalk",
+ "feishu",
+ "wecom",
+ "oauth",
+ "github",
+ "cas",
+ "ldap",
+ "widget",
+ "dingtalk_bot",
+ "feishu_bot",
+ "lark_bot",
+ "wechat_bot",
+ "wecom_ai_bot",
+ "wechat_service_bot",
+ "discord_bot",
+ "wechat_official_account",
+ "openai_api",
+ "mcp_server"
+ ],
+ "x-enum-varnames": [
+ "SourceTypeDingTalk",
+ "SourceTypeFeishu",
+ "SourceTypeWeCom",
+ "SourceTypeOAuth",
+ "SourceTypeGitHub",
+ "SourceTypeCAS",
+ "SourceTypeLDAP",
+ "SourceTypeWidget",
+ "SourceTypeDingtalkBot",
+ "SourceTypeFeishuBot",
+ "SourceTypeLarkBot",
+ "SourceTypeWechatBot",
+ "SourceTypeWecomAIBot",
+ "SourceTypeWechatServiceBot",
+ "SourceTypeDiscordBot",
+ "SourceTypeWechatOfficialAccount",
+ "SourceTypeOpenAIAPI",
+ "SourceTypeMcpServer"
+ ]
+ },
+ "consts.StatDay": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ]
+ },
+ "consts.UserKBPermission": {
+ "type": "string",
+ "enum": [
+ "",
+ "not null",
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "x-enum-comments": {
+ "UserKBPermissionDataOperate": "数据运营",
+ "UserKBPermissionDocManage": "文档管理",
+ "UserKBPermissionFullControl": "完全控制",
+ "UserKBPermissionNotNull": "有权限",
+ "UserKBPermissionNull": "无权限"
+ },
+ "x-enum-descriptions": [
+ "无权限",
+ "有权限",
+ "完全控制",
+ "文档管理",
+ "数据运营"
+ ],
+ "x-enum-varnames": [
+ "UserKBPermissionNull",
+ "UserKBPermissionNotNull",
+ "UserKBPermissionFullControl",
+ "UserKBPermissionDocManage",
+ "UserKBPermissionDataOperate"
+ ]
+ },
+ "consts.UserRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "user"
+ ],
+ "x-enum-comments": {
+ "UserRoleAdmin": "管理员",
+ "UserRoleUser": "普通用户"
+ },
+ "x-enum-descriptions": [
+ "管理员",
+ "普通用户"
+ ],
+ "x-enum-varnames": [
+ "UserRoleAdmin",
+ "UserRoleUser"
+ ]
+ },
+ "consts.WatermarkSetting": {
+ "type": "string",
+ "enum": [
+ "",
+ "hidden",
+ "visible"
+ ],
+ "x-enum-comments": {
+ "WatermarkDisabled": "未开启水印",
+ "WatermarkHidden": "隐形水印",
+ "WatermarkVisible": "显性水印"
+ },
+ "x-enum-descriptions": [
+ "未开启水印",
+ "隐形水印",
+ "显性水印"
+ ],
+ "x-enum-varnames": [
+ "WatermarkDisabled",
+ "WatermarkHidden",
+ "WatermarkVisible"
+ ]
+ },
+ "domain.AIFeedbackSettings": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "is_enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.AccessSettings": {
+ "type": "object",
+ "properties": {
+ "base_url": {
+ "type": "string"
+ },
+ "enterprise_auth": {
+ "$ref": "#/definitions/domain.EnterpriseAuth"
+ },
+ "hosts": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "is_forbidden": {
+ "description": "禁止访问",
+ "type": "boolean"
+ },
+ "ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "private_key": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ },
+ "simple_auth": {
+ "$ref": "#/definitions/domain.SimpleAuth"
+ },
+ "source_type": {
+ "description": "企业认证来源",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ ]
+ },
+ "ssl_ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "trusted_proxies": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "domain.AnydocUploadResp": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "type": "string"
+ },
+ "err": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.AppDetailResp": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettingsResp"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.AppType"
+ }
+ }
+ },
+ "domain.AppInfoResp": {
+ "type": "object",
+ "properties": {
+ "base_url": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettingsResp"
+ }
+ }
+ },
+ "domain.AppSettings": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_settings": {
+ "description": "AI feedback",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AIFeedbackSettings"
+ }
+ ]
+ },
+ "body_code": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {}
+ },
+ "catalog_settings": {
+ "description": "catalog settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CatalogSettings"
+ }
+ ]
+ },
+ "contribute_settings": {
+ "$ref": "#/definitions/domain.ContributeSettings"
+ },
+ "conversation_setting": {
+ "$ref": "#/definitions/domain.ConversationSetting"
+ },
+ "copy_setting": {
+ "enum": [
+ "",
+ "append",
+ "disabled"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.CopySetting"
+ }
+ ]
+ },
+ "desc": {
+ "description": "seo",
+ "type": "string"
+ },
+ "dingtalk_bot_client_id": {
+ "type": "string"
+ },
+ "dingtalk_bot_client_secret": {
+ "type": "string"
+ },
+ "dingtalk_bot_is_enabled": {
+ "description": "DingTalkBot",
+ "type": "boolean"
+ },
+ "dingtalk_bot_template_id": {
+ "type": "string"
+ },
+ "disclaimer_settings": {
+ "description": "Disclaimer Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.DisclaimerSettings"
+ }
+ ]
+ },
+ "discord_bot_is_enabled": {
+ "description": "DisCordBot",
+ "type": "boolean"
+ },
+ "discord_bot_token": {
+ "type": "string"
+ },
+ "document_feedback_is_enabled": {
+ "description": "document feedback",
+ "type": "boolean"
+ },
+ "feishu_bot_app_id": {
+ "type": "string"
+ },
+ "feishu_bot_app_secret": {
+ "type": "string"
+ },
+ "feishu_bot_is_enabled": {
+ "description": "FeishuBot",
+ "type": "boolean"
+ },
+ "footer_settings": {
+ "description": "footer settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FooterSettings"
+ }
+ ]
+ },
+ "head_code": {
+ "description": "inject code",
+ "type": "string"
+ },
+ "home_page_setting": {
+ "$ref": "#/definitions/consts.HomePageSetting"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "keyword": {
+ "type": "string"
+ },
+ "lark_bot_settings": {
+ "description": "LarkBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.LarkBotSettings"
+ }
+ ]
+ },
+ "mcp_server_settings": {
+ "description": "MCP Server Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.MCPServerSettings"
+ }
+ ]
+ },
+ "openai_api_bot_settings": {
+ "description": "OpenAI API Bot settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIAPIBotSettings"
+ }
+ ]
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_placeholder": {
+ "type": "string"
+ },
+ "stats_setting": {
+ "$ref": "#/definitions/domain.StatsSetting"
+ },
+ "theme_and_style": {
+ "$ref": "#/definitions/domain.ThemeAndStyle"
+ },
+ "theme_mode": {
+ "description": "theme",
+ "type": "string"
+ },
+ "title": {
+ "description": "nav",
+ "type": "string"
+ },
+ "watermark_content": {
+ "type": "string"
+ },
+ "watermark_setting": {
+ "enum": [
+ "",
+ "hidden",
+ "visible"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.WatermarkSetting"
+ }
+ ]
+ },
+ "web_app_comment_settings": {
+ "description": "webapp comment settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCommentSettings"
+ }
+ ]
+ },
+ "web_app_custom_style": {
+ "description": "WebAppCustomStyle",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCustomSettings"
+ }
+ ]
+ },
+ "web_app_landing_configs": {
+ "description": "WebAppLandingConfigs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.WebAppLandingConfig"
+ }
+ },
+ "web_app_landing_theme": {
+ "$ref": "#/definitions/domain.WebAppLandingTheme"
+ },
+ "wechat_app_advanced_setting": {
+ "$ref": "#/definitions/domain.WeChatAppAdvancedSetting"
+ },
+ "wechat_app_agent_id": {
+ "type": "string"
+ },
+ "wechat_app_corpid": {
+ "type": "string"
+ },
+ "wechat_app_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_app_is_enabled": {
+ "description": "WechatAppBot 企业微信机器人",
+ "type": "boolean"
+ },
+ "wechat_app_secret": {
+ "type": "string"
+ },
+ "wechat_app_token": {
+ "type": "string"
+ },
+ "wechat_official_account_app_id": {
+ "type": "string"
+ },
+ "wechat_official_account_app_secret": {
+ "type": "string"
+ },
+ "wechat_official_account_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_official_account_is_enabled": {
+ "description": "WechatOfficialAccount",
+ "type": "boolean"
+ },
+ "wechat_official_account_token": {
+ "type": "string"
+ },
+ "wechat_service_contain_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_corpid": {
+ "type": "string"
+ },
+ "wechat_service_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_service_equal_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_is_enabled": {
+ "description": "WechatServiceBot",
+ "type": "boolean"
+ },
+ "wechat_service_logo": {
+ "type": "string"
+ },
+ "wechat_service_secret": {
+ "type": "string"
+ },
+ "wechat_service_token": {
+ "type": "string"
+ },
+ "wecom_ai_bot_settings": {
+ "description": "WecomAIBotSettings 企业微信智能机器人",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WecomAIBotSettings"
+ }
+ ]
+ },
+ "welcome_str": {
+ "description": "welcome",
+ "type": "string"
+ },
+ "widget_bot_settings": {
+ "description": "Widget bot settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WidgetBotSettings"
+ }
+ ]
+ }
+ }
+ },
+ "domain.AppSettingsResp": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_settings": {
+ "description": "AI feedback",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AIFeedbackSettings"
+ }
+ ]
+ },
+ "body_code": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {}
+ },
+ "catalog_settings": {
+ "description": "catalog settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CatalogSettings"
+ }
+ ]
+ },
+ "contribute_settings": {
+ "$ref": "#/definitions/domain.ContributeSettings"
+ },
+ "conversation_setting": {
+ "$ref": "#/definitions/domain.ConversationSetting"
+ },
+ "copy_setting": {
+ "$ref": "#/definitions/consts.CopySetting"
+ },
+ "desc": {
+ "description": "seo",
+ "type": "string"
+ },
+ "dingtalk_bot_client_id": {
+ "type": "string"
+ },
+ "dingtalk_bot_client_secret": {
+ "type": "string"
+ },
+ "dingtalk_bot_is_enabled": {
+ "description": "DingTalkBot",
+ "type": "boolean"
+ },
+ "dingtalk_bot_template_id": {
+ "type": "string"
+ },
+ "disclaimer_settings": {
+ "description": "Disclaimer Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.DisclaimerSettings"
+ }
+ ]
+ },
+ "discord_bot_is_enabled": {
+ "description": "DisCordBot",
+ "type": "boolean"
+ },
+ "discord_bot_token": {
+ "type": "string"
+ },
+ "document_feedback_is_enabled": {
+ "description": "document feedback",
+ "type": "boolean"
+ },
+ "feishu_bot_app_id": {
+ "type": "string"
+ },
+ "feishu_bot_app_secret": {
+ "type": "string"
+ },
+ "feishu_bot_is_enabled": {
+ "description": "FeishuBot",
+ "type": "boolean"
+ },
+ "footer_settings": {
+ "description": "footer settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FooterSettings"
+ }
+ ]
+ },
+ "head_code": {
+ "description": "inject code",
+ "type": "string"
+ },
+ "home_page_setting": {
+ "$ref": "#/definitions/consts.HomePageSetting"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "keyword": {
+ "type": "string"
+ },
+ "lark_bot_settings": {
+ "description": "LarkBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.LarkBotSettings"
+ }
+ ]
+ },
+ "mcp_server_settings": {
+ "description": "MCP Server Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.MCPServerSettings"
+ }
+ ]
+ },
+ "openai_api_bot_settings": {
+ "description": "OpenAI API settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIAPIBotSettings"
+ }
+ ]
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_placeholder": {
+ "type": "string"
+ },
+ "stats_setting": {
+ "$ref": "#/definitions/domain.StatsSetting"
+ },
+ "theme_and_style": {
+ "$ref": "#/definitions/domain.ThemeAndStyle"
+ },
+ "theme_mode": {
+ "description": "theme",
+ "type": "string"
+ },
+ "title": {
+ "description": "nav",
+ "type": "string"
+ },
+ "watermark_content": {
+ "type": "string"
+ },
+ "watermark_setting": {
+ "$ref": "#/definitions/consts.WatermarkSetting"
+ },
+ "web_app_comment_settings": {
+ "description": "webapp comment settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCommentSettings"
+ }
+ ]
+ },
+ "web_app_custom_style": {
+ "description": "WebAppCustomStyle",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCustomSettings"
+ }
+ ]
+ },
+ "web_app_landing_configs": {
+ "description": "WebApp Landing Settings",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.WebAppLandingConfigResp"
+ }
+ },
+ "web_app_landing_theme": {
+ "$ref": "#/definitions/domain.WebAppLandingTheme"
+ },
+ "wechat_app_advanced_setting": {
+ "$ref": "#/definitions/domain.WeChatAppAdvancedSetting"
+ },
+ "wechat_app_agent_id": {
+ "type": "string"
+ },
+ "wechat_app_corpid": {
+ "type": "string"
+ },
+ "wechat_app_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_app_is_enabled": {
+ "description": "WechatAppBot",
+ "type": "boolean"
+ },
+ "wechat_app_secret": {
+ "type": "string"
+ },
+ "wechat_app_token": {
+ "type": "string"
+ },
+ "wechat_official_account_app_id": {
+ "type": "string"
+ },
+ "wechat_official_account_app_secret": {
+ "type": "string"
+ },
+ "wechat_official_account_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_official_account_is_enabled": {
+ "description": "WechatOfficialAccount",
+ "type": "boolean"
+ },
+ "wechat_official_account_token": {
+ "type": "string"
+ },
+ "wechat_service_contain_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_corpid": {
+ "type": "string"
+ },
+ "wechat_service_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_service_equal_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_is_enabled": {
+ "description": "WechatServiceBot",
+ "type": "boolean"
+ },
+ "wechat_service_logo": {
+ "type": "string"
+ },
+ "wechat_service_secret": {
+ "type": "string"
+ },
+ "wechat_service_token": {
+ "type": "string"
+ },
+ "wecom_ai_bot_settings": {
+ "$ref": "#/definitions/domain.WecomAIBotSettings"
+ },
+ "welcome_str": {
+ "description": "welcome",
+ "type": "string"
+ },
+ "widget_bot_settings": {
+ "description": "WidgetBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WidgetBotSettings"
+ }
+ ]
+ }
+ }
+ },
+ "domain.AppType": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12
+ ],
+ "x-enum-varnames": [
+ "AppTypeWeb",
+ "AppTypeWidget",
+ "AppTypeDingTalkBot",
+ "AppTypeFeishuBot",
+ "AppTypeWechatBot",
+ "AppTypeWechatServiceBot",
+ "AppTypeDisCordBot",
+ "AppTypeWechatOfficialAccount",
+ "AppTypeOpenAIAPI",
+ "AppTypeWecomAIBot",
+ "AppTypeLarkBot",
+ "AppTypeMcpServer"
+ ]
+ },
+ "domain.AuthUserInfo": {
+ "type": "object",
+ "properties": {
+ "avatar_url": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BannerConfig": {
+ "type": "object",
+ "properties": {
+ "bg_url": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "href": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "hot_search": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "subtitle": {
+ "type": "string"
+ },
+ "subtitle_color": {
+ "type": "string"
+ },
+ "subtitle_font_size": {
+ "type": "integer"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ },
+ "title_font_size": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.BasicDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BatchMoveReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BlockGridConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BrandGroup": {
+ "type": "object",
+ "properties": {
+ "links": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.Link"
+ }
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BrowserCount": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CarouselConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CaseConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CatalogSettings": {
+ "type": "object",
+ "properties": {
+ "catalog_folder": {
+ "description": "1: 展开, 2: 折叠, default: 1",
+ "type": "integer"
+ },
+ "catalog_visible": {
+ "description": "1: 显示, 2: 隐藏, default: 1",
+ "type": "integer"
+ },
+ "catalog_width": {
+ "description": "200 - 300, default: 260",
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ChatRequest": {
+ "type": "object",
+ "required": [
+ "app_type"
+ ],
+ "properties": {
+ "app_type": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AppType"
+ }
+ ]
+ },
+ "captcha_token": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "maxItems": 3,
+ "items": {
+ "type": "string"
+ }
+ },
+ "message": {
+ "type": "string"
+ },
+ "nonce": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ChatSearchReq": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ChatSearchResp": {
+ "type": "object",
+ "properties": {
+ "node_result": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeContentChunkSSE"
+ }
+ }
+ }
+ },
+ "domain.CommentConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "profession": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentInfo": {
+ "type": "object",
+ "properties": {
+ "auth_user_id": {
+ "type": "integer"
+ },
+ "avatar": {
+ "description": "avatar",
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentListItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.CommentInfo"
+ },
+ "ip_address": {
+ "description": "ip地址",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.IPAddress"
+ }
+ ]
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "description": "文档标题",
+ "type": "string"
+ },
+ "node_type": {
+ "type": "integer"
+ },
+ "root_id": {
+ "type": "string"
+ },
+ "status": {
+ "description": "status : -1 reject 0 pending 1 accept",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CommentStatus"
+ }
+ ]
+ }
+ }
+ },
+ "domain.CommentReq": {
+ "type": "object",
+ "required": [
+ "content",
+ "node_id",
+ "pic_urls"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "pic_urls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "root_id": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentStatus": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ -1,
+ 0,
+ 1
+ ],
+ "x-enum-varnames": [
+ "CommentStatusReject",
+ "CommentStatusPending",
+ "CommentStatusAccepted"
+ ]
+ },
+ "domain.CompleteReq": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "For FIM (Fill in Middle) style completion",
+ "type": "string"
+ },
+ "suffix": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ContributeSettings": {
+ "type": "object",
+ "properties": {
+ "is_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.ConversationDetailResp": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationMessage"
+ }
+ },
+ "references": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationReference"
+ }
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationInfo": {
+ "type": "object",
+ "properties": {
+ "user_info": {
+ "$ref": "#/definitions/domain.UserInfo"
+ }
+ }
+ },
+ "domain.ConversationListItem": {
+ "type": "object",
+ "properties": {
+ "app_name": {
+ "type": "string"
+ },
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "feedback_info": {
+ "description": "用户反馈信息",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "description": "用户信息",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ConversationInfo"
+ }
+ ]
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationMessage": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "info": {
+ "description": "feedbackinfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parent_id": {
+ "description": "parent_id",
+ "type": "string"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "provider": {
+ "description": "model",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ }
+ ]
+ },
+ "remote_ip": {
+ "description": "stats",
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/schema.RoleType"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ConversationMessageListItem": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "conversation_info": {
+ "description": "userInfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ConversationInfo"
+ }
+ ]
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "description": "feedbackInfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "question": {
+ "type": "string"
+ },
+ "remote_ip": {
+ "description": "stats",
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationReference": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationSetting": {
+ "type": "object",
+ "properties": {
+ "copyright_hide_enabled": {
+ "type": "boolean"
+ },
+ "copyright_info": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CreateKBReleaseReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "message",
+ "tag"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "node_ids": {
+ "description": "create release after these nodes published",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CreateKnowledgeBaseReq": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "hosts": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "name": {
+ "type": "string"
+ },
+ "ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "private_key": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ },
+ "ssl_ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "domain.CreateModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.CreateNodeReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "name",
+ "nav_id",
+ "type"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.NodeType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.DirDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.DisclaimerSettings": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.EnterpriseAuth": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.FaqConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "question": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.FeatureConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.FeedBackInfo": {
+ "type": "object",
+ "properties": {
+ "feedback_content": {
+ "type": "string"
+ },
+ "feedback_type": {
+ "type": "string"
+ },
+ "score": {
+ "$ref": "#/definitions/domain.ScoreType"
+ }
+ }
+ },
+ "domain.FeedbackRequest": {
+ "type": "object",
+ "required": [
+ "message_id"
+ ],
+ "properties": {
+ "conversation_id": {
+ "type": "string"
+ },
+ "feedback_content": {
+ "description": "限制内容长度",
+ "type": "string",
+ "maxLength": 200
+ },
+ "message_id": {
+ "type": "string"
+ },
+ "score": {
+ "description": "-1 踩 ,0 1 赞成",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ScoreType"
+ }
+ ]
+ },
+ "type": {
+ "description": "内容不准确,没有帮助,.......",
+ "type": "string"
+ }
+ }
+ },
+ "domain.FooterSettings": {
+ "type": "object",
+ "properties": {
+ "brand_desc": {
+ "type": "string"
+ },
+ "brand_groups": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrandGroup"
+ }
+ },
+ "brand_logo": {
+ "type": "string"
+ },
+ "brand_name": {
+ "type": "string"
+ },
+ "corp_name": {
+ "type": "string"
+ },
+ "footer_style": {
+ "type": "string"
+ },
+ "icp": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.GetKBReleaseListResp": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.KBReleaseListItemResp"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.GetProviderModelListReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.GetProviderModelListResp": {
+ "type": "object",
+ "properties": {
+ "models": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ProviderModelListItem"
+ }
+ }
+ }
+ },
+ "domain.HotBrowser": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrowserCount"
+ }
+ },
+ "os": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrowserCount"
+ }
+ }
+ }
+ },
+ "domain.HotPage": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "type": "string"
+ },
+ "scene": {
+ "$ref": "#/definitions/domain.StatPageScene"
+ }
+ }
+ },
+ "domain.HotRefererHost": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "referer_host": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.IPAddress": {
+ "type": "object",
+ "properties": {
+ "city": {
+ "type": "string"
+ },
+ "country": {
+ "type": "string"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "province": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ImgTextConfig": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.InstantCountResp": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "time": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.InstantPageResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.AuthUserInfo"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "type": "string"
+ },
+ "scene": {
+ "$ref": "#/definitions/domain.StatPageScene"
+ },
+ "user_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.KBReleaseListItemResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.KnowledgeBaseDetail": {
+ "type": "object",
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "dataset_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "perm": {
+ "description": "用户对知识库的权限",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.KnowledgeBaseListItem": {
+ "type": "object",
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "dataset_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.LarkBotSettings": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "encrypt_key": {
+ "type": "string"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "verify_token": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.Link": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.MCPServerSettings": {
+ "type": "object",
+ "properties": {
+ "docs_tool_settings": {
+ "$ref": "#/definitions/domain.MCPToolSettings"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "sample_auth": {
+ "$ref": "#/definitions/domain.SimpleAuth"
+ }
+ }
+ },
+ "domain.MCPToolSettings": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.MessageContent": {
+ "type": "object"
+ },
+ "domain.MessageFrom": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2
+ ],
+ "x-enum-varnames": [
+ "MessageFromGroup",
+ "MessageFromPrivate"
+ ]
+ },
+ "domain.MetricsConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "number": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ModelModeSetting": {
+ "type": "object",
+ "properties": {
+ "auto_mode_api_key": {
+ "description": "百智云 API Key",
+ "type": "string"
+ },
+ "chat_model": {
+ "description": "自定义对话模型名称",
+ "type": "string"
+ },
+ "is_manual_embedding_updated": {
+ "description": "手动模式下嵌入模型是否更新",
+ "type": "boolean"
+ },
+ "mode": {
+ "description": "模式: manual 或 auto",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.ModelSettingMode"
+ }
+ ]
+ }
+ }
+ },
+ "domain.ModelType": {
+ "type": "string",
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeChat",
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeAnalysis",
+ "ModelTypeAnalysisVL"
+ ]
+ },
+ "domain.MoveNodeReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "next_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "prev_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NavDocConfig": {
+ "type": "object",
+ "properties": {
+ "nav_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeActionReq": {
+ "type": "object",
+ "required": [
+ "action",
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "delete"
+ ]
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeContentChunkSSE": {
+ "type": "object",
+ "properties": {
+ "emoji": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_path_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeGroupDetail": {
+ "type": "object",
+ "properties": {
+ "auth_group_id": {
+ "type": "integer"
+ },
+ "auth_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "perm": {
+ "$ref": "#/definitions/consts.NodePermName"
+ }
+ }
+ },
+ "domain.NodeListItemResp": {
+ "type": "object",
+ "properties": {
+ "content_type": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "rag_info": {
+ "$ref": "#/definitions/domain.RagInfo"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeMeta": {
+ "type": "object",
+ "properties": {
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodePermissions": {
+ "type": "object",
+ "properties": {
+ "answerable": {
+ "description": "可被问答",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ },
+ "visible": {
+ "description": "导航内可见",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ },
+ "visitable": {
+ "description": "可被访问",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ }
+ }
+ },
+ "domain.NodeStatus": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "x-enum-comments": {
+ "NodeStatusDraft": "更新未发布",
+ "NodeStatusPublished": "已发布",
+ "NodeStatusUnreleased": "草稿"
+ },
+ "x-enum-descriptions": [
+ "草稿",
+ "更新未发布",
+ "已发布"
+ ],
+ "x-enum-varnames": [
+ "NodeStatusUnreleased",
+ "NodeStatusDraft",
+ "NodeStatusPublished"
+ ]
+ },
+ "domain.NodeSummaryReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeType": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 1,
+ 2
+ ],
+ "x-enum-varnames": [
+ "NodeTypeFolder",
+ "NodeTypeDocument"
+ ]
+ },
+ "domain.ObjectUploadResp": {
+ "type": "object",
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIAPIBotSettings": {
+ "type": "object",
+ "properties": {
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "secret_key": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIChoice": {
+ "type": "object",
+ "properties": {
+ "delta": {
+ "description": "for streaming",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ ]
+ },
+ "finish_reason": {
+ "type": "string"
+ },
+ "index": {
+ "type": "integer"
+ },
+ "message": {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ }
+ },
+ "domain.OpenAICompletionsRequest": {
+ "type": "object",
+ "required": [
+ "messages",
+ "model"
+ ],
+ "properties": {
+ "frequency_penalty": {
+ "type": "number"
+ },
+ "max_tokens": {
+ "type": "integer"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ },
+ "model": {
+ "type": "string"
+ },
+ "presence_penalty": {
+ "type": "number"
+ },
+ "response_format": {
+ "$ref": "#/definitions/domain.OpenAIResponseFormat"
+ },
+ "stop": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "stream": {
+ "type": "boolean"
+ },
+ "stream_options": {
+ "$ref": "#/definitions/domain.OpenAIStreamOptions"
+ },
+ "temperature": {
+ "type": "number"
+ },
+ "tool_choice": {
+ "$ref": "#/definitions/domain.OpenAIToolChoice"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAITool"
+ }
+ },
+ "top_p": {
+ "type": "number"
+ },
+ "user": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAICompletionsResponse": {
+ "type": "object",
+ "properties": {
+ "choices": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIChoice"
+ }
+ },
+ "created": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "object": {
+ "type": "string"
+ },
+ "usage": {
+ "$ref": "#/definitions/domain.OpenAIUsage"
+ }
+ }
+ },
+ "domain.OpenAIError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "param": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "$ref": "#/definitions/domain.OpenAIError"
+ }
+ }
+ },
+ "domain.OpenAIFunction": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ },
+ "domain.OpenAIFunctionCall": {
+ "type": "object",
+ "required": [
+ "arguments",
+ "name"
+ ],
+ "properties": {
+ "arguments": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIFunctionChoice": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIMessage": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "content": {
+ "$ref": "#/definitions/domain.MessageContent"
+ },
+ "name": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "tool_call_id": {
+ "type": "string"
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIToolCall"
+ }
+ }
+ }
+ },
+ "domain.OpenAIResponseFormat": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIStreamOptions": {
+ "type": "object",
+ "properties": {
+ "include_usage": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.OpenAITool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunction"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIToolCall": {
+ "type": "object",
+ "required": [
+ "function",
+ "id",
+ "type"
+ ],
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunctionCall"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIToolChoice": {
+ "type": "object",
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunctionChoice"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIUsage": {
+ "type": "object",
+ "properties": {
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.PWResponse": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.PaginatedResult-array_domain_ConversationMessageListItem": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationMessageListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ProviderModelListItem": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.QuestionConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "question": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.RagInfo": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.NodeRagInfoStatus"
+ },
+ "synced_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.RecommendNodeListResp": {
+ "type": "object",
+ "properties": {
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "nav_name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ }
+ }
+ },
+ "domain.Response": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.ScoreType": {
+ "type": "integer",
+ "enum": [
+ 1,
+ -1
+ ],
+ "x-enum-varnames": [
+ "Like",
+ "DisLike"
+ ]
+ },
+ "domain.ShareCommentListItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.CommentInfo"
+ },
+ "ip_address": {
+ "description": "ip地址",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.IPAddress"
+ }
+ ]
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "pic_urls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "root_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ShareConversationDetailResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareConversationMessage"
+ }
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ShareConversationMessage": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "role": {
+ "$ref": "#/definitions/schema.RoleType"
+ }
+ }
+ },
+ "domain.ShareNodeDetailItem": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareNodeDetailItem"
+ }
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SimpleAuth": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SimpleDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SocialMediaAccount": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "phone": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.StatPageReq": {
+ "type": "object",
+ "required": [
+ "scene"
+ ],
+ "properties": {
+ "node_id": {
+ "type": "string"
+ },
+ "scene": {
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.StatPageScene"
+ }
+ ]
+ }
+ }
+ },
+ "domain.StatPageScene": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "x-enum-varnames": [
+ "StatPageSceneWelcome",
+ "StatPageSceneNodeDetail",
+ "StatPageSceneChat",
+ "StatPageSceneLogin"
+ ]
+ },
+ "domain.StatsSetting": {
+ "type": "object",
+ "properties": {
+ "pv_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.SwitchModeReq": {
+ "type": "object",
+ "required": [
+ "mode"
+ ],
+ "properties": {
+ "auto_mode_api_key": {
+ "description": "百智云 API Key",
+ "type": "string"
+ },
+ "chat_model": {
+ "description": "自定义对话模型名称",
+ "type": "string"
+ },
+ "mode": {
+ "type": "string",
+ "enum": [
+ "manual",
+ "auto"
+ ]
+ }
+ }
+ },
+ "domain.SwitchModeResp": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextConfig": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextImgConfig": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextReq": {
+ "type": "object",
+ "required": [
+ "text"
+ ],
+ "properties": {
+ "action": {
+ "description": "action: improve, summary, extend, shorten, etc.",
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ThemeAndStyle": {
+ "type": "object",
+ "properties": {
+ "bg_image": {
+ "type": "string"
+ },
+ "doc_width": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UpdateAppReq": {
+ "type": "object",
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettings"
+ }
+ }
+ },
+ "domain.UpdateKnowledgeBaseReq": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UpdateModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "id",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.UpdateNodeReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UploadByUrlReq": {
+ "type": "object",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UserInfo": {
+ "type": "object",
+ "properties": {
+ "auth_user_id": {
+ "type": "integer"
+ },
+ "avatar": {
+ "description": "avatar",
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "from": {
+ "$ref": "#/definitions/domain.MessageFrom"
+ },
+ "name": {
+ "type": "string"
+ },
+ "real_name": {
+ "type": "string"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WeChatAppAdvancedSetting": {
+ "type": "object",
+ "properties": {
+ "disclaimer_content": {
+ "type": "string"
+ },
+ "feedback_enable": {
+ "type": "boolean"
+ },
+ "feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "text_response_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.WebAppCommentSettings": {
+ "type": "object",
+ "properties": {
+ "is_enable": {
+ "type": "boolean"
+ },
+ "moderation_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.WebAppCustomSettings": {
+ "type": "object",
+ "properties": {
+ "allow_theme_switching": {
+ "type": "boolean"
+ },
+ "footer_show_intro": {
+ "type": "boolean"
+ },
+ "header_search_placeholder": {
+ "type": "string"
+ },
+ "show_brand_info": {
+ "type": "boolean"
+ },
+ "social_media_accounts": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.SocialMediaAccount"
+ }
+ }
+ }
+ },
+ "domain.WebAppLandingConfig": {
+ "type": "object",
+ "properties": {
+ "banner_config": {
+ "$ref": "#/definitions/domain.BannerConfig"
+ },
+ "basic_doc_config": {
+ "$ref": "#/definitions/domain.BasicDocConfig"
+ },
+ "block_grid_config": {
+ "$ref": "#/definitions/domain.BlockGridConfig"
+ },
+ "carousel_config": {
+ "$ref": "#/definitions/domain.CarouselConfig"
+ },
+ "case_config": {
+ "$ref": "#/definitions/domain.CaseConfig"
+ },
+ "com_config_order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "comment_config": {
+ "$ref": "#/definitions/domain.CommentConfig"
+ },
+ "dir_doc_config": {
+ "$ref": "#/definitions/domain.DirDocConfig"
+ },
+ "faq_config": {
+ "$ref": "#/definitions/domain.FaqConfig"
+ },
+ "feature_config": {
+ "$ref": "#/definitions/domain.FeatureConfig"
+ },
+ "img_text_config": {
+ "$ref": "#/definitions/domain.ImgTextConfig"
+ },
+ "metrics_config": {
+ "$ref": "#/definitions/domain.MetricsConfig"
+ },
+ "nav_doc_config": {
+ "$ref": "#/definitions/domain.NavDocConfig"
+ },
+ "node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "question_config": {
+ "$ref": "#/definitions/domain.QuestionConfig"
+ },
+ "simple_doc_config": {
+ "$ref": "#/definitions/domain.SimpleDocConfig"
+ },
+ "text_config": {
+ "$ref": "#/definitions/domain.TextConfig"
+ },
+ "text_img_config": {
+ "$ref": "#/definitions/domain.TextImgConfig"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WebAppLandingConfigResp": {
+ "type": "object",
+ "properties": {
+ "banner_config": {
+ "$ref": "#/definitions/domain.BannerConfig"
+ },
+ "basic_doc_config": {
+ "$ref": "#/definitions/domain.BasicDocConfig"
+ },
+ "block_grid_config": {
+ "$ref": "#/definitions/domain.BlockGridConfig"
+ },
+ "carousel_config": {
+ "$ref": "#/definitions/domain.CarouselConfig"
+ },
+ "case_config": {
+ "$ref": "#/definitions/domain.CaseConfig"
+ },
+ "com_config_order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "comment_config": {
+ "$ref": "#/definitions/domain.CommentConfig"
+ },
+ "dir_doc_config": {
+ "$ref": "#/definitions/domain.DirDocConfig"
+ },
+ "faq_config": {
+ "$ref": "#/definitions/domain.FaqConfig"
+ },
+ "feature_config": {
+ "$ref": "#/definitions/domain.FeatureConfig"
+ },
+ "img_text_config": {
+ "$ref": "#/definitions/domain.ImgTextConfig"
+ },
+ "metrics_config": {
+ "$ref": "#/definitions/domain.MetricsConfig"
+ },
+ "nav_doc_config": {
+ "$ref": "#/definitions/domain.NavDocConfig"
+ },
+ "node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "question_config": {
+ "$ref": "#/definitions/domain.QuestionConfig"
+ },
+ "simple_doc_config": {
+ "$ref": "#/definitions/domain.SimpleDocConfig"
+ },
+ "text_config": {
+ "$ref": "#/definitions/domain.TextConfig"
+ },
+ "text_img_config": {
+ "$ref": "#/definitions/domain.TextImgConfig"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WebAppLandingTheme": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WecomAIBotSettings": {
+ "type": "object",
+ "properties": {
+ "encodingaeskey": {
+ "type": "string"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WidgetBotSettings": {
+ "type": "object",
+ "properties": {
+ "btn_id": {
+ "type": "string"
+ },
+ "btn_logo": {
+ "type": "string"
+ },
+ "btn_position": {
+ "type": "string"
+ },
+ "btn_style": {
+ "type": "string"
+ },
+ "btn_text": {
+ "type": "string"
+ },
+ "copyright_hide_enabled": {
+ "type": "boolean"
+ },
+ "copyright_info": {
+ "type": "string"
+ },
+ "disclaimer": {
+ "type": "string"
+ },
+ "is_open": {
+ "type": "boolean"
+ },
+ "modal_position": {
+ "type": "string"
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_mode": {
+ "type": "string"
+ },
+ "theme_mode": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp": {
+ "type": "object",
+ "properties": {
+ "auths": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.AuthItem"
+ }
+ },
+ "client_id": {
+ "type": "string"
+ },
+ "client_secret": {
+ "type": "string"
+ },
+ "proxy": {
+ "type": "string"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "is_released": {
+ "type": "boolean"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeListItemResp"
+ }
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "nav_name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "$ref": "#/definitions/consts.AuthType"
+ },
+ "license_edition": {
+ "$ref": "#/definitions/consts.LicenseEdition"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp": {
+ "type": "object"
+ },
+ "github_com_chaitin_panda-wiki_domain.CheckModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.CheckModelResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "error": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelListItem": {
+ "type": "object",
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "total_tokens": {
+ "type": "integer"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelParam": {
+ "type": "object",
+ "properties": {
+ "context_window": {
+ "type": "integer"
+ },
+ "max_tokens": {
+ "type": "integer"
+ },
+ "r1_enabled": {
+ "type": "boolean"
+ },
+ "support_computer_use": {
+ "type": "boolean"
+ },
+ "support_images": {
+ "type": "boolean"
+ },
+ "support_prompt_cache": {
+ "type": "boolean"
+ },
+ "temperature": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelProvider": {
+ "type": "string",
+ "enum": [
+ "BaiZhiCloud"
+ ],
+ "x-enum-varnames": [
+ "ModelProviderBrandBaiZhiCloud"
+ ]
+ },
+ "gocap.ChallengeData": {
+ "type": "object",
+ "properties": {
+ "challenge": {
+ "$ref": "#/definitions/gocap.ChallengeItem"
+ },
+ "expires": {
+ "description": "过期时间,毫秒级时间戳",
+ "type": "integer"
+ },
+ "token": {
+ "description": "质询令牌",
+ "type": "string"
+ }
+ }
+ },
+ "gocap.ChallengeItem": {
+ "type": "object",
+ "properties": {
+ "c": {
+ "description": "质询数量",
+ "type": "integer"
+ },
+ "d": {
+ "description": "质询难度",
+ "type": "integer"
+ },
+ "s": {
+ "description": "质询大小",
+ "type": "integer"
+ }
+ }
+ },
+ "gocap.VerificationResult": {
+ "type": "object",
+ "properties": {
+ "expires": {
+ "description": "过期时间,毫秒级时间戳",
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ },
+ "token": {
+ "description": "验证令牌",
+ "type": "string"
+ }
+ }
+ },
+ "schema.RoleType": {
+ "type": "string",
+ "enum": [
+ "assistant",
+ "user",
+ "system",
+ "tool"
+ ],
+ "x-enum-varnames": [
+ "Assistant",
+ "User",
+ "System",
+ "Tool"
+ ]
+ },
+ "share.ShareCommentLists": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareCommentListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.AuthGitHubReq": {
+ "type": "object",
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "redirect_url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthGitHubResp": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthItem": {
+ "type": "object",
+ "properties": {
+ "avatar_url": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "last_login_time": {
+ "type": "string"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthLoginSimpleReq": {
+ "type": "object",
+ "required": [
+ "password"
+ ],
+ "properties": {
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthSetReq": {
+ "type": "object",
+ "required": [
+ "source_type"
+ ],
+ "properties": {
+ "client_id": {
+ "type": "string"
+ },
+ "client_secret": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "proxy": {
+ "type": "string"
+ },
+ "source_type": {
+ "enum": [
+ "github"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ ]
+ }
+ }
+ },
+ "v1.CommentLists": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.CommentListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.ConversationListItems": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.CrawlerExportReq": {
+ "type": "object",
+ "required": [
+ "doc_id",
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "doc_id": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerExportResp": {
+ "type": "object",
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerParseReq": {
+ "type": "object",
+ "required": [
+ "crawler_source",
+ "kb_id"
+ ],
+ "properties": {
+ "crawler_source": {
+ "$ref": "#/definitions/consts.CrawlerSource"
+ },
+ "dingtalk_setting": {
+ "$ref": "#/definitions/anydoc.DingtalkSetting"
+ },
+ "feishu_setting": {
+ "$ref": "#/definitions/anydoc.FeishuSetting"
+ },
+ "filename": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerParseResp": {
+ "type": "object",
+ "properties": {
+ "docs": {
+ "$ref": "#/definitions/anydoc.Child"
+ },
+ "id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultReq": {
+ "type": "object",
+ "required": [
+ "task_id"
+ ],
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultResp": {
+ "type": "object",
+ "required": [
+ "status"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ }
+ }
+ },
+ "v1.CrawlerResultsReq": {
+ "type": "object",
+ "required": [
+ "task_ids"
+ ],
+ "properties": {
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "v1.CrawlerResultsResp": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.CrawlerResultItem"
+ }
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ }
+ }
+ },
+ "v1.CreateUserReq": {
+ "type": "object",
+ "required": [
+ "account",
+ "password",
+ "role"
+ ],
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string",
+ "minLength": 8
+ },
+ "role": {
+ "enum": [
+ "admin",
+ "user"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ ]
+ }
+ }
+ },
+ "v1.CreateUserResp": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.FileUploadResp": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.KBUserInviteReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "perm",
+ "user_id"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "perm": {
+ "enum": [
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.KBUserListItemResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "perms": {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.KBUserUpdateReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "perm",
+ "user_id"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "perm": {
+ "enum": [
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.LoginReq": {
+ "type": "object",
+ "required": [
+ "account",
+ "password"
+ ],
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.LoginResp": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavAddReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "name"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ }
+ }
+ },
+ "v1.NavListResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavMoveReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "next_id": {
+ "type": "string"
+ },
+ "prev_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavUpdateReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodeDetailResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator_account": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor_account": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "pv": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodeMoveNavReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id",
+ "nav_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodePermissionEditReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "answerable_groups": {
+ "description": "可被问答",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "visible_groups": {
+ "description": "导航内可见",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "visitable_groups": {
+ "description": "可被访问",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "v1.NodePermissionEditResp": {
+ "type": "object"
+ },
+ "v1.NodePermissionResp": {
+ "type": "object",
+ "properties": {
+ "answerable_groups": {
+ "description": "可被问答",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ },
+ "id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "visible_groups": {
+ "description": "导航内可见",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ },
+ "visitable_groups": {
+ "description": "可被访问",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ }
+ }
+ },
+ "v1.NodeRestudyReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "node_ids"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "node_ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "v1.NodeRestudyResp": {
+ "type": "object"
+ },
+ "v1.NodeStatsResp": {
+ "type": "object",
+ "properties": {
+ "unpublished_count": {
+ "description": "未发布的文档数",
+ "type": "integer"
+ },
+ "unreleased_nav_count": {
+ "description": "未发布目录数量",
+ "type": "integer"
+ },
+ "unstudied_count": {
+ "description": "未学习的文档数",
+ "type": "integer"
+ }
+ }
+ },
+ "v1.ResetPasswordReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "new_password"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "new_password": {
+ "type": "string",
+ "minLength": 8
+ }
+ }
+ },
+ "v1.ShareFileUploadUrlReq": {
+ "type": "object",
+ "required": [
+ "captcha_token",
+ "url"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.ShareFileUploadUrlResp": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.ShareNodeDetailResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator_account": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor_account": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareNodeDetailItem"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "pv": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.StatConversationDistributionResp": {
+ "type": "object",
+ "properties": {
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "count": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.StatCountResp": {
+ "type": "object",
+ "properties": {
+ "conversation_count": {
+ "type": "integer"
+ },
+ "ip_count": {
+ "type": "integer"
+ },
+ "page_visit_count": {
+ "type": "integer"
+ },
+ "session_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.UserInfoResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_token": {
+ "type": "boolean"
+ },
+ "last_access": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.UserListItemResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "last_access": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.UserListResp": {
+ "type": "object",
+ "properties": {
+ "users": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.UserListItemResp"
+ }
+ }
+ }
+ },
+ "v1.WechatAppInfoResp": {
+ "type": "object",
+ "properties": {
+ "disclaimer_content": {
+ "type": "string"
+ },
+ "feedback_enable": {
+ "type": "boolean"
+ },
+ "feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_app_is_enabled": {
+ "type": "boolean"
+ }
+ }
+ }
+ },
+ "securityDefinitions": {
+ "bearerAuth": {
+ "description": "Type \"Bearer\" + a space + your token to authorize",
+ "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: "panda-wiki API",
+ Description: "panda-wiki API documentation",
+ InfoInstanceName: "swagger",
+ SwaggerTemplate: docTemplate,
+ LeftDelim: "{{",
+ RightDelim: "}}",
+}
+
+func init() {
+ swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
+}
diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json
new file mode 100644
index 0000000..1487872
--- /dev/null
+++ b/backend/docs/swagger.json
@@ -0,0 +1,9777 @@
+{
+ "swagger": "2.0",
+ "info": {
+ "description": "panda-wiki API documentation",
+ "title": "panda-wiki API",
+ "contact": {},
+ "version": "1.0"
+ },
+ "basePath": "/",
+ "paths": {
+ "/api/v1/app": {
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update app",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Update app",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "app",
+ "name": "app",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateAppReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Delete app",
+ "consumes": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Delete app",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "app id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/app/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get app detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "app"
+ ],
+ "summary": "Get app detail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "type",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.AppDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "删除授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "删除授权信息",
+ "operationId": "v1-OpenAuthDelete",
+ "parameters": [
+ {
+ "type": "integer",
+ "name": "id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/get": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "获取授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "获取授权信息",
+ "operationId": "v1-OpenAuthGet",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "dingtalk",
+ "feishu",
+ "wecom",
+ "oauth",
+ "github",
+ "cas",
+ "ldap",
+ "widget",
+ "dingtalk_bot",
+ "feishu_bot",
+ "lark_bot",
+ "wechat_bot",
+ "wecom_ai_bot",
+ "wechat_service_bot",
+ "discord_bot",
+ "wechat_official_account",
+ "openai_api",
+ "mcp_server"
+ ],
+ "type": "string",
+ "x-enum-varnames": [
+ "SourceTypeDingTalk",
+ "SourceTypeFeishu",
+ "SourceTypeWeCom",
+ "SourceTypeOAuth",
+ "SourceTypeGitHub",
+ "SourceTypeCAS",
+ "SourceTypeLDAP",
+ "SourceTypeWidget",
+ "SourceTypeDingtalkBot",
+ "SourceTypeFeishuBot",
+ "SourceTypeLarkBot",
+ "SourceTypeWechatBot",
+ "SourceTypeWecomAIBot",
+ "SourceTypeWechatServiceBot",
+ "SourceTypeDiscordBot",
+ "SourceTypeWechatOfficialAccount",
+ "SourceTypeOpenAIAPI",
+ "SourceTypeMcpServer"
+ ],
+ "name": "source_type",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/auth/set": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "设置授权信息",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Auth"
+ ],
+ "summary": "设置授权信息",
+ "operationId": "v1-OpenAuthSet",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthSetReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/comment": {
+ "get": {
+ "description": "GetCommentModeratedList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "comment"
+ ],
+ "summary": "GetCommentModeratedList",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "enum": [
+ -1,
+ 0,
+ 1
+ ],
+ "type": "integer",
+ "format": "int32",
+ "x-enum-varnames": [
+ "CommentStatusReject",
+ "CommentStatusPending",
+ "CommentStatusAccepted"
+ ],
+ "name": "status",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "conversationList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CommentLists"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/comment/list": {
+ "delete": {
+ "description": "DeleteCommentList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "comment"
+ ],
+ "summary": "DeleteCommentList",
+ "parameters": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "ids",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "total",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation": {
+ "get": {
+ "description": "get conversation list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "conversation"
+ ],
+ "summary": "get conversation list",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "app_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "remote_ip",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "subject",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ConversationListItems"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/detail": {
+ "get": {
+ "description": "get conversation detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "conversation"
+ ],
+ "summary": "get conversation detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ConversationDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/message/detail": {
+ "get": {
+ "description": "Get message detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Message"
+ ],
+ "summary": "Get message detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ConversationMessage"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/conversation/message/list": {
+ "get": {
+ "description": "GetMessageFeedBackList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Message"
+ ],
+ "summary": "GetMessageFeedBackList",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "page",
+ "in": "query",
+ "required": true
+ },
+ {
+ "minimum": 1,
+ "type": "integer",
+ "name": "per_page",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "MessageList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.PaginatedResult-array_domain_ConversationMessageListItem"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/export": {
+ "post": {
+ "description": "CrawlerExport",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "CrawlerExport",
+ "parameters": [
+ {
+ "description": "Scrape",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerExportReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerExportResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/parse": {
+ "post": {
+ "description": "解析文档树",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "解析文档树",
+ "parameters": [
+ {
+ "description": "Scrape",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerParseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerParseResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/result": {
+ "get": {
+ "description": "Retrieve the result of a previously started scraping task",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "Get Crawler Result",
+ "parameters": [
+ {
+ "description": "Crawler Result Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerResultReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerResultResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/crawler/results": {
+ "post": {
+ "description": "Retrieve the results of a previously started scraping task",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "crawler"
+ ],
+ "summary": "Get Crawler Results",
+ "parameters": [
+ {
+ "description": "Crawler Results Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CrawlerResultsReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CrawlerResultsResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/creation/tab-complete": {
+ "post": {
+ "description": "Tab-based document completion similar to AI coding's FIM (Fill in Middle)",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "creation"
+ ],
+ "summary": "Tab-based document completion",
+ "parameters": [
+ {
+ "description": "tab completion request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CompleteReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/creation/text": {
+ "post": {
+ "description": "Text creation",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "creation"
+ ],
+ "summary": "Text creation",
+ "parameters": [
+ {
+ "description": "text creation request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.TextReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "success",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload": {
+ "post": {
+ "description": "Upload File",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload File",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "formData"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.ObjectUploadResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload/anydoc": {
+ "post": {
+ "description": "Upload Anydoc File",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload Anydoc File",
+ "parameters": [
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "File Path",
+ "name": "path",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.AnydocUploadResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/file/upload/url": {
+ "post": {
+ "description": "Upload File By Url",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "file"
+ ],
+ "summary": "Upload File By Url",
+ "parameters": [
+ {
+ "description": "Request Body",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UploadByUrlReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ObjectUploadResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base": {
+ "post": {
+ "description": "CreateKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "CreateKnowledgeBase",
+ "parameters": [
+ {
+ "description": "CreateKnowledgeBase Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateKnowledgeBaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetKnowledgeBaseDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKnowledgeBaseDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.KnowledgeBaseDetail"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "put": {
+ "description": "UpdateKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "UpdateKnowledgeBase",
+ "parameters": [
+ {
+ "description": "UpdateKnowledgeBase Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateKnowledgeBaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "delete": {
+ "description": "DeleteKnowledgeBase",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "DeleteKnowledgeBase",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/list": {
+ "get": {
+ "description": "GetKnowledgeBaseList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKnowledgeBaseList",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.KnowledgeBaseListItem"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/release": {
+ "post": {
+ "description": "CreateKBRelease",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "CreateKBRelease",
+ "parameters": [
+ {
+ "description": "CreateKBRelease Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateKBReleaseReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/release/list": {
+ "get": {
+ "description": "GetKBReleaseList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "GetKBReleaseList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.GetKBReleaseListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Remove user from knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserDelete",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "user_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/invite": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Invite user to knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserInvite",
+ "parameters": [
+ {
+ "description": "Invite User Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.KBUserInviteReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "KBUserList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.KBUserListItemResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/knowledge_base/user/update": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update user permission in knowledge base",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "knowledge_base"
+ ],
+ "summary": "KBUserUpdate",
+ "parameters": [
+ {
+ "description": "Update User Permission Request",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.KBUserUpdateReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model": {
+ "put": {
+ "description": "update model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "parameters": [
+ {
+ "description": "update model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ },
+ "post": {
+ "description": "create model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "create model",
+ "parameters": [
+ {
+ "description": "create model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/check": {
+ "post": {
+ "description": "check model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "check model",
+ "parameters": [
+ {
+ "description": "check model request",
+ "name": "model",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/list": {
+ "get": {
+ "description": "get model list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get model list",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelListItem"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/mode-setting": {
+ "get": {
+ "description": "get current model mode setting including mode, API key and chat model",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get model mode setting",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ModelModeSetting"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/provider/supported": {
+ "post": {
+ "description": "get provider supported model list",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "get provider supported model list",
+ "parameters": [
+ {
+ "description": "get supported model list request",
+ "name": "params",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.GetProviderModelListReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.GetProviderModelListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/model/switch-mode": {
+ "post": {
+ "description": "switch model mode between manual and auto",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "model"
+ ],
+ "summary": "switch mode",
+ "parameters": [
+ {
+ "description": "switch mode request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.SwitchModeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.SwitchModeResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/add": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Add Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "添加分栏",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavAddReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/delete": {
+ "delete": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "DeleteNav Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "删除栏目",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Nav List",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "获取分栏列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.NavListResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "移动栏目",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavMoveReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/nav/update": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update Nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Nav"
+ ],
+ "summary": "更新栏目信息",
+ "parameters": [
+ {
+ "description": "Params",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NavUpdateReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Create Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Create Node",
+ "parameters": [
+ {
+ "description": "Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CreateNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/action": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Node Action",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Node Action",
+ "parameters": [
+ {
+ "description": "Action",
+ "name": "action",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeActionReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/batch_move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Batch Move Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Batch Move Node",
+ "parameters": [
+ {
+ "description": "Batch Move Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.BatchMoveReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/detail": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node Detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node Detail",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "format",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "put": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Update Node Detail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Update Node Detail",
+ "parameters": [
+ {
+ "description": "Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.UpdateNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/list": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node List",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node List",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "nav_id",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "search",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeListItemResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/list/group/nav": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get unpublished or unstudied document list grouped by nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node List Grouped by Nav",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "nav_ids",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "search",
+ "in": "query"
+ },
+ {
+ "enum": [
+ "released",
+ "unpublished",
+ "unstudied"
+ ],
+ "type": "string",
+ "name": "status",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/move": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Move Node",
+ "parameters": [
+ {
+ "description": "Move Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.MoveNodeReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/move/nav": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Move node (and all its descendants if folder) to a different nav",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Move Node to Nav",
+ "parameters": [
+ {
+ "description": "Move Node Nav",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodeMoveNavReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/permission": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档授权信息获取",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "NodePermission"
+ ],
+ "summary": "文档授权信息获取",
+ "operationId": "v1-NodePermission",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodePermissionResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/permission/edit": {
+ "patch": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档授权信息更新",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "NodePermission"
+ ],
+ "summary": "文档授权信息更新",
+ "operationId": "v1-NodePermissionEdit",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodePermissionEditReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodePermissionEditResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/recommend_nodes": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Recommend Nodes",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Recommend Nodes",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "nav_ids",
+ "in": "query"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "collectionFormat": "csv",
+ "name": "node_ids",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/restudy": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "文档重新学习",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Node"
+ ],
+ "summary": "文档重新学习",
+ "operationId": "v1-NodeRestudy",
+ "parameters": [
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.NodeRestudyReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeRestudyResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/stats": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Get Node Statistics",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Get Node Statistics",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.NodeStatsResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/summary": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Summary Node",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Summary Node 异步后台生成",
+ "parameters": [
+ {
+ "description": "Summary Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeSummaryReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/node/summary/stream": {
+ "post": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "Stream Summary Node for single document",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "text/event-stream"
+ ],
+ "tags": [
+ "node"
+ ],
+ "summary": "Stream Summary Node",
+ "parameters": [
+ {
+ "description": "Summary Node",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.NodeSummaryReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "SSE stream",
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/browsers": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "客户端统计",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "客户端统计",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.HotBrowser"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/conversation_distribution": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "问答来源",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "问答来源",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.StatConversationDistributionResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "全局统计",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "全局统计",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.StatCountResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/geo_count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "用户地理分布",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "用户地理分布",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/hot_pages": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "热门文档",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "热门文档",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.HotPage"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/instant_count": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetInstantCount",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "GetInstantCount",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.InstantCountResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/instant_pages": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "GetInstantPages",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "GetInstantPages",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.InstantPageResp"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/stat/referer_hosts": {
+ "get": {
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "description": "来源域名",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "stat"
+ ],
+ "summary": "来源域名",
+ "parameters": [
+ {
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "type": "integer",
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ],
+ "name": "day",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.HotRefererHost"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user": {
+ "get": {
+ "description": "GetUser",
+ "consumes": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "GetUser",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.UserInfoResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/create": {
+ "post": {
+ "description": "CreateUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "CreateUser",
+ "parameters": [
+ {
+ "description": "CreateUser Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.CreateUserReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.CreateUserResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/delete": {
+ "delete": {
+ "description": "DeleteUser",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "DeleteUser",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "user_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/list": {
+ "get": {
+ "description": "ListUsers",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "ListUsers",
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.UserListResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/login": {
+ "post": {
+ "description": "Login",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "Login",
+ "parameters": [
+ {
+ "description": "Login Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.LoginReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/v1.LoginResp"
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/user/reset_password": {
+ "put": {
+ "description": "ResetPassword",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "user"
+ ],
+ "summary": "ResetPassword",
+ "parameters": [
+ {
+ "description": "ResetPassword Request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.ResetPasswordReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/web/info": {
+ "get": {
+ "description": "GetAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_app"
+ ],
+ "summary": "GetAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.AppInfoResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/wechat/info": {
+ "get": {
+ "description": "WechatAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "WechatAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.WechatAppInfoResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/wechat/service/answer": {
+ "get": {
+ "description": "GetWechatAnswer",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Wechat"
+ ],
+ "summary": "GetWechatAnswer",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "conversation id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/app/widget/info": {
+ "get": {
+ "description": "GetWidgetAppInfo",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_app"
+ ],
+ "summary": "GetWidgetAppInfo",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/get": {
+ "get": {
+ "description": "AuthGet",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_auth"
+ ],
+ "summary": "AuthGet",
+ "operationId": "v1-AuthGet",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb_id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/github": {
+ "post": {
+ "description": "GitHub登录",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareAuth"
+ ],
+ "summary": "GitHub登录",
+ "operationId": "v1-AuthGitHub",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthGitHubReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.AuthGitHubResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/auth/login/simple": {
+ "post": {
+ "description": "AuthLoginSimple",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_auth"
+ ],
+ "summary": "AuthLoginSimple",
+ "operationId": "v1-AuthLoginSimple",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb_id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "para",
+ "name": "param",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.AuthLoginSimpleReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/captcha/challenge": {
+ "post": {
+ "description": "CreateCaptcha",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_captcha"
+ ],
+ "summary": "CreateCaptcha",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/gocap.ChallengeData"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/captcha/redeem": {
+ "post": {
+ "description": "RedeemCaptcha",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_captcha"
+ ],
+ "summary": "RedeemCaptcha",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/consts.RedeemCaptchaReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/gocap.VerificationResult"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/completions": {
+ "post": {
+ "description": "OpenAI API compatible chat completions endpoint",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "ChatCompletions",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "Knowledge Base ID",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "description": "OpenAI API request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAICompletionsRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAICompletionsResponse"
+ }
+ },
+ "400": {
+ "description": "Bad Request",
+ "schema": {
+ "$ref": "#/definitions/domain.OpenAIErrorResponse"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/feedback": {
+ "post": {
+ "description": "Process user feedback for chat conversations",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "Handle chat feedback",
+ "parameters": [
+ {
+ "description": "feedback request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.FeedbackRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/message": {
+ "post": {
+ "description": "ChatMessage",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat"
+ ],
+ "summary": "ChatMessage",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "app_type",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/search": {
+ "post": {
+ "description": "ChatSearch",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_chat_search"
+ ],
+ "summary": "ChatSearch",
+ "parameters": [
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatSearchReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ChatSearchResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/widget": {
+ "post": {
+ "description": "ChatWidget",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Widget"
+ ],
+ "summary": "ChatWidget",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "app type",
+ "name": "app_type",
+ "in": "query",
+ "required": true
+ },
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatRequest"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/chat/widget/search": {
+ "post": {
+ "description": "WidgetSearch",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "Widget"
+ ],
+ "summary": "WidgetSearch",
+ "parameters": [
+ {
+ "description": "Comment",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.ChatSearchReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ChatSearchResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/comment": {
+ "post": {
+ "description": "CreateComment",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_comment"
+ ],
+ "summary": "CreateComment",
+ "parameters": [
+ {
+ "description": "Comment",
+ "name": "comment",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.CommentReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CommentID",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "string"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/comment/list": {
+ "get": {
+ "description": "GetCommentList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_comment"
+ ],
+ "summary": "GetCommentList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "nodeID",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CommentList",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/share.ShareCommentLists"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/common/file/upload": {
+ "post": {
+ "description": "前台用户上传文件,目前只支持图片文件上传",
+ "consumes": [
+ "multipart/form-data"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareFile"
+ ],
+ "summary": "文件上传",
+ "operationId": "share-FileUpload",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "file",
+ "description": "File",
+ "name": "file",
+ "in": "formData",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "captcha_token",
+ "name": "captcha_token",
+ "in": "formData",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.FileUploadResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/common/file/upload/url": {
+ "post": {
+ "description": "前台用户上传文件,目前只支持图片文件上传",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareFile"
+ ],
+ "summary": "文件上传",
+ "operationId": "share-FileUploadByUrl",
+ "parameters": [
+ {
+ "description": "body",
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/v1.ShareFileUploadUrlReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ShareFileUploadUrlResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/conversation/detail": {
+ "get": {
+ "description": "GetConversationDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_conversation"
+ ],
+ "summary": "GetConversationDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "conversation id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/domain.ShareConversationDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/nav/list": {
+ "get": {
+ "description": "ShareNavList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_nav"
+ ],
+ "summary": "前台获取栏目列表",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "kb_id",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/node/detail": {
+ "get": {
+ "description": "GetNodeDetail",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_node"
+ ],
+ "summary": "GetNodeDetail",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "node id",
+ "name": "id",
+ "in": "query",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "format",
+ "name": "format",
+ "in": "query",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/v1.ShareNodeDetailResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/node/list": {
+ "get": {
+ "description": "ShareNodeList",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_node"
+ ],
+ "summary": "ShareNodeList",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "kb id",
+ "name": "X-KB-ID",
+ "in": "header",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/openapi/github/callback": {
+ "get": {
+ "description": "GitHub回调",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareOpenapi"
+ ],
+ "summary": "GitHub回调",
+ "operationId": "v1-GitHubCallback",
+ "parameters": [
+ {
+ "type": "string",
+ "name": "code",
+ "in": "query"
+ },
+ {
+ "type": "string",
+ "name": "state",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.PWResponse"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp"
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/openapi/lark/bot/{kb_id}": {
+ "post": {
+ "description": "Lark机器人请求",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "ShareOpenapi"
+ ],
+ "summary": "Lark机器人请求",
+ "operationId": "v1-LarkBot",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "知识库ID",
+ "name": "kb_id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.PWResponse"
+ }
+ }
+ }
+ }
+ },
+ "/share/v1/stat/page": {
+ "post": {
+ "description": "RecordPage",
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "share_stat"
+ ],
+ "summary": "RecordPage",
+ "parameters": [
+ {
+ "description": "request",
+ "name": "request",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/domain.StatPageReq"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/domain.Response"
+ }
+ }
+ }
+ }
+ }
+ },
+ "definitions": {
+ "anydoc.Child": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/anydoc.Child"
+ }
+ },
+ "value": {
+ "$ref": "#/definitions/anydoc.Value"
+ }
+ }
+ },
+ "anydoc.DingtalkSetting": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "phone": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ },
+ "unionid": {
+ "type": "string"
+ }
+ }
+ },
+ "anydoc.FeishuSetting": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ },
+ "user_access_token": {
+ "type": "string"
+ }
+ }
+ },
+ "anydoc.Value": {
+ "type": "object",
+ "properties": {
+ "file": {
+ "type": "boolean"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "consts.AuthType": {
+ "type": "string",
+ "enum": [
+ "",
+ "simple",
+ "enterprise"
+ ],
+ "x-enum-comments": {
+ "AuthTypeEnterprise": "企业认证",
+ "AuthTypeNull": "无认证",
+ "AuthTypeSimple": "简单口令"
+ },
+ "x-enum-descriptions": [
+ "无认证",
+ "简单口令",
+ "企业认证"
+ ],
+ "x-enum-varnames": [
+ "AuthTypeNull",
+ "AuthTypeSimple",
+ "AuthTypeEnterprise"
+ ]
+ },
+ "consts.CopySetting": {
+ "type": "string",
+ "enum": [
+ "",
+ "append",
+ "disabled"
+ ],
+ "x-enum-comments": {
+ "CopySettingAppend": "增加内容尾巴",
+ "CopySettingDisabled": "禁止复制内容",
+ "CopySettingNone": "无限制"
+ },
+ "x-enum-descriptions": [
+ "无限制",
+ "增加内容尾巴",
+ "禁止复制内容"
+ ],
+ "x-enum-varnames": [
+ "CopySettingNone",
+ "CopySettingAppend",
+ "CopySettingDisabled"
+ ]
+ },
+ "consts.CrawlerSource": {
+ "type": "string",
+ "enum": [
+ "url",
+ "rss",
+ "sitemap",
+ "notion",
+ "feishu",
+ "dingtalk",
+ "file",
+ "epub",
+ "yuque",
+ "siyuan",
+ "mindoc",
+ "wikijs",
+ "confluence"
+ ],
+ "x-enum-varnames": [
+ "CrawlerSourceUrl",
+ "CrawlerSourceRSS",
+ "CrawlerSourceSitemap",
+ "CrawlerSourceNotion",
+ "CrawlerSourceFeishu",
+ "CrawlerSourceDingtalk",
+ "CrawlerSourceFile",
+ "CrawlerSourceEpub",
+ "CrawlerSourceYuque",
+ "CrawlerSourceSiyuan",
+ "CrawlerSourceMindoc",
+ "CrawlerSourceWikijs",
+ "CrawlerSourceConfluence"
+ ]
+ },
+ "consts.CrawlerStatus": {
+ "type": "string",
+ "enum": [
+ "pending",
+ "in_process",
+ "completed",
+ "failed"
+ ],
+ "x-enum-varnames": [
+ "CrawlerStatusPending",
+ "CrawlerStatusInProcess",
+ "CrawlerStatusCompleted",
+ "CrawlerStatusFailed"
+ ]
+ },
+ "consts.HomePageSetting": {
+ "type": "string",
+ "enum": [
+ "doc",
+ "custom"
+ ],
+ "x-enum-comments": {
+ "HomePageSettingCustom": "自定义首页",
+ "HomePageSettingDoc": "文档页面"
+ },
+ "x-enum-descriptions": [
+ "文档页面",
+ "自定义首页"
+ ],
+ "x-enum-varnames": [
+ "HomePageSettingDoc",
+ "HomePageSettingCustom"
+ ]
+ },
+ "consts.LicenseEdition": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "x-enum-comments": {
+ "LicenseEditionBusiness": "商业版",
+ "LicenseEditionEnterprise": "企业版",
+ "LicenseEditionFree": "开源版",
+ "LicenseEditionProfession": "专业版"
+ },
+ "x-enum-descriptions": [
+ "开源版",
+ "专业版",
+ "企业版",
+ "商业版"
+ ],
+ "x-enum-varnames": [
+ "LicenseEditionFree",
+ "LicenseEditionProfession",
+ "LicenseEditionEnterprise",
+ "LicenseEditionBusiness"
+ ]
+ },
+ "consts.ModelSettingMode": {
+ "type": "string",
+ "enum": [
+ "manual",
+ "auto"
+ ],
+ "x-enum-varnames": [
+ "ModelSettingModeManual",
+ "ModelSettingModeAuto"
+ ]
+ },
+ "consts.NodeAccessPerm": {
+ "type": "string",
+ "enum": [
+ "open",
+ "partial",
+ "closed"
+ ],
+ "x-enum-comments": {
+ "NodeAccessPermClosed": "完全禁止",
+ "NodeAccessPermOpen": "完全开放",
+ "NodeAccessPermPartial": "部分开放"
+ },
+ "x-enum-descriptions": [
+ "完全开放",
+ "部分开放",
+ "完全禁止"
+ ],
+ "x-enum-varnames": [
+ "NodeAccessPermOpen",
+ "NodeAccessPermPartial",
+ "NodeAccessPermClosed"
+ ]
+ },
+ "consts.NodePermName": {
+ "type": "string",
+ "enum": [
+ "visible",
+ "visitable",
+ "answerable"
+ ],
+ "x-enum-comments": {
+ "NodePermNameAnswerable": "可被问答",
+ "NodePermNameVisible": "导航内可见",
+ "NodePermNameVisitable": "可被访问"
+ },
+ "x-enum-descriptions": [
+ "导航内可见",
+ "可被访问",
+ "可被问答"
+ ],
+ "x-enum-varnames": [
+ "NodePermNameVisible",
+ "NodePermNameVisitable",
+ "NodePermNameAnswerable"
+ ]
+ },
+ "consts.NodeRagInfoStatus": {
+ "type": "string",
+ "enum": [
+ "PENDING",
+ "RUNNING",
+ "FAILED",
+ "SUCCEEDED",
+ "REINDEX"
+ ],
+ "x-enum-comments": {
+ "NodeRagStatusFailed": "处理失败",
+ "NodeRagStatusPending": "等待处理",
+ "NodeRagStatusReindexing": "重新索引中",
+ "NodeRagStatusRunning": "正在进行处理(文本分割、向量化等)",
+ "NodeRagStatusSucceeded": "处理成功"
+ },
+ "x-enum-descriptions": [
+ "等待处理",
+ "正在进行处理(文本分割、向量化等)",
+ "处理失败",
+ "处理成功",
+ "重新索引中"
+ ],
+ "x-enum-varnames": [
+ "NodeRagStatusPending",
+ "NodeRagStatusRunning",
+ "NodeRagStatusFailed",
+ "NodeRagStatusSucceeded",
+ "NodeRagStatusReindexing"
+ ]
+ },
+ "consts.RedeemCaptchaReq": {
+ "type": "object",
+ "properties": {
+ "solutions": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "consts.SourceType": {
+ "type": "string",
+ "enum": [
+ "dingtalk",
+ "feishu",
+ "wecom",
+ "oauth",
+ "github",
+ "cas",
+ "ldap",
+ "widget",
+ "dingtalk_bot",
+ "feishu_bot",
+ "lark_bot",
+ "wechat_bot",
+ "wecom_ai_bot",
+ "wechat_service_bot",
+ "discord_bot",
+ "wechat_official_account",
+ "openai_api",
+ "mcp_server"
+ ],
+ "x-enum-varnames": [
+ "SourceTypeDingTalk",
+ "SourceTypeFeishu",
+ "SourceTypeWeCom",
+ "SourceTypeOAuth",
+ "SourceTypeGitHub",
+ "SourceTypeCAS",
+ "SourceTypeLDAP",
+ "SourceTypeWidget",
+ "SourceTypeDingtalkBot",
+ "SourceTypeFeishuBot",
+ "SourceTypeLarkBot",
+ "SourceTypeWechatBot",
+ "SourceTypeWecomAIBot",
+ "SourceTypeWechatServiceBot",
+ "SourceTypeDiscordBot",
+ "SourceTypeWechatOfficialAccount",
+ "SourceTypeOpenAIAPI",
+ "SourceTypeMcpServer"
+ ]
+ },
+ "consts.StatDay": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 7,
+ 30,
+ 90
+ ],
+ "x-enum-varnames": [
+ "StatDay1",
+ "StatDay7",
+ "StatDay30",
+ "StatDay90"
+ ]
+ },
+ "consts.UserKBPermission": {
+ "type": "string",
+ "enum": [
+ "",
+ "not null",
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "x-enum-comments": {
+ "UserKBPermissionDataOperate": "数据运营",
+ "UserKBPermissionDocManage": "文档管理",
+ "UserKBPermissionFullControl": "完全控制",
+ "UserKBPermissionNotNull": "有权限",
+ "UserKBPermissionNull": "无权限"
+ },
+ "x-enum-descriptions": [
+ "无权限",
+ "有权限",
+ "完全控制",
+ "文档管理",
+ "数据运营"
+ ],
+ "x-enum-varnames": [
+ "UserKBPermissionNull",
+ "UserKBPermissionNotNull",
+ "UserKBPermissionFullControl",
+ "UserKBPermissionDocManage",
+ "UserKBPermissionDataOperate"
+ ]
+ },
+ "consts.UserRole": {
+ "type": "string",
+ "enum": [
+ "admin",
+ "user"
+ ],
+ "x-enum-comments": {
+ "UserRoleAdmin": "管理员",
+ "UserRoleUser": "普通用户"
+ },
+ "x-enum-descriptions": [
+ "管理员",
+ "普通用户"
+ ],
+ "x-enum-varnames": [
+ "UserRoleAdmin",
+ "UserRoleUser"
+ ]
+ },
+ "consts.WatermarkSetting": {
+ "type": "string",
+ "enum": [
+ "",
+ "hidden",
+ "visible"
+ ],
+ "x-enum-comments": {
+ "WatermarkDisabled": "未开启水印",
+ "WatermarkHidden": "隐形水印",
+ "WatermarkVisible": "显性水印"
+ },
+ "x-enum-descriptions": [
+ "未开启水印",
+ "隐形水印",
+ "显性水印"
+ ],
+ "x-enum-varnames": [
+ "WatermarkDisabled",
+ "WatermarkHidden",
+ "WatermarkVisible"
+ ]
+ },
+ "domain.AIFeedbackSettings": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "is_enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.AccessSettings": {
+ "type": "object",
+ "properties": {
+ "base_url": {
+ "type": "string"
+ },
+ "enterprise_auth": {
+ "$ref": "#/definitions/domain.EnterpriseAuth"
+ },
+ "hosts": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "is_forbidden": {
+ "description": "禁止访问",
+ "type": "boolean"
+ },
+ "ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "private_key": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ },
+ "simple_auth": {
+ "$ref": "#/definitions/domain.SimpleAuth"
+ },
+ "source_type": {
+ "description": "企业认证来源",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ ]
+ },
+ "ssl_ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "trusted_proxies": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "domain.AnydocUploadResp": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {
+ "type": "string"
+ },
+ "err": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.AppDetailResp": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettingsResp"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.AppType"
+ }
+ }
+ },
+ "domain.AppInfoResp": {
+ "type": "object",
+ "properties": {
+ "base_url": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettingsResp"
+ }
+ }
+ },
+ "domain.AppSettings": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_settings": {
+ "description": "AI feedback",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AIFeedbackSettings"
+ }
+ ]
+ },
+ "body_code": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {}
+ },
+ "catalog_settings": {
+ "description": "catalog settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CatalogSettings"
+ }
+ ]
+ },
+ "contribute_settings": {
+ "$ref": "#/definitions/domain.ContributeSettings"
+ },
+ "conversation_setting": {
+ "$ref": "#/definitions/domain.ConversationSetting"
+ },
+ "copy_setting": {
+ "enum": [
+ "",
+ "append",
+ "disabled"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.CopySetting"
+ }
+ ]
+ },
+ "desc": {
+ "description": "seo",
+ "type": "string"
+ },
+ "dingtalk_bot_client_id": {
+ "type": "string"
+ },
+ "dingtalk_bot_client_secret": {
+ "type": "string"
+ },
+ "dingtalk_bot_is_enabled": {
+ "description": "DingTalkBot",
+ "type": "boolean"
+ },
+ "dingtalk_bot_template_id": {
+ "type": "string"
+ },
+ "disclaimer_settings": {
+ "description": "Disclaimer Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.DisclaimerSettings"
+ }
+ ]
+ },
+ "discord_bot_is_enabled": {
+ "description": "DisCordBot",
+ "type": "boolean"
+ },
+ "discord_bot_token": {
+ "type": "string"
+ },
+ "document_feedback_is_enabled": {
+ "description": "document feedback",
+ "type": "boolean"
+ },
+ "feishu_bot_app_id": {
+ "type": "string"
+ },
+ "feishu_bot_app_secret": {
+ "type": "string"
+ },
+ "feishu_bot_is_enabled": {
+ "description": "FeishuBot",
+ "type": "boolean"
+ },
+ "footer_settings": {
+ "description": "footer settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FooterSettings"
+ }
+ ]
+ },
+ "head_code": {
+ "description": "inject code",
+ "type": "string"
+ },
+ "home_page_setting": {
+ "$ref": "#/definitions/consts.HomePageSetting"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "keyword": {
+ "type": "string"
+ },
+ "lark_bot_settings": {
+ "description": "LarkBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.LarkBotSettings"
+ }
+ ]
+ },
+ "mcp_server_settings": {
+ "description": "MCP Server Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.MCPServerSettings"
+ }
+ ]
+ },
+ "openai_api_bot_settings": {
+ "description": "OpenAI API Bot settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIAPIBotSettings"
+ }
+ ]
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_placeholder": {
+ "type": "string"
+ },
+ "stats_setting": {
+ "$ref": "#/definitions/domain.StatsSetting"
+ },
+ "theme_and_style": {
+ "$ref": "#/definitions/domain.ThemeAndStyle"
+ },
+ "theme_mode": {
+ "description": "theme",
+ "type": "string"
+ },
+ "title": {
+ "description": "nav",
+ "type": "string"
+ },
+ "watermark_content": {
+ "type": "string"
+ },
+ "watermark_setting": {
+ "enum": [
+ "",
+ "hidden",
+ "visible"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.WatermarkSetting"
+ }
+ ]
+ },
+ "web_app_comment_settings": {
+ "description": "webapp comment settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCommentSettings"
+ }
+ ]
+ },
+ "web_app_custom_style": {
+ "description": "WebAppCustomStyle",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCustomSettings"
+ }
+ ]
+ },
+ "web_app_landing_configs": {
+ "description": "WebAppLandingConfigs",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.WebAppLandingConfig"
+ }
+ },
+ "web_app_landing_theme": {
+ "$ref": "#/definitions/domain.WebAppLandingTheme"
+ },
+ "wechat_app_advanced_setting": {
+ "$ref": "#/definitions/domain.WeChatAppAdvancedSetting"
+ },
+ "wechat_app_agent_id": {
+ "type": "string"
+ },
+ "wechat_app_corpid": {
+ "type": "string"
+ },
+ "wechat_app_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_app_is_enabled": {
+ "description": "WechatAppBot 企业微信机器人",
+ "type": "boolean"
+ },
+ "wechat_app_secret": {
+ "type": "string"
+ },
+ "wechat_app_token": {
+ "type": "string"
+ },
+ "wechat_official_account_app_id": {
+ "type": "string"
+ },
+ "wechat_official_account_app_secret": {
+ "type": "string"
+ },
+ "wechat_official_account_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_official_account_is_enabled": {
+ "description": "WechatOfficialAccount",
+ "type": "boolean"
+ },
+ "wechat_official_account_token": {
+ "type": "string"
+ },
+ "wechat_service_contain_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_corpid": {
+ "type": "string"
+ },
+ "wechat_service_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_service_equal_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_is_enabled": {
+ "description": "WechatServiceBot",
+ "type": "boolean"
+ },
+ "wechat_service_logo": {
+ "type": "string"
+ },
+ "wechat_service_secret": {
+ "type": "string"
+ },
+ "wechat_service_token": {
+ "type": "string"
+ },
+ "wecom_ai_bot_settings": {
+ "description": "WecomAIBotSettings 企业微信智能机器人",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WecomAIBotSettings"
+ }
+ ]
+ },
+ "welcome_str": {
+ "description": "welcome",
+ "type": "string"
+ },
+ "widget_bot_settings": {
+ "description": "Widget bot settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WidgetBotSettings"
+ }
+ ]
+ }
+ }
+ },
+ "domain.AppSettingsResp": {
+ "type": "object",
+ "properties": {
+ "ai_feedback_settings": {
+ "description": "AI feedback",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AIFeedbackSettings"
+ }
+ ]
+ },
+ "body_code": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {}
+ },
+ "catalog_settings": {
+ "description": "catalog settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CatalogSettings"
+ }
+ ]
+ },
+ "contribute_settings": {
+ "$ref": "#/definitions/domain.ContributeSettings"
+ },
+ "conversation_setting": {
+ "$ref": "#/definitions/domain.ConversationSetting"
+ },
+ "copy_setting": {
+ "$ref": "#/definitions/consts.CopySetting"
+ },
+ "desc": {
+ "description": "seo",
+ "type": "string"
+ },
+ "dingtalk_bot_client_id": {
+ "type": "string"
+ },
+ "dingtalk_bot_client_secret": {
+ "type": "string"
+ },
+ "dingtalk_bot_is_enabled": {
+ "description": "DingTalkBot",
+ "type": "boolean"
+ },
+ "dingtalk_bot_template_id": {
+ "type": "string"
+ },
+ "disclaimer_settings": {
+ "description": "Disclaimer Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.DisclaimerSettings"
+ }
+ ]
+ },
+ "discord_bot_is_enabled": {
+ "description": "DisCordBot",
+ "type": "boolean"
+ },
+ "discord_bot_token": {
+ "type": "string"
+ },
+ "document_feedback_is_enabled": {
+ "description": "document feedback",
+ "type": "boolean"
+ },
+ "feishu_bot_app_id": {
+ "type": "string"
+ },
+ "feishu_bot_app_secret": {
+ "type": "string"
+ },
+ "feishu_bot_is_enabled": {
+ "description": "FeishuBot",
+ "type": "boolean"
+ },
+ "footer_settings": {
+ "description": "footer settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FooterSettings"
+ }
+ ]
+ },
+ "head_code": {
+ "description": "inject code",
+ "type": "string"
+ },
+ "home_page_setting": {
+ "$ref": "#/definitions/consts.HomePageSetting"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "keyword": {
+ "type": "string"
+ },
+ "lark_bot_settings": {
+ "description": "LarkBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.LarkBotSettings"
+ }
+ ]
+ },
+ "mcp_server_settings": {
+ "description": "MCP Server Settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.MCPServerSettings"
+ }
+ ]
+ },
+ "openai_api_bot_settings": {
+ "description": "OpenAI API settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIAPIBotSettings"
+ }
+ ]
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_placeholder": {
+ "type": "string"
+ },
+ "stats_setting": {
+ "$ref": "#/definitions/domain.StatsSetting"
+ },
+ "theme_and_style": {
+ "$ref": "#/definitions/domain.ThemeAndStyle"
+ },
+ "theme_mode": {
+ "description": "theme",
+ "type": "string"
+ },
+ "title": {
+ "description": "nav",
+ "type": "string"
+ },
+ "watermark_content": {
+ "type": "string"
+ },
+ "watermark_setting": {
+ "$ref": "#/definitions/consts.WatermarkSetting"
+ },
+ "web_app_comment_settings": {
+ "description": "webapp comment settings",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCommentSettings"
+ }
+ ]
+ },
+ "web_app_custom_style": {
+ "description": "WebAppCustomStyle",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WebAppCustomSettings"
+ }
+ ]
+ },
+ "web_app_landing_configs": {
+ "description": "WebApp Landing Settings",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.WebAppLandingConfigResp"
+ }
+ },
+ "web_app_landing_theme": {
+ "$ref": "#/definitions/domain.WebAppLandingTheme"
+ },
+ "wechat_app_advanced_setting": {
+ "$ref": "#/definitions/domain.WeChatAppAdvancedSetting"
+ },
+ "wechat_app_agent_id": {
+ "type": "string"
+ },
+ "wechat_app_corpid": {
+ "type": "string"
+ },
+ "wechat_app_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_app_is_enabled": {
+ "description": "WechatAppBot",
+ "type": "boolean"
+ },
+ "wechat_app_secret": {
+ "type": "string"
+ },
+ "wechat_app_token": {
+ "type": "string"
+ },
+ "wechat_official_account_app_id": {
+ "type": "string"
+ },
+ "wechat_official_account_app_secret": {
+ "type": "string"
+ },
+ "wechat_official_account_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_official_account_is_enabled": {
+ "description": "WechatOfficialAccount",
+ "type": "boolean"
+ },
+ "wechat_official_account_token": {
+ "type": "string"
+ },
+ "wechat_service_contain_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_corpid": {
+ "type": "string"
+ },
+ "wechat_service_encodingaeskey": {
+ "type": "string"
+ },
+ "wechat_service_equal_keywords": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_service_is_enabled": {
+ "description": "WechatServiceBot",
+ "type": "boolean"
+ },
+ "wechat_service_logo": {
+ "type": "string"
+ },
+ "wechat_service_secret": {
+ "type": "string"
+ },
+ "wechat_service_token": {
+ "type": "string"
+ },
+ "wecom_ai_bot_settings": {
+ "$ref": "#/definitions/domain.WecomAIBotSettings"
+ },
+ "welcome_str": {
+ "description": "welcome",
+ "type": "string"
+ },
+ "widget_bot_settings": {
+ "description": "WidgetBot",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.WidgetBotSettings"
+ }
+ ]
+ }
+ }
+ },
+ "domain.AppType": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4,
+ 5,
+ 6,
+ 7,
+ 8,
+ 9,
+ 10,
+ 11,
+ 12
+ ],
+ "x-enum-varnames": [
+ "AppTypeWeb",
+ "AppTypeWidget",
+ "AppTypeDingTalkBot",
+ "AppTypeFeishuBot",
+ "AppTypeWechatBot",
+ "AppTypeWechatServiceBot",
+ "AppTypeDisCordBot",
+ "AppTypeWechatOfficialAccount",
+ "AppTypeOpenAIAPI",
+ "AppTypeWecomAIBot",
+ "AppTypeLarkBot",
+ "AppTypeMcpServer"
+ ]
+ },
+ "domain.AuthUserInfo": {
+ "type": "object",
+ "properties": {
+ "avatar_url": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BannerConfig": {
+ "type": "object",
+ "properties": {
+ "bg_url": {
+ "type": "string"
+ },
+ "btns": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "href": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "hot_search": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "subtitle": {
+ "type": "string"
+ },
+ "subtitle_color": {
+ "type": "string"
+ },
+ "subtitle_font_size": {
+ "type": "integer"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ },
+ "title_font_size": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.BasicDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BatchMoveReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BlockGridConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BrandGroup": {
+ "type": "object",
+ "properties": {
+ "links": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.Link"
+ }
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.BrowserCount": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CarouselConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CaseConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CatalogSettings": {
+ "type": "object",
+ "properties": {
+ "catalog_folder": {
+ "description": "1: 展开, 2: 折叠, default: 1",
+ "type": "integer"
+ },
+ "catalog_visible": {
+ "description": "1: 显示, 2: 隐藏, default: 1",
+ "type": "integer"
+ },
+ "catalog_width": {
+ "description": "200 - 300, default: 260",
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ChatRequest": {
+ "type": "object",
+ "required": [
+ "app_type"
+ ],
+ "properties": {
+ "app_type": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.AppType"
+ }
+ ]
+ },
+ "captcha_token": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "maxItems": 3,
+ "items": {
+ "type": "string"
+ }
+ },
+ "message": {
+ "type": "string"
+ },
+ "nonce": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ChatSearchReq": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ChatSearchResp": {
+ "type": "object",
+ "properties": {
+ "node_result": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeContentChunkSSE"
+ }
+ }
+ }
+ },
+ "domain.CommentConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "avatar": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "profession": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentInfo": {
+ "type": "object",
+ "properties": {
+ "auth_user_id": {
+ "type": "integer"
+ },
+ "avatar": {
+ "description": "avatar",
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentListItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.CommentInfo"
+ },
+ "ip_address": {
+ "description": "ip地址",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.IPAddress"
+ }
+ ]
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "description": "文档标题",
+ "type": "string"
+ },
+ "node_type": {
+ "type": "integer"
+ },
+ "root_id": {
+ "type": "string"
+ },
+ "status": {
+ "description": "status : -1 reject 0 pending 1 accept",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.CommentStatus"
+ }
+ ]
+ }
+ }
+ },
+ "domain.CommentReq": {
+ "type": "object",
+ "required": [
+ "content",
+ "node_id",
+ "pic_urls"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "content": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "pic_urls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "root_id": {
+ "type": "string"
+ },
+ "user_name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CommentStatus": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ -1,
+ 0,
+ 1
+ ],
+ "x-enum-varnames": [
+ "CommentStatusReject",
+ "CommentStatusPending",
+ "CommentStatusAccepted"
+ ]
+ },
+ "domain.CompleteReq": {
+ "type": "object",
+ "properties": {
+ "prefix": {
+ "description": "For FIM (Fill in Middle) style completion",
+ "type": "string"
+ },
+ "suffix": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ContributeSettings": {
+ "type": "object",
+ "properties": {
+ "is_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.ConversationDetailResp": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationMessage"
+ }
+ },
+ "references": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationReference"
+ }
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationInfo": {
+ "type": "object",
+ "properties": {
+ "user_info": {
+ "$ref": "#/definitions/domain.UserInfo"
+ }
+ }
+ },
+ "domain.ConversationListItem": {
+ "type": "object",
+ "properties": {
+ "app_name": {
+ "type": "string"
+ },
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "feedback_info": {
+ "description": "用户反馈信息",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "description": "用户信息",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ConversationInfo"
+ }
+ ]
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "remote_ip": {
+ "type": "string"
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationMessage": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "info": {
+ "description": "feedbackinfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parent_id": {
+ "description": "parent_id",
+ "type": "string"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "provider": {
+ "description": "model",
+ "allOf": [
+ {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ }
+ ]
+ },
+ "remote_ip": {
+ "description": "stats",
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/schema.RoleType"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ConversationMessageListItem": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "conversation_info": {
+ "description": "userInfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ConversationInfo"
+ }
+ ]
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "description": "feedbackInfo",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.FeedBackInfo"
+ }
+ ]
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "question": {
+ "type": "string"
+ },
+ "remote_ip": {
+ "description": "stats",
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationReference": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "conversation_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ConversationSetting": {
+ "type": "object",
+ "properties": {
+ "copyright_hide_enabled": {
+ "type": "boolean"
+ },
+ "copyright_info": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CreateKBReleaseReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "message",
+ "tag"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "node_ids": {
+ "description": "create release after these nodes published",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.CreateKnowledgeBaseReq": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "hosts": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "name": {
+ "type": "string"
+ },
+ "ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "private_key": {
+ "type": "string"
+ },
+ "public_key": {
+ "type": "string"
+ },
+ "ssl_ports": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "domain.CreateModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.CreateNodeReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "name",
+ "nav_id",
+ "type"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "enum": [
+ 1,
+ 2
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.NodeType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.DirDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.DisclaimerSettings": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.EnterpriseAuth": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.FaqConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "question": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.FeatureConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.FeedBackInfo": {
+ "type": "object",
+ "properties": {
+ "feedback_content": {
+ "type": "string"
+ },
+ "feedback_type": {
+ "type": "string"
+ },
+ "score": {
+ "$ref": "#/definitions/domain.ScoreType"
+ }
+ }
+ },
+ "domain.FeedbackRequest": {
+ "type": "object",
+ "required": [
+ "message_id"
+ ],
+ "properties": {
+ "conversation_id": {
+ "type": "string"
+ },
+ "feedback_content": {
+ "description": "限制内容长度",
+ "type": "string",
+ "maxLength": 200
+ },
+ "message_id": {
+ "type": "string"
+ },
+ "score": {
+ "description": "-1 踩 ,0 1 赞成",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ScoreType"
+ }
+ ]
+ },
+ "type": {
+ "description": "内容不准确,没有帮助,.......",
+ "type": "string"
+ }
+ }
+ },
+ "domain.FooterSettings": {
+ "type": "object",
+ "properties": {
+ "brand_desc": {
+ "type": "string"
+ },
+ "brand_groups": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrandGroup"
+ }
+ },
+ "brand_logo": {
+ "type": "string"
+ },
+ "brand_name": {
+ "type": "string"
+ },
+ "corp_name": {
+ "type": "string"
+ },
+ "footer_style": {
+ "type": "string"
+ },
+ "icp": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.GetKBReleaseListResp": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.KBReleaseListItemResp"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.GetProviderModelListReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.GetProviderModelListResp": {
+ "type": "object",
+ "properties": {
+ "models": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ProviderModelListItem"
+ }
+ }
+ }
+ },
+ "domain.HotBrowser": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrowserCount"
+ }
+ },
+ "os": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.BrowserCount"
+ }
+ }
+ }
+ },
+ "domain.HotPage": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "type": "string"
+ },
+ "scene": {
+ "$ref": "#/definitions/domain.StatPageScene"
+ }
+ }
+ },
+ "domain.HotRefererHost": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "referer_host": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.IPAddress": {
+ "type": "object",
+ "properties": {
+ "city": {
+ "type": "string"
+ },
+ "country": {
+ "type": "string"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "province": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ImgTextConfig": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.InstantCountResp": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "time": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.InstantPageResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.AuthUserInfo"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "ip_address": {
+ "$ref": "#/definitions/domain.IPAddress"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_name": {
+ "type": "string"
+ },
+ "scene": {
+ "$ref": "#/definitions/domain.StatPageScene"
+ },
+ "user_id": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.KBReleaseListItemResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "tag": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.KnowledgeBaseDetail": {
+ "type": "object",
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "dataset_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "perm": {
+ "description": "用户对知识库的权限",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.KnowledgeBaseListItem": {
+ "type": "object",
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "dataset_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.LarkBotSettings": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "string"
+ },
+ "app_secret": {
+ "type": "string"
+ },
+ "encrypt_key": {
+ "type": "string"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "verify_token": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.Link": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.MCPServerSettings": {
+ "type": "object",
+ "properties": {
+ "docs_tool_settings": {
+ "$ref": "#/definitions/domain.MCPToolSettings"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "sample_auth": {
+ "$ref": "#/definitions/domain.SimpleAuth"
+ }
+ }
+ },
+ "domain.MCPToolSettings": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.MessageContent": {
+ "type": "object"
+ },
+ "domain.MessageFrom": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2
+ ],
+ "x-enum-varnames": [
+ "MessageFromGroup",
+ "MessageFromPrivate"
+ ]
+ },
+ "domain.MetricsConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "number": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ModelModeSetting": {
+ "type": "object",
+ "properties": {
+ "auto_mode_api_key": {
+ "description": "百智云 API Key",
+ "type": "string"
+ },
+ "chat_model": {
+ "description": "自定义对话模型名称",
+ "type": "string"
+ },
+ "is_manual_embedding_updated": {
+ "description": "手动模式下嵌入模型是否更新",
+ "type": "boolean"
+ },
+ "mode": {
+ "description": "模式: manual 或 auto",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.ModelSettingMode"
+ }
+ ]
+ }
+ }
+ },
+ "domain.ModelType": {
+ "type": "string",
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "x-enum-varnames": [
+ "ModelTypeChat",
+ "ModelTypeEmbedding",
+ "ModelTypeRerank",
+ "ModelTypeAnalysis",
+ "ModelTypeAnalysisVL"
+ ]
+ },
+ "domain.MoveNodeReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "next_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "prev_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NavDocConfig": {
+ "type": "object",
+ "properties": {
+ "nav_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "title": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeActionReq": {
+ "type": "object",
+ "required": [
+ "action",
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "action": {
+ "type": "string",
+ "enum": [
+ "delete"
+ ]
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeContentChunkSSE": {
+ "type": "object",
+ "properties": {
+ "emoji": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "node_path_names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeGroupDetail": {
+ "type": "object",
+ "properties": {
+ "auth_group_id": {
+ "type": "integer"
+ },
+ "auth_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "perm": {
+ "$ref": "#/definitions/consts.NodePermName"
+ }
+ }
+ },
+ "domain.NodeListItemResp": {
+ "type": "object",
+ "properties": {
+ "content_type": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "rag_info": {
+ "$ref": "#/definitions/domain.RagInfo"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeMeta": {
+ "type": "object",
+ "properties": {
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodePermissions": {
+ "type": "object",
+ "properties": {
+ "answerable": {
+ "description": "可被问答",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ },
+ "visible": {
+ "description": "导航内可见",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ },
+ "visitable": {
+ "description": "可被访问",
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.NodeAccessPerm"
+ }
+ ]
+ }
+ }
+ },
+ "domain.NodeStatus": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "x-enum-comments": {
+ "NodeStatusDraft": "更新未发布",
+ "NodeStatusPublished": "已发布",
+ "NodeStatusUnreleased": "草稿"
+ },
+ "x-enum-descriptions": [
+ "草稿",
+ "更新未发布",
+ "已发布"
+ ],
+ "x-enum-varnames": [
+ "NodeStatusUnreleased",
+ "NodeStatusDraft",
+ "NodeStatusPublished"
+ ]
+ },
+ "domain.NodeSummaryReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.NodeType": {
+ "type": "integer",
+ "format": "int32",
+ "enum": [
+ 1,
+ 2
+ ],
+ "x-enum-varnames": [
+ "NodeTypeFolder",
+ "NodeTypeDocument"
+ ]
+ },
+ "domain.ObjectUploadResp": {
+ "type": "object",
+ "properties": {
+ "filename": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIAPIBotSettings": {
+ "type": "object",
+ "properties": {
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "secret_key": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIChoice": {
+ "type": "object",
+ "properties": {
+ "delta": {
+ "description": "for streaming",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ ]
+ },
+ "finish_reason": {
+ "type": "string"
+ },
+ "index": {
+ "type": "integer"
+ },
+ "message": {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ }
+ },
+ "domain.OpenAICompletionsRequest": {
+ "type": "object",
+ "required": [
+ "messages",
+ "model"
+ ],
+ "properties": {
+ "frequency_penalty": {
+ "type": "number"
+ },
+ "max_tokens": {
+ "type": "integer"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIMessage"
+ }
+ },
+ "model": {
+ "type": "string"
+ },
+ "presence_penalty": {
+ "type": "number"
+ },
+ "response_format": {
+ "$ref": "#/definitions/domain.OpenAIResponseFormat"
+ },
+ "stop": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "stream": {
+ "type": "boolean"
+ },
+ "stream_options": {
+ "$ref": "#/definitions/domain.OpenAIStreamOptions"
+ },
+ "temperature": {
+ "type": "number"
+ },
+ "tool_choice": {
+ "$ref": "#/definitions/domain.OpenAIToolChoice"
+ },
+ "tools": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAITool"
+ }
+ },
+ "top_p": {
+ "type": "number"
+ },
+ "user": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAICompletionsResponse": {
+ "type": "object",
+ "properties": {
+ "choices": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIChoice"
+ }
+ },
+ "created": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "object": {
+ "type": "string"
+ },
+ "usage": {
+ "$ref": "#/definitions/domain.OpenAIUsage"
+ }
+ }
+ },
+ "domain.OpenAIError": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "param": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIErrorResponse": {
+ "type": "object",
+ "properties": {
+ "error": {
+ "$ref": "#/definitions/domain.OpenAIError"
+ }
+ }
+ },
+ "domain.OpenAIFunction": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parameters": {
+ "type": "object",
+ "additionalProperties": true
+ }
+ }
+ },
+ "domain.OpenAIFunctionCall": {
+ "type": "object",
+ "required": [
+ "arguments",
+ "name"
+ ],
+ "properties": {
+ "arguments": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIFunctionChoice": {
+ "type": "object",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIMessage": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "content": {
+ "$ref": "#/definitions/domain.MessageContent"
+ },
+ "name": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string"
+ },
+ "tool_call_id": {
+ "type": "string"
+ },
+ "tool_calls": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.OpenAIToolCall"
+ }
+ }
+ }
+ },
+ "domain.OpenAIResponseFormat": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIStreamOptions": {
+ "type": "object",
+ "properties": {
+ "include_usage": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.OpenAITool": {
+ "type": "object",
+ "required": [
+ "type"
+ ],
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunction"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIToolCall": {
+ "type": "object",
+ "required": [
+ "function",
+ "id",
+ "type"
+ ],
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunctionCall"
+ },
+ "id": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIToolChoice": {
+ "type": "object",
+ "properties": {
+ "function": {
+ "$ref": "#/definitions/domain.OpenAIFunctionChoice"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.OpenAIUsage": {
+ "type": "object",
+ "properties": {
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "total_tokens": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.PWResponse": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer"
+ },
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.PaginatedResult-array_domain_ConversationMessageListItem": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationMessageListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "domain.ProviderModelListItem": {
+ "type": "object",
+ "properties": {
+ "model": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.QuestionConfig": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "question": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.RagInfo": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.NodeRagInfoStatus"
+ },
+ "synced_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.RecommendNodeListResp": {
+ "type": "object",
+ "properties": {
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "nav_name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "recommend_nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "summary": {
+ "type": "string"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ }
+ }
+ },
+ "domain.Response": {
+ "type": "object",
+ "properties": {
+ "data": {},
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.ScoreType": {
+ "type": "integer",
+ "enum": [
+ 1,
+ -1
+ ],
+ "x-enum-varnames": [
+ "Like",
+ "DisLike"
+ ]
+ },
+ "domain.ShareCommentListItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "info": {
+ "$ref": "#/definitions/domain.CommentInfo"
+ },
+ "ip_address": {
+ "description": "ip地址",
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.IPAddress"
+ }
+ ]
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "node_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "pic_urls": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "root_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ShareConversationDetailResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareConversationMessage"
+ }
+ },
+ "subject": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ShareConversationMessage": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "image_paths": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "role": {
+ "$ref": "#/definitions/schema.RoleType"
+ }
+ }
+ },
+ "domain.ShareNodeDetailItem": {
+ "type": "object",
+ "properties": {
+ "children": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareNodeDetailItem"
+ }
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "position": {
+ "type": "number"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SimpleAuth": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SimpleDocConfig": {
+ "type": "object",
+ "properties": {
+ "bg_color": {
+ "type": "string"
+ },
+ "title": {
+ "type": "string"
+ },
+ "title_color": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.SocialMediaAccount": {
+ "type": "object",
+ "properties": {
+ "channel": {
+ "type": "string"
+ },
+ "icon": {
+ "type": "string"
+ },
+ "link": {
+ "type": "string"
+ },
+ "phone": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.StatPageReq": {
+ "type": "object",
+ "required": [
+ "scene"
+ ],
+ "properties": {
+ "node_id": {
+ "type": "string"
+ },
+ "scene": {
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.StatPageScene"
+ }
+ ]
+ }
+ }
+ },
+ "domain.StatPageScene": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "x-enum-varnames": [
+ "StatPageSceneWelcome",
+ "StatPageSceneNodeDetail",
+ "StatPageSceneChat",
+ "StatPageSceneLogin"
+ ]
+ },
+ "domain.StatsSetting": {
+ "type": "object",
+ "properties": {
+ "pv_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.SwitchModeReq": {
+ "type": "object",
+ "required": [
+ "mode"
+ ],
+ "properties": {
+ "auto_mode_api_key": {
+ "description": "百智云 API Key",
+ "type": "string"
+ },
+ "chat_model": {
+ "description": "自定义对话模型名称",
+ "type": "string"
+ },
+ "mode": {
+ "type": "string",
+ "enum": [
+ "manual",
+ "auto"
+ ]
+ }
+ }
+ },
+ "domain.SwitchModeResp": {
+ "type": "object",
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextConfig": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextImgConfig": {
+ "type": "object",
+ "properties": {
+ "item": {
+ "type": "object",
+ "properties": {
+ "desc": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "title": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.TextReq": {
+ "type": "object",
+ "required": [
+ "text"
+ ],
+ "properties": {
+ "action": {
+ "description": "action: improve, summary, extend, shorten, etc.",
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.ThemeAndStyle": {
+ "type": "object",
+ "properties": {
+ "bg_image": {
+ "type": "string"
+ },
+ "doc_width": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UpdateAppReq": {
+ "type": "object",
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "settings": {
+ "$ref": "#/definitions/domain.AppSettings"
+ }
+ }
+ },
+ "domain.UpdateKnowledgeBaseReq": {
+ "type": "object",
+ "required": [
+ "id"
+ ],
+ "properties": {
+ "access_settings": {
+ "$ref": "#/definitions/domain.AccessSettings"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UpdateModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "id",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "domain.UpdateNodeReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "content_type": {
+ "type": "string"
+ },
+ "emoji": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "summary": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UploadByUrlReq": {
+ "type": "object",
+ "required": [
+ "url"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.UserInfo": {
+ "type": "object",
+ "properties": {
+ "auth_user_id": {
+ "type": "integer"
+ },
+ "avatar": {
+ "description": "avatar",
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "from": {
+ "$ref": "#/definitions/domain.MessageFrom"
+ },
+ "name": {
+ "type": "string"
+ },
+ "real_name": {
+ "type": "string"
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WeChatAppAdvancedSetting": {
+ "type": "object",
+ "properties": {
+ "disclaimer_content": {
+ "type": "string"
+ },
+ "feedback_enable": {
+ "type": "boolean"
+ },
+ "feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "prompt": {
+ "type": "string"
+ },
+ "text_response_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.WebAppCommentSettings": {
+ "type": "object",
+ "properties": {
+ "is_enable": {
+ "type": "boolean"
+ },
+ "moderation_enable": {
+ "type": "boolean"
+ }
+ }
+ },
+ "domain.WebAppCustomSettings": {
+ "type": "object",
+ "properties": {
+ "allow_theme_switching": {
+ "type": "boolean"
+ },
+ "footer_show_intro": {
+ "type": "boolean"
+ },
+ "header_search_placeholder": {
+ "type": "string"
+ },
+ "show_brand_info": {
+ "type": "boolean"
+ },
+ "social_media_accounts": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.SocialMediaAccount"
+ }
+ }
+ }
+ },
+ "domain.WebAppLandingConfig": {
+ "type": "object",
+ "properties": {
+ "banner_config": {
+ "$ref": "#/definitions/domain.BannerConfig"
+ },
+ "basic_doc_config": {
+ "$ref": "#/definitions/domain.BasicDocConfig"
+ },
+ "block_grid_config": {
+ "$ref": "#/definitions/domain.BlockGridConfig"
+ },
+ "carousel_config": {
+ "$ref": "#/definitions/domain.CarouselConfig"
+ },
+ "case_config": {
+ "$ref": "#/definitions/domain.CaseConfig"
+ },
+ "com_config_order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "comment_config": {
+ "$ref": "#/definitions/domain.CommentConfig"
+ },
+ "dir_doc_config": {
+ "$ref": "#/definitions/domain.DirDocConfig"
+ },
+ "faq_config": {
+ "$ref": "#/definitions/domain.FaqConfig"
+ },
+ "feature_config": {
+ "$ref": "#/definitions/domain.FeatureConfig"
+ },
+ "img_text_config": {
+ "$ref": "#/definitions/domain.ImgTextConfig"
+ },
+ "metrics_config": {
+ "$ref": "#/definitions/domain.MetricsConfig"
+ },
+ "nav_doc_config": {
+ "$ref": "#/definitions/domain.NavDocConfig"
+ },
+ "node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "question_config": {
+ "$ref": "#/definitions/domain.QuestionConfig"
+ },
+ "simple_doc_config": {
+ "$ref": "#/definitions/domain.SimpleDocConfig"
+ },
+ "text_config": {
+ "$ref": "#/definitions/domain.TextConfig"
+ },
+ "text_img_config": {
+ "$ref": "#/definitions/domain.TextImgConfig"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WebAppLandingConfigResp": {
+ "type": "object",
+ "properties": {
+ "banner_config": {
+ "$ref": "#/definitions/domain.BannerConfig"
+ },
+ "basic_doc_config": {
+ "$ref": "#/definitions/domain.BasicDocConfig"
+ },
+ "block_grid_config": {
+ "$ref": "#/definitions/domain.BlockGridConfig"
+ },
+ "carousel_config": {
+ "$ref": "#/definitions/domain.CarouselConfig"
+ },
+ "case_config": {
+ "$ref": "#/definitions/domain.CaseConfig"
+ },
+ "com_config_order": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "comment_config": {
+ "$ref": "#/definitions/domain.CommentConfig"
+ },
+ "dir_doc_config": {
+ "$ref": "#/definitions/domain.DirDocConfig"
+ },
+ "faq_config": {
+ "$ref": "#/definitions/domain.FaqConfig"
+ },
+ "feature_config": {
+ "$ref": "#/definitions/domain.FeatureConfig"
+ },
+ "img_text_config": {
+ "$ref": "#/definitions/domain.ImgTextConfig"
+ },
+ "metrics_config": {
+ "$ref": "#/definitions/domain.MetricsConfig"
+ },
+ "nav_doc_config": {
+ "$ref": "#/definitions/domain.NavDocConfig"
+ },
+ "node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "nodes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.RecommendNodeListResp"
+ }
+ },
+ "question_config": {
+ "$ref": "#/definitions/domain.QuestionConfig"
+ },
+ "simple_doc_config": {
+ "$ref": "#/definitions/domain.SimpleDocConfig"
+ },
+ "text_config": {
+ "$ref": "#/definitions/domain.TextConfig"
+ },
+ "text_img_config": {
+ "$ref": "#/definitions/domain.TextImgConfig"
+ },
+ "type": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WebAppLandingTheme": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WecomAIBotSettings": {
+ "type": "object",
+ "properties": {
+ "encodingaeskey": {
+ "type": "string"
+ },
+ "is_enabled": {
+ "type": "boolean"
+ },
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "domain.WidgetBotSettings": {
+ "type": "object",
+ "properties": {
+ "btn_id": {
+ "type": "string"
+ },
+ "btn_logo": {
+ "type": "string"
+ },
+ "btn_position": {
+ "type": "string"
+ },
+ "btn_style": {
+ "type": "string"
+ },
+ "btn_text": {
+ "type": "string"
+ },
+ "copyright_hide_enabled": {
+ "type": "boolean"
+ },
+ "copyright_info": {
+ "type": "string"
+ },
+ "disclaimer": {
+ "type": "string"
+ },
+ "is_open": {
+ "type": "boolean"
+ },
+ "modal_position": {
+ "type": "string"
+ },
+ "placeholder": {
+ "type": "string"
+ },
+ "recommend_node_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "recommend_questions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "search_mode": {
+ "type": "string"
+ },
+ "theme_mode": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp": {
+ "type": "object",
+ "properties": {
+ "auths": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.AuthItem"
+ }
+ },
+ "client_id": {
+ "type": "string"
+ },
+ "client_secret": {
+ "type": "string"
+ },
+ "proxy": {
+ "type": "string"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer"
+ },
+ "is_released": {
+ "type": "boolean"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeListItemResp"
+ }
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "nav_name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp": {
+ "type": "object",
+ "properties": {
+ "auth_type": {
+ "$ref": "#/definitions/consts.AuthType"
+ },
+ "license_edition": {
+ "$ref": "#/definitions/consts.LicenseEdition"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp": {
+ "type": "object"
+ },
+ "github_com_chaitin_panda-wiki_domain.CheckModelReq": {
+ "type": "object",
+ "required": [
+ "base_url",
+ "model",
+ "provider",
+ "type"
+ ],
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "type": {
+ "enum": [
+ "chat",
+ "embedding",
+ "rerank",
+ "analysis",
+ "analysis-vl"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ ]
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.CheckModelResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "error": {
+ "type": "string"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelListItem": {
+ "type": "object",
+ "properties": {
+ "api_header": {
+ "type": "string"
+ },
+ "api_key": {
+ "type": "string"
+ },
+ "api_version": {
+ "description": "for azure openai",
+ "type": "string"
+ },
+ "base_url": {
+ "type": "string"
+ },
+ "completion_tokens": {
+ "type": "integer"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_active": {
+ "type": "boolean"
+ },
+ "model": {
+ "type": "string"
+ },
+ "parameters": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam"
+ },
+ "prompt_tokens": {
+ "type": "integer"
+ },
+ "provider": {
+ "$ref": "#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider"
+ },
+ "total_tokens": {
+ "type": "integer"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.ModelType"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelParam": {
+ "type": "object",
+ "properties": {
+ "context_window": {
+ "type": "integer"
+ },
+ "max_tokens": {
+ "type": "integer"
+ },
+ "r1_enabled": {
+ "type": "boolean"
+ },
+ "support_computer_use": {
+ "type": "boolean"
+ },
+ "support_images": {
+ "type": "boolean"
+ },
+ "support_prompt_cache": {
+ "type": "boolean"
+ },
+ "temperature": {
+ "type": "number"
+ }
+ }
+ },
+ "github_com_chaitin_panda-wiki_domain.ModelProvider": {
+ "type": "string",
+ "enum": [
+ "BaiZhiCloud"
+ ],
+ "x-enum-varnames": [
+ "ModelProviderBrandBaiZhiCloud"
+ ]
+ },
+ "gocap.ChallengeData": {
+ "type": "object",
+ "properties": {
+ "challenge": {
+ "$ref": "#/definitions/gocap.ChallengeItem"
+ },
+ "expires": {
+ "description": "过期时间,毫秒级时间戳",
+ "type": "integer"
+ },
+ "token": {
+ "description": "质询令牌",
+ "type": "string"
+ }
+ }
+ },
+ "gocap.ChallengeItem": {
+ "type": "object",
+ "properties": {
+ "c": {
+ "description": "质询数量",
+ "type": "integer"
+ },
+ "d": {
+ "description": "质询难度",
+ "type": "integer"
+ },
+ "s": {
+ "description": "质询大小",
+ "type": "integer"
+ }
+ }
+ },
+ "gocap.VerificationResult": {
+ "type": "object",
+ "properties": {
+ "expires": {
+ "description": "过期时间,毫秒级时间戳",
+ "type": "integer"
+ },
+ "message": {
+ "type": "string"
+ },
+ "success": {
+ "type": "boolean"
+ },
+ "token": {
+ "description": "验证令牌",
+ "type": "string"
+ }
+ }
+ },
+ "schema.RoleType": {
+ "type": "string",
+ "enum": [
+ "assistant",
+ "user",
+ "system",
+ "tool"
+ ],
+ "x-enum-varnames": [
+ "Assistant",
+ "User",
+ "System",
+ "Tool"
+ ]
+ },
+ "share.ShareCommentLists": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareCommentListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.AuthGitHubReq": {
+ "type": "object",
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "redirect_url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthGitHubResp": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthItem": {
+ "type": "object",
+ "properties": {
+ "avatar_url": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "integer"
+ },
+ "ip": {
+ "type": "string"
+ },
+ "last_login_time": {
+ "type": "string"
+ },
+ "source_type": {
+ "$ref": "#/definitions/consts.SourceType"
+ },
+ "username": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthLoginSimpleReq": {
+ "type": "object",
+ "required": [
+ "password"
+ ],
+ "properties": {
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.AuthSetReq": {
+ "type": "object",
+ "required": [
+ "source_type"
+ ],
+ "properties": {
+ "client_id": {
+ "type": "string"
+ },
+ "client_secret": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "proxy": {
+ "type": "string"
+ },
+ "source_type": {
+ "enum": [
+ "github"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.SourceType"
+ }
+ ]
+ }
+ }
+ },
+ "v1.CommentLists": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.CommentListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.ConversationListItems": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ConversationListItem"
+ }
+ },
+ "total": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.CrawlerExportReq": {
+ "type": "object",
+ "required": [
+ "doc_id",
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "doc_id": {
+ "type": "string"
+ },
+ "file_type": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "space_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerExportResp": {
+ "type": "object",
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerParseReq": {
+ "type": "object",
+ "required": [
+ "crawler_source",
+ "kb_id"
+ ],
+ "properties": {
+ "crawler_source": {
+ "$ref": "#/definitions/consts.CrawlerSource"
+ },
+ "dingtalk_setting": {
+ "$ref": "#/definitions/anydoc.DingtalkSetting"
+ },
+ "feishu_setting": {
+ "$ref": "#/definitions/anydoc.FeishuSetting"
+ },
+ "filename": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerParseResp": {
+ "type": "object",
+ "properties": {
+ "docs": {
+ "$ref": "#/definitions/anydoc.Child"
+ },
+ "id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultItem": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ },
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultReq": {
+ "type": "object",
+ "required": [
+ "task_id"
+ ],
+ "properties": {
+ "task_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.CrawlerResultResp": {
+ "type": "object",
+ "required": [
+ "status"
+ ],
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ }
+ }
+ },
+ "v1.CrawlerResultsReq": {
+ "type": "object",
+ "required": [
+ "task_ids"
+ ],
+ "properties": {
+ "task_ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "v1.CrawlerResultsResp": {
+ "type": "object",
+ "properties": {
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.CrawlerResultItem"
+ }
+ },
+ "status": {
+ "$ref": "#/definitions/consts.CrawlerStatus"
+ }
+ }
+ },
+ "v1.CreateUserReq": {
+ "type": "object",
+ "required": [
+ "account",
+ "password",
+ "role"
+ ],
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string",
+ "minLength": 8
+ },
+ "role": {
+ "enum": [
+ "admin",
+ "user"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ ]
+ }
+ }
+ },
+ "v1.CreateUserResp": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.FileUploadResp": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.KBUserInviteReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "perm",
+ "user_id"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "perm": {
+ "enum": [
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.KBUserListItemResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "perms": {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.KBUserUpdateReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "perm",
+ "user_id"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "perm": {
+ "enum": [
+ "full_control",
+ "doc_manage",
+ "data_operate"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/definitions/consts.UserKBPermission"
+ }
+ ]
+ },
+ "user_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.LoginReq": {
+ "type": "object",
+ "required": [
+ "account",
+ "password"
+ ],
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "password": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.LoginResp": {
+ "type": "object",
+ "properties": {
+ "token": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavAddReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "name"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ }
+ }
+ },
+ "v1.NavListResp": {
+ "type": "object",
+ "properties": {
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "position": {
+ "type": "number"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavMoveReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "next_id": {
+ "type": "string"
+ },
+ "prev_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NavUpdateReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "kb_id",
+ "name"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodeDetailResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator_account": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor_account": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "pv": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodeMoveNavReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id",
+ "nav_id"
+ ],
+ "properties": {
+ "ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "nav_id": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.NodePermissionEditReq": {
+ "type": "object",
+ "required": [
+ "ids",
+ "kb_id"
+ ],
+ "properties": {
+ "answerable_groups": {
+ "description": "可被问答",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "ids": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "visible_groups": {
+ "description": "导航内可见",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "visitable_groups": {
+ "description": "可被访问",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ }
+ }
+ },
+ "v1.NodePermissionEditResp": {
+ "type": "object"
+ },
+ "v1.NodePermissionResp": {
+ "type": "object",
+ "properties": {
+ "answerable_groups": {
+ "description": "可被问答",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ },
+ "id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "visible_groups": {
+ "description": "导航内可见",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ },
+ "visitable_groups": {
+ "description": "可被访问",
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.NodeGroupDetail"
+ }
+ }
+ }
+ },
+ "v1.NodeRestudyReq": {
+ "type": "object",
+ "required": [
+ "kb_id",
+ "node_ids"
+ ],
+ "properties": {
+ "kb_id": {
+ "type": "string"
+ },
+ "node_ids": {
+ "type": "array",
+ "minItems": 1,
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "v1.NodeRestudyResp": {
+ "type": "object"
+ },
+ "v1.NodeStatsResp": {
+ "type": "object",
+ "properties": {
+ "unpublished_count": {
+ "description": "未发布的文档数",
+ "type": "integer"
+ },
+ "unreleased_nav_count": {
+ "description": "未发布目录数量",
+ "type": "integer"
+ },
+ "unstudied_count": {
+ "description": "未学习的文档数",
+ "type": "integer"
+ }
+ }
+ },
+ "v1.ResetPasswordReq": {
+ "type": "object",
+ "required": [
+ "id",
+ "new_password"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "new_password": {
+ "type": "string",
+ "minLength": 8
+ }
+ }
+ },
+ "v1.ShareFileUploadUrlReq": {
+ "type": "object",
+ "required": [
+ "captcha_token",
+ "url"
+ ],
+ "properties": {
+ "captcha_token": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.ShareFileUploadUrlResp": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.ShareNodeDetailResp": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "creator_account": {
+ "type": "string"
+ },
+ "creator_id": {
+ "type": "string"
+ },
+ "editor_account": {
+ "type": "string"
+ },
+ "editor_id": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "kb_id": {
+ "type": "string"
+ },
+ "list": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/domain.ShareNodeDetailItem"
+ }
+ },
+ "meta": {
+ "$ref": "#/definitions/domain.NodeMeta"
+ },
+ "name": {
+ "type": "string"
+ },
+ "parent_id": {
+ "type": "string"
+ },
+ "permissions": {
+ "$ref": "#/definitions/domain.NodePermissions"
+ },
+ "publisher_account": {
+ "type": "string"
+ },
+ "publisher_id": {
+ "type": "string"
+ },
+ "pv": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/domain.NodeStatus"
+ },
+ "type": {
+ "$ref": "#/definitions/domain.NodeType"
+ },
+ "updated_at": {
+ "type": "string"
+ }
+ }
+ },
+ "v1.StatConversationDistributionResp": {
+ "type": "object",
+ "properties": {
+ "app_type": {
+ "$ref": "#/definitions/domain.AppType"
+ },
+ "count": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.StatCountResp": {
+ "type": "object",
+ "properties": {
+ "conversation_count": {
+ "type": "integer"
+ },
+ "ip_count": {
+ "type": "integer"
+ },
+ "page_visit_count": {
+ "type": "integer"
+ },
+ "session_count": {
+ "type": "integer"
+ }
+ }
+ },
+ "v1.UserInfoResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "is_token": {
+ "type": "boolean"
+ },
+ "last_access": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.UserListItemResp": {
+ "type": "object",
+ "properties": {
+ "account": {
+ "type": "string"
+ },
+ "created_at": {
+ "type": "string"
+ },
+ "id": {
+ "type": "string"
+ },
+ "last_access": {
+ "type": "string"
+ },
+ "role": {
+ "$ref": "#/definitions/consts.UserRole"
+ }
+ }
+ },
+ "v1.UserListResp": {
+ "type": "object",
+ "properties": {
+ "users": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/v1.UserListItemResp"
+ }
+ }
+ }
+ },
+ "v1.WechatAppInfoResp": {
+ "type": "object",
+ "properties": {
+ "disclaimer_content": {
+ "type": "string"
+ },
+ "feedback_enable": {
+ "type": "boolean"
+ },
+ "feedback_type": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "wechat_app_is_enabled": {
+ "type": "boolean"
+ }
+ }
+ }
+ },
+ "securityDefinitions": {
+ "bearerAuth": {
+ "description": "Type \"Bearer\" + a space + your token to authorize",
+ "type": "apiKey",
+ "name": "Authorization",
+ "in": "header"
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml
new file mode 100644
index 0000000..0964054
--- /dev/null
+++ b/backend/docs/swagger.yaml
@@ -0,0 +1,6269 @@
+basePath: /
+definitions:
+ anydoc.Child:
+ properties:
+ children:
+ items:
+ $ref: '#/definitions/anydoc.Child'
+ type: array
+ value:
+ $ref: '#/definitions/anydoc.Value'
+ type: object
+ anydoc.DingtalkSetting:
+ properties:
+ app_id:
+ type: string
+ app_secret:
+ type: string
+ phone:
+ type: string
+ space_id:
+ type: string
+ unionid:
+ type: string
+ type: object
+ anydoc.FeishuSetting:
+ properties:
+ app_id:
+ type: string
+ app_secret:
+ type: string
+ space_id:
+ type: string
+ user_access_token:
+ type: string
+ type: object
+ anydoc.Value:
+ properties:
+ file:
+ type: boolean
+ file_type:
+ type: string
+ id:
+ type: string
+ summary:
+ type: string
+ title:
+ type: string
+ type: object
+ consts.AuthType:
+ enum:
+ - ""
+ - simple
+ - enterprise
+ type: string
+ x-enum-comments:
+ AuthTypeEnterprise: 企业认证
+ AuthTypeNull: 无认证
+ AuthTypeSimple: 简单口令
+ x-enum-descriptions:
+ - 无认证
+ - 简单口令
+ - 企业认证
+ x-enum-varnames:
+ - AuthTypeNull
+ - AuthTypeSimple
+ - AuthTypeEnterprise
+ consts.CopySetting:
+ enum:
+ - ""
+ - append
+ - disabled
+ type: string
+ x-enum-comments:
+ CopySettingAppend: 增加内容尾巴
+ CopySettingDisabled: 禁止复制内容
+ CopySettingNone: 无限制
+ x-enum-descriptions:
+ - 无限制
+ - 增加内容尾巴
+ - 禁止复制内容
+ x-enum-varnames:
+ - CopySettingNone
+ - CopySettingAppend
+ - CopySettingDisabled
+ consts.CrawlerSource:
+ enum:
+ - url
+ - rss
+ - sitemap
+ - notion
+ - feishu
+ - dingtalk
+ - file
+ - epub
+ - yuque
+ - siyuan
+ - mindoc
+ - wikijs
+ - confluence
+ type: string
+ x-enum-varnames:
+ - CrawlerSourceUrl
+ - CrawlerSourceRSS
+ - CrawlerSourceSitemap
+ - CrawlerSourceNotion
+ - CrawlerSourceFeishu
+ - CrawlerSourceDingtalk
+ - CrawlerSourceFile
+ - CrawlerSourceEpub
+ - CrawlerSourceYuque
+ - CrawlerSourceSiyuan
+ - CrawlerSourceMindoc
+ - CrawlerSourceWikijs
+ - CrawlerSourceConfluence
+ consts.CrawlerStatus:
+ enum:
+ - pending
+ - in_process
+ - completed
+ - failed
+ type: string
+ x-enum-varnames:
+ - CrawlerStatusPending
+ - CrawlerStatusInProcess
+ - CrawlerStatusCompleted
+ - CrawlerStatusFailed
+ consts.HomePageSetting:
+ enum:
+ - doc
+ - custom
+ type: string
+ x-enum-comments:
+ HomePageSettingCustom: 自定义首页
+ HomePageSettingDoc: 文档页面
+ x-enum-descriptions:
+ - 文档页面
+ - 自定义首页
+ x-enum-varnames:
+ - HomePageSettingDoc
+ - HomePageSettingCustom
+ consts.LicenseEdition:
+ enum:
+ - 0
+ - 1
+ - 2
+ - 3
+ format: int32
+ type: integer
+ x-enum-comments:
+ LicenseEditionBusiness: 商业版
+ LicenseEditionEnterprise: 企业版
+ LicenseEditionFree: 开源版
+ LicenseEditionProfession: 专业版
+ x-enum-descriptions:
+ - 开源版
+ - 专业版
+ - 企业版
+ - 商业版
+ x-enum-varnames:
+ - LicenseEditionFree
+ - LicenseEditionProfession
+ - LicenseEditionEnterprise
+ - LicenseEditionBusiness
+ consts.ModelSettingMode:
+ enum:
+ - manual
+ - auto
+ type: string
+ x-enum-varnames:
+ - ModelSettingModeManual
+ - ModelSettingModeAuto
+ consts.NodeAccessPerm:
+ enum:
+ - open
+ - partial
+ - closed
+ type: string
+ x-enum-comments:
+ NodeAccessPermClosed: 完全禁止
+ NodeAccessPermOpen: 完全开放
+ NodeAccessPermPartial: 部分开放
+ x-enum-descriptions:
+ - 完全开放
+ - 部分开放
+ - 完全禁止
+ x-enum-varnames:
+ - NodeAccessPermOpen
+ - NodeAccessPermPartial
+ - NodeAccessPermClosed
+ consts.NodePermName:
+ enum:
+ - visible
+ - visitable
+ - answerable
+ type: string
+ x-enum-comments:
+ NodePermNameAnswerable: 可被问答
+ NodePermNameVisible: 导航内可见
+ NodePermNameVisitable: 可被访问
+ x-enum-descriptions:
+ - 导航内可见
+ - 可被访问
+ - 可被问答
+ x-enum-varnames:
+ - NodePermNameVisible
+ - NodePermNameVisitable
+ - NodePermNameAnswerable
+ consts.NodeRagInfoStatus:
+ enum:
+ - PENDING
+ - RUNNING
+ - FAILED
+ - SUCCEEDED
+ - REINDEX
+ type: string
+ x-enum-comments:
+ NodeRagStatusFailed: 处理失败
+ NodeRagStatusPending: 等待处理
+ NodeRagStatusReindexing: 重新索引中
+ NodeRagStatusRunning: 正在进行处理(文本分割、向量化等)
+ NodeRagStatusSucceeded: 处理成功
+ x-enum-descriptions:
+ - 等待处理
+ - 正在进行处理(文本分割、向量化等)
+ - 处理失败
+ - 处理成功
+ - 重新索引中
+ x-enum-varnames:
+ - NodeRagStatusPending
+ - NodeRagStatusRunning
+ - NodeRagStatusFailed
+ - NodeRagStatusSucceeded
+ - NodeRagStatusReindexing
+ consts.RedeemCaptchaReq:
+ properties:
+ solutions:
+ items:
+ type: integer
+ type: array
+ token:
+ type: string
+ type: object
+ consts.SourceType:
+ enum:
+ - dingtalk
+ - feishu
+ - wecom
+ - oauth
+ - github
+ - cas
+ - ldap
+ - widget
+ - dingtalk_bot
+ - feishu_bot
+ - lark_bot
+ - wechat_bot
+ - wecom_ai_bot
+ - wechat_service_bot
+ - discord_bot
+ - wechat_official_account
+ - openai_api
+ - mcp_server
+ type: string
+ x-enum-varnames:
+ - SourceTypeDingTalk
+ - SourceTypeFeishu
+ - SourceTypeWeCom
+ - SourceTypeOAuth
+ - SourceTypeGitHub
+ - SourceTypeCAS
+ - SourceTypeLDAP
+ - SourceTypeWidget
+ - SourceTypeDingtalkBot
+ - SourceTypeFeishuBot
+ - SourceTypeLarkBot
+ - SourceTypeWechatBot
+ - SourceTypeWecomAIBot
+ - SourceTypeWechatServiceBot
+ - SourceTypeDiscordBot
+ - SourceTypeWechatOfficialAccount
+ - SourceTypeOpenAIAPI
+ - SourceTypeMcpServer
+ consts.StatDay:
+ enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ consts.UserKBPermission:
+ enum:
+ - ""
+ - not null
+ - full_control
+ - doc_manage
+ - data_operate
+ type: string
+ x-enum-comments:
+ UserKBPermissionDataOperate: 数据运营
+ UserKBPermissionDocManage: 文档管理
+ UserKBPermissionFullControl: 完全控制
+ UserKBPermissionNotNull: 有权限
+ UserKBPermissionNull: 无权限
+ x-enum-descriptions:
+ - 无权限
+ - 有权限
+ - 完全控制
+ - 文档管理
+ - 数据运营
+ x-enum-varnames:
+ - UserKBPermissionNull
+ - UserKBPermissionNotNull
+ - UserKBPermissionFullControl
+ - UserKBPermissionDocManage
+ - UserKBPermissionDataOperate
+ consts.UserRole:
+ enum:
+ - admin
+ - user
+ type: string
+ x-enum-comments:
+ UserRoleAdmin: 管理员
+ UserRoleUser: 普通用户
+ x-enum-descriptions:
+ - 管理员
+ - 普通用户
+ x-enum-varnames:
+ - UserRoleAdmin
+ - UserRoleUser
+ consts.WatermarkSetting:
+ enum:
+ - ""
+ - hidden
+ - visible
+ type: string
+ x-enum-comments:
+ WatermarkDisabled: 未开启水印
+ WatermarkHidden: 隐形水印
+ WatermarkVisible: 显性水印
+ x-enum-descriptions:
+ - 未开启水印
+ - 隐形水印
+ - 显性水印
+ x-enum-varnames:
+ - WatermarkDisabled
+ - WatermarkHidden
+ - WatermarkVisible
+ domain.AIFeedbackSettings:
+ properties:
+ ai_feedback_type:
+ items:
+ type: string
+ type: array
+ is_enabled:
+ type: boolean
+ type: object
+ domain.AccessSettings:
+ properties:
+ base_url:
+ type: string
+ enterprise_auth:
+ $ref: '#/definitions/domain.EnterpriseAuth'
+ hosts:
+ items:
+ type: string
+ type: array
+ is_forbidden:
+ description: 禁止访问
+ type: boolean
+ ports:
+ items:
+ type: integer
+ type: array
+ private_key:
+ type: string
+ public_key:
+ type: string
+ simple_auth:
+ $ref: '#/definitions/domain.SimpleAuth'
+ source_type:
+ allOf:
+ - $ref: '#/definitions/consts.SourceType'
+ description: 企业认证来源
+ ssl_ports:
+ items:
+ type: integer
+ type: array
+ trusted_proxies:
+ items:
+ type: string
+ type: array
+ type: object
+ domain.AnydocUploadResp:
+ properties:
+ code:
+ type: integer
+ data:
+ type: string
+ err:
+ type: string
+ type: object
+ domain.AppDetailResp:
+ properties:
+ id:
+ type: string
+ kb_id:
+ type: string
+ name:
+ type: string
+ recommend_nodes:
+ items:
+ $ref: '#/definitions/domain.RecommendNodeListResp'
+ type: array
+ settings:
+ $ref: '#/definitions/domain.AppSettingsResp'
+ type:
+ $ref: '#/definitions/domain.AppType'
+ type: object
+ domain.AppInfoResp:
+ properties:
+ base_url:
+ type: string
+ name:
+ type: string
+ recommend_nodes:
+ items:
+ $ref: '#/definitions/domain.RecommendNodeListResp'
+ type: array
+ settings:
+ $ref: '#/definitions/domain.AppSettingsResp'
+ type: object
+ domain.AppSettings:
+ properties:
+ ai_feedback_settings:
+ allOf:
+ - $ref: '#/definitions/domain.AIFeedbackSettings'
+ description: AI feedback
+ body_code:
+ type: string
+ btns:
+ items: {}
+ type: array
+ catalog_settings:
+ allOf:
+ - $ref: '#/definitions/domain.CatalogSettings'
+ description: catalog settings
+ contribute_settings:
+ $ref: '#/definitions/domain.ContributeSettings'
+ conversation_setting:
+ $ref: '#/definitions/domain.ConversationSetting'
+ copy_setting:
+ allOf:
+ - $ref: '#/definitions/consts.CopySetting'
+ enum:
+ - ""
+ - append
+ - disabled
+ desc:
+ description: seo
+ type: string
+ dingtalk_bot_client_id:
+ type: string
+ dingtalk_bot_client_secret:
+ type: string
+ dingtalk_bot_is_enabled:
+ description: DingTalkBot
+ type: boolean
+ dingtalk_bot_template_id:
+ type: string
+ disclaimer_settings:
+ allOf:
+ - $ref: '#/definitions/domain.DisclaimerSettings'
+ description: Disclaimer Settings
+ discord_bot_is_enabled:
+ description: DisCordBot
+ type: boolean
+ discord_bot_token:
+ type: string
+ document_feedback_is_enabled:
+ description: document feedback
+ type: boolean
+ feishu_bot_app_id:
+ type: string
+ feishu_bot_app_secret:
+ type: string
+ feishu_bot_is_enabled:
+ description: FeishuBot
+ type: boolean
+ footer_settings:
+ allOf:
+ - $ref: '#/definitions/domain.FooterSettings'
+ description: footer settings
+ head_code:
+ description: inject code
+ type: string
+ home_page_setting:
+ $ref: '#/definitions/consts.HomePageSetting'
+ icon:
+ type: string
+ keyword:
+ type: string
+ lark_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.LarkBotSettings'
+ description: LarkBot
+ mcp_server_settings:
+ allOf:
+ - $ref: '#/definitions/domain.MCPServerSettings'
+ description: MCP Server Settings
+ openai_api_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.OpenAIAPIBotSettings'
+ description: OpenAI API Bot settings
+ recommend_node_ids:
+ items:
+ type: string
+ type: array
+ recommend_questions:
+ items:
+ type: string
+ type: array
+ search_placeholder:
+ type: string
+ stats_setting:
+ $ref: '#/definitions/domain.StatsSetting'
+ theme_and_style:
+ $ref: '#/definitions/domain.ThemeAndStyle'
+ theme_mode:
+ description: theme
+ type: string
+ title:
+ description: nav
+ type: string
+ watermark_content:
+ type: string
+ watermark_setting:
+ allOf:
+ - $ref: '#/definitions/consts.WatermarkSetting'
+ enum:
+ - ""
+ - hidden
+ - visible
+ web_app_comment_settings:
+ allOf:
+ - $ref: '#/definitions/domain.WebAppCommentSettings'
+ description: webapp comment settings
+ web_app_custom_style:
+ allOf:
+ - $ref: '#/definitions/domain.WebAppCustomSettings'
+ description: WebAppCustomStyle
+ web_app_landing_configs:
+ description: WebAppLandingConfigs
+ items:
+ $ref: '#/definitions/domain.WebAppLandingConfig'
+ type: array
+ web_app_landing_theme:
+ $ref: '#/definitions/domain.WebAppLandingTheme'
+ wechat_app_advanced_setting:
+ $ref: '#/definitions/domain.WeChatAppAdvancedSetting'
+ wechat_app_agent_id:
+ type: string
+ wechat_app_corpid:
+ type: string
+ wechat_app_encodingaeskey:
+ type: string
+ wechat_app_is_enabled:
+ description: WechatAppBot 企业微信机器人
+ type: boolean
+ wechat_app_secret:
+ type: string
+ wechat_app_token:
+ type: string
+ wechat_official_account_app_id:
+ type: string
+ wechat_official_account_app_secret:
+ type: string
+ wechat_official_account_encodingaeskey:
+ type: string
+ wechat_official_account_is_enabled:
+ description: WechatOfficialAccount
+ type: boolean
+ wechat_official_account_token:
+ type: string
+ wechat_service_contain_keywords:
+ items:
+ type: string
+ type: array
+ wechat_service_corpid:
+ type: string
+ wechat_service_encodingaeskey:
+ type: string
+ wechat_service_equal_keywords:
+ items:
+ type: string
+ type: array
+ wechat_service_is_enabled:
+ description: WechatServiceBot
+ type: boolean
+ wechat_service_logo:
+ type: string
+ wechat_service_secret:
+ type: string
+ wechat_service_token:
+ type: string
+ wecom_ai_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.WecomAIBotSettings'
+ description: WecomAIBotSettings 企业微信智能机器人
+ welcome_str:
+ description: welcome
+ type: string
+ widget_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.WidgetBotSettings'
+ description: Widget bot settings
+ type: object
+ domain.AppSettingsResp:
+ properties:
+ ai_feedback_settings:
+ allOf:
+ - $ref: '#/definitions/domain.AIFeedbackSettings'
+ description: AI feedback
+ body_code:
+ type: string
+ btns:
+ items: {}
+ type: array
+ catalog_settings:
+ allOf:
+ - $ref: '#/definitions/domain.CatalogSettings'
+ description: catalog settings
+ contribute_settings:
+ $ref: '#/definitions/domain.ContributeSettings'
+ conversation_setting:
+ $ref: '#/definitions/domain.ConversationSetting'
+ copy_setting:
+ $ref: '#/definitions/consts.CopySetting'
+ desc:
+ description: seo
+ type: string
+ dingtalk_bot_client_id:
+ type: string
+ dingtalk_bot_client_secret:
+ type: string
+ dingtalk_bot_is_enabled:
+ description: DingTalkBot
+ type: boolean
+ dingtalk_bot_template_id:
+ type: string
+ disclaimer_settings:
+ allOf:
+ - $ref: '#/definitions/domain.DisclaimerSettings'
+ description: Disclaimer Settings
+ discord_bot_is_enabled:
+ description: DisCordBot
+ type: boolean
+ discord_bot_token:
+ type: string
+ document_feedback_is_enabled:
+ description: document feedback
+ type: boolean
+ feishu_bot_app_id:
+ type: string
+ feishu_bot_app_secret:
+ type: string
+ feishu_bot_is_enabled:
+ description: FeishuBot
+ type: boolean
+ footer_settings:
+ allOf:
+ - $ref: '#/definitions/domain.FooterSettings'
+ description: footer settings
+ head_code:
+ description: inject code
+ type: string
+ home_page_setting:
+ $ref: '#/definitions/consts.HomePageSetting'
+ icon:
+ type: string
+ keyword:
+ type: string
+ lark_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.LarkBotSettings'
+ description: LarkBot
+ mcp_server_settings:
+ allOf:
+ - $ref: '#/definitions/domain.MCPServerSettings'
+ description: MCP Server Settings
+ openai_api_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.OpenAIAPIBotSettings'
+ description: OpenAI API settings
+ recommend_node_ids:
+ items:
+ type: string
+ type: array
+ recommend_questions:
+ items:
+ type: string
+ type: array
+ search_placeholder:
+ type: string
+ stats_setting:
+ $ref: '#/definitions/domain.StatsSetting'
+ theme_and_style:
+ $ref: '#/definitions/domain.ThemeAndStyle'
+ theme_mode:
+ description: theme
+ type: string
+ title:
+ description: nav
+ type: string
+ watermark_content:
+ type: string
+ watermark_setting:
+ $ref: '#/definitions/consts.WatermarkSetting'
+ web_app_comment_settings:
+ allOf:
+ - $ref: '#/definitions/domain.WebAppCommentSettings'
+ description: webapp comment settings
+ web_app_custom_style:
+ allOf:
+ - $ref: '#/definitions/domain.WebAppCustomSettings'
+ description: WebAppCustomStyle
+ web_app_landing_configs:
+ description: WebApp Landing Settings
+ items:
+ $ref: '#/definitions/domain.WebAppLandingConfigResp'
+ type: array
+ web_app_landing_theme:
+ $ref: '#/definitions/domain.WebAppLandingTheme'
+ wechat_app_advanced_setting:
+ $ref: '#/definitions/domain.WeChatAppAdvancedSetting'
+ wechat_app_agent_id:
+ type: string
+ wechat_app_corpid:
+ type: string
+ wechat_app_encodingaeskey:
+ type: string
+ wechat_app_is_enabled:
+ description: WechatAppBot
+ type: boolean
+ wechat_app_secret:
+ type: string
+ wechat_app_token:
+ type: string
+ wechat_official_account_app_id:
+ type: string
+ wechat_official_account_app_secret:
+ type: string
+ wechat_official_account_encodingaeskey:
+ type: string
+ wechat_official_account_is_enabled:
+ description: WechatOfficialAccount
+ type: boolean
+ wechat_official_account_token:
+ type: string
+ wechat_service_contain_keywords:
+ items:
+ type: string
+ type: array
+ wechat_service_corpid:
+ type: string
+ wechat_service_encodingaeskey:
+ type: string
+ wechat_service_equal_keywords:
+ items:
+ type: string
+ type: array
+ wechat_service_is_enabled:
+ description: WechatServiceBot
+ type: boolean
+ wechat_service_logo:
+ type: string
+ wechat_service_secret:
+ type: string
+ wechat_service_token:
+ type: string
+ wecom_ai_bot_settings:
+ $ref: '#/definitions/domain.WecomAIBotSettings'
+ welcome_str:
+ description: welcome
+ type: string
+ widget_bot_settings:
+ allOf:
+ - $ref: '#/definitions/domain.WidgetBotSettings'
+ description: WidgetBot
+ type: object
+ domain.AppType:
+ enum:
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
+ - 6
+ - 7
+ - 8
+ - 9
+ - 10
+ - 11
+ - 12
+ format: int32
+ type: integer
+ x-enum-varnames:
+ - AppTypeWeb
+ - AppTypeWidget
+ - AppTypeDingTalkBot
+ - AppTypeFeishuBot
+ - AppTypeWechatBot
+ - AppTypeWechatServiceBot
+ - AppTypeDisCordBot
+ - AppTypeWechatOfficialAccount
+ - AppTypeOpenAIAPI
+ - AppTypeWecomAIBot
+ - AppTypeLarkBot
+ - AppTypeMcpServer
+ domain.AuthUserInfo:
+ properties:
+ avatar_url:
+ type: string
+ email:
+ type: string
+ username:
+ type: string
+ type: object
+ domain.BannerConfig:
+ properties:
+ bg_url:
+ type: string
+ btns:
+ items:
+ properties:
+ href:
+ type: string
+ id:
+ type: string
+ text:
+ type: string
+ type:
+ type: string
+ type: object
+ type: array
+ hot_search:
+ items:
+ type: string
+ type: array
+ placeholder:
+ type: string
+ subtitle:
+ type: string
+ subtitle_color:
+ type: string
+ subtitle_font_size:
+ type: integer
+ title:
+ type: string
+ title_color:
+ type: string
+ title_font_size:
+ type: integer
+ type: object
+ domain.BasicDocConfig:
+ properties:
+ bg_color:
+ type: string
+ title:
+ type: string
+ title_color:
+ type: string
+ type: object
+ domain.BatchMoveReq:
+ properties:
+ ids:
+ items:
+ type: string
+ type: array
+ kb_id:
+ type: string
+ parent_id:
+ type: string
+ required:
+ - ids
+ - kb_id
+ type: object
+ domain.BlockGridConfig:
+ properties:
+ list:
+ items:
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ url:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.BrandGroup:
+ properties:
+ links:
+ items:
+ $ref: '#/definitions/domain.Link'
+ type: array
+ name:
+ type: string
+ type: object
+ domain.BrowserCount:
+ properties:
+ count:
+ type: integer
+ name:
+ type: string
+ type: object
+ domain.CarouselConfig:
+ properties:
+ bg_color:
+ type: string
+ list:
+ items:
+ properties:
+ desc:
+ type: string
+ id:
+ type: string
+ title:
+ type: string
+ url:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type: object
+ domain.CaseConfig:
+ properties:
+ list:
+ items:
+ properties:
+ id:
+ type: string
+ link:
+ type: string
+ name:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.CatalogSettings:
+ properties:
+ catalog_folder:
+ description: '1: 展开, 2: 折叠, default: 1'
+ type: integer
+ catalog_visible:
+ description: '1: 显示, 2: 隐藏, default: 1'
+ type: integer
+ catalog_width:
+ description: '200 - 300, default: 260'
+ type: integer
+ type: object
+ domain.ChatRequest:
+ properties:
+ app_type:
+ allOf:
+ - $ref: '#/definitions/domain.AppType'
+ enum:
+ - 1
+ - 2
+ captcha_token:
+ type: string
+ conversation_id:
+ type: string
+ image_paths:
+ items:
+ type: string
+ maxItems: 3
+ type: array
+ message:
+ type: string
+ nonce:
+ type: string
+ required:
+ - app_type
+ type: object
+ domain.ChatSearchReq:
+ properties:
+ captcha_token:
+ type: string
+ message:
+ type: string
+ required:
+ - message
+ type: object
+ domain.ChatSearchResp:
+ properties:
+ node_result:
+ items:
+ $ref: '#/definitions/domain.NodeContentChunkSSE'
+ type: array
+ type: object
+ domain.CommentConfig:
+ properties:
+ list:
+ items:
+ properties:
+ avatar:
+ type: string
+ comment:
+ type: string
+ id:
+ type: string
+ profession:
+ type: string
+ user_name:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.CommentInfo:
+ properties:
+ auth_user_id:
+ type: integer
+ avatar:
+ description: avatar
+ type: string
+ email:
+ type: string
+ remote_ip:
+ type: string
+ user_name:
+ type: string
+ type: object
+ domain.CommentListItem:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ info:
+ $ref: '#/definitions/domain.CommentInfo'
+ ip_address:
+ allOf:
+ - $ref: '#/definitions/domain.IPAddress'
+ description: ip地址
+ node_id:
+ type: string
+ node_name:
+ description: 文档标题
+ type: string
+ node_type:
+ type: integer
+ root_id:
+ type: string
+ status:
+ allOf:
+ - $ref: '#/definitions/domain.CommentStatus'
+ description: 'status : -1 reject 0 pending 1 accept'
+ type: object
+ domain.CommentReq:
+ properties:
+ captcha_token:
+ type: string
+ content:
+ type: string
+ node_id:
+ type: string
+ parent_id:
+ type: string
+ pic_urls:
+ items:
+ type: string
+ type: array
+ root_id:
+ type: string
+ user_name:
+ type: string
+ required:
+ - content
+ - node_id
+ - pic_urls
+ type: object
+ domain.CommentStatus:
+ enum:
+ - -1
+ - 0
+ - 1
+ format: int32
+ type: integer
+ x-enum-varnames:
+ - CommentStatusReject
+ - CommentStatusPending
+ - CommentStatusAccepted
+ domain.CompleteReq:
+ properties:
+ prefix:
+ description: For FIM (Fill in Middle) style completion
+ type: string
+ suffix:
+ type: string
+ type: object
+ domain.ContributeSettings:
+ properties:
+ is_enable:
+ type: boolean
+ type: object
+ domain.ConversationDetailResp:
+ properties:
+ app_id:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ ip_address:
+ $ref: '#/definitions/domain.IPAddress'
+ messages:
+ items:
+ $ref: '#/definitions/domain.ConversationMessage'
+ type: array
+ references:
+ items:
+ $ref: '#/definitions/domain.ConversationReference'
+ type: array
+ remote_ip:
+ type: string
+ subject:
+ type: string
+ type: object
+ domain.ConversationInfo:
+ properties:
+ user_info:
+ $ref: '#/definitions/domain.UserInfo'
+ type: object
+ domain.ConversationListItem:
+ properties:
+ app_name:
+ type: string
+ app_type:
+ $ref: '#/definitions/domain.AppType'
+ created_at:
+ type: string
+ feedback_info:
+ allOf:
+ - $ref: '#/definitions/domain.FeedBackInfo'
+ description: 用户反馈信息
+ id:
+ type: string
+ info:
+ allOf:
+ - $ref: '#/definitions/domain.ConversationInfo'
+ description: 用户信息
+ ip_address:
+ $ref: '#/definitions/domain.IPAddress'
+ remote_ip:
+ type: string
+ subject:
+ type: string
+ type: object
+ domain.ConversationMessage:
+ properties:
+ app_id:
+ type: string
+ completion_tokens:
+ type: integer
+ content:
+ type: string
+ conversation_id:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ image_paths:
+ items:
+ type: string
+ type: array
+ info:
+ allOf:
+ - $ref: '#/definitions/domain.FeedBackInfo'
+ description: feedbackinfo
+ kb_id:
+ type: string
+ model:
+ type: string
+ parent_id:
+ description: parent_id
+ type: string
+ prompt_tokens:
+ type: integer
+ provider:
+ allOf:
+ - $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider'
+ description: model
+ remote_ip:
+ description: stats
+ type: string
+ role:
+ $ref: '#/definitions/schema.RoleType'
+ total_tokens:
+ type: integer
+ type: object
+ domain.ConversationMessageListItem:
+ properties:
+ app_id:
+ type: string
+ app_type:
+ $ref: '#/definitions/domain.AppType'
+ conversation_id:
+ type: string
+ conversation_info:
+ allOf:
+ - $ref: '#/definitions/domain.ConversationInfo'
+ description: userInfo
+ created_at:
+ type: string
+ id:
+ type: string
+ info:
+ allOf:
+ - $ref: '#/definitions/domain.FeedBackInfo'
+ description: feedbackInfo
+ ip_address:
+ $ref: '#/definitions/domain.IPAddress'
+ question:
+ type: string
+ remote_ip:
+ description: stats
+ type: string
+ type: object
+ domain.ConversationReference:
+ properties:
+ app_id:
+ type: string
+ conversation_id:
+ type: string
+ name:
+ type: string
+ node_id:
+ type: string
+ url:
+ type: string
+ type: object
+ domain.ConversationSetting:
+ properties:
+ copyright_hide_enabled:
+ type: boolean
+ copyright_info:
+ type: string
+ type: object
+ domain.CreateKBReleaseReq:
+ properties:
+ kb_id:
+ type: string
+ message:
+ type: string
+ node_ids:
+ description: create release after these nodes published
+ items:
+ type: string
+ type: array
+ tag:
+ type: string
+ required:
+ - kb_id
+ - message
+ - tag
+ type: object
+ domain.CreateKnowledgeBaseReq:
+ properties:
+ hosts:
+ items:
+ type: string
+ type: array
+ name:
+ type: string
+ ports:
+ items:
+ type: integer
+ type: array
+ private_key:
+ type: string
+ public_key:
+ type: string
+ ssl_ports:
+ items:
+ type: integer
+ type: array
+ required:
+ - name
+ type: object
+ domain.CreateModelReq:
+ properties:
+ api_header:
+ type: string
+ api_key:
+ type: string
+ api_version:
+ description: for azure openai
+ type: string
+ base_url:
+ type: string
+ model:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam'
+ provider:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider'
+ type:
+ allOf:
+ - $ref: '#/definitions/domain.ModelType'
+ enum:
+ - chat
+ - embedding
+ - rerank
+ - analysis
+ - analysis-vl
+ required:
+ - base_url
+ - model
+ - provider
+ - type
+ type: object
+ domain.CreateNodeReq:
+ properties:
+ content:
+ type: string
+ content_type:
+ type: string
+ emoji:
+ type: string
+ kb_id:
+ type: string
+ name:
+ type: string
+ nav_id:
+ type: string
+ parent_id:
+ type: string
+ position:
+ type: number
+ summary:
+ type: string
+ type:
+ allOf:
+ - $ref: '#/definitions/domain.NodeType'
+ enum:
+ - 1
+ - 2
+ required:
+ - kb_id
+ - name
+ - nav_id
+ - type
+ type: object
+ domain.DirDocConfig:
+ properties:
+ bg_color:
+ type: string
+ title:
+ type: string
+ title_color:
+ type: string
+ type: object
+ domain.DisclaimerSettings:
+ properties:
+ content:
+ type: string
+ type: object
+ domain.EnterpriseAuth:
+ properties:
+ enabled:
+ type: boolean
+ type: object
+ domain.FaqConfig:
+ properties:
+ bg_color:
+ type: string
+ list:
+ items:
+ properties:
+ id:
+ type: string
+ link:
+ type: string
+ question:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ title_color:
+ type: string
+ type: object
+ domain.FeatureConfig:
+ properties:
+ list:
+ items:
+ properties:
+ desc:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.FeedBackInfo:
+ properties:
+ feedback_content:
+ type: string
+ feedback_type:
+ type: string
+ score:
+ $ref: '#/definitions/domain.ScoreType'
+ type: object
+ domain.FeedbackRequest:
+ properties:
+ conversation_id:
+ type: string
+ feedback_content:
+ description: 限制内容长度
+ maxLength: 200
+ type: string
+ message_id:
+ type: string
+ score:
+ allOf:
+ - $ref: '#/definitions/domain.ScoreType'
+ description: -1 踩 ,0 1 赞成
+ type:
+ description: 内容不准确,没有帮助,.......
+ type: string
+ required:
+ - message_id
+ type: object
+ domain.FooterSettings:
+ properties:
+ brand_desc:
+ type: string
+ brand_groups:
+ items:
+ $ref: '#/definitions/domain.BrandGroup'
+ type: array
+ brand_logo:
+ type: string
+ brand_name:
+ type: string
+ corp_name:
+ type: string
+ footer_style:
+ type: string
+ icp:
+ type: string
+ type: object
+ domain.GetKBReleaseListResp:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.KBReleaseListItemResp'
+ type: array
+ total:
+ type: integer
+ type: object
+ domain.GetProviderModelListReq:
+ properties:
+ api_header:
+ type: string
+ api_key:
+ type: string
+ base_url:
+ type: string
+ provider:
+ type: string
+ type:
+ allOf:
+ - $ref: '#/definitions/domain.ModelType'
+ enum:
+ - chat
+ - embedding
+ - rerank
+ - analysis
+ - analysis-vl
+ required:
+ - base_url
+ - provider
+ - type
+ type: object
+ domain.GetProviderModelListResp:
+ properties:
+ models:
+ items:
+ $ref: '#/definitions/domain.ProviderModelListItem'
+ type: array
+ type: object
+ domain.HotBrowser:
+ properties:
+ browser:
+ items:
+ $ref: '#/definitions/domain.BrowserCount'
+ type: array
+ os:
+ items:
+ $ref: '#/definitions/domain.BrowserCount'
+ type: array
+ type: object
+ domain.HotPage:
+ properties:
+ count:
+ type: integer
+ node_id:
+ type: string
+ node_name:
+ type: string
+ scene:
+ $ref: '#/definitions/domain.StatPageScene'
+ type: object
+ domain.HotRefererHost:
+ properties:
+ count:
+ type: integer
+ referer_host:
+ type: string
+ type: object
+ domain.IPAddress:
+ properties:
+ city:
+ type: string
+ country:
+ type: string
+ ip:
+ type: string
+ province:
+ type: string
+ type: object
+ domain.ImgTextConfig:
+ properties:
+ item:
+ properties:
+ desc:
+ type: string
+ name:
+ type: string
+ url:
+ type: string
+ type: object
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.InstantCountResp:
+ properties:
+ count:
+ type: integer
+ time:
+ type: string
+ type: object
+ domain.InstantPageResp:
+ properties:
+ created_at:
+ type: string
+ info:
+ $ref: '#/definitions/domain.AuthUserInfo'
+ ip:
+ type: string
+ ip_address:
+ $ref: '#/definitions/domain.IPAddress'
+ node_id:
+ type: string
+ node_name:
+ type: string
+ scene:
+ $ref: '#/definitions/domain.StatPageScene'
+ user_id:
+ type: integer
+ type: object
+ domain.KBReleaseListItemResp:
+ properties:
+ created_at:
+ type: string
+ id:
+ type: string
+ kb_id:
+ type: string
+ message:
+ type: string
+ publisher_account:
+ type: string
+ tag:
+ type: string
+ type: object
+ domain.KnowledgeBaseDetail:
+ properties:
+ access_settings:
+ $ref: '#/definitions/domain.AccessSettings'
+ created_at:
+ type: string
+ dataset_id:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ perm:
+ allOf:
+ - $ref: '#/definitions/consts.UserKBPermission'
+ description: 用户对知识库的权限
+ updated_at:
+ type: string
+ type: object
+ domain.KnowledgeBaseListItem:
+ properties:
+ access_settings:
+ $ref: '#/definitions/domain.AccessSettings'
+ created_at:
+ type: string
+ dataset_id:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ updated_at:
+ type: string
+ type: object
+ domain.LarkBotSettings:
+ properties:
+ app_id:
+ type: string
+ app_secret:
+ type: string
+ encrypt_key:
+ type: string
+ is_enabled:
+ type: boolean
+ verify_token:
+ type: string
+ type: object
+ domain.Link:
+ properties:
+ name:
+ type: string
+ url:
+ type: string
+ type: object
+ domain.MCPServerSettings:
+ properties:
+ docs_tool_settings:
+ $ref: '#/definitions/domain.MCPToolSettings'
+ is_enabled:
+ type: boolean
+ sample_auth:
+ $ref: '#/definitions/domain.SimpleAuth'
+ type: object
+ domain.MCPToolSettings:
+ properties:
+ desc:
+ type: string
+ name:
+ type: string
+ type: object
+ domain.MessageContent:
+ type: object
+ domain.MessageFrom:
+ enum:
+ - 1
+ - 2
+ type: integer
+ x-enum-varnames:
+ - MessageFromGroup
+ - MessageFromPrivate
+ domain.MetricsConfig:
+ properties:
+ list:
+ items:
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ number:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.ModelModeSetting:
+ properties:
+ auto_mode_api_key:
+ description: 百智云 API Key
+ type: string
+ chat_model:
+ description: 自定义对话模型名称
+ type: string
+ is_manual_embedding_updated:
+ description: 手动模式下嵌入模型是否更新
+ type: boolean
+ mode:
+ allOf:
+ - $ref: '#/definitions/consts.ModelSettingMode'
+ description: '模式: manual 或 auto'
+ type: object
+ domain.ModelType:
+ enum:
+ - chat
+ - embedding
+ - rerank
+ - analysis
+ - analysis-vl
+ type: string
+ x-enum-varnames:
+ - ModelTypeChat
+ - ModelTypeEmbedding
+ - ModelTypeRerank
+ - ModelTypeAnalysis
+ - ModelTypeAnalysisVL
+ domain.MoveNodeReq:
+ properties:
+ id:
+ type: string
+ kb_id:
+ type: string
+ next_id:
+ type: string
+ parent_id:
+ type: string
+ prev_id:
+ type: string
+ required:
+ - id
+ - kb_id
+ type: object
+ domain.NavDocConfig:
+ properties:
+ nav_ids:
+ items:
+ type: string
+ type: array
+ title:
+ type: string
+ type: object
+ domain.NodeActionReq:
+ properties:
+ action:
+ enum:
+ - delete
+ type: string
+ ids:
+ items:
+ type: string
+ type: array
+ kb_id:
+ type: string
+ required:
+ - action
+ - ids
+ - kb_id
+ type: object
+ domain.NodeContentChunkSSE:
+ properties:
+ emoji:
+ type: string
+ name:
+ type: string
+ node_id:
+ type: string
+ node_path_names:
+ items:
+ type: string
+ type: array
+ summary:
+ type: string
+ type: object
+ domain.NodeGroupDetail:
+ properties:
+ auth_group_id:
+ type: integer
+ auth_ids:
+ items:
+ type: integer
+ type: array
+ kb_id:
+ type: string
+ name:
+ type: string
+ node_id:
+ type: string
+ perm:
+ $ref: '#/definitions/consts.NodePermName'
+ type: object
+ domain.NodeListItemResp:
+ properties:
+ content_type:
+ type: string
+ created_at:
+ type: string
+ creator:
+ type: string
+ creator_id:
+ type: string
+ editor:
+ type: string
+ editor_id:
+ type: string
+ emoji:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ nav_id:
+ type: string
+ parent_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ position:
+ type: number
+ publisher_id:
+ type: string
+ rag_info:
+ $ref: '#/definitions/domain.RagInfo'
+ status:
+ $ref: '#/definitions/domain.NodeStatus'
+ summary:
+ type: string
+ type:
+ $ref: '#/definitions/domain.NodeType'
+ updated_at:
+ type: string
+ type: object
+ domain.NodeMeta:
+ properties:
+ content_type:
+ type: string
+ emoji:
+ type: string
+ summary:
+ type: string
+ type: object
+ domain.NodePermissions:
+ properties:
+ answerable:
+ allOf:
+ - $ref: '#/definitions/consts.NodeAccessPerm'
+ description: 可被问答
+ visible:
+ allOf:
+ - $ref: '#/definitions/consts.NodeAccessPerm'
+ description: 导航内可见
+ visitable:
+ allOf:
+ - $ref: '#/definitions/consts.NodeAccessPerm'
+ description: 可被访问
+ type: object
+ domain.NodeStatus:
+ enum:
+ - 0
+ - 1
+ - 2
+ format: int32
+ type: integer
+ x-enum-comments:
+ NodeStatusDraft: 更新未发布
+ NodeStatusPublished: 已发布
+ NodeStatusUnreleased: 草稿
+ x-enum-descriptions:
+ - 草稿
+ - 更新未发布
+ - 已发布
+ x-enum-varnames:
+ - NodeStatusUnreleased
+ - NodeStatusDraft
+ - NodeStatusPublished
+ domain.NodeSummaryReq:
+ properties:
+ ids:
+ items:
+ type: string
+ type: array
+ kb_id:
+ type: string
+ required:
+ - ids
+ - kb_id
+ type: object
+ domain.NodeType:
+ enum:
+ - 1
+ - 2
+ format: int32
+ type: integer
+ x-enum-varnames:
+ - NodeTypeFolder
+ - NodeTypeDocument
+ domain.ObjectUploadResp:
+ properties:
+ filename:
+ type: string
+ key:
+ type: string
+ type: object
+ domain.OpenAIAPIBotSettings:
+ properties:
+ is_enabled:
+ type: boolean
+ secret_key:
+ type: string
+ type: object
+ domain.OpenAIChoice:
+ properties:
+ delta:
+ allOf:
+ - $ref: '#/definitions/domain.OpenAIMessage'
+ description: for streaming
+ finish_reason:
+ type: string
+ index:
+ type: integer
+ message:
+ $ref: '#/definitions/domain.OpenAIMessage'
+ type: object
+ domain.OpenAICompletionsRequest:
+ properties:
+ frequency_penalty:
+ type: number
+ max_tokens:
+ type: integer
+ messages:
+ items:
+ $ref: '#/definitions/domain.OpenAIMessage'
+ type: array
+ model:
+ type: string
+ presence_penalty:
+ type: number
+ response_format:
+ $ref: '#/definitions/domain.OpenAIResponseFormat'
+ stop:
+ items:
+ type: string
+ type: array
+ stream:
+ type: boolean
+ stream_options:
+ $ref: '#/definitions/domain.OpenAIStreamOptions'
+ temperature:
+ type: number
+ tool_choice:
+ $ref: '#/definitions/domain.OpenAIToolChoice'
+ tools:
+ items:
+ $ref: '#/definitions/domain.OpenAITool'
+ type: array
+ top_p:
+ type: number
+ user:
+ type: string
+ required:
+ - messages
+ - model
+ type: object
+ domain.OpenAICompletionsResponse:
+ properties:
+ choices:
+ items:
+ $ref: '#/definitions/domain.OpenAIChoice'
+ type: array
+ created:
+ type: integer
+ id:
+ type: string
+ model:
+ type: string
+ object:
+ type: string
+ usage:
+ $ref: '#/definitions/domain.OpenAIUsage'
+ type: object
+ domain.OpenAIError:
+ properties:
+ code:
+ type: string
+ message:
+ type: string
+ param:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.OpenAIErrorResponse:
+ properties:
+ error:
+ $ref: '#/definitions/domain.OpenAIError'
+ type: object
+ domain.OpenAIFunction:
+ properties:
+ description:
+ type: string
+ name:
+ type: string
+ parameters:
+ additionalProperties: true
+ type: object
+ required:
+ - name
+ type: object
+ domain.OpenAIFunctionCall:
+ properties:
+ arguments:
+ type: string
+ name:
+ type: string
+ required:
+ - arguments
+ - name
+ type: object
+ domain.OpenAIFunctionChoice:
+ properties:
+ name:
+ type: string
+ required:
+ - name
+ type: object
+ domain.OpenAIMessage:
+ properties:
+ content:
+ $ref: '#/definitions/domain.MessageContent'
+ name:
+ type: string
+ role:
+ type: string
+ tool_call_id:
+ type: string
+ tool_calls:
+ items:
+ $ref: '#/definitions/domain.OpenAIToolCall'
+ type: array
+ required:
+ - role
+ type: object
+ domain.OpenAIResponseFormat:
+ properties:
+ type:
+ type: string
+ required:
+ - type
+ type: object
+ domain.OpenAIStreamOptions:
+ properties:
+ include_usage:
+ type: boolean
+ type: object
+ domain.OpenAITool:
+ properties:
+ function:
+ $ref: '#/definitions/domain.OpenAIFunction'
+ type:
+ type: string
+ required:
+ - type
+ type: object
+ domain.OpenAIToolCall:
+ properties:
+ function:
+ $ref: '#/definitions/domain.OpenAIFunctionCall'
+ id:
+ type: string
+ type:
+ type: string
+ required:
+ - function
+ - id
+ - type
+ type: object
+ domain.OpenAIToolChoice:
+ properties:
+ function:
+ $ref: '#/definitions/domain.OpenAIFunctionChoice'
+ type:
+ type: string
+ type: object
+ domain.OpenAIUsage:
+ properties:
+ completion_tokens:
+ type: integer
+ prompt_tokens:
+ type: integer
+ total_tokens:
+ type: integer
+ type: object
+ domain.PWResponse:
+ properties:
+ code:
+ type: integer
+ data: {}
+ message:
+ type: string
+ success:
+ type: boolean
+ type: object
+ domain.PaginatedResult-array_domain_ConversationMessageListItem:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.ConversationMessageListItem'
+ type: array
+ total:
+ type: integer
+ type: object
+ domain.ProviderModelListItem:
+ properties:
+ model:
+ type: string
+ type: object
+ domain.QuestionConfig:
+ properties:
+ list:
+ items:
+ properties:
+ id:
+ type: string
+ question:
+ type: string
+ type: object
+ type: array
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.RagInfo:
+ properties:
+ message:
+ type: string
+ status:
+ $ref: '#/definitions/consts.NodeRagInfoStatus'
+ synced_at:
+ type: string
+ type: object
+ domain.RecommendNodeListResp:
+ properties:
+ emoji:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ nav_id:
+ type: string
+ nav_name:
+ type: string
+ parent_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ position:
+ type: number
+ recommend_nodes:
+ items:
+ $ref: '#/definitions/domain.RecommendNodeListResp'
+ type: array
+ summary:
+ type: string
+ type:
+ $ref: '#/definitions/domain.NodeType'
+ type: object
+ domain.Response:
+ properties:
+ data: {}
+ message:
+ type: string
+ success:
+ type: boolean
+ type: object
+ domain.ScoreType:
+ enum:
+ - 1
+ - -1
+ type: integer
+ x-enum-varnames:
+ - Like
+ - DisLike
+ domain.ShareCommentListItem:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ info:
+ $ref: '#/definitions/domain.CommentInfo'
+ ip_address:
+ allOf:
+ - $ref: '#/definitions/domain.IPAddress'
+ description: ip地址
+ kb_id:
+ type: string
+ node_id:
+ type: string
+ parent_id:
+ type: string
+ pic_urls:
+ items:
+ type: string
+ type: array
+ root_id:
+ type: string
+ type: object
+ domain.ShareConversationDetailResp:
+ properties:
+ created_at:
+ type: string
+ id:
+ type: string
+ messages:
+ items:
+ $ref: '#/definitions/domain.ShareConversationMessage'
+ type: array
+ subject:
+ type: string
+ type: object
+ domain.ShareConversationMessage:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ image_paths:
+ items:
+ type: string
+ type: array
+ role:
+ $ref: '#/definitions/schema.RoleType'
+ type: object
+ domain.ShareNodeDetailItem:
+ properties:
+ children:
+ items:
+ $ref: '#/definitions/domain.ShareNodeDetailItem'
+ type: array
+ emoji:
+ type: string
+ id:
+ type: string
+ meta:
+ $ref: '#/definitions/domain.NodeMeta'
+ name:
+ type: string
+ parent_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ position:
+ type: number
+ type:
+ $ref: '#/definitions/domain.NodeType'
+ updated_at:
+ type: string
+ type: object
+ domain.SimpleAuth:
+ properties:
+ enabled:
+ type: boolean
+ password:
+ type: string
+ type: object
+ domain.SimpleDocConfig:
+ properties:
+ bg_color:
+ type: string
+ title:
+ type: string
+ title_color:
+ type: string
+ type: object
+ domain.SocialMediaAccount:
+ properties:
+ channel:
+ type: string
+ icon:
+ type: string
+ link:
+ type: string
+ phone:
+ type: string
+ text:
+ type: string
+ type: object
+ domain.StatPageReq:
+ properties:
+ node_id:
+ type: string
+ scene:
+ allOf:
+ - $ref: '#/definitions/domain.StatPageScene'
+ enum:
+ - 1
+ - 2
+ - 3
+ - 4
+ required:
+ - scene
+ type: object
+ domain.StatPageScene:
+ enum:
+ - 1
+ - 2
+ - 3
+ - 4
+ type: integer
+ x-enum-varnames:
+ - StatPageSceneWelcome
+ - StatPageSceneNodeDetail
+ - StatPageSceneChat
+ - StatPageSceneLogin
+ domain.StatsSetting:
+ properties:
+ pv_enable:
+ type: boolean
+ type: object
+ domain.SwitchModeReq:
+ properties:
+ auto_mode_api_key:
+ description: 百智云 API Key
+ type: string
+ chat_model:
+ description: 自定义对话模型名称
+ type: string
+ mode:
+ enum:
+ - manual
+ - auto
+ type: string
+ required:
+ - mode
+ type: object
+ domain.SwitchModeResp:
+ properties:
+ message:
+ type: string
+ type: object
+ domain.TextConfig:
+ properties:
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.TextImgConfig:
+ properties:
+ item:
+ properties:
+ desc:
+ type: string
+ name:
+ type: string
+ url:
+ type: string
+ type: object
+ title:
+ type: string
+ type:
+ type: string
+ type: object
+ domain.TextReq:
+ properties:
+ action:
+ description: 'action: improve, summary, extend, shorten, etc.'
+ type: string
+ text:
+ type: string
+ required:
+ - text
+ type: object
+ domain.ThemeAndStyle:
+ properties:
+ bg_image:
+ type: string
+ doc_width:
+ type: string
+ type: object
+ domain.UpdateAppReq:
+ properties:
+ kb_id:
+ type: string
+ name:
+ type: string
+ settings:
+ $ref: '#/definitions/domain.AppSettings'
+ type: object
+ domain.UpdateKnowledgeBaseReq:
+ properties:
+ access_settings:
+ $ref: '#/definitions/domain.AccessSettings'
+ id:
+ type: string
+ name:
+ type: string
+ required:
+ - id
+ type: object
+ domain.UpdateModelReq:
+ properties:
+ api_header:
+ type: string
+ api_key:
+ type: string
+ api_version:
+ description: for azure openai
+ type: string
+ base_url:
+ type: string
+ id:
+ type: string
+ is_active:
+ type: boolean
+ model:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam'
+ provider:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider'
+ type:
+ allOf:
+ - $ref: '#/definitions/domain.ModelType'
+ enum:
+ - chat
+ - embedding
+ - rerank
+ - analysis
+ - analysis-vl
+ required:
+ - base_url
+ - id
+ - model
+ - provider
+ - type
+ type: object
+ domain.UpdateNodeReq:
+ properties:
+ content:
+ type: string
+ content_type:
+ type: string
+ emoji:
+ type: string
+ id:
+ type: string
+ kb_id:
+ type: string
+ name:
+ type: string
+ nav_id:
+ type: string
+ position:
+ type: number
+ summary:
+ type: string
+ required:
+ - id
+ - kb_id
+ type: object
+ domain.UploadByUrlReq:
+ properties:
+ kb_id:
+ type: string
+ url:
+ type: string
+ required:
+ - url
+ type: object
+ domain.UserInfo:
+ properties:
+ auth_user_id:
+ type: integer
+ avatar:
+ description: avatar
+ type: string
+ email:
+ type: string
+ from:
+ $ref: '#/definitions/domain.MessageFrom'
+ name:
+ type: string
+ real_name:
+ type: string
+ user_id:
+ type: string
+ type: object
+ domain.WeChatAppAdvancedSetting:
+ properties:
+ disclaimer_content:
+ type: string
+ feedback_enable:
+ type: boolean
+ feedback_type:
+ items:
+ type: string
+ type: array
+ prompt:
+ type: string
+ text_response_enable:
+ type: boolean
+ type: object
+ domain.WebAppCommentSettings:
+ properties:
+ is_enable:
+ type: boolean
+ moderation_enable:
+ type: boolean
+ type: object
+ domain.WebAppCustomSettings:
+ properties:
+ allow_theme_switching:
+ type: boolean
+ footer_show_intro:
+ type: boolean
+ header_search_placeholder:
+ type: string
+ show_brand_info:
+ type: boolean
+ social_media_accounts:
+ items:
+ $ref: '#/definitions/domain.SocialMediaAccount'
+ type: array
+ type: object
+ domain.WebAppLandingConfig:
+ properties:
+ banner_config:
+ $ref: '#/definitions/domain.BannerConfig'
+ basic_doc_config:
+ $ref: '#/definitions/domain.BasicDocConfig'
+ block_grid_config:
+ $ref: '#/definitions/domain.BlockGridConfig'
+ carousel_config:
+ $ref: '#/definitions/domain.CarouselConfig'
+ case_config:
+ $ref: '#/definitions/domain.CaseConfig'
+ com_config_order:
+ items:
+ type: string
+ type: array
+ comment_config:
+ $ref: '#/definitions/domain.CommentConfig'
+ dir_doc_config:
+ $ref: '#/definitions/domain.DirDocConfig'
+ faq_config:
+ $ref: '#/definitions/domain.FaqConfig'
+ feature_config:
+ $ref: '#/definitions/domain.FeatureConfig'
+ img_text_config:
+ $ref: '#/definitions/domain.ImgTextConfig'
+ metrics_config:
+ $ref: '#/definitions/domain.MetricsConfig'
+ nav_doc_config:
+ $ref: '#/definitions/domain.NavDocConfig'
+ node_ids:
+ items:
+ type: string
+ type: array
+ question_config:
+ $ref: '#/definitions/domain.QuestionConfig'
+ simple_doc_config:
+ $ref: '#/definitions/domain.SimpleDocConfig'
+ text_config:
+ $ref: '#/definitions/domain.TextConfig'
+ text_img_config:
+ $ref: '#/definitions/domain.TextImgConfig'
+ type:
+ type: string
+ type: object
+ domain.WebAppLandingConfigResp:
+ properties:
+ banner_config:
+ $ref: '#/definitions/domain.BannerConfig'
+ basic_doc_config:
+ $ref: '#/definitions/domain.BasicDocConfig'
+ block_grid_config:
+ $ref: '#/definitions/domain.BlockGridConfig'
+ carousel_config:
+ $ref: '#/definitions/domain.CarouselConfig'
+ case_config:
+ $ref: '#/definitions/domain.CaseConfig'
+ com_config_order:
+ items:
+ type: string
+ type: array
+ comment_config:
+ $ref: '#/definitions/domain.CommentConfig'
+ dir_doc_config:
+ $ref: '#/definitions/domain.DirDocConfig'
+ faq_config:
+ $ref: '#/definitions/domain.FaqConfig'
+ feature_config:
+ $ref: '#/definitions/domain.FeatureConfig'
+ img_text_config:
+ $ref: '#/definitions/domain.ImgTextConfig'
+ metrics_config:
+ $ref: '#/definitions/domain.MetricsConfig'
+ nav_doc_config:
+ $ref: '#/definitions/domain.NavDocConfig'
+ node_ids:
+ items:
+ type: string
+ type: array
+ nodes:
+ items:
+ $ref: '#/definitions/domain.RecommendNodeListResp'
+ type: array
+ question_config:
+ $ref: '#/definitions/domain.QuestionConfig'
+ simple_doc_config:
+ $ref: '#/definitions/domain.SimpleDocConfig'
+ text_config:
+ $ref: '#/definitions/domain.TextConfig'
+ text_img_config:
+ $ref: '#/definitions/domain.TextImgConfig'
+ type:
+ type: string
+ type: object
+ domain.WebAppLandingTheme:
+ properties:
+ name:
+ type: string
+ type: object
+ domain.WecomAIBotSettings:
+ properties:
+ encodingaeskey:
+ type: string
+ is_enabled:
+ type: boolean
+ token:
+ type: string
+ type: object
+ domain.WidgetBotSettings:
+ properties:
+ btn_id:
+ type: string
+ btn_logo:
+ type: string
+ btn_position:
+ type: string
+ btn_style:
+ type: string
+ btn_text:
+ type: string
+ copyright_hide_enabled:
+ type: boolean
+ copyright_info:
+ type: string
+ disclaimer:
+ type: string
+ is_open:
+ type: boolean
+ modal_position:
+ type: string
+ placeholder:
+ type: string
+ recommend_node_ids:
+ items:
+ type: string
+ type: array
+ recommend_questions:
+ items:
+ type: string
+ type: array
+ search_mode:
+ type: string
+ theme_mode:
+ type: string
+ type: object
+ github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp:
+ properties:
+ auths:
+ items:
+ $ref: '#/definitions/v1.AuthItem'
+ type: array
+ client_id:
+ type: string
+ client_secret:
+ type: string
+ proxy:
+ type: string
+ source_type:
+ $ref: '#/definitions/consts.SourceType'
+ type: object
+ github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp:
+ properties:
+ count:
+ type: integer
+ is_released:
+ type: boolean
+ list:
+ items:
+ $ref: '#/definitions/domain.NodeListItemResp'
+ type: array
+ nav_id:
+ type: string
+ nav_name:
+ type: string
+ position:
+ type: number
+ type: object
+ github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp:
+ properties:
+ auth_type:
+ $ref: '#/definitions/consts.AuthType'
+ license_edition:
+ $ref: '#/definitions/consts.LicenseEdition'
+ source_type:
+ $ref: '#/definitions/consts.SourceType'
+ type: object
+ github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp:
+ type: object
+ github_com_chaitin_panda-wiki_domain.CheckModelReq:
+ properties:
+ api_header:
+ type: string
+ api_key:
+ type: string
+ api_version:
+ description: for azure openai
+ type: string
+ base_url:
+ type: string
+ model:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam'
+ provider:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider'
+ type:
+ allOf:
+ - $ref: '#/definitions/domain.ModelType'
+ enum:
+ - chat
+ - embedding
+ - rerank
+ - analysis
+ - analysis-vl
+ required:
+ - base_url
+ - model
+ - provider
+ - type
+ type: object
+ github_com_chaitin_panda-wiki_domain.CheckModelResp:
+ properties:
+ content:
+ type: string
+ error:
+ type: string
+ type: object
+ github_com_chaitin_panda-wiki_domain.ModelListItem:
+ properties:
+ api_header:
+ type: string
+ api_key:
+ type: string
+ api_version:
+ description: for azure openai
+ type: string
+ base_url:
+ type: string
+ completion_tokens:
+ type: integer
+ id:
+ type: string
+ is_active:
+ type: boolean
+ model:
+ type: string
+ parameters:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelParam'
+ prompt_tokens:
+ type: integer
+ provider:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelProvider'
+ total_tokens:
+ type: integer
+ type:
+ $ref: '#/definitions/domain.ModelType'
+ type: object
+ github_com_chaitin_panda-wiki_domain.ModelParam:
+ properties:
+ context_window:
+ type: integer
+ max_tokens:
+ type: integer
+ r1_enabled:
+ type: boolean
+ support_computer_use:
+ type: boolean
+ support_images:
+ type: boolean
+ support_prompt_cache:
+ type: boolean
+ temperature:
+ type: number
+ type: object
+ github_com_chaitin_panda-wiki_domain.ModelProvider:
+ enum:
+ - BaiZhiCloud
+ type: string
+ x-enum-varnames:
+ - ModelProviderBrandBaiZhiCloud
+ gocap.ChallengeData:
+ properties:
+ challenge:
+ $ref: '#/definitions/gocap.ChallengeItem'
+ expires:
+ description: 过期时间,毫秒级时间戳
+ type: integer
+ token:
+ description: 质询令牌
+ type: string
+ type: object
+ gocap.ChallengeItem:
+ properties:
+ c:
+ description: 质询数量
+ type: integer
+ d:
+ description: 质询难度
+ type: integer
+ s:
+ description: 质询大小
+ type: integer
+ type: object
+ gocap.VerificationResult:
+ properties:
+ expires:
+ description: 过期时间,毫秒级时间戳
+ type: integer
+ message:
+ type: string
+ success:
+ type: boolean
+ token:
+ description: 验证令牌
+ type: string
+ type: object
+ schema.RoleType:
+ enum:
+ - assistant
+ - user
+ - system
+ - tool
+ type: string
+ x-enum-varnames:
+ - Assistant
+ - User
+ - System
+ - Tool
+ share.ShareCommentLists:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.ShareCommentListItem'
+ type: array
+ total:
+ type: integer
+ type: object
+ v1.AuthGitHubReq:
+ properties:
+ kb_id:
+ type: string
+ redirect_url:
+ type: string
+ type: object
+ v1.AuthGitHubResp:
+ properties:
+ url:
+ type: string
+ type: object
+ v1.AuthItem:
+ properties:
+ avatar_url:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: integer
+ ip:
+ type: string
+ last_login_time:
+ type: string
+ source_type:
+ $ref: '#/definitions/consts.SourceType'
+ username:
+ type: string
+ type: object
+ v1.AuthLoginSimpleReq:
+ properties:
+ password:
+ type: string
+ required:
+ - password
+ type: object
+ v1.AuthSetReq:
+ properties:
+ client_id:
+ type: string
+ client_secret:
+ type: string
+ kb_id:
+ type: string
+ proxy:
+ type: string
+ source_type:
+ allOf:
+ - $ref: '#/definitions/consts.SourceType'
+ enum:
+ - github
+ required:
+ - source_type
+ type: object
+ v1.CommentLists:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.CommentListItem'
+ type: array
+ total:
+ type: integer
+ type: object
+ v1.ConversationListItems:
+ properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.ConversationListItem'
+ type: array
+ total:
+ type: integer
+ type: object
+ v1.CrawlerExportReq:
+ properties:
+ doc_id:
+ type: string
+ file_type:
+ type: string
+ id:
+ type: string
+ kb_id:
+ type: string
+ space_id:
+ type: string
+ required:
+ - doc_id
+ - id
+ - kb_id
+ type: object
+ v1.CrawlerExportResp:
+ properties:
+ task_id:
+ type: string
+ type: object
+ v1.CrawlerParseReq:
+ properties:
+ crawler_source:
+ $ref: '#/definitions/consts.CrawlerSource'
+ dingtalk_setting:
+ $ref: '#/definitions/anydoc.DingtalkSetting'
+ feishu_setting:
+ $ref: '#/definitions/anydoc.FeishuSetting'
+ filename:
+ type: string
+ kb_id:
+ type: string
+ key:
+ type: string
+ required:
+ - crawler_source
+ - kb_id
+ type: object
+ v1.CrawlerParseResp:
+ properties:
+ docs:
+ $ref: '#/definitions/anydoc.Child'
+ id:
+ type: string
+ type: object
+ v1.CrawlerResultItem:
+ properties:
+ content:
+ type: string
+ status:
+ $ref: '#/definitions/consts.CrawlerStatus'
+ task_id:
+ type: string
+ type: object
+ v1.CrawlerResultReq:
+ properties:
+ task_id:
+ type: string
+ required:
+ - task_id
+ type: object
+ v1.CrawlerResultResp:
+ properties:
+ content:
+ type: string
+ status:
+ $ref: '#/definitions/consts.CrawlerStatus'
+ required:
+ - status
+ type: object
+ v1.CrawlerResultsReq:
+ properties:
+ task_ids:
+ items:
+ type: string
+ type: array
+ required:
+ - task_ids
+ type: object
+ v1.CrawlerResultsResp:
+ properties:
+ list:
+ items:
+ $ref: '#/definitions/v1.CrawlerResultItem'
+ type: array
+ status:
+ $ref: '#/definitions/consts.CrawlerStatus'
+ type: object
+ v1.CreateUserReq:
+ properties:
+ account:
+ type: string
+ password:
+ minLength: 8
+ type: string
+ role:
+ allOf:
+ - $ref: '#/definitions/consts.UserRole'
+ enum:
+ - admin
+ - user
+ required:
+ - account
+ - password
+ - role
+ type: object
+ v1.CreateUserResp:
+ properties:
+ id:
+ type: string
+ type: object
+ v1.FileUploadResp:
+ properties:
+ key:
+ type: string
+ type: object
+ v1.KBUserInviteReq:
+ properties:
+ kb_id:
+ type: string
+ perm:
+ allOf:
+ - $ref: '#/definitions/consts.UserKBPermission'
+ enum:
+ - full_control
+ - doc_manage
+ - data_operate
+ user_id:
+ type: string
+ required:
+ - kb_id
+ - perm
+ - user_id
+ type: object
+ v1.KBUserListItemResp:
+ properties:
+ account:
+ type: string
+ id:
+ type: string
+ perms:
+ $ref: '#/definitions/consts.UserKBPermission'
+ role:
+ $ref: '#/definitions/consts.UserRole'
+ type: object
+ v1.KBUserUpdateReq:
+ properties:
+ kb_id:
+ type: string
+ perm:
+ allOf:
+ - $ref: '#/definitions/consts.UserKBPermission'
+ enum:
+ - full_control
+ - doc_manage
+ - data_operate
+ user_id:
+ type: string
+ required:
+ - kb_id
+ - perm
+ - user_id
+ type: object
+ v1.LoginReq:
+ properties:
+ account:
+ type: string
+ password:
+ type: string
+ required:
+ - account
+ - password
+ type: object
+ v1.LoginResp:
+ properties:
+ token:
+ type: string
+ type: object
+ v1.NavAddReq:
+ properties:
+ kb_id:
+ type: string
+ name:
+ type: string
+ position:
+ type: number
+ required:
+ - kb_id
+ - name
+ type: object
+ v1.NavListResp:
+ properties:
+ created_at:
+ type: string
+ id:
+ type: string
+ name:
+ type: string
+ position:
+ type: number
+ updated_at:
+ type: string
+ type: object
+ v1.NavMoveReq:
+ properties:
+ id:
+ type: string
+ kb_id:
+ type: string
+ next_id:
+ type: string
+ prev_id:
+ type: string
+ required:
+ - id
+ - kb_id
+ type: object
+ v1.NavUpdateReq:
+ properties:
+ id:
+ type: string
+ kb_id:
+ type: string
+ name:
+ type: string
+ required:
+ - id
+ - kb_id
+ - name
+ type: object
+ v1.NodeDetailResp:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ creator_account:
+ type: string
+ creator_id:
+ type: string
+ editor_account:
+ type: string
+ editor_id:
+ type: string
+ id:
+ type: string
+ kb_id:
+ type: string
+ meta:
+ $ref: '#/definitions/domain.NodeMeta'
+ name:
+ type: string
+ nav_id:
+ type: string
+ parent_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ publisher_account:
+ type: string
+ publisher_id:
+ type: string
+ pv:
+ type: integer
+ status:
+ $ref: '#/definitions/domain.NodeStatus'
+ type:
+ $ref: '#/definitions/domain.NodeType'
+ updated_at:
+ type: string
+ type: object
+ v1.NodeMoveNavReq:
+ properties:
+ ids:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ kb_id:
+ type: string
+ nav_id:
+ type: string
+ required:
+ - ids
+ - kb_id
+ - nav_id
+ type: object
+ v1.NodePermissionEditReq:
+ properties:
+ answerable_groups:
+ description: 可被问答
+ items:
+ type: integer
+ type: array
+ ids:
+ items:
+ type: string
+ type: array
+ kb_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ visible_groups:
+ description: 导航内可见
+ items:
+ type: integer
+ type: array
+ visitable_groups:
+ description: 可被访问
+ items:
+ type: integer
+ type: array
+ required:
+ - ids
+ - kb_id
+ type: object
+ v1.NodePermissionEditResp:
+ type: object
+ v1.NodePermissionResp:
+ properties:
+ answerable_groups:
+ description: 可被问答
+ items:
+ $ref: '#/definitions/domain.NodeGroupDetail'
+ type: array
+ id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ visible_groups:
+ description: 导航内可见
+ items:
+ $ref: '#/definitions/domain.NodeGroupDetail'
+ type: array
+ visitable_groups:
+ description: 可被访问
+ items:
+ $ref: '#/definitions/domain.NodeGroupDetail'
+ type: array
+ type: object
+ v1.NodeRestudyReq:
+ properties:
+ kb_id:
+ type: string
+ node_ids:
+ items:
+ type: string
+ minItems: 1
+ type: array
+ required:
+ - kb_id
+ - node_ids
+ type: object
+ v1.NodeRestudyResp:
+ type: object
+ v1.NodeStatsResp:
+ properties:
+ unpublished_count:
+ description: 未发布的文档数
+ type: integer
+ unreleased_nav_count:
+ description: 未发布目录数量
+ type: integer
+ unstudied_count:
+ description: 未学习的文档数
+ type: integer
+ type: object
+ v1.ResetPasswordReq:
+ properties:
+ id:
+ type: string
+ new_password:
+ minLength: 8
+ type: string
+ required:
+ - id
+ - new_password
+ type: object
+ v1.ShareFileUploadUrlReq:
+ properties:
+ captcha_token:
+ type: string
+ url:
+ type: string
+ required:
+ - captcha_token
+ - url
+ type: object
+ v1.ShareFileUploadUrlResp:
+ properties:
+ key:
+ type: string
+ type: object
+ v1.ShareNodeDetailResp:
+ properties:
+ content:
+ type: string
+ created_at:
+ type: string
+ creator_account:
+ type: string
+ creator_id:
+ type: string
+ editor_account:
+ type: string
+ editor_id:
+ type: string
+ id:
+ type: string
+ kb_id:
+ type: string
+ list:
+ items:
+ $ref: '#/definitions/domain.ShareNodeDetailItem'
+ type: array
+ meta:
+ $ref: '#/definitions/domain.NodeMeta'
+ name:
+ type: string
+ parent_id:
+ type: string
+ permissions:
+ $ref: '#/definitions/domain.NodePermissions'
+ publisher_account:
+ type: string
+ publisher_id:
+ type: string
+ pv:
+ type: integer
+ status:
+ $ref: '#/definitions/domain.NodeStatus'
+ type:
+ $ref: '#/definitions/domain.NodeType'
+ updated_at:
+ type: string
+ type: object
+ v1.StatConversationDistributionResp:
+ properties:
+ app_type:
+ $ref: '#/definitions/domain.AppType'
+ count:
+ type: integer
+ type: object
+ v1.StatCountResp:
+ properties:
+ conversation_count:
+ type: integer
+ ip_count:
+ type: integer
+ page_visit_count:
+ type: integer
+ session_count:
+ type: integer
+ type: object
+ v1.UserInfoResp:
+ properties:
+ account:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ is_token:
+ type: boolean
+ last_access:
+ type: string
+ role:
+ $ref: '#/definitions/consts.UserRole'
+ type: object
+ v1.UserListItemResp:
+ properties:
+ account:
+ type: string
+ created_at:
+ type: string
+ id:
+ type: string
+ last_access:
+ type: string
+ role:
+ $ref: '#/definitions/consts.UserRole'
+ type: object
+ v1.UserListResp:
+ properties:
+ users:
+ items:
+ $ref: '#/definitions/v1.UserListItemResp'
+ type: array
+ type: object
+ v1.WechatAppInfoResp:
+ properties:
+ disclaimer_content:
+ type: string
+ feedback_enable:
+ type: boolean
+ feedback_type:
+ items:
+ type: string
+ type: array
+ wechat_app_is_enabled:
+ type: boolean
+ type: object
+info:
+ contact: {}
+ description: panda-wiki API documentation
+ title: panda-wiki API
+ version: "1.0"
+paths:
+ /api/v1/app:
+ delete:
+ consumes:
+ - application/json
+ description: Delete app
+ parameters:
+ - description: kb id
+ in: query
+ name: kb_id
+ required: true
+ type: string
+ - description: app id
+ in: query
+ name: id
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Delete app
+ tags:
+ - app
+ put:
+ consumes:
+ - application/json
+ description: Update app
+ parameters:
+ - description: id
+ in: query
+ name: id
+ required: true
+ type: string
+ - description: app
+ in: body
+ name: app
+ required: true
+ schema:
+ $ref: '#/definitions/domain.UpdateAppReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Update app
+ tags:
+ - app
+ /api/v1/app/detail:
+ get:
+ consumes:
+ - application/json
+ description: Get app detail
+ parameters:
+ - description: kb id
+ in: query
+ name: kb_id
+ required: true
+ type: string
+ - description: app type
+ in: query
+ name: type
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.AppDetailResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Get app detail
+ tags:
+ - app
+ /api/v1/auth/delete:
+ delete:
+ consumes:
+ - application/json
+ description: 删除授权信息
+ operationId: v1-OpenAuthDelete
+ parameters:
+ - in: query
+ name: id
+ type: integer
+ - in: query
+ name: kb_id
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: 删除授权信息
+ tags:
+ - Auth
+ /api/v1/auth/get:
+ get:
+ consumes:
+ - application/json
+ description: 获取授权信息
+ operationId: v1-OpenAuthGet
+ parameters:
+ - in: query
+ name: kb_id
+ type: string
+ - enum:
+ - dingtalk
+ - feishu
+ - wecom
+ - oauth
+ - github
+ - cas
+ - ldap
+ - widget
+ - dingtalk_bot
+ - feishu_bot
+ - lark_bot
+ - wechat_bot
+ - wecom_ai_bot
+ - wechat_service_bot
+ - discord_bot
+ - wechat_official_account
+ - openai_api
+ - mcp_server
+ in: query
+ name: source_type
+ required: true
+ type: string
+ x-enum-varnames:
+ - SourceTypeDingTalk
+ - SourceTypeFeishu
+ - SourceTypeWeCom
+ - SourceTypeOAuth
+ - SourceTypeGitHub
+ - SourceTypeCAS
+ - SourceTypeLDAP
+ - SourceTypeWidget
+ - SourceTypeDingtalkBot
+ - SourceTypeFeishuBot
+ - SourceTypeLarkBot
+ - SourceTypeWechatBot
+ - SourceTypeWecomAIBot
+ - SourceTypeWechatServiceBot
+ - SourceTypeDiscordBot
+ - SourceTypeWechatOfficialAccount
+ - SourceTypeOpenAIAPI
+ - SourceTypeMcpServer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_api_auth_v1.AuthGetResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 获取授权信息
+ tags:
+ - Auth
+ /api/v1/auth/set:
+ post:
+ consumes:
+ - application/json
+ description: 设置授权信息
+ operationId: v1-OpenAuthSet
+ parameters:
+ - description: para
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.AuthSetReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: 设置授权信息
+ tags:
+ - Auth
+ /api/v1/comment:
+ get:
+ consumes:
+ - application/json
+ description: GetCommentModeratedList
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - in: query
+ minimum: 1
+ name: page
+ required: true
+ type: integer
+ - in: query
+ minimum: 1
+ name: per_page
+ required: true
+ type: integer
+ - enum:
+ - -1
+ - 0
+ - 1
+ format: int32
+ in: query
+ name: status
+ type: integer
+ x-enum-varnames:
+ - CommentStatusReject
+ - CommentStatusPending
+ - CommentStatusAccepted
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: conversationList
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CommentLists'
+ type: object
+ summary: GetCommentModeratedList
+ tags:
+ - comment
+ /api/v1/comment/list:
+ delete:
+ consumes:
+ - application/json
+ description: DeleteCommentList
+ parameters:
+ - collectionFormat: csv
+ in: query
+ items:
+ type: string
+ name: ids
+ type: array
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: total
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: DeleteCommentList
+ tags:
+ - comment
+ /api/v1/conversation:
+ get:
+ consumes:
+ - application/json
+ description: get conversation list
+ parameters:
+ - in: query
+ name: app_id
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - in: query
+ minimum: 1
+ name: page
+ required: true
+ type: integer
+ - in: query
+ minimum: 1
+ name: per_page
+ required: true
+ type: integer
+ - in: query
+ name: remote_ip
+ type: string
+ - in: query
+ name: subject
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.ConversationListItems'
+ type: object
+ summary: get conversation list
+ tags:
+ - conversation
+ /api/v1/conversation/detail:
+ get:
+ consumes:
+ - application/json
+ description: get conversation detail
+ parameters:
+ - in: query
+ name: id
+ required: true
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ConversationDetailResp'
+ type: object
+ summary: get conversation detail
+ tags:
+ - conversation
+ /api/v1/conversation/message/detail:
+ get:
+ consumes:
+ - application/json
+ description: Get message detail
+ parameters:
+ - in: query
+ name: id
+ required: true
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ConversationMessage'
+ type: object
+ summary: Get message detail
+ tags:
+ - Message
+ /api/v1/conversation/message/list:
+ get:
+ consumes:
+ - application/json
+ description: GetMessageFeedBackList
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - in: query
+ minimum: 1
+ name: page
+ required: true
+ type: integer
+ - in: query
+ minimum: 1
+ name: per_page
+ required: true
+ type: integer
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: MessageList
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.PaginatedResult-array_domain_ConversationMessageListItem'
+ type: object
+ summary: GetMessageFeedBackList
+ tags:
+ - Message
+ /api/v1/crawler/export:
+ post:
+ consumes:
+ - application/json
+ description: CrawlerExport
+ parameters:
+ - description: Scrape
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CrawlerExportReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CrawlerExportResp'
+ type: object
+ summary: CrawlerExport
+ tags:
+ - crawler
+ /api/v1/crawler/parse:
+ post:
+ consumes:
+ - application/json
+ description: 解析文档树
+ parameters:
+ - description: Scrape
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CrawlerParseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CrawlerParseResp'
+ type: object
+ summary: 解析文档树
+ tags:
+ - crawler
+ /api/v1/crawler/result:
+ get:
+ consumes:
+ - application/json
+ description: Retrieve the result of a previously started scraping task
+ parameters:
+ - description: Crawler Result Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CrawlerResultReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CrawlerResultResp'
+ type: object
+ summary: Get Crawler Result
+ tags:
+ - crawler
+ /api/v1/crawler/results:
+ post:
+ consumes:
+ - application/json
+ description: Retrieve the results of a previously started scraping task
+ parameters:
+ - description: Crawler Results Request
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CrawlerResultsReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CrawlerResultsResp'
+ type: object
+ summary: Get Crawler Results
+ tags:
+ - crawler
+ /api/v1/creation/tab-complete:
+ post:
+ consumes:
+ - application/json
+ description: Tab-based document completion similar to AI coding's FIM (Fill
+ in Middle)
+ parameters:
+ - description: tab completion request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CompleteReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: success
+ schema:
+ type: string
+ summary: Tab-based document completion
+ tags:
+ - creation
+ /api/v1/creation/text:
+ post:
+ consumes:
+ - application/json
+ description: Text creation
+ parameters:
+ - description: text creation request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.TextReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: success
+ schema:
+ type: string
+ summary: Text creation
+ tags:
+ - creation
+ /api/v1/file/upload:
+ post:
+ consumes:
+ - multipart/form-data
+ description: Upload File
+ parameters:
+ - description: File
+ in: formData
+ name: file
+ required: true
+ type: file
+ - description: Knowledge Base ID
+ in: formData
+ name: kb_id
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.ObjectUploadResp'
+ summary: Upload File
+ tags:
+ - file
+ /api/v1/file/upload/anydoc:
+ post:
+ consumes:
+ - multipart/form-data
+ description: Upload Anydoc File
+ parameters:
+ - description: File
+ in: formData
+ name: file
+ required: true
+ type: file
+ - description: File Path
+ in: formData
+ name: path
+ required: true
+ type: string
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.AnydocUploadResp'
+ summary: Upload Anydoc File
+ tags:
+ - file
+ /api/v1/file/upload/url:
+ post:
+ consumes:
+ - application/json
+ description: Upload File By Url
+ parameters:
+ - description: Request Body
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.UploadByUrlReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ObjectUploadResp'
+ type: object
+ summary: Upload File By Url
+ tags:
+ - file
+ /api/v1/knowledge_base:
+ post:
+ consumes:
+ - application/json
+ description: CreateKnowledgeBase
+ parameters:
+ - description: CreateKnowledgeBase Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CreateKnowledgeBaseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: CreateKnowledgeBase
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/detail:
+ delete:
+ consumes:
+ - application/json
+ description: DeleteKnowledgeBase
+ parameters:
+ - description: Knowledge Base ID
+ in: query
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: DeleteKnowledgeBase
+ tags:
+ - knowledge_base
+ get:
+ consumes:
+ - application/json
+ description: GetKnowledgeBaseDetail
+ parameters:
+ - description: Knowledge Base ID
+ in: query
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.KnowledgeBaseDetail'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: GetKnowledgeBaseDetail
+ tags:
+ - knowledge_base
+ put:
+ consumes:
+ - application/json
+ description: UpdateKnowledgeBase
+ parameters:
+ - description: UpdateKnowledgeBase Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.UpdateKnowledgeBaseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: UpdateKnowledgeBase
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/list:
+ get:
+ consumes:
+ - application/json
+ description: GetKnowledgeBaseList
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.KnowledgeBaseListItem'
+ type: array
+ type: object
+ summary: GetKnowledgeBaseList
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/release:
+ post:
+ consumes:
+ - application/json
+ description: CreateKBRelease
+ parameters:
+ - description: CreateKBRelease Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CreateKBReleaseReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: CreateKBRelease
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/release/list:
+ get:
+ consumes:
+ - application/json
+ description: GetKBReleaseList
+ parameters:
+ - description: Knowledge Base ID
+ in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.GetKBReleaseListResp'
+ type: object
+ summary: GetKBReleaseList
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/user/delete:
+ delete:
+ consumes:
+ - application/json
+ description: Remove user from knowledge base
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - in: query
+ name: user_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: KBUserDelete
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/user/invite:
+ post:
+ consumes:
+ - application/json
+ description: Invite user to knowledge base
+ parameters:
+ - description: Invite User Request
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.KBUserInviteReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: KBUserInvite
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/user/list:
+ get:
+ consumes:
+ - application/json
+ description: KBUserList
+ parameters:
+ - description: Knowledge Base ID
+ in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/v1.KBUserListItemResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: KBUserList
+ tags:
+ - knowledge_base
+ /api/v1/knowledge_base/user/update:
+ patch:
+ consumes:
+ - application/json
+ description: Update user permission in knowledge base
+ parameters:
+ - description: Update User Permission Request
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.KBUserUpdateReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: KBUserUpdate
+ tags:
+ - knowledge_base
+ /api/v1/model:
+ post:
+ consumes:
+ - application/json
+ description: create model
+ parameters:
+ - description: create model request
+ in: body
+ name: model
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CreateModelReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: create model
+ tags:
+ - model
+ put:
+ consumes:
+ - application/json
+ description: update model
+ parameters:
+ - description: update model request
+ in: body
+ name: model
+ required: true
+ schema:
+ $ref: '#/definitions/domain.UpdateModelReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ tags:
+ - model
+ /api/v1/model/check:
+ post:
+ consumes:
+ - application/json
+ description: check model
+ parameters:
+ - description: check model request
+ in: body
+ name: model
+ required: true
+ schema:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.CheckModelResp'
+ type: object
+ summary: check model
+ tags:
+ - model
+ /api/v1/model/list:
+ get:
+ consumes:
+ - application/json
+ description: get model list
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_domain.ModelListItem'
+ type: object
+ summary: get model list
+ tags:
+ - model
+ /api/v1/model/mode-setting:
+ get:
+ consumes:
+ - application/json
+ description: get current model mode setting including mode, API key and chat
+ model
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ModelModeSetting'
+ type: object
+ summary: get model mode setting
+ tags:
+ - model
+ /api/v1/model/provider/supported:
+ post:
+ consumes:
+ - application/json
+ description: get provider supported model list
+ parameters:
+ - description: get supported model list request
+ in: body
+ name: params
+ required: true
+ schema:
+ $ref: '#/definitions/domain.GetProviderModelListReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.GetProviderModelListResp'
+ type: object
+ summary: get provider supported model list
+ tags:
+ - model
+ /api/v1/model/switch-mode:
+ post:
+ consumes:
+ - application/json
+ description: switch model mode between manual and auto
+ parameters:
+ - description: switch mode request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.SwitchModeReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.SwitchModeResp'
+ type: object
+ summary: switch mode
+ tags:
+ - model
+ /api/v1/nav/add:
+ post:
+ consumes:
+ - application/json
+ description: Add Nav
+ parameters:
+ - description: Params
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NavAddReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.PWResponse'
+ security:
+ - bearerAuth: []
+ summary: 添加分栏
+ tags:
+ - Nav
+ /api/v1/nav/delete:
+ delete:
+ consumes:
+ - application/json
+ description: DeleteNav Nav
+ parameters:
+ - in: query
+ name: id
+ required: true
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.PWResponse'
+ security:
+ - bearerAuth: []
+ summary: 删除栏目
+ tags:
+ - Nav
+ /api/v1/nav/list:
+ get:
+ consumes:
+ - application/json
+ description: Get Nav List
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/v1.NavListResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 获取分栏列表
+ tags:
+ - Nav
+ /api/v1/nav/move:
+ post:
+ consumes:
+ - application/json
+ description: Move Nav
+ parameters:
+ - description: Params
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NavMoveReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.PWResponse'
+ security:
+ - bearerAuth: []
+ summary: 移动栏目
+ tags:
+ - Nav
+ /api/v1/nav/update:
+ patch:
+ consumes:
+ - application/json
+ description: Update Nav
+ parameters:
+ - description: Params
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NavUpdateReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.PWResponse'
+ security:
+ - bearerAuth: []
+ summary: 更新栏目信息
+ tags:
+ - Nav
+ /api/v1/node:
+ post:
+ consumes:
+ - application/json
+ description: Create Node
+ parameters:
+ - description: Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CreateNodeReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Create Node
+ tags:
+ - node
+ /api/v1/node/action:
+ post:
+ consumes:
+ - application/json
+ description: Node Action
+ parameters:
+ - description: Action
+ in: body
+ name: action
+ required: true
+ schema:
+ $ref: '#/definitions/domain.NodeActionReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ additionalProperties:
+ type: string
+ type: object
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Node Action
+ tags:
+ - node
+ /api/v1/node/batch_move:
+ post:
+ consumes:
+ - application/json
+ description: Batch Move Node
+ parameters:
+ - description: Batch Move Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.BatchMoveReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Batch Move Node
+ tags:
+ - node
+ /api/v1/node/detail:
+ get:
+ consumes:
+ - application/json
+ description: Get Node Detail
+ parameters:
+ - in: query
+ name: format
+ type: string
+ - in: query
+ name: id
+ required: true
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.NodeDetailResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Get Node Detail
+ tags:
+ - node
+ put:
+ consumes:
+ - application/json
+ description: Update Node Detail
+ parameters:
+ - description: Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.UpdateNodeReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Update Node Detail
+ tags:
+ - node
+ /api/v1/node/list:
+ get:
+ consumes:
+ - application/json
+ description: Get Node List
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - in: query
+ name: nav_id
+ type: string
+ - in: query
+ name: search
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.NodeListItemResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Get Node List
+ tags:
+ - node
+ /api/v1/node/list/group/nav:
+ get:
+ consumes:
+ - application/json
+ description: Get unpublished or unstudied document list grouped by nav
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - collectionFormat: csv
+ in: query
+ items:
+ type: string
+ name: nav_ids
+ type: array
+ - in: query
+ name: search
+ type: string
+ - enum:
+ - released
+ - unpublished
+ - unstudied
+ in: query
+ name: status
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_api_node_v1.NodeListGroupNavResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Get Node List Grouped by Nav
+ tags:
+ - node
+ /api/v1/node/move:
+ post:
+ consumes:
+ - application/json
+ description: Move Node
+ parameters:
+ - description: Move Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.MoveNodeReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Move Node
+ tags:
+ - node
+ /api/v1/node/move/nav:
+ post:
+ consumes:
+ - application/json
+ description: Move node (and all its descendants if folder) to a different nav
+ parameters:
+ - description: Move Node Nav
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NodeMoveNavReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Move Node to Nav
+ tags:
+ - node
+ /api/v1/node/permission:
+ get:
+ consumes:
+ - application/json
+ description: 文档授权信息获取
+ operationId: v1-NodePermission
+ parameters:
+ - in: query
+ name: id
+ required: true
+ type: string
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.NodePermissionResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 文档授权信息获取
+ tags:
+ - NodePermission
+ /api/v1/node/permission/edit:
+ patch:
+ consumes:
+ - application/json
+ description: 文档授权信息更新
+ operationId: v1-NodePermissionEdit
+ parameters:
+ - description: para
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NodePermissionEditReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.NodePermissionEditResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 文档授权信息更新
+ tags:
+ - NodePermission
+ /api/v1/node/recommend_nodes:
+ get:
+ consumes:
+ - application/json
+ description: Recommend Nodes
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ - collectionFormat: csv
+ in: query
+ items:
+ type: string
+ name: nav_ids
+ type: array
+ - collectionFormat: csv
+ in: query
+ items:
+ type: string
+ name: node_ids
+ type: array
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.RecommendNodeListResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Recommend Nodes
+ tags:
+ - node
+ /api/v1/node/restudy:
+ post:
+ consumes:
+ - application/json
+ description: 文档重新学习
+ operationId: v1-NodeRestudy
+ parameters:
+ - description: para
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.NodeRestudyReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.NodeRestudyResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 文档重新学习
+ tags:
+ - Node
+ /api/v1/node/stats:
+ get:
+ consumes:
+ - application/json
+ description: Get Node Statistics
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.NodeStatsResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: Get Node Statistics
+ tags:
+ - node
+ /api/v1/node/summary:
+ post:
+ consumes:
+ - application/json
+ description: Summary Node
+ parameters:
+ - description: Summary Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.NodeSummaryReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: Summary Node 异步后台生成
+ tags:
+ - node
+ /api/v1/node/summary/stream:
+ post:
+ consumes:
+ - application/json
+ description: Stream Summary Node for single document
+ parameters:
+ - description: Summary Node
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/domain.NodeSummaryReq'
+ produces:
+ - text/event-stream
+ responses:
+ "200":
+ description: SSE stream
+ schema:
+ type: string
+ security:
+ - bearerAuth: []
+ summary: Stream Summary Node
+ tags:
+ - node
+ /api/v1/stat/browsers:
+ get:
+ consumes:
+ - application/json
+ description: 客户端统计
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.HotBrowser'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 客户端统计
+ tags:
+ - stat
+ /api/v1/stat/conversation_distribution:
+ get:
+ consumes:
+ - application/json
+ description: 问答来源
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/v1.StatConversationDistributionResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 问答来源
+ tags:
+ - stat
+ /api/v1/stat/count:
+ get:
+ consumes:
+ - application/json
+ description: 全局统计
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.StatCountResp'
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 全局统计
+ tags:
+ - stat
+ /api/v1/stat/geo_count:
+ get:
+ consumes:
+ - application/json
+ description: 用户地理分布
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ security:
+ - bearerAuth: []
+ summary: 用户地理分布
+ tags:
+ - stat
+ /api/v1/stat/hot_pages:
+ get:
+ consumes:
+ - application/json
+ description: 热门文档
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.HotPage'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 热门文档
+ tags:
+ - stat
+ /api/v1/stat/instant_count:
+ get:
+ consumes:
+ - application/json
+ description: GetInstantCount
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.InstantCountResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: GetInstantCount
+ tags:
+ - stat
+ /api/v1/stat/instant_pages:
+ get:
+ consumes:
+ - application/json
+ description: GetInstantPages
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.InstantPageResp'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: GetInstantPages
+ tags:
+ - stat
+ /api/v1/stat/referer_hosts:
+ get:
+ consumes:
+ - application/json
+ description: 来源域名
+ parameters:
+ - enum:
+ - 1
+ - 7
+ - 30
+ - 90
+ in: query
+ name: day
+ type: integer
+ x-enum-varnames:
+ - StatDay1
+ - StatDay7
+ - StatDay30
+ - StatDay90
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/domain.HotRefererHost'
+ type: array
+ type: object
+ security:
+ - bearerAuth: []
+ summary: 来源域名
+ tags:
+ - stat
+ /api/v1/user:
+ get:
+ consumes:
+ - application/json
+ description: GetUser
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.UserInfoResp'
+ summary: GetUser
+ tags:
+ - user
+ /api/v1/user/create:
+ post:
+ consumes:
+ - application/json
+ description: CreateUser
+ parameters:
+ - description: CreateUser Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.CreateUserReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.CreateUserResp'
+ type: object
+ summary: CreateUser
+ tags:
+ - user
+ /api/v1/user/delete:
+ delete:
+ consumes:
+ - application/json
+ description: DeleteUser
+ parameters:
+ - in: query
+ name: user_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: DeleteUser
+ tags:
+ - user
+ /api/v1/user/list:
+ get:
+ consumes:
+ - application/json
+ description: ListUsers
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.UserListResp'
+ type: object
+ summary: ListUsers
+ tags:
+ - user
+ /api/v1/user/login:
+ post:
+ consumes:
+ - application/json
+ description: Login
+ parameters:
+ - description: Login Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.LoginReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/v1.LoginResp'
+ summary: Login
+ tags:
+ - user
+ /api/v1/user/reset_password:
+ put:
+ consumes:
+ - application/json
+ description: ResetPassword
+ parameters:
+ - description: ResetPassword Request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.ResetPasswordReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: ResetPassword
+ tags:
+ - user
+ /share/v1/app/web/info:
+ get:
+ consumes:
+ - application/json
+ description: GetAppInfo
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.AppInfoResp'
+ type: object
+ summary: GetAppInfo
+ tags:
+ - share_app
+ /share/v1/app/wechat/info:
+ get:
+ consumes:
+ - application/json
+ description: WechatAppInfo
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.WechatAppInfoResp'
+ type: object
+ summary: WechatAppInfo
+ tags:
+ - share_chat
+ /share/v1/app/wechat/service/answer:
+ get:
+ consumes:
+ - application/json
+ description: GetWechatAnswer
+ parameters:
+ - description: conversation id
+ in: query
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: GetWechatAnswer
+ tags:
+ - Wechat
+ /share/v1/app/widget/info:
+ get:
+ consumes:
+ - application/json
+ description: GetWidgetAppInfo
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: GetWidgetAppInfo
+ tags:
+ - share_app
+ /share/v1/auth/get:
+ get:
+ consumes:
+ - application/json
+ description: AuthGet
+ operationId: v1-AuthGet
+ parameters:
+ - description: kb_id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_api_share_v1.AuthGetResp'
+ type: object
+ summary: AuthGet
+ tags:
+ - share_auth
+ /share/v1/auth/github:
+ post:
+ consumes:
+ - application/json
+ description: GitHub登录
+ operationId: v1-AuthGitHub
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: para
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.AuthGitHubReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.AuthGitHubResp'
+ type: object
+ summary: GitHub登录
+ tags:
+ - ShareAuth
+ /share/v1/auth/login/simple:
+ post:
+ consumes:
+ - application/json
+ description: AuthLoginSimple
+ operationId: v1-AuthLoginSimple
+ parameters:
+ - description: kb_id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: para
+ in: body
+ name: param
+ required: true
+ schema:
+ $ref: '#/definitions/v1.AuthLoginSimpleReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: AuthLoginSimple
+ tags:
+ - share_auth
+ /share/v1/captcha/challenge:
+ post:
+ consumes:
+ - application/json
+ description: CreateCaptcha
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/gocap.ChallengeData'
+ summary: CreateCaptcha
+ tags:
+ - share_captcha
+ /share/v1/captcha/redeem:
+ post:
+ consumes:
+ - application/json
+ description: RedeemCaptcha
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: request
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/consts.RedeemCaptchaReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/gocap.VerificationResult'
+ summary: RedeemCaptcha
+ tags:
+ - share_captcha
+ /share/v1/chat/completions:
+ post:
+ consumes:
+ - application/json
+ description: OpenAI API compatible chat completions endpoint
+ parameters:
+ - description: Knowledge Base ID
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: OpenAI API request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.OpenAICompletionsRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.OpenAICompletionsResponse'
+ "400":
+ description: Bad Request
+ schema:
+ $ref: '#/definitions/domain.OpenAIErrorResponse'
+ summary: ChatCompletions
+ tags:
+ - share_chat
+ /share/v1/chat/feedback:
+ post:
+ consumes:
+ - application/json
+ description: Process user feedback for chat conversations
+ parameters:
+ - description: feedback request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.FeedbackRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: Handle chat feedback
+ tags:
+ - share_chat
+ /share/v1/chat/message:
+ post:
+ consumes:
+ - application/json
+ description: ChatMessage
+ parameters:
+ - description: app type
+ in: query
+ name: app_type
+ required: true
+ type: string
+ - description: request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.ChatRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: ChatMessage
+ tags:
+ - share_chat
+ /share/v1/chat/search:
+ post:
+ consumes:
+ - application/json
+ description: ChatSearch
+ parameters:
+ - description: request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.ChatSearchReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ChatSearchResp'
+ type: object
+ summary: ChatSearch
+ tags:
+ - share_chat_search
+ /share/v1/chat/widget:
+ post:
+ consumes:
+ - application/json
+ description: ChatWidget
+ parameters:
+ - description: app type
+ in: query
+ name: app_type
+ required: true
+ type: string
+ - description: request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.ChatRequest'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: ChatWidget
+ tags:
+ - Widget
+ /share/v1/chat/widget/search:
+ post:
+ consumes:
+ - application/json
+ description: WidgetSearch
+ parameters:
+ - description: Comment
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.ChatSearchReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ChatSearchResp'
+ type: object
+ summary: WidgetSearch
+ tags:
+ - Widget
+ /share/v1/comment:
+ post:
+ consumes:
+ - application/json
+ description: CreateComment
+ parameters:
+ - description: Comment
+ in: body
+ name: comment
+ required: true
+ schema:
+ $ref: '#/definitions/domain.CommentReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: CommentID
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ type: string
+ type: object
+ summary: CreateComment
+ tags:
+ - share_comment
+ /share/v1/comment/list:
+ get:
+ consumes:
+ - application/json
+ description: GetCommentList
+ parameters:
+ - description: nodeID
+ in: query
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: CommentList
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/share.ShareCommentLists'
+ type: object
+ summary: GetCommentList
+ tags:
+ - share_comment
+ /share/v1/common/file/upload:
+ post:
+ consumes:
+ - multipart/form-data
+ description: 前台用户上传文件,目前只支持图片文件上传
+ operationId: share-FileUpload
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: File
+ in: formData
+ name: file
+ required: true
+ type: file
+ - description: captcha_token
+ in: formData
+ name: captcha_token
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.FileUploadResp'
+ type: object
+ summary: 文件上传
+ tags:
+ - ShareFile
+ /share/v1/common/file/upload/url:
+ post:
+ consumes:
+ - application/json
+ description: 前台用户上传文件,目前只支持图片文件上传
+ operationId: share-FileUploadByUrl
+ parameters:
+ - description: body
+ in: body
+ name: body
+ required: true
+ schema:
+ $ref: '#/definitions/v1.ShareFileUploadUrlReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.ShareFileUploadUrlResp'
+ type: object
+ summary: 文件上传
+ tags:
+ - ShareFile
+ /share/v1/conversation/detail:
+ get:
+ consumes:
+ - application/json
+ description: GetConversationDetail
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: conversation id
+ in: query
+ name: id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/domain.ShareConversationDetailResp'
+ type: object
+ summary: GetConversationDetail
+ tags:
+ - share_conversation
+ /share/v1/nav/list:
+ get:
+ consumes:
+ - application/json
+ description: ShareNavList
+ parameters:
+ - in: query
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: 前台获取栏目列表
+ tags:
+ - share_nav
+ /share/v1/node/detail:
+ get:
+ consumes:
+ - application/json
+ description: GetNodeDetail
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ - description: node id
+ in: query
+ name: id
+ required: true
+ type: string
+ - description: format
+ in: query
+ name: format
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.Response'
+ - properties:
+ data:
+ $ref: '#/definitions/v1.ShareNodeDetailResp'
+ type: object
+ summary: GetNodeDetail
+ tags:
+ - share_node
+ /share/v1/node/list:
+ get:
+ consumes:
+ - application/json
+ description: ShareNodeList
+ parameters:
+ - description: kb id
+ in: header
+ name: X-KB-ID
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: ShareNodeList
+ tags:
+ - share_node
+ /share/v1/openapi/github/callback:
+ get:
+ consumes:
+ - application/json
+ description: GitHub回调
+ operationId: v1-GitHubCallback
+ parameters:
+ - in: query
+ name: code
+ type: string
+ - in: query
+ name: state
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ allOf:
+ - $ref: '#/definitions/domain.PWResponse'
+ - properties:
+ data:
+ $ref: '#/definitions/github_com_chaitin_panda-wiki_api_share_v1.GitHubCallbackResp'
+ type: object
+ summary: GitHub回调
+ tags:
+ - ShareOpenapi
+ /share/v1/openapi/lark/bot/{kb_id}:
+ post:
+ consumes:
+ - application/json
+ description: Lark机器人请求
+ operationId: v1-LarkBot
+ parameters:
+ - description: 知识库ID
+ in: path
+ name: kb_id
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.PWResponse'
+ summary: Lark机器人请求
+ tags:
+ - ShareOpenapi
+ /share/v1/stat/page:
+ post:
+ consumes:
+ - application/json
+ description: RecordPage
+ parameters:
+ - description: request
+ in: body
+ name: request
+ required: true
+ schema:
+ $ref: '#/definitions/domain.StatPageReq'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/domain.Response'
+ summary: RecordPage
+ tags:
+ - share_stat
+securityDefinitions:
+ bearerAuth:
+ description: Type "Bearer" + a space + your token to authorize
+ in: header
+ name: Authorization
+ type: apiKey
+swagger: "2.0"
diff --git a/backend/domain/api_token.go b/backend/domain/api_token.go
new file mode 100644
index 0000000..9f8f702
--- /dev/null
+++ b/backend/domain/api_token.go
@@ -0,0 +1,48 @@
+package domain
+
+import (
+ "context"
+ "time"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type APIToken struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ Name string `json:"name" gorm:"not null"`
+ UserID string `json:"user_id" gorm:"not null"`
+ Token string `json:"token" gorm:"uniqueIndex;not null"`
+ KbId string `json:"kb_id" gorm:"not null"`
+ Permission consts.UserKBPermission `json:"permission" gorm:"not null"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+}
+
+func (APIToken) TableName() string {
+ return "api_tokens"
+}
+
+type CtxAuthInfo struct {
+ IsToken bool
+ Permission consts.UserKBPermission
+ UserId string
+ KBId string
+}
+
+type contextKey string
+
+const (
+ CtxAuthInfoKey contextKey = "ctx_auth_info"
+)
+
+func GetAuthInfoFromCtx(c context.Context) *CtxAuthInfo {
+ v := c.Value(CtxAuthInfoKey)
+ if v == nil {
+ return nil
+ }
+ ctxAuthInfo, ok := v.(*CtxAuthInfo)
+ if !ok {
+ return nil
+ }
+ return ctxAuthInfo
+}
diff --git a/backend/domain/app.go b/backend/domain/app.go
new file mode 100644
index 0000000..50a35ee
--- /dev/null
+++ b/backend/domain/app.go
@@ -0,0 +1,642 @@
+package domain
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "time"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type AppType uint8
+
+const (
+ AppTypeWeb AppType = iota + 1
+ AppTypeWidget
+ AppTypeDingTalkBot
+ AppTypeFeishuBot
+ AppTypeWechatBot
+ AppTypeWechatServiceBot
+ AppTypeDisCordBot
+ AppTypeWechatOfficialAccount
+ AppTypeOpenAIAPI
+ AppTypeWecomAIBot
+ AppTypeLarkBot
+ AppTypeMcpServer
+)
+
+var AppTypes = []AppType{
+ AppTypeWeb,
+ AppTypeWidget,
+ AppTypeDingTalkBot,
+ AppTypeFeishuBot,
+ AppTypeWechatBot,
+ AppTypeWechatServiceBot,
+ AppTypeDisCordBot,
+ AppTypeWechatOfficialAccount,
+ AppTypeOpenAIAPI,
+ AppTypeWecomAIBot,
+ AppTypeLarkBot,
+ AppTypeMcpServer,
+}
+
+func (t AppType) ToSourceType() consts.SourceType {
+ switch t {
+ case AppTypeWeb:
+ return ""
+ case AppTypeWidget:
+ return consts.SourceTypeWidget
+ case AppTypeDingTalkBot:
+ return consts.SourceTypeDingtalkBot
+ case AppTypeFeishuBot:
+ return consts.SourceTypeFeishuBot
+ case AppTypeWechatBot:
+ return consts.SourceTypeWechatBot
+ case AppTypeWecomAIBot:
+ return consts.SourceTypeWecomAIBot
+ case AppTypeWechatServiceBot:
+ return consts.SourceTypeWechatServiceBot
+ case AppTypeDisCordBot:
+ return consts.SourceTypeDiscordBot
+ case AppTypeWechatOfficialAccount:
+ return consts.SourceTypeWechatOfficialAccount
+ case AppTypeOpenAIAPI:
+ return consts.SourceTypeOpenAIAPI
+ case AppTypeLarkBot:
+ return consts.SourceTypeLarkBot
+ default:
+ return ""
+ }
+}
+
+type App struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ KBID string `json:"kb_id"`
+ Name string `json:"name"`
+ Type AppType `json:"type"`
+
+ Settings AppSettings `json:"settings" gorm:"type:jsonb"`
+
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+}
+
+type AppSettings struct {
+ // nav
+ Title string `json:"title,omitempty"`
+ Icon string `json:"icon,omitempty"`
+ Btns []any `json:"btns,omitempty"`
+ // welcome
+ WelcomeStr string `json:"welcome_str,omitempty"`
+ SearchPlaceholder string `json:"search_placeholder,omitempty"`
+ RecommendQuestions []string `json:"recommend_questions,omitempty"`
+ RecommendNodeIDs []string `json:"recommend_node_ids,omitempty"`
+ // seo
+ Desc string `json:"desc,omitempty"`
+ Keyword string `json:"keyword,omitempty"`
+ // inject code
+ HeadCode string `json:"head_code,omitempty"`
+ BodyCode string `json:"body_code,omitempty"`
+ // DingTalkBot
+ DingTalkBotIsEnabled *bool `json:"dingtalk_bot_is_enabled,omitempty"`
+ DingTalkBotClientID string `json:"dingtalk_bot_client_id,omitempty"`
+ DingTalkBotClientSecret string `json:"dingtalk_bot_client_secret,omitempty"`
+ DingTalkBotTemplateID string `json:"dingtalk_bot_template_id,omitempty"`
+ // FeishuBot
+ FeishuBotIsEnabled *bool `json:"feishu_bot_is_enabled,omitempty"`
+ FeishuBotAppID string `json:"feishu_bot_app_id,omitempty"`
+ FeishuBotAppSecret string `json:"feishu_bot_app_secret,omitempty"`
+ // LarkBot
+ LarkBotSettings LarkBotSettings `json:"lark_bot_settings,omitempty"`
+ // WechatAppBot 企业微信机器人
+ WeChatAppIsEnabled *bool `json:"wechat_app_is_enabled,omitempty"`
+ WeChatAppToken string `json:"wechat_app_token,omitempty"`
+ WeChatAppEncodingAESKey string `json:"wechat_app_encodingaeskey,omitempty"`
+ WeChatAppCorpID string `json:"wechat_app_corpid,omitempty"`
+ WeChatAppSecret string `json:"wechat_app_secret,omitempty"`
+ WeChatAppAgentID string `json:"wechat_app_agent_id,omitempty"`
+ WeChatAppAdvancedSetting WeChatAppAdvancedSetting `json:"wechat_app_advanced_setting"`
+ // WecomAIBotSettings 企业微信智能机器人
+ WecomAIBotSettings WecomAIBotSettings `json:"wecom_ai_bot_settings"`
+ // WechatServiceBot
+ WeChatServiceIsEnabled *bool `json:"wechat_service_is_enabled,omitempty"`
+ WeChatServiceToken string `json:"wechat_service_token,omitempty"`
+ WeChatServiceEncodingAESKey string `json:"wechat_service_encodingaeskey,omitempty"`
+ WeChatServiceCorpID string `json:"wechat_service_corpid,omitempty"`
+ WeChatServiceSecret string `json:"wechat_service_secret,omitempty"`
+ WechatServiceLogo string `json:"wechat_service_logo,omitempty"`
+ WechatServiceContainKeywords []string `json:"wechat_service_contain_keywords"`
+ WechatServiceEqualKeywords []string `json:"wechat_service_equal_keywords"`
+ // DisCordBot
+ DiscordBotIsEnabled *bool `json:"discord_bot_is_enabled,omitempty"`
+ DiscordBotToken string `json:"discord_bot_token,omitempty"`
+ // WechatOfficialAccount
+ WechatOfficialAccountIsEnabled *bool `json:"wechat_official_account_is_enabled,omitempty"`
+ WechatOfficialAccountAppID string `json:"wechat_official_account_app_id,omitempty"`
+ WechatOfficialAccountAppSecret string `json:"wechat_official_account_app_secret,omitempty"`
+ WechatOfficialAccountToken string `json:"wechat_official_account_token,omitempty"`
+ WechatOfficialAccountEncodingAESKey string `json:"wechat_official_account_encodingaeskey,omitempty"`
+
+ // theme
+ ThemeMode string `json:"theme_mode,omitempty"`
+ ThemeAndStyle ThemeAndStyle `json:"theme_and_style"`
+ // catalog settings
+ CatalogSettings CatalogSettings `json:"catalog_settings"`
+ // footer settings
+ FooterSettings FooterSettings `json:"footer_settings"`
+ // Widget bot settings
+ WidgetBotSettings WidgetBotSettings `json:"widget_bot_settings"`
+ // webapp comment settings
+ WebAppCommentSettings WebAppCommentSettings `json:"web_app_comment_settings"`
+ // document feedback
+ DocumentFeedBackIsEnabled *bool `json:"document_feedback_is_enabled,omitempty"`
+ // AI feedback
+ AIFeedbackSettings AIFeedbackSettings `json:"ai_feedback_settings"`
+ // WebAppCustomStyle
+ WebAppCustomSettings WebAppCustomSettings `json:"web_app_custom_style"`
+ // OpenAI API Bot settings
+ OpenAIAPIBotSettings OpenAIAPIBotSettings `json:"openai_api_bot_settings"`
+ // Disclaimer Settings
+ DisclaimerSettings DisclaimerSettings `json:"disclaimer_settings"`
+ // WebAppLandingConfigs
+ WebAppLandingConfigs []WebAppLandingConfig `json:"web_app_landing_configs,omitempty"`
+ WebAppLandingTheme WebAppLandingTheme `json:"web_app_landing_theme"`
+
+ WatermarkContent string `json:"watermark_content"`
+ WatermarkSetting consts.WatermarkSetting `json:"watermark_setting" validate:"omitempty,oneof='' hidden visible"`
+ CopySetting consts.CopySetting `json:"copy_setting" validate:"omitempty,oneof='' append disabled"`
+ ContributeSettings ContributeSettings `json:"contribute_settings"`
+ HomePageSetting consts.HomePageSetting `json:"home_page_setting"`
+ ConversationSetting ConversationSetting `json:"conversation_setting"`
+ // MCP Server Settings
+ MCPServerSettings MCPServerSettings `json:"mcp_server_settings,omitempty"`
+ StatsSetting StatsSetting `json:"stats_setting"`
+}
+
+type WeChatAppAdvancedSetting struct {
+ TextResponseEnable bool `json:"text_response_enable,omitempty"`
+ FeedbackEnable bool `json:"feedback_enable,omitempty"`
+ FeedbackType []string `json:"feedback_type,omitempty"`
+ DisclaimerContent string `json:"disclaimer_content,omitempty"`
+ Prompt string `json:"prompt,omitempty"`
+}
+
+type StatsSetting struct {
+ PVEnable bool `json:"pv_enable"`
+}
+
+type ConversationSetting struct {
+ CopyrightInfo string `json:"copyright_info"`
+ CopyrightHideEnabled bool `json:"copyright_hide_enabled"`
+}
+
+type WebAppLandingTheme struct {
+ Name string `json:"name"`
+}
+
+type MCPServerSettings struct {
+ IsEnabled bool `json:"is_enabled"`
+ DocsToolSettings MCPToolSettings `json:"docs_tool_settings"`
+ SampleAuth SimpleAuth `json:"sample_auth"`
+}
+
+type MCPToolSettings struct {
+ Name string `json:"name"`
+ Desc string `json:"desc"`
+}
+
+type LarkBotSettings struct {
+ IsEnabled *bool `json:"is_enabled"`
+ AppID string `json:"app_id"`
+ AppSecret string `json:"app_secret"`
+ VerifyToken string `json:"verify_token"`
+ EncryptKey string `json:"encrypt_key"`
+}
+
+type BannerConfig struct {
+ Title string `json:"title"`
+ TitleColor string `json:"title_color"`
+ TitleFontSize int `json:"title_font_size"`
+ Subtitle string `json:"subtitle"`
+ Placeholder string `json:"placeholder"`
+ SubtitleColor string `json:"subtitle_color"`
+ SubtitleFontSize int `json:"subtitle_font_size"`
+ BgURL string `json:"bg_url"`
+ HotSearch []string `json:"hot_search"`
+ Btns []struct {
+ ID string `json:"id"`
+ Text string `json:"text"`
+ Type string `json:"type"`
+ Href string `json:"href"`
+ } `json:"btns"`
+}
+type BasicDocConfig struct {
+ Title string `json:"title"`
+ TitleColor string `json:"title_color"`
+ BgColor string `json:"bg_color"`
+}
+type DirDocConfig struct {
+ Title string `json:"title"`
+ TitleColor string `json:"title_color"`
+ BgColor string `json:"bg_color"`
+}
+
+type NavDocConfig struct {
+ NavIds []string `json:"nav_ids"`
+ Title string `json:"title"`
+}
+
+type SimpleDocConfig struct {
+ Title string `json:"title"`
+ TitleColor string `json:"title_color"`
+ BgColor string `json:"bg_color"`
+}
+type CarouselConfig struct {
+ Title string `json:"title"`
+ BgColor string `json:"bg_color"`
+ List []struct {
+ ID string `json:"id"`
+ Title string `json:"title"`
+ URL string `json:"url"`
+ Desc string `json:"desc"`
+ } `json:"list"`
+}
+type FaqConfig struct {
+ Title string `json:"title"`
+ TitleColor string `json:"title_color"`
+ BgColor string `json:"bg_color"`
+ List []struct {
+ ID string `json:"id"`
+ Question string `json:"question"`
+ Link string `json:"link"`
+ } `json:"list"`
+}
+type TextConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+}
+type MetricsConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Number string `json:"number"`
+ } `json:"list"`
+}
+type CaseConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Link string `json:"link"`
+ } `json:"list"`
+}
+type CommentConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Avatar string `json:"avatar"`
+ UserName string `json:"user_name"`
+ Profession string `json:"profession"`
+ Comment string `json:"comment"`
+ } `json:"list"`
+}
+type FeatureConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ Desc string `json:"desc"`
+ } `json:"list"`
+}
+type ImgTextConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ Item struct {
+ URL string `json:"url"`
+ Name string `json:"name"`
+ Desc string `json:"desc"`
+ } `json:"item"`
+}
+type TextImgConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ Item struct {
+ URL string `json:"url"`
+ Name string `json:"name"`
+ Desc string `json:"desc"`
+ } `json:"item"`
+}
+type QuestionConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Question string `json:"question"`
+ } `json:"list"`
+}
+type BlockGridConfig struct {
+ Type string `json:"type"`
+ Title string `json:"title"`
+ List []struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ URL string `json:"url"`
+ } `json:"list"`
+}
+
+type WebAppLandingConfig struct {
+ Type string `json:"type"`
+ NodeIds []string `json:"node_ids"`
+ BannerConfig *BannerConfig `json:"banner_config,omitempty"`
+ BasicDocConfig *BasicDocConfig `json:"basic_doc_config,omitempty"`
+ DirDocConfig *DirDocConfig `json:"dir_doc_config,omitempty"`
+ NavDocConfig *NavDocConfig `json:"nav_doc_config,omitempty"`
+ SimpleDocConfig *SimpleDocConfig `json:"simple_doc_config,omitempty"`
+ CarouselConfig *CarouselConfig `json:"carousel_config,omitempty"`
+ FaqConfig *FaqConfig `json:"faq_config,omitempty"`
+ MetricsConfig *MetricsConfig `json:"metrics_config,omitempty"`
+ CaseConfig *CaseConfig `json:"case_config,omitempty"`
+ TextConfig *TextConfig `json:"text_config,omitempty"`
+ CommentConfig *CommentConfig `json:"comment_config,omitempty"`
+ FeatureConfig *FeatureConfig `json:"feature_config,omitempty"`
+ ImgTextConfig *ImgTextConfig `json:"img_text_config,omitempty"`
+ TextImgConfig *TextImgConfig `json:"text_img_config,omitempty"`
+ QuestionConfig *QuestionConfig `json:"question_config,omitempty"`
+ BlockGridConfig *BlockGridConfig `json:"block_grid_config,omitempty"`
+ ComConfigOrder []string `json:"com_config_order"`
+}
+
+type WecomAIBotSettings struct {
+ IsEnabled bool `json:"is_enabled,omitempty"`
+ Token string `json:"token,omitempty"`
+ EncodingAESKey string `json:"encodingaeskey,omitempty"`
+}
+
+type DisclaimerSettings struct {
+ Content *string `json:"content"`
+}
+
+type ContributeSettings struct {
+ IsEnable bool `json:"is_enable"`
+}
+
+type OpenAIAPIBotSettings struct {
+ IsEnabled bool `json:"is_enabled"`
+ SecretKey string `json:"secret_key"`
+}
+
+type WebAppCustomSettings struct {
+ AllowThemeSwitching *bool `json:"allow_theme_switching"`
+ HeaderPlaceholder string `json:"header_search_placeholder"`
+ SocialMediaAccounts []SocialMediaAccount `json:"social_media_accounts"`
+ ShowBrandInfo *bool `json:"show_brand_info"`
+ FooterShowIntro *bool `json:"footer_show_intro"`
+}
+
+type SocialMediaAccount struct {
+ Channel string `json:"channel"`
+ Text string `json:"text"`
+ Link string `json:"link"`
+ Icon string `json:"icon"`
+ Phone string `json:"phone"`
+}
+
+type WebAppCommentSettings struct {
+ IsEnable bool `json:"is_enable"`
+ ModerationEnable bool `json:"moderation_enable"`
+}
+
+type AIFeedbackSettings struct {
+ AIFeedbackIsEnabled *bool `json:"is_enabled"`
+ AIFeedbackType []string `json:"ai_feedback_type"`
+}
+
+type ThemeAndStyle struct {
+ BGImage string `json:"bg_image,omitempty"`
+ DocWidth string `json:"doc_width,omitempty"`
+}
+
+type CatalogSettings struct {
+ CatalogFolder int `json:"catalog_folder,omitempty"` // 1: 展开, 2: 折叠, default: 1
+ CatalogWidth int `json:"catalog_width,omitempty"` // 200 - 300, default: 260
+ CatalogVisible int `json:"catalog_visible,omitempty"` // 1: 显示, 2: 隐藏, default: 1
+}
+
+type FooterSettings struct {
+ FooterStyle string `json:"footer_style,omitempty"`
+ CorpName string `json:"corp_name,omitempty"`
+ ICP string `json:"icp,omitempty"`
+ BrandName string `json:"brand_name,omitempty"`
+ BrandDesc string `json:"brand_desc,omitempty"`
+ BrandLogo string `json:"brand_logo,omitempty"`
+ BrandGroups []BrandGroup `json:"brand_groups,omitempty"`
+}
+
+type WidgetBotSettings struct {
+ IsOpen bool `json:"is_open,omitempty"`
+ ThemeMode string `json:"theme_mode,omitempty"`
+ BtnText string `json:"btn_text,omitempty"`
+ BtnLogo string `json:"btn_logo,omitempty"`
+ RecommendQuestions []string `json:"recommend_questions,omitempty"`
+ RecommendNodeIDs []string `json:"recommend_node_ids,omitempty"`
+ BtnStyle string `json:"btn_style,omitempty"`
+ BtnID string `json:"btn_id,omitempty"`
+ BtnPosition string `json:"btn_position,omitempty"`
+ ModalPosition string `json:"modal_position,omitempty"`
+ SearchMode string `json:"search_mode,omitempty"`
+ Placeholder string `json:"placeholder,omitempty"`
+ Disclaimer string `json:"disclaimer,omitempty"`
+ CopyrightInfo string `json:"copyright_info,omitempty"`
+ CopyrightHideEnabled bool `json:"copyright_hide_enabled,omitempty"`
+}
+
+type BrandGroup struct {
+ Name string `json:"name,omitempty"`
+ Links []Link `json:"links,omitempty"`
+}
+
+type Link struct {
+ Name string `json:"name,omitempty"`
+ URL string `json:"url,omitempty"`
+}
+
+func (s *AppSettings) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid app settings value type:", value))
+ }
+ return json.Unmarshal(bytes, s)
+}
+
+func (s AppSettings) Value() (driver.Value, error) {
+ return json.Marshal(s)
+}
+
+type AppDetailResp struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ KBID string `json:"kb_id"`
+
+ Name string `json:"name"`
+ Type AppType `json:"type"`
+
+ Settings AppSettingsResp `json:"settings" gorm:"type:jsonb"`
+
+ RecommendNodes []*RecommendNodeListResp `json:"recommend_nodes,omitempty" gorm:"-"`
+}
+
+type AppSettingsResp struct {
+ // nav
+ Title string `json:"title,omitempty"`
+ Icon string `json:"icon,omitempty"`
+ Btns []any `json:"btns,omitempty"`
+ // welcome
+ WelcomeStr string `json:"welcome_str,omitempty"`
+ SearchPlaceholder string `json:"search_placeholder,omitempty"`
+ RecommendQuestions []string `json:"recommend_questions,omitempty"`
+ RecommendNodeIDs []string `json:"recommend_node_ids,omitempty"`
+ // seo
+ Desc string `json:"desc,omitempty"`
+ Keyword string `json:"keyword,omitempty"`
+ // inject code
+ HeadCode string `json:"head_code,omitempty"`
+ BodyCode string `json:"body_code,omitempty"`
+ // DingTalkBot
+ DingTalkBotIsEnabled *bool `json:"dingtalk_bot_is_enabled,omitempty"`
+ DingTalkBotClientID string `json:"dingtalk_bot_client_id,omitempty"`
+ DingTalkBotClientSecret string `json:"dingtalk_bot_client_secret,omitempty"`
+ DingTalkBotTemplateID string `json:"dingtalk_bot_template_id,omitempty"`
+ // FeishuBot
+ FeishuBotIsEnabled *bool `json:"feishu_bot_is_enabled,omitempty"`
+ FeishuBotAppID string `json:"feishu_bot_app_id,omitempty"`
+ FeishuBotAppSecret string `json:"feishu_bot_app_secret,omitempty"`
+ // LarkBot
+ LarkBotSettings LarkBotSettings `json:"lark_bot_settings,omitempty"`
+ // WechatAppBot
+ WeChatAppIsEnabled *bool `json:"wechat_app_is_enabled,omitempty"`
+ WeChatAppToken string `json:"wechat_app_token,omitempty"`
+ WeChatAppEncodingAESKey string `json:"wechat_app_encodingaeskey,omitempty"`
+ WeChatAppCorpID string `json:"wechat_app_corpid,omitempty"`
+ WeChatAppSecret string `json:"wechat_app_secret,omitempty"`
+ WeChatAppAgentID string `json:"wechat_app_agent_id,omitempty"`
+ WeChatAppAdvancedSetting WeChatAppAdvancedSetting `json:"wechat_app_advanced_setting"`
+ // WechatServiceBot
+ WeChatServiceIsEnabled *bool `json:"wechat_service_is_enabled,omitempty"`
+ WeChatServiceToken string `json:"wechat_service_token,omitempty"`
+ WeChatServiceEncodingAESKey string `json:"wechat_service_encodingaeskey,omitempty"`
+ WeChatServiceCorpID string `json:"wechat_service_corpid,omitempty"`
+ WeChatServiceSecret string `json:"wechat_service_secret,omitempty"`
+ WechatServiceLogo string `json:"wechat_service_logo,omitempty"`
+ WechatServiceContainKeywords []string `json:"wechat_service_contain_keywords"`
+ WechatServiceEqualKeywords []string `json:"wechat_service_equal_keywords"`
+
+ // DisCordBot
+ DiscordBotIsEnabled *bool `json:"discord_bot_is_enabled,omitempty"`
+ DiscordBotToken string `json:"discord_bot_token,omitempty"`
+ // WechatOfficialAccount
+ WechatOfficialAccountIsEnabled *bool `json:"wechat_official_account_is_enabled,omitempty"`
+ WechatOfficialAccountAppID string `json:"wechat_official_account_app_id,omitempty"`
+ WechatOfficialAccountAppSecret string `json:"wechat_official_account_app_secret,omitempty"`
+ WechatOfficialAccountToken string `json:"wechat_official_account_token,omitempty"`
+ WechatOfficialAccountEncodingAESKey string `json:"wechat_official_account_encodingaeskey,omitempty"`
+
+ WecomAIBotSettings WecomAIBotSettings `json:"wecom_ai_bot_settings"`
+
+ // theme
+ ThemeMode string `json:"theme_mode,omitempty"`
+ ThemeAndStyle ThemeAndStyle `json:"theme_and_style"`
+ // catalog settings
+ CatalogSettings CatalogSettings `json:"catalog_settings"`
+ // footer settings
+ FooterSettings FooterSettings `json:"footer_settings"`
+ // WidgetBot
+ WidgetBotSettings WidgetBotSettings `json:"widget_bot_settings"`
+ // webapp comment settings
+ WebAppCommentSettings WebAppCommentSettings `json:"web_app_comment_settings"`
+ // document feedback
+ DocumentFeedBackIsEnabled *bool `json:"document_feedback_is_enabled,omitempty"`
+ // AI feedback
+ AIFeedbackSettings AIFeedbackSettings `json:"ai_feedback_settings"`
+ // WebAppCustomStyle
+ WebAppCustomSettings WebAppCustomSettings `json:"web_app_custom_style"`
+
+ WatermarkContent string `json:"watermark_content"`
+ WatermarkSetting consts.WatermarkSetting `json:"watermark_setting"`
+ CopySetting consts.CopySetting `json:"copy_setting"`
+ ContributeSettings ContributeSettings `json:"contribute_settings"`
+
+ // OpenAI API settings
+ OpenAIAPIBotSettings OpenAIAPIBotSettings `json:"openai_api_bot_settings"`
+ // Disclaimer Settings
+ DisclaimerSettings DisclaimerSettings `json:"disclaimer_settings"`
+ // WebApp Landing Settings
+ WebAppLandingConfigs []WebAppLandingConfigResp `json:"web_app_landing_configs,omitempty"`
+ WebAppLandingTheme WebAppLandingTheme `json:"web_app_landing_theme"`
+ HomePageSetting consts.HomePageSetting `json:"home_page_setting"`
+ ConversationSetting ConversationSetting `json:"conversation_setting"`
+ // MCP Server Settings
+ MCPServerSettings MCPServerSettings `json:"mcp_server_settings,omitempty"`
+ StatsSetting StatsSetting `json:"stats_setting"`
+}
+
+type WebAppLandingConfigResp struct {
+ Type string `json:"type"`
+ BannerConfig *BannerConfig `json:"banner_config,omitempty"`
+ BasicDocConfig *BasicDocConfig `json:"basic_doc_config,omitempty"`
+ DirDocConfig *DirDocConfig `json:"dir_doc_config,omitempty"`
+ NavDocConfig *NavDocConfig `json:"nav_doc_config,omitempty"`
+ SimpleDocConfig *SimpleDocConfig `json:"simple_doc_config,omitempty"`
+ CarouselConfig *CarouselConfig `json:"carousel_config,omitempty"`
+ FaqConfig *FaqConfig `json:"faq_config,omitempty"`
+ MetricsConfig *MetricsConfig `json:"metrics_config,omitempty"`
+ CaseConfig *CaseConfig `json:"case_config,omitempty"`
+ TextConfig *TextConfig `json:"text_config,omitempty"`
+ CommentConfig *CommentConfig `json:"comment_config,omitempty"`
+ FeatureConfig *FeatureConfig `json:"feature_config,omitempty"`
+ ImgTextConfig *ImgTextConfig `json:"img_text_config,omitempty"`
+ TextImgConfig *TextImgConfig `json:"text_img_config,omitempty"`
+ QuestionConfig *QuestionConfig `json:"question_config,omitempty"`
+ BlockGridConfig *BlockGridConfig `json:"block_grid_config,omitempty"`
+ ComConfigOrder []string `json:"com_config_order"`
+ NodeIds []string `json:"node_ids"`
+ Nodes []*RecommendNodeListResp `json:"nodes" gorm:"-"`
+}
+
+func (s *AppSettingsResp) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid app settings value type:", value))
+ }
+ return json.Unmarshal(bytes, s)
+}
+
+func (s AppSettingsResp) Value() (driver.Value, error) {
+ return json.Marshal(s)
+}
+
+type UpdateAppReq struct {
+ Name *string `json:"name"`
+ KbID string `json:"kb_id"`
+ Settings *AppSettings `json:"settings" gorm:"type:jsonb"`
+}
+
+type CreateAppReq struct {
+ Name string `json:"name"`
+ Type AppType `json:"type" validate:"required,oneof=1 2 3 4 5 6 7 8"`
+ Icon string `json:"icon"`
+ KBID string `json:"kb_id" validate:"required"`
+}
+
+type AppInfoResp struct {
+ Name string `json:"name"`
+
+ Settings AppSettingsResp `json:"settings" gorm:"type:jsonb"`
+ BaseUrl string `json:"base_url"`
+ RecommendNodes []*RecommendNodeListResp `json:"recommend_nodes,omitempty" gorm:"-"`
+}
diff --git a/backend/domain/auth.go b/backend/domain/auth.go
new file mode 100644
index 0000000..0427db8
--- /dev/null
+++ b/backend/domain/auth.go
@@ -0,0 +1,119 @@
+package domain
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "time"
+
+ "github.com/labstack/echo/v4"
+ "github.com/lib/pq"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+const (
+ SessionCacheKey = "_session_store"
+ SessionName = "_pw_auth_session"
+)
+
+type Auth struct {
+ ID uint `gorm:"primaryKey;column:id" json:"id,omitempty"` // Unique identifier for the authentication record
+ IP string `gorm:"column:ip;not null" json:"ip,omitempty"` // IP address from which the login occurred (nullable)
+ KBID string `gorm:"column:kb_id;not null" json:"kb_id,omitempty"`
+ UnionID string `gorm:"column:union_id;not null" json:"union_id,omitempty"` // Union ID for the user, used in OAuth scenarios
+ SourceType consts.SourceType `gorm:"column:source_type;not null" json:"source_type,omitempty"` // Type of authentication source (e.g., "local", "oauth")
+ LastLoginTime time.Time `gorm:"column:last_login_time;not null" json:"last_login_time,omitempty"` // Timestamp of the last successful login (nullable)
+ CreatedAt time.Time `gorm:"column:created_at;not null;default:now()" json:"created_at"` // Timestamp when the record was created
+ UpdatedAt time.Time `gorm:"column:updated_at;not null;default:now()" json:"updated_at"` // Timestamp when the record was last updated
+ UserInfo AuthUserInfo `json:"user_info" gorm:"type:jsonb"`
+}
+
+func (Auth) TableName() string {
+ return "auths"
+}
+
+type AuthGroup struct {
+ ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
+ Name string `json:"name" gorm:"uniqueIndex;size:100;not null"`
+ KbID string `json:"kb_id,omitempty" gorm:"column:kb_id;not null"`
+ ParentID *uint `json:"parent_id" gorm:"column:parent_id"`
+ Position float64 `json:"position"`
+ AuthIDs pq.Int64Array `json:"auth_ids" gorm:"type:int[]"`
+ CreatedAt time.Time `json:"created_at"`
+ UpdatedAt time.Time `json:"updated_at"`
+ SyncId string `json:"sync_id"`
+ SyncParentId string `json:"sync_parent_id"`
+ SourceType consts.SourceType `json:"source_type" gorm:"column:source_type;not null"`
+
+ // 关联字段
+ Parent *AuthGroup `json:"parent,omitempty" gorm:"-"`
+ Children []AuthGroup `json:"children,omitempty" gorm:"-"`
+}
+
+func (AuthGroup) TableName() string {
+ return "auth_groups"
+}
+
+type AuthConfig struct {
+ ID uint `gorm:"primaryKey;column:id"` // Unique identifier for the authentication configuration
+ KbID string `gorm:"column:kb_id;not null" json:"kb_id"`
+ AuthSetting AuthSetting `gorm:"type:jsonb" json:"auth_setting"`
+ SourceType consts.SourceType `gorm:"column:source_type;not null;unique"` // Unique type of authentication source (e.g., "github", "google")
+ CreatedAt time.Time `gorm:"column:created_at;not null;default:now()"` // Timestamp when the record was created
+ UpdatedAt time.Time `gorm:"column:updated_at;not null;default:now()"` // Timestamp when the record was last updated
+}
+
+func (s *AuthSetting) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid AuthSetting type:", value))
+ }
+ return json.Unmarshal(bytes, s)
+}
+
+func (s AuthSetting) Value() (driver.Value, error) {
+ return json.Marshal(s)
+}
+
+func (AuthConfig) TableName() string {
+ return "auth_configs"
+}
+
+type AuthSetting struct {
+ ClientID string `json:"client_id,omitempty"`
+ ClientSecret string `json:"client_secret,omitempty"`
+ Proxy string `json:"proxy,omitempty"`
+}
+
+type AuthInfo struct {
+ ID uint `gorm:"column:id" json:"id,omitempty"`
+ AuthUserInfo AuthUserInfo `json:"auth_user_info" gorm:"type:jsonb"`
+}
+
+type AuthUserInfo struct {
+ Username string `json:"username,omitempty"`
+ AvatarUrl string `json:"avatar_url,omitempty"`
+ Email string `json:"email,omitempty"`
+}
+
+func (s *AuthUserInfo) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid user info type:", value))
+ }
+ return json.Unmarshal(bytes, s)
+}
+
+func (s *AuthUserInfo) Value() (driver.Value, error) {
+ return json.Marshal(s)
+}
+
+func GetAuthID(c echo.Context) uint {
+ userId, ok := c.Get("user_id").(uint)
+ if !ok {
+ return 0
+ }
+ return userId
+}
diff --git a/backend/domain/chat.go b/backend/domain/chat.go
new file mode 100644
index 0000000..e2327e8
--- /dev/null
+++ b/backend/domain/chat.go
@@ -0,0 +1,93 @@
+package domain
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+)
+
+type ChatRequest struct {
+ ConversationID string `json:"conversation_id"`
+ Message string `json:"message"`
+ ImagePaths []string `json:"image_paths" validate:"max=3"`
+ Nonce string `json:"nonce"`
+ AppType AppType `json:"app_type" validate:"required,oneof=1 2"`
+ CaptchaToken string `json:"captcha_token"`
+
+ KBID string `json:"-" validate:"required"`
+ AppID string `json:"-"`
+
+ ModelInfo *Model `json:"-"`
+
+ RemoteIP string `json:"-"`
+ Info ConversationInfo `json:"-"`
+ Prompt string `json:"-"`
+}
+
+type ChatRagOnlyRequest struct {
+ Message string `json:"message" validate:"required"`
+
+ KBID string `json:"-" validate:"required"`
+
+ UserInfo UserInfo `json:"user_info"`
+ AppType AppType `json:"app_type" validate:"required,oneof=1 2"`
+}
+
+type ConversationInfo struct {
+ UserInfo UserInfo `json:"user_info"`
+}
+
+type UserInfo struct {
+ AuthUserID uint `json:"auth_user_id"`
+ UserID string `json:"user_id"`
+ NickName string `json:"name"`
+ From MessageFrom `json:"from"`
+ RealName string `json:"real_name"`
+ Email string `json:"email"`
+ Avatar string `json:"avatar"` // avatar
+}
+
+func (s *ConversationInfo) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid access settings value type:", value))
+ }
+ return json.Unmarshal(bytes, s)
+}
+
+func (s ConversationInfo) Value() (driver.Value, error) {
+ return json.Marshal(s)
+}
+
+type MessageFrom int
+
+const (
+ MessageFromGroup MessageFrom = iota + 1
+ MessageFromPrivate
+)
+
+func (m MessageFrom) String() string {
+ switch m {
+ case MessageFromGroup:
+ return "group"
+ case MessageFromPrivate:
+ return "private"
+ default:
+ return "unknown"
+ }
+}
+
+type ChatSearchReq struct {
+ Message string `json:"message" validate:"required"`
+ CaptchaToken string `json:"captcha_token"`
+
+ KBID string `json:"-" validate:"required"`
+
+ RemoteIP string `json:"-"`
+ AuthUserID uint `json:"-"`
+}
+
+type ChatSearchResp struct {
+ NodeResult []NodeContentChunkSSE `json:"node_result"`
+}
diff --git a/backend/domain/comment.go b/backend/domain/comment.go
new file mode 100644
index 0000000..cc7cab4
--- /dev/null
+++ b/backend/domain/comment.go
@@ -0,0 +1,103 @@
+package domain
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "time"
+
+ "github.com/lib/pq"
+)
+
+type Comment struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ KbID string `json:"kb_id"`
+ UserID string `json:"user_id"`
+ NodeID string `json:"node_id" gorm:"index"`
+ Info CommentInfo `json:"info" gorm:"type:jsonb"`
+ ParentID string `json:"parent_id"`
+ RootID string `json:"root_id"`
+ Content string `json:"content"`
+ Status CommentStatus `json:"status"` // status : -1 reject 0 pending 1 accept
+ PicUrls pq.StringArray `json:"pic_urls" gorm:"type:text[];not null;default:{}"`
+ CreatedAt time.Time `json:"created_at"`
+}
+
+func (Comment) TableName() string {
+ return "comments"
+}
+
+type CommentInfo struct {
+ AuthUserID uint `json:"auth_user_id"`
+ UserName string `json:"user_name"`
+ Email string `json:"email"`
+ Avatar string `json:"avatar"` // avatar
+ RemoteIP string `json:"remote_ip"`
+}
+
+type CommentStatus int8
+
+const (
+ CommentStatusReject CommentStatus = -1
+ CommentStatusPending CommentStatus = 0
+ CommentStatusAccepted CommentStatus = 1
+)
+
+func (d *CommentInfo) Value() (driver.Value, error) {
+ return json.Marshal(d)
+}
+
+func (d *CommentInfo) Scan(value any) error {
+ bytes, ok := value.([]byte)
+ if !ok {
+ return errors.New(fmt.Sprint("invalid comment info type:", value))
+ }
+ return json.Unmarshal(bytes, d)
+}
+
+type CommentReq struct {
+ NodeID string `json:"node_id" validate:"required"`
+ Content string `json:"content" validate:"required"`
+ UserName string `json:"user_name"`
+ ParentID string `json:"parent_id"`
+ RootID string `json:"root_id"`
+ CaptchaToken string `json:"captcha_token"`
+ PicUrls []string `json:"pic_urls" validate:"required"`
+}
+
+type CommentListReq struct {
+ KbID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Status *CommentStatus `json:"status" query:"status"`
+ Pager
+}
+
+type CommentListItem struct {
+ ID string `json:"id"`
+ NodeID string `json:"node_id"`
+ RootID string `json:"root_id"`
+ Info CommentInfo `json:"info" gorm:"info;type:jsonb"`
+ NodeType int `json:"node_type"`
+ NodeName string `json:"node_name"` // 文档标题
+ Content string `json:"content"`
+ Status CommentStatus `json:"status"` // status : -1 reject 0 pending 1 accept
+ IPAddress *IPAddress `json:"ip_address" gorm:"-"` // ip地址
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type DeleteCommentListReq struct {
+ IDS []string `json:"ids" query:"ids"`
+}
+
+type ShareCommentListItem struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ KbID string `json:"kb_id"`
+ NodeID string `json:"node_id" gorm:"index"`
+ Info CommentInfo `json:"info" gorm:"type:jsonb"`
+ ParentID string `json:"parent_id"`
+ RootID string `json:"root_id"`
+ Content string `json:"content"`
+ PicUrls pq.StringArray `json:"pic_urls" gorm:"type:text[]"`
+ IPAddress *IPAddress `json:"ip_address" gorm:"-"` // ip地址
+ CreatedAt time.Time `json:"created_at"`
+}
diff --git a/backend/domain/contribute.go b/backend/domain/contribute.go
new file mode 100644
index 0000000..5408bf0
--- /dev/null
+++ b/backend/domain/contribute.go
@@ -0,0 +1,29 @@
+package domain
+
+import (
+ "time"
+
+ "github.com/chaitin/panda-wiki/consts"
+)
+
+type Contribute struct {
+ Id string `json:"id" gorm:"primaryKey;type:text"`
+ AuthId *int64 `json:"auth_id"`
+ KBId string `json:"kb_id" gorm:"type:text;not null"`
+ Status consts.ContributeStatus `json:"status" gorm:"type:text;not null"`
+ Type consts.ContributeType `json:"type" gorm:"type:text;not null"`
+ NodeId string `json:"node_id" gorm:"type:text"`
+ Name string `json:"name" gorm:"type:text"`
+ Content string `json:"content" gorm:"type:text;not null"`
+ Meta NodeMeta `json:"meta"`
+ Reason string `json:"reason" gorm:"type:text;not null"`
+ AuditUserID string `json:"audit_user_id" gorm:"type:text;not null"`
+ AuditTime *time.Time `json:"audit_time"`
+ RemoteIP string `json:"remote_ip" gorm:"type:text;not null"`
+ CreatedAt time.Time `gorm:"column:created_at;not null;default:now()"`
+ UpdatedAt time.Time `gorm:"column:updated_at;not null;default:now()"`
+}
+
+func (Contribute) TableName() string {
+ return "contributes"
+}
diff --git a/backend/domain/conversation.go b/backend/domain/conversation.go
new file mode 100644
index 0000000..dd12dc1
--- /dev/null
+++ b/backend/domain/conversation.go
@@ -0,0 +1,160 @@
+package domain
+
+import (
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "time"
+
+ "github.com/cloudwego/eino/schema"
+ "github.com/lib/pq"
+)
+
+type Conversation struct {
+ ID string `json:"id"`
+ Nonce string `json:"nonce"`
+
+ KBID string `json:"kb_id" gorm:"index"`
+ AppID string `json:"app_id" gorm:"index"`
+
+ Subject string `json:"subject"` // subject for conversation, now is first question
+
+ RemoteIP string `json:"remote_ip"`
+ Info ConversationInfo `json:"info" gorm:"type:jsonb"`
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type ConversationMessage struct {
+ ID string `json:"id" gorm:"primaryKey"`
+ ConversationID string `json:"conversation_id" gorm:"index"`
+ AppID string `json:"app_id" gorm:"index"`
+ KBID string `json:"kb_id"`
+
+ Role schema.RoleType `json:"role"`
+ Content string `json:"content"`
+ ImagePaths pq.StringArray `json:"image_paths" gorm:"type:text[];not null;default:{}"`
+
+ // model
+ Provider ModelProvider `json:"provider"`
+ Model string `json:"model"`
+ PromptTokens int `json:"prompt_tokens" gorm:"default:0"`
+ CompletionTokens int `json:"completion_tokens" gorm:"default:0"`
+ TotalTokens int `json:"total_tokens" gorm:"default:0"`
+
+ // stats
+ RemoteIP string `json:"remote_ip"`
+ CreatedAt time.Time `json:"created_at"`
+
+ // feedbackinfo
+ Info FeedBackInfo `json:"info" gorm:"column:info;type:jsonb"`
+
+ // parent_id
+ ParentID string `json:"parent_id"`
+}
+
+type FeedBackInfo struct {
+ Score ScoreType `json:"score"`
+ FeedbackType FeedbackType `json:"feedback_type"`
+ FeedbackContent string `json:"feedback_content"`
+}
+
+func (f *FeedBackInfo) Value() (driver.Value, error) {
+ return json.Marshal(f)
+}
+
+func (f *FeedBackInfo) Scan(value any) error {
+ b, ok := value.([]byte)
+ if !ok {
+ return errors.New("invalid feed back info type")
+ }
+ return json.Unmarshal(b, &f)
+}
+
+type ConversationReference struct {
+ ConversationID string `json:"conversation_id" gorm:"index"`
+ AppID string `json:"app_id"`
+
+ NodeID string `json:"node_id"`
+ Name string `json:"name"`
+ URL string `json:"url"`
+}
+
+type ConversationListReq struct {
+ KBID string `json:"kb_id" query:"kb_id" validate:"required"`
+ AppID *string `json:"app_id" query:"app_id"`
+
+ Subject *string `json:"subject" query:"subject"`
+
+ RemoteIP *string `json:"remote_ip" query:"remote_ip"`
+
+ Pager
+}
+
+type ConversationListItem struct {
+ ID string `json:"id"`
+ AppName string `json:"app_name"`
+ Info ConversationInfo `json:"info" gorm:"info;type:jsonb"` // 用户信息
+ AppType AppType `json:"app_type"`
+ Subject string `json:"subject"`
+
+ RemoteIP string `json:"remote_ip"`
+
+ IPAddress *IPAddress `json:"ip_address" gorm:"-"`
+
+ CreatedAt time.Time `json:"created_at"`
+
+ FeedBackInfo *FeedBackInfo `json:"feedback_info" gorm:"-"` // 用户反馈信息
+}
+
+type ConversationDetailResp struct {
+ ID string `json:"id"`
+ AppID string `json:"app_id"`
+ Subject string `json:"subject"`
+ RemoteIP string `json:"remote_ip"`
+
+ Messages []*ConversationMessage `json:"messages" gorm:"-"`
+ References []*ConversationReference `json:"references" gorm:"-"`
+
+ IPAddress *IPAddress `json:"ip_address" gorm:"-"`
+
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type MessageListReq struct {
+ KBID string `json:"kb_id" query:"kb_id" validate:"required"`
+ Pager
+}
+
+type ConversationMessageListItem struct {
+ ID string `json:"id"`
+ ConversationID string `json:"conversation_id"`
+ AppID string `json:"app_id"`
+ AppType AppType `json:"app_type"`
+
+ Question string `json:"question"`
+
+ // stats
+ RemoteIP string `json:"remote_ip"`
+ CreatedAt time.Time `json:"created_at"`
+
+ // userInfo
+ ConversationInfo ConversationInfo `json:"conversation_info" gorm:"column:conversation_info;type:jsonb"`
+ // feedbackInfo
+ Info FeedBackInfo `json:"info" gorm:"column:info;type:jsonb"`
+
+ IPAddress *IPAddress `json:"ip_address" gorm:"-"`
+}
+
+type ShareConversationDetailResp struct {
+ ID string `json:"id"`
+ Subject string `json:"subject"`
+ Messages []*ShareConversationMessage `json:"messages" gorm:"-"`
+ CreatedAt time.Time `json:"created_at"`
+}
+
+type ShareConversationMessage struct {
+ Role schema.RoleType `json:"role"`
+ Content string `json:"content"`
+ ImagePaths pq.StringArray `json:"image_paths"`
+ CreatedAt time.Time `json:"created_at"`
+}
diff --git a/backend/domain/creation.go b/backend/domain/creation.go
new file mode 100644
index 0000000..cf3ab11
--- /dev/null
+++ b/backend/domain/creation.go
@@ -0,0 +1,19 @@
+package domain
+
+type TextReq struct {
+ Text string `json:"text" validate:"required"`
+ Action string `json:"action"` // action: improve, summary, extend, shorten, etc.
+}
+
+// FIM (Fill in Middle) tokens
+const (
+ FIMPrefix = "=a)}}for(var h=this.__startIndex;h