VideosServiceImpl.java
1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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);
}
}