package com.izouma.immall.repo;

import com.izouma.immall.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;


public interface UserRepo extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {
    User findByUsername(String username);

    //根据邀请码查找用户
//    User findByInvitationCode(String invitationCode);

//    List<User> findAllByAuthoritiesContains(VipAuthority authority);

    User findByOpenId(String openId);

    User findByPhone(String phone);

    //查找重复邀请码是否已存在
//    Boolean existsByInvitationCode(Integer invitationCode);

    //查找父类（邀请人）的信息
    List<User> findAllById(Long parentId);
}
