fix: GET /sessions @Body → @Query, 修复对话列表获取失败
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 44s
GET 请求不应使用 @Body 装饰器(NestJS 默认不解析 GET body)。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
dc5948a2cd
commit
6d0cc9b6dc
@ -1,4 +1,4 @@
|
||||
import { Controller, Get, Post, Delete, Body, Param, Res } from '@nestjs/common';
|
||||
import { Controller, Get, Post, Delete, Body, Param, Res, Query } from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import type { Response } from 'express';
|
||||
import { RagChatService } from './rag-chat.service';
|
||||
@ -19,7 +19,7 @@ export class RagChatController {
|
||||
|
||||
@Get('sessions')
|
||||
@ApiOperation({ summary: '对话列表' })
|
||||
async listSessions(@CurrentUser() user: UserPayload, @Body('knowledgeBaseId') kbId?: string) {
|
||||
async listSessions(@CurrentUser() user: UserPayload, @Query('knowledgeBaseId') kbId?: string) {
|
||||
return this.svc.listSessions(String(user.id), kbId);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user