import { Controller, Get, Query } from '@nestjs/common' import { ApiOperation, ApiTags } from '@nestjs/swagger' import { GetStaffSessionSummaryDto, GetStaffListDto, GetStaffSessionListDto, GetConversationListDto } from '@/dto/chat-management' import { ChatManagementService } from './service/chat-management.service' @ApiTags('chat-management') @Controller('chat-management') export class ChatManagementController { constructor(private readonly chatManagementService: ChatManagementService) {} @Get('staff-session-summary') @ApiOperation({ summary: '获取客服会话总览' }) async getStaffSessionSummary(@Query() query: GetStaffSessionSummaryDto) { const { staffId, status, page, size } = query console.log(staffId, status, page, size) return this.chatManagementService.getStaffSessionSummary( staffId, status, page, size ) } @Get('staff-list') @ApiOperation({ summary: '获取客服列表' }) async getStaffList(@Query() query: GetStaffListDto) { const { page, size } = query return this.chatManagementService.getStaffList(page, size) } @Get('staff-session-list') @ApiOperation({ summary: '获取客服会话列表' }) async getStaffSessionList(@Query() query: GetStaffSessionListDto) { const { staffId, page, pageSize } = query return this.chatManagementService.getStaffSessionList( staffId, page, pageSize ) } @Get('conversation-list') @ApiOperation({ summary: '获取会话列表' }) async getConversationList(@Query() query: GetConversationListDto) { const { customerId, staffId, status, page, size } = query return this.chatManagementService.getConversationList( customerId, staffId, status, page, size ) } }