package com.gic.haoban.manage.api.service.notify;

import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.manage.api.dto.notify.dto.NoticeMessageInfoDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.NotifyMessageBatchQDTO;
import com.gic.haoban.manage.api.dto.qdto.NoticeMessageQDTO;

import java.util.List;
import java.util.Map;

/**
 * Created 2021/12/17.
 *
 * @author hua
 */
public interface NoticeMessageApiService {
    /**
     * 消息接收 发送消息
     * "routerName": "haobanNoticeMessage"
     *
     * @param json
     */
    public void noticeMessageMq(String json);

    /**
     * 冗余
     * @param json
     */
    public void run(String json);

    /**
     * 消息接收 发送消息
     * "routerName": "haobanNoticeMessageBatch"
     * @param json
     */
    void noticeMessageBatchMq(String json);

    /**
     * 批量发送实现
     * @param notifyMessageBatchQDTO
     * @return
     */
    ServiceResponse<Void> batchSendMessage(NotifyMessageBatchQDTO notifyMessageBatchQDTO);

    /**
     * 消息分页
     *1
     * @param enterpriseId
     * @param storeId
     * @param clerkId      可以空 标识查询门店级别消息
     * @param categoryType
     * @param pageInfo
     * @return
     */
    public ServiceResponse<Page<NoticeMessageInfoDTO>> pageNoticeMessage(String enterpriseId, String storeId, String clerkId, int categoryType, BasePageInfo pageInfo);

    /**
     * 未读数量
     *
     * @param enterpriseId
     * @param storeId
     * @param clerkId      可以空 标识查询门店级别消息
     * @return
     */
    public ServiceResponse<Integer> countUnReadNoticeMessage(String enterpriseId, String storeId, String clerkId);

    /**
     * 更新已读状态
     *
     * @param id
     * @return
     */
    public ServiceResponse<Boolean> updateReadFlagById(Long id);

    /**
     * 更新某人的所有已读状态
     *
     * @param enterpriseId
     * @param clerkId
     * @param categoryType
     * @return
     */
    public ServiceResponse<Boolean> updateWriteFlagByClerkId(String enterpriseId, String clerkId, int categoryType);

    /**
     * 新增好办内部通知
     *
     * @param qdto
     * @return
     */
    public ServiceResponse<Boolean> addOrCreateNoticeMessage(List<NoticeMessageQDTO> qdto);


    public void sendMessageForOpenStaff(String enterpriseId, Map<String, String> map) ;

}