package com.yeejoin.amos.patrol.business.service.intfc;

import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.util.DaoCriteria;
import com.yeejoin.amos.patrol.core.common.request.CommonPageable;
import com.yeejoin.amos.patrol.dao.entity.Msg;
import com.yeejoin.amos.patrol.dao.entity.MsgSubscribe;
import org.springframework.data.domain.Page;

import java.util.List;

public interface IMsgSubscribeService {
	public List<MsgSubscribe> queryMsgSubscribes(String orgCode, String userId);
	
	public List<MsgSubscribe> queryMsgSubscribes(String userId);

	public void saveSubscribe(List<MsgSubscribe> subscribe);
	
	/**
	 * 根据登陆用户获取未读消息数
	 * @param user
	 * @return
	 */
	public int getUnreadCount(AgencyUserModel user);
	
	/**
	 * 根据条件获取用户消息列表
	 * @param criterias
	 * @param commonPageable
	 * @return
	 */
	public Page<Msg> queryMsgList(List<DaoCriteria> criterias,CommonPageable commonPageable);
	
	/**
	 * 修改消息为已读
	 * @param msgId
	 * @return
	 */
	public Msg isRead(long msgId);
}
