admin
2021-01-25 d182390205a9828bd1091b06fa712e028004c687
'初始化导入'
6个文件已删除
11个文件已修改
1个文件已添加
262642 ■■■■■ 已修改文件
logs/counttime.log 补丁 | 查看 | 原始文档 | blame | 历史
logs/ehcache.log 补丁 | 查看 | 原始文档 | blame | 历史
logs/iqiyi.log 70696 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/new_video.log 117297 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/new_video_error.log 74492 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/statistics.log 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/controller/parser/AdParser.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/controller/parser/HomeParser.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/controller/parser/UserParser.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/controller/parser/web/WebHomeParser.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/controller/parser/web/WebVideosParser.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/job/AdJob.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/service/imp/ConfigService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/service/imp/juhe/FunTV2ServiceImpl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/service/inter/FunTV2Service.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/util/video/VideoDetailUtil.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/newvideo/vo/AcceptData.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/log4j.properties 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
logs/counttime.log
logs/ehcache.log
logs/iqiyi.log
File was deleted
logs/new_video.log
File was deleted
logs/new_video_error.log
File was deleted
logs/statistics.log
src/main/java/com/newvideo/controller/parser/AdParser.java
@@ -194,12 +194,16 @@
        Map<String, String> map = configService.getConfigAsMap();
        JSONObject data = new JSONObject();
        if ("huawei".equalsIgnoreCase(channel)
                && Integer.parseInt(version) >= Integer.parseInt(map.get("huawei_online_version"))) {
            data.put("showAd", false);
        } else
            data.put("showAd", true);
        //分渠道控制
        String onLiningInfo = map.get("onlining_channel_info");
        if (!StringUtil.isNullOrEmpty(onLiningInfo)) {
            JSONObject obj = JSONObject.fromObject(onLiningInfo);
            String v = obj.optString(channel.toLowerCase());
            if (!StringUtil.isNullOrEmpty(v) && Integer.parseInt(version) >= Integer.parseInt(v)) {
                data.put("showAd", false);
            }
        }
        out.print(JsonUtil.loadTrueJson(data.toString()));
    }
src/main/java/com/newvideo/controller/parser/HomeParser.java
@@ -9,6 +9,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import com.newvideo.vo.AcceptData;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
@@ -588,6 +589,16 @@
        String type = request.getParameter("Type");
        String packageName = request.getParameter("Package");
        String videoId = request.getParameter("VideoId");
        String channel= request.getParameter("Channel");
        AcceptData acceptData=new AcceptData();
        acceptData.setChannel(channel);
        acceptData.setMethod(method);
        acceptData.setPackage(packageName);
        acceptData.setPlatform(platform);
        acceptData.setSystem(system);
        acceptData.setVersion(Integer.parseInt(version));
        if (StringUtil.isNullOrEmpty(method)) {
            out.print(JsonUtil.loadFalseJson("请上传Method"));
@@ -626,7 +637,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        PlayUrl pu = videoDeailUtil.getPlayUrl(detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        PlayUrl pu = videoDeailUtil.getPlayUrl(acceptData,detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))
src/main/java/com/newvideo/controller/parser/UserParser.java
@@ -132,8 +132,13 @@
                object.put("NoticeContent", map.get("play_notice_content"));
            object.put("ShowMoreApp", map.get("show_more_app"));
            //广告控制
            object.put("ShowAd", map.get("show_ad"));
            object.put("PPTVSO", map.get("pptvsourl"));
            object.put("COMMENT_ALERT", map.get("comment_alert"));
src/main/java/com/newvideo/controller/parser/web/WebHomeParser.java
@@ -933,7 +933,7 @@
        DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
        PlayUrl pu = videoDeailUtil.getPlayUrl(detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        PlayUrl pu = videoDeailUtil.getPlayUrl(null,detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
        if (pu != null) {
            if (!StringUtil.isNullOrEmpty(pu.getUrl()))
src/main/java/com/newvideo/controller/parser/web/WebVideosParser.java
@@ -360,7 +360,7 @@
            DetailSystem detailSystem = systemService.getDetailSystemByPackage(packageName);
            PlayUrl pu = videoDeailUtil.getPlayUrl(detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
            PlayUrl pu = videoDeailUtil.getPlayUrl(null,detailSystem.getId(), id, type, Integer.parseInt(resourceId), videoId);
            if (pu != null) {
                if (!StringUtil.isNullOrEmpty(pu.getUrl()))
src/main/java/com/newvideo/job/AdJob.java
@@ -14,7 +14,7 @@
/**
 * @author Administrator
 */
@Component
//@Component
public class AdJob {
    @Resource
src/main/java/com/newvideo/service/imp/ConfigService.java
@@ -43,6 +43,14 @@
        }
        return map;
    }
    @Cacheable(value = "homeCache", key = "'getConfigByKey-'+#key")
    public Config getConfigByKeyCache(String key) {
        List<Config> list = configDao.list("from Config cf where cf.key=?", new Serializable[] { key });
        if (list != null && list.size() > 0)
            return list.get(0);
        else
            return null;
    }
    public Config getConfigByKey(String key) {
        List<Config> list = configDao.list("from Config cf where cf.key=?", new Serializable[] { key });
src/main/java/com/newvideo/service/imp/juhe/FunTV2ServiceImpl.java
@@ -4,6 +4,7 @@
import com.newvideo.dao.juhe.funtv.FunTVAlbum2Dao;
import com.newvideo.dao.juhe.funtv.FunTVVideo2Dao;
import com.newvideo.dao.juhe.funtv.VideoFunTV2Dao;
import com.newvideo.domain.Config;
import com.newvideo.domain.VideoDetailInfo;
import com.newvideo.domain.VideoInfo;
import com.newvideo.domain.VideoResource;
@@ -12,18 +13,18 @@
import com.newvideo.funtv.entity.FunTVAlbum2;
import com.newvideo.funtv.entity.FunTVVideo2;
import com.newvideo.funtv.entity.VideoFunTV2;
import com.newvideo.service.imp.CategoryVideoService;
import com.newvideo.service.imp.ResourceVideoService;
import com.newvideo.service.imp.VideoInfoService;
import com.newvideo.service.imp.VideoResourceService;
import com.newvideo.service.imp.*;
import com.newvideo.service.inter.FunTV2Service;
import com.newvideo.util.JuHe.VideoConstant;
import com.newvideo.util.StringUtil;
import com.newvideo.vo.AcceptData;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Service
@@ -53,6 +54,9 @@
    @Resource
    private VideoResourceService videoResourceService;
    @Resource
    private ConfigService configService;
    @Override
@@ -192,12 +196,20 @@
    }
    @Override
    public PlayUrl getPlayUrl(String detailSystemId, int resourceId, String id, String videoId) {
    public PlayUrl getPlayUrl(AcceptData acceptData, String detailSystemId, int resourceId, String id, String videoId) {
        FunTVVideo2 video2 = funTVVideo2Dao.get(id);
        VideoResource vr = videoResourceService.getResource(resourceId + "");
        int t = FunTVUtil2.getPlayType(video2);
        int t = FunTVUtil2.PLAY_HTML;
        PlayUrl pu = new PlayUrl();
        pu.setParams("");
        Config config = configService.getConfigByKeyCache("funshion_sdk_play_channels");
        if (config != null && !StringUtil.isNullOrEmpty(config.getValue())) {
            String[] channels = config.getValue().split(",");
            if (Arrays.asList(channels).contains(acceptData.getChannel().toLowerCase())) {
                t = FunTVUtil2.PLAY_SDK;
            }
        }
        pu.setPlayType(t);
        pu.setResource(vr);
        pu.setCode(video2.getCeCode());
src/main/java/com/newvideo/service/inter/FunTV2Service.java
@@ -4,6 +4,7 @@
import com.newvideo.domain.entity.PlayUrl;
import com.newvideo.funtv.entity.FunTVAlbum2;
import com.newvideo.funtv.entity.FunTVVideo2;
import com.newvideo.vo.AcceptData;
import java.util.List;
@@ -61,7 +62,7 @@
    public int getShowType(String videoid) ;
    public PlayUrl getPlayUrl(String detailSystemId, int resourceId, String id, String videoId);
    public PlayUrl getPlayUrl(AcceptData acceptData,String detailSystemId, int resourceId, String id, String videoId);
    /**
src/main/java/com/newvideo/util/video/VideoDetailUtil.java
@@ -6,6 +6,7 @@
import com.newvideo.funtv.FunTVUtil2;
import com.newvideo.service.inter.FunTV2Service;
import com.newvideo.vo.AcceptData;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.cache.annotation.Cacheable;
@@ -320,7 +321,7 @@
    }
    @Cacheable(value = "homeCache", key = "'getPlayUrl'+'-'+#detailSystemId+'-'+#id+'-'+#type+'-'+#resourceid")
    public PlayUrl getPlayUrl(String detailSystemId, String id, String type, int resourceid, String videoid) {
    public PlayUrl getPlayUrl(AcceptData acceptData, String detailSystemId, String id, String type, int resourceid, String videoid) {
        if (resourceid == 13) {// 爱奇艺
            return iqiyiUtil.getPlayUrl(detailSystemId, resourceid + "", type, id);
        } else if (resourceid == 14) {// 搜狐
@@ -334,7 +335,7 @@
        else if (resourceid == 19)// 乐视
            return funTVService.getPlayUrl(detailSystemId, id, type, resourceid, videoid);
        else if (resourceid == FunTVUtil2.RESOURCE_ID)// 风行
            return funTV2Service.getPlayUrl(detailSystemId, resourceid, id, videoid);
            return funTV2Service.getPlayUrl(acceptData, detailSystemId, resourceid, id, videoid);
        return null;
    }
}
src/main/java/com/newvideo/vo/AcceptData.java
New file
@@ -0,0 +1,77 @@
package com.newvideo.vo;
public class AcceptData {
    private String method;
    private String device;
    private String system;
    private String sign;
    private String platform;
    private String channel;
    private Integer version;
    private String Package;
    public String getMethod() {
        return method;
    }
    public void setMethod(String method) {
        this.method = method;
    }
    public String getDevice() {
        return device;
    }
    public void setDevice(String device) {
        this.device = device;
    }
    public String getSystem() {
        return system;
    }
    public void setSystem(String system) {
        this.system = system;
    }
    public String getSign() {
        return sign;
    }
    public void setSign(String sign) {
        this.sign = sign;
    }
    public String getPlatform() {
        return platform;
    }
    public void setPlatform(String platform) {
        this.platform = platform;
    }
    public String getChannel() {
        return channel;
    }
    public void setChannel(String channel) {
        this.channel = channel;
    }
    public Integer getVersion() {
        return version;
    }
    public void setVersion(Integer version) {
        this.version = version;
    }
    public String getPackage() {
        return Package;
    }
    public void setPackage(String aPackage) {
        Package = aPackage;
    }
}
src/main/resources/log4j.properties
@@ -1,6 +1,6 @@
### 
###debug,stdout,D,E   off,file
log4j.rootLogger = info,stdout,I,E
log4j.rootLogger = INFO,stdout,I,E
### 
log4j.appender.stdout = org.apache.log4j.ConsoleAppender