package com.emotion.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.emotion.common.BasePageRequest;
import com.emotion.common.PageResult;
import com.emotion.dto.request.EmotionAnalysisCreateRequest;
import com.emotion.dto.request.EmotionAnalysisPageRequest;
import com.emotion.dto.request.EmotionAnalysisUpdateRequest;
import com.emotion.dto.response.EmotionAnalysisResponse;
import com.emotion.entity.EmotionAnalysis;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 情绪分析服务接口
 * 
 * @author huazhongmin
 * @date 2025-07-23
 */
public interface EmotionAnalysisService extends IService<EmotionAnalysis> {
    
    /**
     * 分页查询情绪分析记录
     */
    IPage<EmotionAnalysis> getPage(BasePageRequest request);
    
    /**
     * 根据用户ID分页查询情绪分析记录
     */
    IPage<EmotionAnalysis> getPageByUserId(BasePageRequest request, String userId);
    
    /**
     * 根据消息ID查询情绪分析记录
     */
    EmotionAnalysis getByMessageId(String messageId);

    /**
     * 创建情绪分析记录
     */
    EmotionAnalysis createEmotionAnalysis(String messageId, String userId, String primaryEmotion, 
                                         String polarity, Double intensity, Double confidence);

    // 新增的方法

    /**
     * 分页查询情绪分析记录响应
     */
    PageResult<EmotionAnalysisResponse> getPageWithResponse(EmotionAnalysisPageRequest request);

    /**
     * 根据用户ID分页查询情绪分析记录响应
     */
    PageResult<EmotionAnalysisResponse> getPageByUserIdWithResponse(String userId, EmotionAnalysisPageRequest request);

    /**
     * 根据ID获取情绪分析记录响应
     */
    EmotionAnalysisResponse getEmotionAnalysisResponseById(String id);

    /**
     * 根据消息ID获取情绪分析记录响应
     */
    EmotionAnalysisResponse getEmotionAnalysisResponseByMessageId(String messageId);

    /**
     * 创建情绪分析记录并返回响应
     */
    EmotionAnalysisResponse createEmotionAnalysisWithResponse(EmotionAnalysisCreateRequest request);

    /**
     * 更新情绪分析记录并返回响应
     */
    EmotionAnalysisResponse updateEmotionAnalysisWithResponse(EmotionAnalysisUpdateRequest request);

    /**
     * 删除情绪分析记录
     */
    boolean deleteEmotionAnalysis(String id);
}