package com.ematou.wxservice.service;

import com.ematou.wxservice.entity.pojo.Material;
import com.ematou.wxservice.mapper.MaterialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MaterialService {


    @Autowired
    private MaterialMapper materialMapper;

    public int save(Material material){
        return materialMapper.insertMaterial(material);
    }

    public int update(Material material){
        return materialMapper.updateMaterial(material);
    }

    public Material queryByMediaId(String mediaId){
        return materialMapper.queryMaterialByMediaId(mediaId);
    }

    public Material queryByFileName(String fileName){
        return materialMapper.queryMaterialByFileName(fileName);
    }
    public int deleteByMediaId(String mediaId){
        return materialMapper.deleteMaterialByMediaId(mediaId);
    }
}
