You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.9 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package com.dao;
import java.sql.SQLException;
import java.util.List;
import com.javaBean.Account;
/**
* 账户数据访问接口,定义对账户数据进行操作的方法。
*/
public interface AccountDao {
/**
* 验证用户凭证。
* 通过用户名userid和密码password检查数据库中是否存在匹配的账户记录。
*
* @param userid 用户名
* @param password 密码
* @return 匹配的Account对象如果没有匹配则返回null
* @throws SQLException 数据库访问异常
*/
Account validateUser(String userid, String password) throws SQLException;
/**
* 根据用户名查找账户信息。
* 提供用户名作为参数返回对应的Account对象。
*
* @param userid 用户名
* @return 对应的Account对象如果未找到则返回null
*/
Account findByUserid(String userid);
/**
* 向数据库中添加新的账户记录。
* 参数为一个Account对象包含要添加的账户所有信息。
*
* @param account 要添加的Account对象
*/
void addAccount(Account account);
/**
* 查询并返回数据库中的所有账户记录。
* 结果以List<Account>的形式给出。
*
* @return 包含所有账户的List
*/
List<Account> findAll();
/**
* 更新数据库中已存在的账户信息。
* 参数为一个Account对象其中包含了要更新的账户属性。
*
* @param account 要更新的Account对象
* @return 受影响的行数通常1表示成功更新
*/
int updateAccount(Account account);
/**
* 根据用户ID删除数据库中的账户记录。
*
* @param userid 用户ID
* @return 受影响的行数1表示成功删除
*/
int deleteAccount(String userid);
}