package cn.com.qmth.stmms.biz.exam.service.impl;

import java.util.List;

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

import cn.com.qmth.stmms.biz.common.BaseQueryService;
import cn.com.qmth.stmms.biz.exam.dao.TagDao;
import cn.com.qmth.stmms.biz.exam.model.Tag;
import cn.com.qmth.stmms.biz.exam.service.TagService;

@Service
public class TagServiceImpl extends BaseQueryService<Tag> implements TagService {

    @Autowired
    private TagDao tagDao;

    @Override
    @Cacheable(value = "tag_cache")
    public List<Tag> findAll() {
        return tagDao.list();
    }

    @Override
    @Cacheable(value = "tag_cache", key = "#id", condition = "#id!=null")
    public Tag findById(Integer id) {
        return tagDao.findOne(id);
    }

}
