package org.example.service;

import org.example.entity.Yonghu;
import org.example.mapper.YonghuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class YonghuService {
    
    @Autowired
    private YonghuMapper yonghuMapper;
    
    public boolean authenticate(String username, String password) {
        Yonghu yonghu = yonghuMapper.findByUsername(username);
        if (yonghu != null && yonghu.getPassword().equals(password)) {
            return true;
        }
        return false;
    }
}