fix: use correct mock user ID in conversation controller

Changed userId from '1' to 'user-mock-001' in all conversation controller methods to match the actual mock user created in database.

This fixes the 400 error when creating conversations.
This commit is contained in:
AI Clinical Dev Team
2025-10-10 21:39:40 +08:00
parent b9cb173eb6
commit 6e8b43f6df

View File

@@ -18,7 +18,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; // 临时硬编码 const userId = 'user-mock-001'; // 临时使用模拟用户
const { projectId, agentId, title } = request.body; const { projectId, agentId, title } = request.body;
@@ -54,7 +54,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; const userId = 'user-mock-001';
const projectId = request.query.projectId; const projectId = request.query.projectId;
@@ -88,7 +88,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; const userId = 'user-mock-001';
const conversationId = request.params.id; const conversationId = request.params.id;
@@ -125,7 +125,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; const userId = 'user-mock-001';
const { conversationId, content, modelType, knowledgeBaseIds } = const { conversationId, content, modelType, knowledgeBaseIds } =
request.body; request.body;
@@ -177,7 +177,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; const userId = 'user-mock-001';
const { conversationId, content, modelType, knowledgeBaseIds } = const { conversationId, content, modelType, knowledgeBaseIds } =
request.body; request.body;
@@ -240,7 +240,7 @@ export class ConversationController {
) { ) {
try { try {
// TODO: 从JWT token获取userId // TODO: 从JWT token获取userId
const userId = '1'; const userId = 'user-mock-001';
const conversationId = request.params.id; const conversationId = request.params.id;