package com.itwill.cmoa.model.dao;

import java.util.List;

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

import com.itwill.cmoa.model.dto.LikeNews;
import com.itwill.cmoa.model.dto.Member;
import com.itwill.cmoa.model.dto.RssNews;
import com.itwill.cmoa.model.dto.RssUrl;
import com.itwill.cmoa.model.mapper.NewsMapper;

@Repository("newsDao")
public class TheNewsDao implements NewsDao {
	
	@Autowired
	@Qualifier("newsMapper")
	private NewsMapper newsMapper;
	
	@Override
	public List<RssNews> getAllNewsByRseq2(int rseq) {
		return newsMapper.selectAllNewsByRseq2(rseq);
	}
	
	
	@Override
	public String getRcategory(int rseq){
		return newsMapper.selectRcategory(rseq);
	}

	@Override
	public List<RssNews> getAllNewsByRseqAndDate(int rseq,String hPubDate) {
		return newsMapper.selectAllNewsByRseqAndDate(rseq,hPubDate);
	}
	
	
/*	@Override
	public List<RssNews> getNewsByPubDate(String hPubDate) {
		return newsMapper.selectNewsByPubDate(hPubDate);
	}
*/

	@Override
	public List<RssUrl> getAllNewsUrlByRcategory(String rCategory) {
		
		return newsMapper.selectAllNewsUrlByRcategory(rCategory);
	}

	@Override
	public List<LikeNews> getAllNewsUrlMenuByMemail(String mEmail) {
		
		return newsMapper.getAllNewsUrlMenuByMemail(mEmail);
	}

	@Override
	public void addNewsUrlMenuByRseq(int rSeq,String mEmail) {
		newsMapper.addNewsUrlMenuByRseq(rSeq,mEmail);
		
	}


	@Override
	public List<Member> getRandomMember() {
		
		return newsMapper.getRandomMember();
	}

}
