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

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

import java.util.List;

@Service(version = "1.0")
public class WxMaterialServiceImpl extends BaseServiceImpl<WxMaterial, String> implements WxMaterialService {

	@Autowired
	private WxMaterialDao dao;
	
	@Override
	public PagingAndSortingRepository<WxMaterial, String> getDao() {
		
		return null;
	}

	@Override
	public List<WxMaterial> listByWxMaterial() {
		return dao.listByWxMaterial();
	}

	@Override
	public List<WxMaterial> getByWxMaterialId(String materialId) {
		return dao.getByWxMaterialId(materialId);
	}

	@Override
	public void saveWxMaterial(WxMaterial wxMaterial) {
		dao.saveWxMaterial(wxMaterial.getMediaId(), wxMaterial.getMsgType(), wxMaterial.getTitle(), wxMaterial.getAuthor(), wxMaterial.getDigest(), wxMaterial.getContent(), wxMaterial.getContentSourceUrl(), wxMaterial.getThumbMediaId(), wxMaterial.getShowCoverPic(), wxMaterial.getUrl(), wxMaterial.getThumbUrl());
		
	}

	@Override
	public void updateWxMaterialById(WxMaterial wxMaterial) {
		dao.updateWxMaterial(wxMaterial.getId(), wxMaterial.getContent(),wxMaterial.getMsgType());
		
	}


	

}
