package com.yonge.cooleshow.cms.service.impl;

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

import com.yonge.toolset.mybatis.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yonge.cooleshow.cms.dal.dao.HelpCenterContentDao;
import com.yonge.cooleshow.cms.dal.entity.HelpCenterContent;
import com.yonge.cooleshow.cms.service.HelpCenterContentService;
import com.yonge.toolset.mybatis.dal.BaseDAO;

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

	@Autowired
	private HelpCenterContentDao contentCenterDao;

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

	@Override
	public boolean updateContentByCatalog(Long 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(Long catalogId) {
		contentCenterDao.deleteContentByCatalog(catalogId);
		return true;
	}

    @Override
    public boolean status(Long id) {

		contentCenterDao.status(id);
		return true;
    }

}
