package com.tasteby.mapper;

import com.tasteby.domain.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    UserInfo findByProviderAndProviderId(@Param("provider") String provider,
                                         @Param("providerId") String providerId);

    void updateLastLogin(@Param("id") String id);

    void insert(UserInfo user);

    UserInfo findById(@Param("id") String id);

    List<UserInfo> findAllWithCounts(@Param("limit") int limit, @Param("offset") int offset);

    int countAll();

    int updateAdmin(@Param("id") String id, @Param("admin") int admin);
}
