package com.qmth.qrzk.repository.user.service.impl;

import java.util.ArrayList;
import java.util.List;

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

import com.qmth.qrzk.dao.IQuestionOperationLogDao;
import com.qmth.qrzk.repository.user.model.QuestionOperationLog;
import com.qmth.qrzk.repository.user.service.IQuestionOperationLogService;

@Service("questionOperationLogServiceImpl")
public class QuestionOperationLogServiceImpl implements
		IQuestionOperationLogService {
	
	@Autowired  
	@Qualifier("questionOperationLogDaoImpl")
	private IQuestionOperationLogDao questionOperationLogDao;
	@Override
	public int recordLog(QuestionOperationLog qol) {
		return questionOperationLogDao.insert(qol);
	}
	@Override
	public List<Integer> queryIds(QuestionOperationLog qol) {
		// TODO Auto-generated method stub
		List<Integer> list=new ArrayList<Integer>();
		List<QuestionOperationLog> ls=questionOperationLogDao.query(qol);
		for(QuestionOperationLog qo:ls){
			list.add(qo.getQuestionId());
		}
		return list;
	}
	@Override
	public List<QuestionOperationLog> queryLogs(int id) {
		// TODO Auto-generated method stub
		return questionOperationLogDao.queryLogs(id);
	}

}
