VideosServiceImpl.java 1.38 KB
package com.cnlive.shenhe.serviceImpl;
import com.alibaba.fastjson.JSONObject;
import com.cnlive.shenhe.entity.ShySites;
import com.cnlive.shenhe.entity.ShyVideos;
import com.cnlive.shenhe.mapper.ShySitesMapper;
import com.cnlive.shenhe.mapper.ShyVideosMapper;
import com.cnlive.shenhe.utils.CommonConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: chenhao
 * @Date: 2018/11/30 14:23
 * @Description:
 */
@Service
public class VideosServiceImpl {
    @Autowired
    ShyVideosMapper shyVideosMapper;
    @Autowired
    ShySitesMapper shySitesMapper;

    public int impotVideo(ShyVideos shyVideos){
        int result = shyVideosMapper.insert(shyVideos);
        return result;
    }
    public List<ShySites> getBusiness (ShySites shySites ){
        List<ShySites> sitesList = shySitesMapper.select(shySites);
        return sitesList;
    }
    public void updateVideo(String activity_id,int state,String attr_tags,String msg){
        ShyVideos shyVideos = new ShyVideos();
        shyVideos.setVideo_id(activity_id);
        shyVideos.setState(state);
        shyVideos.setVideo_tags(attr_tags);
        shyVideos.setMsg(msg);
        Example<ShyVideos> example = Example.of(shyVideos);
        shyVideosMapper.updateByExample(shyVideos,example);
    }
}