package com.ssj.service.sys.menu.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ssj.bean.sys.menu.domain.WxMsgEvent;
import com.ssj.dao.sys.menu.dao.WxMsgEventDao;
import com.ssj.framework.core.common.service.BaseServiceImpl;
import com.ssj.service.sys.menu.service.WxMsgEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


@Service(version = "1.0")
public class WxMsgEventServiceImpl extends BaseServiceImpl<WxMsgEvent, String> implements WxMsgEventService {
	
	@Autowired
	private WxMsgEventDao dao;
	
	@Override
	public PagingAndSortingRepository<WxMsgEvent, String> getDao() {
		
		return null;
	}

	@Override
	public WxMsgEvent getWxMsgEventByKey(String eventKey, String event) {
		 List<WxMsgEvent>  wxMsgEvents=dao.getWxMsgEventByKey(eventKey, event);
		 if(wxMsgEvents!=null && wxMsgEvents.size()>0){
			 return wxMsgEvents.get(0);
		 }
		 return null;
	}

	@Override
	public void saveWxMsgEvent(WxMsgEvent wxMsgEvent) {
		dao.saveWxMsgEvent(wxMsgEvent.getWeixinid(), wxMsgEvent.getEvent(), wxMsgEvent.getEventKey(), wxMsgEvent.getMediaId(), wxMsgEvent.getRemark());
	}

	@Override
	public void delWxMsgEvent(String eventKey) {
		dao.delWxMsgEvent(eventKey);
	}

	
	
}



