package com.keao.edu.cms.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.keao.edu.cms.dal.dao.HelpCenterContentDao;
import com.keao.edu.cms.dal.entity.HelpCenterContent;
import com.keao.edu.cms.service.HelpCenterContentService;
import com.keao.edu.common.dal.BaseDAO;
import com.keao.edu.common.service.impl.BaseServiceImpl;

@Service
public class HelpCenterContentServiceImpl extends BaseServiceImpl<Integer, HelpCenterContent> implements HelpCenterContentService {

	@Autowired
	private HelpCenterContentDao contentCenterDao;

	@Override
	public BaseDAO<Integer, HelpCenterContent> getDAO() {
		return contentCenterDao;
	}

	@Override
	public boolean updateContentByCatalog(Integer catalogId, Integer status) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("catalogId", catalogId);
		map.put("status", status);
		contentCenterDao.updateContentByCatalog(map);
		return true;
	}

	@Override
	public boolean deleteContentByCatalog(Integer catalogId) {
		contentCenterDao.deleteContentByCatalog(catalogId);
		return true;
	}

}
