package com.m2pool.lease.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.m2pool.common.datasource.annotation.GAuth;
import com.m2pool.lease.entity.GoogleInfo;
import com.m2pool.lease.entity.LeaseUser;
import com.m2pool.lease.vo.v2.UserGoogleAuthInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author yyb
 * @since 2025-07-23
 */
@Mapper
public interface LeaseUserMapper extends BaseMapper<LeaseUser> {
    /**
     * 获取谷歌验证相关信息
     * @param email
     * @return
     */
     GoogleInfo getGoogleInfoByEmail(@Param("email") String email);


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


     /**
      * 获取用户谷歌验证码相关信息（包括密码）
      * @param email
      * @return
      */
     UserGoogleAuthInfo getUserInfoByEmail(@Param("email") String email);


     /**
      * 绑定谷歌验证码
      * @param info
      * @return
      */
    boolean bingGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);

    /**
      * 关闭谷歌验证码
      * @param info
      * @return
      */
    boolean closeGoogleAuthenticator(@Param("info") UserGoogleAuthInfo info);
}
