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.EmotionRecordCreateRequest;
import com.emotion.dto.request.EmotionRecordPageRequest;
import com.emotion.dto.request.EmotionRecordUpdateRequest;
import com.emotion.dto.response.EmotionRecordResponse;
import com.emotion.entity.EmotionRecord;

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

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

    /**
     * 创建情绪记录
     */
    EmotionRecord createEmotionRecord(String userId, String emotionType, Double intensity, 
                                     String trigger, String location, String notes);

    // 新增的方法

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

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

    /**
     * 根据ID获取情绪记录响应
     */
    EmotionRecordResponse getEmotionRecordResponseById(String id);

    /**
     * 创建情绪记录并返回响应
     */
    EmotionRecordResponse createEmotionRecordWithResponse(EmotionRecordCreateRequest request);

    /**
     * 更新情绪记录并返回响应
     */
    EmotionRecordResponse updateEmotionRecordWithResponse(EmotionRecordUpdateRequest request);

    /**
     * 删除情绪记录
     */
    boolean deleteEmotionRecord(String id);

    /**
     * 获取用户情绪统计
     */
    Map<String, Object> getEmotionStats(String userId, String startDate, String endDate);
}