package com.iamberry.wechat.service.wechat.dao.impl;

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

import com.iamberry.wechat.core.entity.wx.Config;
import com.iamberry.wechat.core.entity.wx.WechatShare;
import com.iamberry.wechat.service.StaticCacheMemory;
import com.iamberry.wechat.service.mapper.ConfigMapper;
import com.iamberry.wechat.service.mapper.WechatShareMapper;
import com.iamberry.wechat.service.wechat.dao.ConfigDAO;
import com.iamberry.wechat.tools.NameUtils;

@Repository
public class ConfigDAOImpl implements ConfigDAO {
	
	@Autowired
	private WechatShareMapper wechatShareMapper;
	
	@Autowired
	private ConfigMapper configMapper;
	public void setConfigMapper(ConfigMapper configMapper) {
		this.configMapper = configMapper;
	}

	@Override
	public Config getConfig(String appId) {
		return configMapper.getConfig(appId);
	}

	@Override
	public void updateConfig(Config config) {
		configMapper.updateConfig(config);
	}

	@Override
	public int addWechatShare(WechatShare wechatShare) {
		// TODO Auto-generated method stub
		return wechatShareMapper.addWechatShare(wechatShare);
	}

	@Override
	public WechatShare selectWechatShareByHash(Integer urlHash) {
		// TODO Auto-generated method stub
		return wechatShareMapper.selectWechatShareByHash(urlHash);
	}

	@Override
	public int updateWechatShareByHash(WechatShare share) {
		// TODO Auto-generated method stub
		return wechatShareMapper.updateWechatShareByHash(share);
	}
}
