admin
2020-09-12 2778cf2a16823f9b1153a0549b47f7b503176a17
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
44
45
46
package com.yeshi.buwan.util.factory;
 
import com.yeshi.buwan.domain.SolrVideo;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.VideoTypeUtil;
 
import java.util.Date;
 
public class SolrVideoFactory {
 
 
    public static SolrVideo create(VideoInfo videoInfo) {
 
 
        SolrVideo solrVideo = new SolrVideo();
        solrVideo.setMainactor(videoInfo.getMainActor());
        solrVideo.setShow(Integer.parseInt(videoInfo.getShow()));
        solrVideo.setLatestHpicture(videoInfo.getLatestHpicture());
        solrVideo.setDuration(videoInfo.getDuration());
        solrVideo.setScore(videoInfo.getScore());
        solrVideo.setVpicture(videoInfo.getVpicture());
        solrVideo.setLatestVpicture(videoInfo.getLatestVpicture());
        solrVideo.setId(videoInfo.getId());
        solrVideo.setTag(videoInfo.getTag());
        solrVideo.setHpicture(videoInfo.getHpicture());
        solrVideo.setArea(videoInfo.getArea());
        solrVideo.setCreatetime(videoInfo.getCreatetime() + "");
        solrVideo.setWatchcount(Integer.parseInt(videoInfo.getWatchCount()));
        solrVideo.setDirector(videoInfo.getDirector());
        solrVideo.setPicture(videoInfo.getPicture());
        solrVideo.setContenttype(videoInfo.getContentType());
        solrVideo.setSolrTime(new Date());
        solrVideo.setCommentcount(videoInfo.getCommentCount());
        solrVideo.setVideocount(videoInfo.getVideocount());
        solrVideo.setName(videoInfo.getName());
        solrVideo.setUpdatetime(videoInfo.getUpdatetime());
        if (videoInfo.getVideoType() != null)
            solrVideo.setRootVideoType(videoInfo.getVideoType().getId());
        else
            solrVideo.setRootVideoType(0);
 
        solrVideo.setYear(videoInfo.getYear());
        return solrVideo;
    }
}