package com.sonic.cow.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sonic.cow.domain.entity.VoiceChatRecord;
import com.sonic.cow.enums.VoiceChatStatusEnum;

/**
 * 语音聊天记录
 *
 * @author code
 */
public interface VoiceChatRecordService extends IService<VoiceChatRecord> {

    /**
     * 新增聊天通话记录
     *
     * @param userId
     * @param aiId
     * @param roomId
     * @param taskId
     */
    Long add(Long userId, Long aiId, String roomId, String taskId, String endpoint);

    /**
     * 更新状态
     *
     * @param roomId
     * @param taskId
     * @param status
     */
    void updateStatus(String roomId, String taskId, VoiceChatStatusEnum status);

    /**
     * 更新通话时长
     *
     * @param roomId
     * @param taskId
     * @param duration
     */
    void updateDuration(String roomId, String taskId, Long duration);

    /**
     * 通过roomId和taskId,获取聊天通话记录
     *
     * @param roomId
     * @param taskId
     * @return
     */
    VoiceChatRecord getByRoomIdAndTaskId(String roomId, String taskId);

    /**
     * 通过taskId,获取聊天通话记录
     *
     * @param taskId
     * @return
     */
    VoiceChatRecord getByTaskId(String taskId);
}