package nlib.bbs.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import nlib.bbs.service.AttachFileService;
import nlib.bbs.service.AttachFileVO;

@Service("attachFileService")
public class AttachFileServiceImpl implements AttachFileService
{
	static Logger log = LoggerFactory.getLogger(AttachFileServiceImpl.class);
	
	@Resource(name="attachFileDAO")
	AttachFileDAO attachFileDAO;
	
	/**
	 * 첨부파일 목록을 조회한다.  
	 * 
	 * @param
	 * @return
	 * @throws Exception
	 */
	public List<AttachFileVO> listAttachFiles(String attachFileId) throws Exception {
		return attachFileDAO.listAttachFiles(attachFileId);
	}

	@Override
	public int insertAttachFile(AttachFileVO attachFileVO) throws Exception {
		
		return attachFileDAO.insertAttachFile(attachFileVO);
	}

	@Override
	public int deleteAttachFile(AttachFileVO attachFileVO) throws Exception {
		return attachFileDAO.deleteAttachFile(attachFileVO);
	}

	@Override
	public int increaseDownloadCount(AttachFileVO attachFileVO) throws Exception {
		return attachFileDAO.increaseDownloadCount(attachFileVO);
	}

}