package cn.reghao.tnb.user.app.db.mapper;

import cn.reghao.jutil.jdk.web.db.BaseMapper;
import cn.reghao.tnb.user.app.model.po.UserContact;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author reghao
 * @date 2022-04-18 11:01:04
 */
@Mapper
public interface UserContactMapper extends BaseMapper<UserContact> {
    void updateContactStatus(@Param("userId") long userId, @Param("status") boolean status);
    void updateFriendStatus(long owner, boolean status, long friendId);
    void updateContactRemark(long friendId, String remarkName, long owner);

    List<UserContact> findByOwner(long owner);
    UserContact findByOwnerAndFriendId(@Param("owner") long owner, @Param("friendId") long friendId);
    List<Long> findOnlineFriends(long owner);
    List<UserContact> findFriendsByNotInGroup(long userId, long groupId);
}
