package com.style24.front.biz.service;

import java.util.Collection;

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

import com.style24.front.biz.dao.TsfWishlistDao;
import com.style24.front.support.security.session.TsfSession;
import com.style24.persistence.domain.Goods;
import com.style24.persistence.domain.Login;
import com.style24.persistence.domain.WishList;

import lombok.extern.slf4j.Slf4j;

/**
 * 위시리스트 Service
 *
 * @author gagamel
 * @since 2020. 12. 29
 */
@Service
@Slf4j
public class TsfWishlistService {

	@Autowired
	private TsfWishlistDao wishListDao;

	/**
	 * 위시리스트 달
	 *
	 * @param
	 * @return
	 * @author sowon	
	 * @since 2021. 3. 29
	 */
	public Collection<WishList> getWishListMonth(WishList wishList) {
		Login login = TsfSession.getInfo();
		wishList.setCustNo(login.getCustNo());
		return wishListDao.getWishListMonth(wishList);
	}
	
	/**
	 * 위시리스트 상품목록
	 *
	 * @param
	 * @return
	 * @author sowon	
	 * @since 2021. 3. 29
	 */
	public Collection<Goods> getWishListGoodsList(WishList wishList) {
		Login login = TsfSession.getInfo();
		wishList.setCustNo(login.getCustNo());
		return wishListDao.getWishListGoodsList(wishList);
	}
	
	/**
	 * 위시리스트 퀵 상품목록
	 *
	 * @param 
	 * @return
	 * @author sowon
	 * @date 2021. 5. 13
	 */
	public Collection<Goods> getQuickWishList(WishList wishList){
		Login login = TsfSession.getInfo();
		wishList.setCustNo(login.getCustNo());
		return wishListDao.getQuickWishList(wishList);
	}
	
	/**
	 * 위시리스트 상품여부용 
	 *
	 * @param 
	 * @return
	 * @author eskim
	 * @date 2021. 6. 30
	 */
	public int getWishListGoodsCount(String goodsCd){
		WishList wishList = new WishList();
		Login login = TsfSession.getInfo();
		wishList.setCustNo(login.getCustNo());
		wishList.setGoodsCd(goodsCd);
		return wishListDao.getWishListGoodsCount(wishList);
	}
	
	
	
}
