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

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

import java.util.List;

/**
 * @author reghao
 * @date 2022-06-08 13:38:02
 */
@Mapper
public interface UserRelationMapper extends BaseMapper<UserRelation> {
    void deleteByUserRelation(long userId, long followingId);

    List<Long> findFollowingUsers(long userId);
    UserRelation findRelation(@Param("loginUserId") long loginUserId, @Param("userId") long userId);

    int countUserFollower(long userId);
    List<Long> findUserFollowers(long userId);

    int countUserFollowing(long userId);
    List<Long> findUserFollowings(long userId);
}
