admin
2021-04-30 cd4a4617fd33b0e25185ab2012a536821420fd80
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
package com.yeshi.buwan.util.factory.live;
 
import com.yeshi.buwan.domain.live.TVLiveChannel;
import com.yeshi.buwan.live.migu.MiGuLiveListInfo;
import com.yeshi.buwan.util.StringUtil;
 
public class TVLiveChannelFactory {
 
    public static TVLiveChannel create(MiGuLiveListInfo miGuLiveListInfo) {
        TVLiveChannel channel = new TVLiveChannel();
        channel.sethPicture(miGuLiveListInfo.getH5pics().getHighResolutionH());
        channel.setvPicture(miGuLiveListInfo.getH5pics().getHighResolutionV());
        channel.setName(miGuLiveListInfo.getName());
        channel.setId(StringUtil.Md5(channel.getName()));
        if (miGuLiveListInfo.getNow() != null) {
            channel.setNowProgram(miGuLiveListInfo.getNow().getPlayName());
            channel.setNowProgramTime(miGuLiveListInfo.getNow().getStartTime() + "-" + miGuLiveListInfo.getNow().getEndTime());
        }
        if (miGuLiveListInfo.getNext() != null) {
            channel.setNextProgram(miGuLiveListInfo.getNext().getPlayName());
            channel.setNextProgramTime(miGuLiveListInfo.getNext().getStartTime() + "-" + miGuLiveListInfo.getNext().getEndTime());
        }
        channel.setState(TVLiveChannel.STATE_NORMAL);
        return channel;
    }
 
 
}