Commit df6bba2a2227b04b8a58563fb8fcef3ad85fc506

Authored by 周伟鹏
1 parent f6e9c77b

添加抽帧时长限制

src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
... ... @@ -96,6 +96,7 @@ public class VideosControllerApi {
96 96 shyVideos.setState(CommonConst.AUDIT_INTT);
97 97 shyVideos.setBucket(json.getString("bucketName"));
98 98 shyVideos.setPlat(json.getInteger("bucketType"));
  99 + shyVideos.setDuration(json.getInteger("duration"));
99 100 boolean YorN = videosService.updateshyVideos(shyVideos);
100 101 if (YorN == true) {
101 102 return new ResponseBean(ErrorEnum.SUCCESS);
... ... @@ -126,10 +127,11 @@ public class VideosControllerApi {
126 127 shyVideos1.setState(CommonConst.AUDIT_INTT);
127 128 shyVideos1.setBucket(json.getString("bucketName"));
128 129 shyVideos1.setPlat(json.getInteger("bucketType"));
129   - //Integer duration = json.getInteger("");
130   - //if (CommonUtils.isNotNull(duration) && duration > 10) {
131   - shyVideos1 = avsample(shyVideos1);//视频长度超过10秒,请求抽帧
132   - //}
  130 + Integer duration = json.getInteger("duration");
  131 + shyVideos1.setDuration(duration);
  132 + if (CommonUtils.isNotNull(duration) && duration > 80) {
  133 + shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧
  134 + }
133 135 boolean result = videosService.impotVideo(shyVideos1);
134 136 if (result == true) {
135 137 return new ResponseBean(ErrorEnum.SUCCESS);
... ...
src/main/java/com/cnlive/shenhe/job/UsersSiteJob.java
... ... @@ -71,7 +71,7 @@ public class UsersSiteJob {
71 71 //用户信息入库
72 72 JSONObject user = data.getJSONObject(i);
73 73 Integer id = user.getInteger("sid");
74   - String user_id = CommonUtils.md5(id+"");
  74 + String user_id = CommonUtils.md5(id + "");
75 75 String email = user.getString("email");
76 76 Integer spid = user.getInteger("new_sp_id");
77 77 String userLogo = user.getString("userLogo");
... ... @@ -108,10 +108,15 @@ public class UsersSiteJob {
108 108 ShySites shySites = new ShySites();
109 109 shySites.setSpid(spid);
110 110 List<ShySites> shySitesList = shySitesMapper.select(shySites);
111   - if(shySitesList.isEmpty()){
  111 + if (shySitesList.isEmpty()) {
112 112 shySites.setCompany(company);
113 113 shySites.setName(company_brief);
114 114 shySitesMapper.insertSelective(shySites);
  115 + }else if(CommonUtils.isEmpty(shySitesList.get(0).getCompany()) || CommonUtils.isEmpty(shySitesList.get(0).getName())){
  116 + shySites = shySitesList.get(0);
  117 + shySites.setCompany(company);
  118 + shySites.setName(company_brief);
  119 + shySitesMapper.updateByPrimaryKeySelective(shySites);
115 120 }
116 121  
117 122 }
... ...