import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; export class ChatSessionRowDto { @ApiProperty({ type: String, example: '1', description: '会话 ID(数字字符串)' }) id!: string; @ApiProperty({ type: String, example: '1', description: '用户 ID(数字字符串)' }) userId!: string; @ApiProperty({ type: String, description: '标题(可能为空字符串)', example: '你好', }) title!: string; @ApiProperty({ type: String, description: '创建时间 ISO8601' }) createdAt!: string; @ApiProperty({ type: String, description: '更新时间 ISO8601' }) updatedAt!: string; } export class ChatSessionListResponseDto { @ApiProperty({ type: () => ChatSessionRowDto, isArray: true }) items!: ChatSessionRowDto[]; @ApiProperty({ type: Number }) total!: number; @ApiProperty({ type: Number }) limit!: number; @ApiProperty({ type: Number }) offset!: number; } export class ChatMessageRowDto { @ApiProperty({ type: String, example: '1', description: '消息 ID(数字字符串)' }) id!: string; @ApiProperty({ type: String, example: 'user' }) role!: string; @ApiProperty({ type: String }) content!: string; @ApiProperty({ type: Number, description: 'completion token 数(用户消息为 0)', }) tokenCount!: number; @ApiPropertyOptional({ type: String, nullable: true, description: '大模型渠道(用户消息一般为 null)', }) provider?: string | null; @ApiProperty({ type: String, description: '创建时间 ISO8601' }) createdAt!: string; } export class ChatMessageListResponseDto { @ApiProperty({ type: String, example: '1' }) sessionId!: string; @ApiProperty({ type: () => ChatMessageRowDto, isArray: true }) items!: ChatMessageRowDto[]; @ApiProperty({ type: Number }) total!: number; @ApiProperty({ type: Number }) limit!: number; @ApiProperty({ type: Number }) offset!: number; }