feat(chat): Enhance session management with new API endpoints and filtering options
- Added `status` query parameter to `list_sessions_api` for filtering sessions by their status (active/closed). - Introduced `close_all_sessions_api` endpoint to allow users to close all active sessions for the current actor. - Updated `SessionRepository` to support status filtering in session listing and implemented logic for closing active sessions. - Improved Redis connection settings for better performance and reliability. This update enhances the chat functionality by providing more control over session management, improving user experience and system efficiency.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
formatDateTime,
|
||||
labelAlertStatus,
|
||||
labelAlertType,
|
||||
labelAnalystMetric,
|
||||
labelTradeType,
|
||||
} from '../displayLabels'
|
||||
|
||||
describe('displayLabels', () => {
|
||||
it('formatDateTime strips ISO to locale minute', () => {
|
||||
const out = formatDateTime('2026-08-15T14:20:00')
|
||||
expect(out).toMatch(/2026/)
|
||||
expect(out).not.toContain('T')
|
||||
})
|
||||
|
||||
it('maps enums to Chinese', () => {
|
||||
expect(labelAlertType('aml')).toBe('AML')
|
||||
expect(labelAlertStatus('pending_review')).toBe('待审核')
|
||||
expect(labelTradeType('subscribe')).toBe('申购')
|
||||
expect(labelAnalystMetric('dict_count')).toBe('口径字典资产数')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user