Commit df6bba2a2227b04b8a58563fb8fcef3ad85fc506
1 parent
f6e9c77b
添加抽帧时长限制
Showing
2 changed files
with
13 additions
and
6 deletions
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
| @@ -96,6 +96,7 @@ public class VideosControllerApi { | @@ -96,6 +96,7 @@ public class VideosControllerApi { | ||
| 96 | shyVideos.setState(CommonConst.AUDIT_INTT); | 96 | shyVideos.setState(CommonConst.AUDIT_INTT); |
| 97 | shyVideos.setBucket(json.getString("bucketName")); | 97 | shyVideos.setBucket(json.getString("bucketName")); |
| 98 | shyVideos.setPlat(json.getInteger("bucketType")); | 98 | shyVideos.setPlat(json.getInteger("bucketType")); |
| 99 | + shyVideos.setDuration(json.getInteger("duration")); | ||
| 99 | boolean YorN = videosService.updateshyVideos(shyVideos); | 100 | boolean YorN = videosService.updateshyVideos(shyVideos); |
| 100 | if (YorN == true) { | 101 | if (YorN == true) { |
| 101 | return new ResponseBean(ErrorEnum.SUCCESS); | 102 | return new ResponseBean(ErrorEnum.SUCCESS); |
| @@ -126,10 +127,11 @@ public class VideosControllerApi { | @@ -126,10 +127,11 @@ public class VideosControllerApi { | ||
| 126 | shyVideos1.setState(CommonConst.AUDIT_INTT); | 127 | shyVideos1.setState(CommonConst.AUDIT_INTT); |
| 127 | shyVideos1.setBucket(json.getString("bucketName")); | 128 | shyVideos1.setBucket(json.getString("bucketName")); |
| 128 | shyVideos1.setPlat(json.getInteger("bucketType")); | 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 | boolean result = videosService.impotVideo(shyVideos1); | 135 | boolean result = videosService.impotVideo(shyVideos1); |
| 134 | if (result == true) { | 136 | if (result == true) { |
| 135 | return new ResponseBean(ErrorEnum.SUCCESS); | 137 | return new ResponseBean(ErrorEnum.SUCCESS); |
src/main/java/com/cnlive/shenhe/job/UsersSiteJob.java
| @@ -71,7 +71,7 @@ public class UsersSiteJob { | @@ -71,7 +71,7 @@ public class UsersSiteJob { | ||
| 71 | //用户信息入库 | 71 | //用户信息入库 |
| 72 | JSONObject user = data.getJSONObject(i); | 72 | JSONObject user = data.getJSONObject(i); |
| 73 | Integer id = user.getInteger("sid"); | 73 | Integer id = user.getInteger("sid"); |
| 74 | - String user_id = CommonUtils.md5(id+""); | 74 | + String user_id = CommonUtils.md5(id + ""); |
| 75 | String email = user.getString("email"); | 75 | String email = user.getString("email"); |
| 76 | Integer spid = user.getInteger("new_sp_id"); | 76 | Integer spid = user.getInteger("new_sp_id"); |
| 77 | String userLogo = user.getString("userLogo"); | 77 | String userLogo = user.getString("userLogo"); |
| @@ -108,10 +108,15 @@ public class UsersSiteJob { | @@ -108,10 +108,15 @@ public class UsersSiteJob { | ||
| 108 | ShySites shySites = new ShySites(); | 108 | ShySites shySites = new ShySites(); |
| 109 | shySites.setSpid(spid); | 109 | shySites.setSpid(spid); |
| 110 | List<ShySites> shySitesList = shySitesMapper.select(shySites); | 110 | List<ShySites> shySitesList = shySitesMapper.select(shySites); |
| 111 | - if(shySitesList.isEmpty()){ | 111 | + if (shySitesList.isEmpty()) { |
| 112 | shySites.setCompany(company); | 112 | shySites.setCompany(company); |
| 113 | shySites.setName(company_brief); | 113 | shySites.setName(company_brief); |
| 114 | shySitesMapper.insertSelective(shySites); | 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 | } |