AdminServiceImpl.java
上传用户:yunfeng252
上传日期:2022-07-23
资源大小:12403k
文件大小:1k
源码类别:
Jsp/Servlet
开发平台:
Java
- package org.yufeng.service.serviceImpl;
- import java.util.List;
- import java.util.Map;
- import org.yufeng.dao.IAdminDao;
- import org.yufeng.domains.Admin;
- import org.yufeng.service.IAdminServiceDao;
- import org.yufeng.service.IArticleServiceDao;
- import org.yufeng.utils.AppContext;
- import org.yufeng.utils.Tools;
- public class AdminServiceImpl implements IAdminServiceDao {
- private IAdminDao adminDao;
- public boolean validate(String username,String password){
- return adminDao.validate(username, password);
- }
- public List browseAdmin() {
- return adminDao.browseAdmin();
- }
- public boolean delAdmin(Admin admin) {
- return adminDao.delAdmin(admin);
- }
- public boolean addAdmin(Admin admin) {
- return adminDao.addAdmin(admin);
- }
- public boolean updateAdmin(Admin admin) {
- return adminDao.updateAdmin(admin);
- }
- public IAdminDao getAdminDao() {
- return this.adminDao;
- }
- public void setAdminDao(IAdminDao adminDao) {
- this.adminDao = adminDao;
- }
- public static void main(String[] args) {
- IAdminServiceDao test = (IAdminServiceDao) AppContext.getInstance()
- .getAppContext().getBean("adminTarget");
- boolean flag = test.validate("admin","admin");
- System.out.println(flag);
- }
- public Admin loadAdmin(String username) {
- return adminDao.loadAdmin(username);
- }
- }