package com.zsc.edu.gateway.modules.notice.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zsc.edu.gateway.framework.security.UserDetailsImpl;
import com.zsc.edu.gateway.modules.notice.dto.UserMessageDto;
import com.zsc.edu.gateway.modules.notice.entity.MessagePayload;
import com.zsc.edu.gateway.modules.notice.entity.MessageSetting;
import com.zsc.edu.gateway.modules.notice.entity.UserMessage;
import com.zsc.edu.gateway.modules.notice.query.BulletinQuery;
import com.zsc.edu.gateway.modules.notice.query.UserMessageQuery;
import com.zsc.edu.gateway.modules.notice.vo.BulletinVo;
import com.zsc.edu.gateway.modules.notice.vo.UserMessageVo;
import com.zsc.edu.gateway.modules.system.entity.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
 * 用户消息Service
 *
 * @author harry_yao
 */
public interface UserMessageService extends IService<UserMessage> {

    Boolean createByAdmin(UserMessageDto dto);

    UserMessageVo detail(Long messageId, Long userId);

    Boolean insertInto(Long messageId, List<String> attachmentIds);

    List<MessageSetting> getSetting();

    IPage<UserMessageVo> page(Page<UserMessageVo> page, UserMessageQuery query);

    Integer countUnread(UserDetailsImpl userDetails);

    Integer markAsRead(UserDetailsImpl userDetails, List<Long> messageIds);

    @Transactional
    List<MessageSetting> saveSetting(List<MessageSetting> settings);

}
