package com.m2pool.pool.mapper;

import com.m2pool.common.datasource.annotation.DistributionDB;
import com.m2pool.common.datasource.annotation.GAuth;
import com.m2pool.pool.dto.GoogleInfoDto;
import com.m2pool.pool.dto.ProfitDto;
import com.m2pool.pool.entity.GoogleInfo;
import com.m2pool.pool.entity.UserGoogleAuthInfo;
import com.m2pool.system.api.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description 谷歌验证器相关sql
 * @Date 2022/8/30 17:47
 * @Author 杜懿
 */
@GAuth
public interface GoogleAuthMapper {

    /**
     * 查询是否绑定google验证器
     * @param email
     * @return
     */
    public boolean checkIfBindByEmail(@Param("email") String email);

    /**
     * 获取谷歌验证码
     * @param email
     * @return
     */
    public GoogleInfo getGoogleInfoByEmail(@Param("email") String email);

    public UserGoogleAuthInfo getUserInfoByEmail(@Param("email") String email);

    public boolean bingGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);



    /**
     * 判断验证码是否已存在
     * @param secret
     * @return
     */
    public boolean checkSecretIfExist(@Param("secret") String secret);

    public boolean closeGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);
}
