package com.izouma.dingdong.repo;

import com.izouma.dingdong.domain.Chat;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface ChatRepo extends JpaRepository<Chat, Long>, JpaSpecificationExecutor<Chat> {

    //按聊天框查找
    List<Chat> findAllBySendUserIdAndReceiveUserId(Long sendUserId, Long receiveUserId);

    //按个人查找
    List<Chat> findAllBySendUserIdOrReceiveUserId(Long userId, Long userId2);

}