📄 accountservice1impl.java
字号:
/**
*
*/
package unicom.service;
import unicom.bean.Account;
import unicom.dao.IAccountDao;
import unicom.factory.AbstractFactory;
import unicom.factory.MakeFactory;
/**
* @author 陈才旭
* 功能:实现IAccountService接口,封装具体的业务逻辑
* 优点:
* 缺点:
* 建议:
*/
public class AccountService1Impl implements IAccountService {
private static IAccountDao accountDao;
//当类加载时赋予初始值
static{
AbstractFactory factory = MakeFactory.makeFactory();
accountDao = factory.createAccountDao();
}
//根据id检查是否否该账户被占用
public boolean checkAccountById(String id) {
return accountDao.checkAccountById(id);
}
//增加账户
public boolean addAccount(Account account,String mobileNumber) {
return accountDao.addAccount(account,mobileNumber);
}
//取得开户业务所需要的金额
public double getStartAccountCharge(){
return accountDao.getStartAccountCharge();
}
//根据手机帐号id以对象的形式返回手机帐号信息
public Account getAccountById(String id) {
return accountDao.getAccountById(id);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -