admin
2021-04-25 36aafca8d6c1964bb755fe2ae030b163b6d0f92b
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package com.yeshi.buwan.vo.video;
 
import com.yeshi.buwan.domain.solr.SolrAlbumVideo;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.util.StringUtil;
import com.yeshi.buwan.util.TimeUtil;
import com.yeshi.buwan.util.video.VideoConstant;
 
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
 
public class VideoAdminInfoVO {
 
    private String id;
    private String name;
    private String hpicture;
    private String vpicture;
    private String updatetime;
    private String show;
    private String tag;
    private Integer freeType;
    private String area;
    private List<String> resourceList;
    private String createTime;
 
    public String getArea() {
        return area;
    }
 
    public void setArea(String area) {
        this.area = area;
    }
 
    public Integer getFreeType() {
        return freeType;
    }
 
    public void setFreeType(Integer freeType) {
        this.freeType = freeType;
    }
 
    public void setShow(String show) {
        this.show = show;
    }
 
    public String getShow() {
        return show;
    }
 
    public String getTag() {
        return tag;
    }
 
    public void setTag(String tag) {
        this.tag = tag;
    }
 
    public static VideoAdminInfoVO create(VideoInfo video) {
        VideoAdminInfoVO vo = new VideoAdminInfoVO();
        vo.setId(video.getId());
        vo.setName(video.getName());
        if (video.getVideoType() != null && VideoConstant.isMainCategory(video.getVideoType().getId()))
            vo.setVpicture(video.getVpicture());
        else
            vo.setHpicture(video.getHpicture());
 
 
        vo.setShow(video.getShow() + "");
        vo.setUpdatetime(TimeUtil.getGernalTime(
                Long.parseLong(
                        StringUtil.isNullOrEmpty(video.getCreatetime() + "") ? "0" : video.getCreatetime() + ""),
                "yyyy-MM-dd"));
        vo.setTag(video.getTag());
        vo.setCreateTime(TimeUtil.getGernalTime(video.getCreatetime(), "yyyy-MM-dd"));
        return vo;
    }
 
 
    public static VideoAdminInfoVO create(SolrAlbumVideo solrVideo, Map<Long, String> resourceNameMap) {
        VideoAdminInfoVO vo = new VideoAdminInfoVO();
        vo.setId(solrVideo.getId());
        vo.setName(solrVideo.getName());
        vo.setVpicture(solrVideo.getVpicture());
        vo.setShow(solrVideo.getShow() + "");
        vo.setUpdatetime(TimeUtil.getGernalTime(
                Long.parseLong(
                        StringUtil.isNullOrEmpty(solrVideo.getUpdatetime() + "") ? "0" : solrVideo.getUpdatetime() + ""),
                "yyyy-MM-dd"));
        vo.setTag(solrVideo.getTag());
        vo.setFreeType(solrVideo.getFreeType());
        vo.setArea(solrVideo.getArea());
        vo.setHpicture(solrVideo.getHpicture());
        List<String> resources = new ArrayList<>();
        if (solrVideo.getResourceIds() != null) {
            String[] rids = solrVideo.getResourceIds().split(",");
            for (String rid : rids) {
                resources.add(resourceNameMap.get(Long.parseLong(rid)));
            }
        }
        vo.setResourceList(resources);
        vo.setCreateTime(TimeUtil.getGernalTime(Long.parseLong(solrVideo.getCreatetime()), "yyyy-MM-dd"));
        return vo;
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getUpdatetime() {
        return updatetime;
    }
 
    public void setUpdatetime(String updatetime) {
        this.updatetime = updatetime;
    }
 
    public String getHpicture() {
        return hpicture;
    }
 
    public void setHpicture(String hpicture) {
        this.hpicture = hpicture;
    }
 
    public String getVpicture() {
        return vpicture;
    }
 
    public void setVpicture(String vpicture) {
        this.vpicture = vpicture;
    }
 
    public List<String> getResourceList() {
        return resourceList;
    }
 
    public void setResourceList(List<String> resourceList) {
        this.resourceList = resourceList;
    }
 
    public String getCreateTime() {
        return createTime;
    }
 
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}