accountservice1impl.java

来自「开发的一个java web的任务管理系统。」· Java 代码 · 共 49 行

JAVA
49
字号
/**
 * 
 */
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 + =
减小字号Ctrl + -
显示快捷键?