feat: 工作台聊天室功能
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user