feat: 工作台聊天室功能

This commit is contained in:
2026-05-31 02:37:23 +08:00
parent 83cf9eab94
commit f83f434863
33 changed files with 2520 additions and 265 deletions

View File

@@ -156,6 +156,62 @@ export function startServer(options: StartServerOptions) {
logger,
),
},
"/api/projects/:id/chat": {
POST: withErrorHandler(
async (req) => {
const { handleSendChat } = await import("./routes/chat/send");
return handleSendChat(req, db, mode);
},
mode,
logger,
),
},
"/api/projects/:id/conversations": {
GET: withErrorHandler(
async (req) => {
const { handleListConversations } = await import("./routes/chat/list");
return handleListConversations(req, db, mode);
},
mode,
logger,
),
POST: withErrorHandler(
async (req) => {
const { handleCreateConversation } = await import("./routes/chat/create");
return handleCreateConversation(req, db, mode);
},
mode,
logger,
),
},
"/api/projects/:id/conversations/:cid": {
DELETE: withErrorHandler(
async (req) => {
const { handleDeleteConversation } = await import("./routes/chat/delete");
return handleDeleteConversation(req, db, mode);
},
mode,
logger,
),
GET: withErrorHandler(
async (req) => {
const { handleGetConversation } = await import("./routes/chat/get");
return handleGetConversation(req, db, mode);
},
mode,
logger,
),
},
"/api/projects/:id/conversations/:cid/messages": {
GET: withErrorHandler(
async (req) => {
const { handleListMessages } = await import("./routes/chat/messages");
return handleListMessages(req, db, mode);
},
mode,
logger,
),
},
"/api/projects/:id/restore": {
POST: withErrorHandler(
async (req) => {