package cn.reghao.tnb.account.app.db.query.impl;

import cn.reghao.tnb.account.app.db.mapper.UserAccountMapper;
import cn.reghao.tnb.account.app.db.query.UserAuthQuery;
import cn.reghao.tnb.account.app.model.dto.AccountDetail;
import org.springframework.stereotype.Service;

/**
 * @author reghao
 * @date 2021-11-16 09:22:35
 */
@Service
public class UserAuthQueryImpl implements UserAuthQuery {
    private final UserAccountMapper userAccountMapper;

    public UserAuthQueryImpl(UserAccountMapper userAccountMapper) {
        this.userAccountMapper = userAccountMapper;
    }

    @Override
    public AccountDetail findByUsername(String username) {
        return userAccountMapper.findByUsername(username);
    }

    @Override
    public AccountDetail findByEmail(String email) {
        return userAccountMapper.findByEmail1(email);
    }

    @Override
    public AccountDetail findByMobile(String mobile) {
        return userAccountMapper.findByMobile1(mobile);
    }
}
