package com.palmnest.service.impl;

import com.palmnest.dao.AppMenuDao;
import com.palmnest.model.AppMenu;
import com.palmnest.service.AppMenuManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 系统菜单业务接口实现
 *
 * @author yb
 * @since 2014-05-28
 */
@Component("appMenuManager")
public class AppMenuManagerImpl implements AppMenuManager {

	private AppMenuDao appMenuDao;

	@Autowired
	public void setAppMenuDao(AppMenuDao appMenuDao) {
		this.appMenuDao = appMenuDao;
	}

	@Override
	public List<AppMenu> getAll() {
		return appMenuDao.getAll();
	}

	public List<AppMenu> getAll2() {
		return appMenuDao.getAll2();
	}

	@Override
	public int menuTotalCount() {
		return appMenuDao.menuTotalCount();
	}

	@Override
	public void saveOrUpdate(AppMenu appmenu) {
		appMenuDao.save(appmenu);
	}

	@Override
	public AppMenu getMenu(int id) {
		return appMenuDao.get(id);
	}

	@Override
	public AppMenu getMenu(String treeCode, String parentCode) {
		return appMenuDao.getMenu(treeCode, parentCode);
	}

	@Override
	public int maxMenuId() {
		return appMenuDao.maxMenuId();
	}

	@Override
	public void deleMenu(String treeCode, String parentCode) {
		appMenuDao.deleMenu(treeCode, parentCode);
	}

	@Override
	public List<AppMenu> getAllAppMenu() {
		return appMenuDao.getAllAppMenu();
	}

	@Override
	public List<AppMenu> getMenuByParent(String parentCode) {
		return appMenuDao.getMenuByParent(parentCode);
	}

	@Override
	public List<AppMenu> getMenuByFunid(String funIds) {
		return appMenuDao.getMenuByFunid(funIds);
	}

	@Override
	public List<AppMenu> getLevelOneMenu() {
		return appMenuDao.getLevelOneMenu();
	}

}
