package com.ym.mec.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.ym.mec.cms.dal.dao.HelpCenterContentDao;
import com.ym.mec.cms.dal.entity.HelpCenterContent;
import com.ym.mec.cms.service.HelpCenterContentService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.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;
	}

}
