package com.ruoyi.frequency.appmessage.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.controller.req.AppMessageReadOrDeleteReq;
import com.ruoyi.controller.req.MessageReadOrDeleteReq;
import com.ruoyi.enums.message.AppMessageEnums;
import com.ruoyi.frequency.appmessage.entity.AppMessage;
import com.ruoyi.frequency.appmessage.model.param.AppMessageParam;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.PageBasic;
import com.ruoyi.vo.UserInfo;
import com.ruoyi.vo.UserVo;

import java.util.List;

/**
 * app端消息Service接口
 * 
 * @author liwenlong
 * @date 2023-07-20
 */
public interface AppMessageService extends IService<AppMessage>
{
    /**
     * 查询app端消息
     * 
     * @param id app端消息主键
     * @return app端消息
     */
    AppMessage selectAppMessageById(Long id);

    /**
     * 查询app端消息列表
     * 
     * @param appMessage app端消息
     * @return app端消息集合
     */
    List<AppMessage> selectAppMessageList(AppMessage appMessage);

    /**
     * 新增app端消息
     * 
     * @param appMessage app端消息
     * @return 结果
     */
    int insertAppMessage(AppMessage appMessage);

    /**
     * 修改app端消息
     * 
     * @param appMessage app端消息
     * @return 结果
     */
    int updateAppMessage(AppMessage appMessage);

    /**
     * 批量删除app端消息
     * 
     * @param ids 需要删除的app端消息主键集合
     * @return 结果
     */
    int deleteAppMessageByIds(Long[] ids,Integer delFlag);

    /**
     * 删除app端消息信息
     * 
     * @param id app端消息主键
     * @return 结果
     */
    int deleteAppMessageById(Long id);

    /**
     * 消息发布
     * @param appMessageParam
     */
    void publish(AppMessageParam appMessageParam);


    List<UserInfo> messageUserPage(AppMessage appMessage);

    /**
     * 统计未读系统消息数量
     * @param userVo
     * @return
     */
    Integer systemMessageCount(UserVo userVo);


    /**
     * 查询最新一条系统消息
     * @param userVo
     * @return
     */
    AppMessage systemMessageNew(UserVo userVo);


    /**
     * api-查询系统消息列表
     * @param userVo
     * @param req
     * @return
     */
    ResponseData messagePage(UserVo userVo, PageBasic req);


    /**
     * 已读/删除
     * @param req
     * @param userVo
     * @return
     */
    ResponseData appMessageReadOrDelete(MessageReadOrDeleteReq req, UserVo userVo);


    /**
     * 系统消息
     * @param userVo
     * @param objectId
     * @param authMessageSusess
     */
    void addAppMessage(UserVo userVo, Long objectId, AppMessageEnums authMessageSusess);

    /**
     * 系统消息详情
     * @param id
     * @param userVo
     * @return
     */
    ResponseData<AppMessage> messageDetail(Long id, UserVo userVo);

}
