fix: 修复遗漏的 backend-single 引用(Java源码/前端注释/配置文件/IDE配置)

This commit is contained in:
2026-06-27 17:32:18 +08:00
parent 591f70a2f6
commit 8e6b69f6c7
24 changed files with 31 additions and 1585 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ export class AuthService {
* 发送短信验证码(用于登录/注册/找回密码等场景)
*/
static async sendSmsCode(phone: string) {
// backend-single: GET /auth/sms-code?phone=xxx
// server: GET /auth/sms-code?phone=xxx
const response = await http.get('/auth/sms-code', { params: { phone } })
return response.data
}
@@ -80,7 +80,7 @@ export class AuthService {
* 获取当前用户信息
*/
static async getCurrentUserInfo(): Promise<UserInfo> {
// backend-single: GET /auth/userInfo
// server: GET /auth/userInfo
const response = await http.get<UserInfo>('/auth/userInfo')
return response.data
}
+4 -4
View File
@@ -52,7 +52,7 @@ export class ChatApiService {
async createSession(userId: string, title?: string): Promise<ChatSession> {
try {
console.log('📝 创建会话API调用:', { userId, title })
// backend-single: POST /conversation/create
// server: POST /conversation/create
const response = await http.post<ConversationResponse>('/conversation/create', {
userId,
title: title || `对话${Date.now()}`
@@ -89,7 +89,7 @@ export class ChatApiService {
async getUserSessions(userId: string): Promise<ChatSession[]> {
try {
console.log('📂 获取用户会话API调用:', { userId })
// backend-single: GET /conversation/page?userId=xxx
// server: GET /conversation/page?userId=xxx
const response = await http.get<any>('/conversation/page', { params: { userId, current: 1, size: 100 } })
console.log('📂 获取用户会话API响应:', response)
@@ -132,7 +132,7 @@ export class ChatApiService {
async deleteSession(sessionId: string): Promise<void> {
try {
console.log('🗑️ 删除会话API调用:', { sessionId })
// backend-single: DELETE /conversation/delete?id=xxx
// server: DELETE /conversation/delete?id=xxx
await http.delete('/conversation/delete', { params: { id: sessionId } })
console.log('✅ 删除会话成功')
} catch (error) {
@@ -147,7 +147,7 @@ export class ChatApiService {
async updateSessionTitle(sessionId: string, title: string): Promise<void> {
try {
console.log('✏️ 更新会话标题API调用:', { sessionId, title })
// backend-single: PUT /conversation/update 传id和title
// server: PUT /conversation/update 传id和title
await http.put('/conversation/update', { id: sessionId, title })
console.log('✅ 更新会话标题成功')
} catch (error) {
+4 -4
View File
@@ -58,7 +58,7 @@ export const messageApi = {
// 获取用户消息分页
getUserMessages: async (current: number = 1, size: number = 20) => {
console.log('📨 调用getUserMessages API:', { current, size })
// backend-single: GET /message/page (后端根据token识别用户)
// server: GET /message/page (后端根据token识别用户)
const response = await http.get(`/message/page`, { params: { current, size } })
console.log('📨 getUserMessages API响应:', response)
return response
@@ -67,7 +67,7 @@ export const messageApi = {
// 搜索用户消息
searchUserMessages: async (keyword: string, limit: number = 50) => {
console.log('🔍 调用searchUserMessages API:', { keyword, limit })
// backend-single: POST /message/search
// server: POST /message/search
const resp = await http.post(`/message/search`, { keyword, limit })
console.log('🔍 searchUserMessages API响应:', resp)
// 统一返回数组,兼容控制器返回 PageResult 结构
@@ -79,7 +79,7 @@ export const messageApi = {
// 获取用户最近的聊天记录 - 返回数组,兼容后端 PageResult 结构
getRecentMessages: async (limit: number = 10) => {
console.log('📝 调用getRecentMessages API:', { limit })
// backend-single: POST /message/recent
// server: POST /message/recent
const resp = await http.post(`/message/recent`, { limit })
console.log('📝 getRecentMessages API响应:', resp)
const data: any = (resp as any).data || resp
@@ -90,7 +90,7 @@ export const messageApi = {
// 获取消息详情
getMessageById: async (id: string) => {
console.log('📄 调用getMessageById API:', { id })
// backend-single: GET /message/detail?id=xxx
// server: GET /message/detail?id=xxx
const response = await http.get(`/message/detail`, { params: { id } })
console.log('📄 getMessageById API响应:', response)
return response