package com.storlead.message.service;

import com.storlead.framework.common.result.Result;
import com.storlead.framework.mybatis.service.MyBaseService;
import com.storlead.message.pojo.dto.MessageSendDTO;
import com.storlead.message.pojo.entity.InsideMessageRecordEntity;
import com.storlead.message.pojo.entity.MessageTemplateEventDetailEntity;
import com.storlead.message.pojo.entity.MessageTemplateEventGroupEntity;

import java.util.Collection;
import java.util.Map;

/**
 * 系统内部消息 服务类（域内接口，与实现同置于 biz）。
 *
 * @author chenkq
 * @since 2024-04-19
 */
public interface InsideMessageRecordService extends MyBaseService<InsideMessageRecordEntity> {

    Map getOldMapDataById(String table, String fieldColumn, String id);

    Result sendInsideMessage(MessageTemplateEventGroupEntity eventGroup, MessageTemplateEventDetailEntity templateEventDetail, Map map, Long receiverUserId, String callbackParam, Long sendUserId);

    Result sendInsideMessage(MessageTemplateEventGroupEntity eventGroup, MessageTemplateEventDetailEntity templateEventDetail, Map map, Collection<Long> receiverUserIds, String callbackParam, Long sendUserId);

    void asynSendInsideMessage(MessageTemplateEventGroupEntity eventGroup, MessageTemplateEventDetailEntity templateEventDetail, Map map, Long receiverUserId, String callbackParam, Long sendUserId);

    void asynSendInsideMessage(MessageTemplateEventGroupEntity eventGroup, MessageTemplateEventDetailEntity templateEventDetail, Map map, Collection<Long> receiverUserIds, String callbackParam, Long sendUserId);

    /**
     * 直接发送站内消息（不依赖消息模板），用于联调 / ApiPost 测试。
     */
    Result<Long> sendDirectMessage(MessageSendDTO dto);
}
