package com.bb.service;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

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

import com.bb.dao.SettingDao;
import com.bb.model.BlockGameVO;
import com.bb.model.CmnSearch;
import com.bb.model.SiteVendorSkinVO;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
public class SettingServiceImpl implements SettingService {

	@Autowired
	SettingDao settingDao;
	
	
	@Override
	public List<HashMap<String, Object>> getSettingVendorList(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getSettingVendorList(search);
	}


	@Override
	public List<HashMap<String, Object>> getSettingSkinList(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getSettingSkinList(search);
	}


	@Override
	public int settingVendorSkinSave(SiteVendorSkinVO item) {
		// TODO Auto-generated method stub
		return settingDao.settingVendorSkinSave(item);
	}


	@Override
	public List<String> getWhiteIpList(CmnSearch search) {
		// TODO Auto-generated method stub
		String ipListStr = settingDao.getWhiteIpListStr(search);
		List<String> ipList = null;
		try {
			ipList = Arrays.asList(ipListStr.split(","));
		} catch (Exception e) {
			log.error("#-API::SETTING::whiteIpList::"+search.getSiteIdx()+"::::" + "Exception::"+e.getMessage());
		}
		
		return ipList;
	}


	@Override
	public List<HashMap<String, Object>> getBlockVendorSelectBoxList(String category) {
		// TODO Auto-generated method stub
		return settingDao.getBlockVendorSelectBoxList(category);
	}


	@Override
	public List<HashMap<String, Object>> getBlockVendorSelectBoxList2(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getBlockVendorSelectBoxList2(search);
	}


	@Override
	public List<HashMap<String, Object>> getBlockTableSelectBoxList(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getBlockTableSelectBoxList(search);
	}


	@Override
	public String getBlockTableIds(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getBlockTableIds(search);
	}


	@Override
	public int blockTableIdSave(BlockGameVO blockGameVO) {
		// TODO Auto-generated method stub
		return settingDao.blockTableIdSave(blockGameVO);
	}


	@Override
	public String getVendorTitle(CmnSearch search) {
		// TODO Auto-generated method stub
		return settingDao.getVendorTitle(search);
	}


	@Override
	public HashMap<String, String> getBetRadarApiInfo(String siteId) {
		// TODO Auto-generated method stub
		return settingDao.getBetRadarApiInfo(siteId);
	}
}
