Commit 5e90f5ce9684af8228fdd89c9bb6685edc2bfaf5
Merge branch 'dev'
Showing
26 changed files
with
1210 additions
and
211 deletions
pom.xml
| ... | ... | @@ -51,7 +51,17 @@ |
| 51 | 51 | </exclusions> |
| 52 | 52 | </dependency> |
| 53 | 53 | |
| 54 | - | |
| 54 | + <!-- 自动更新 --> | |
| 55 | + <dependency> | |
| 56 | + <groupId>org.springframework.boot</groupId> | |
| 57 | + <artifactId>spring-boot-devtools</artifactId> | |
| 58 | + <optional>true</optional> | |
| 59 | + </dependency> | |
| 60 | + <dependency> | |
| 61 | + <groupId>org.apache.commons</groupId> | |
| 62 | + <artifactId>commons-lang3</artifactId> | |
| 63 | + <version>3.8</version> | |
| 64 | + </dependency> | |
| 55 | 65 | |
| 56 | 66 | <dependency> |
| 57 | 67 | <groupId>org.mybatis.spring.boot</groupId> |
| ... | ... | @@ -136,7 +146,6 @@ |
| 136 | 146 | <groupId>org.springframework.boot</groupId> |
| 137 | 147 | <artifactId>spring-boot-maven-plugin</artifactId> |
| 138 | 148 | </plugin> |
| 139 | - | |
| 140 | 149 | <!-- mybatis generator 自动生成代码插件 --> |
| 141 | 150 | <plugin> |
| 142 | 151 | <groupId>org.mybatis.generator</groupId> | ... | ... |
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
| ... | ... | @@ -74,6 +74,8 @@ public class VideosControllerApi { |
| 74 | 74 | shyVideos1.setVideo_id(videoId); |
| 75 | 75 | Integer duration = json.getInteger("duration"); |
| 76 | 76 | if (CommonUtils.isNotNull(duration)) duration = duration / 1000; |
| 77 | + //获取栏目分类 | |
| 78 | + String category=CommonUtils.isEmpty(json.getString("multiplecategory"))?"":json.getString("multiplecategory"); | |
| 77 | 79 | //查询一下 存在,更新 没有,插入 |
| 78 | 80 | List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1); |
| 79 | 81 | if (listshyVideos.size() > 0) { |
| ... | ... | @@ -99,6 +101,7 @@ public class VideosControllerApi { |
| 99 | 101 | shyVideos.setBucket(json.getString("bucketName")); |
| 100 | 102 | shyVideos.setPlat(json.getInteger("bucketType")); |
| 101 | 103 | shyVideos.setDuration(duration); |
| 104 | + shyVideos.setCategory(category);//传入栏目分类 | |
| 102 | 105 | boolean YorN = videosService.updateshyVideos(shyVideos); |
| 103 | 106 | if (YorN == true) { |
| 104 | 107 | return new ResponseBean(ErrorEnum.SUCCESS); |
| ... | ... | @@ -130,8 +133,17 @@ public class VideosControllerApi { |
| 130 | 133 | shyVideos1.setBucket(json.getString("bucketName")); |
| 131 | 134 | shyVideos1.setPlat(json.getInteger("bucketType")); |
| 132 | 135 | shyVideos1.setDuration(duration); |
| 133 | - if (CommonUtils.isNotNull(duration) && duration > 80) { | |
| 134 | - shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧 | |
| 136 | + shyVideos1.setCategory(category);//传入栏目分类 | |
| 137 | + | |
| 138 | + | |
| 139 | + if(!(category).equals(CommonConst.CATEGORY_WITNESS)){//如果当前栏目分类不是“目击者”,按照原有规则 | |
| 140 | + if (CommonUtils.isNotNull(duration) && duration > 80) { | |
| 141 | + shyVideos1 = avsample(shyVideos1);//视频至少可以抽8张,请求抽帧 | |
| 142 | + } | |
| 143 | + }else{ | |
| 144 | + if (CommonUtils.isNotNull(duration) ) {//"目击者"视频,直接抽帧 | |
| 145 | + shyVideos1 = avsample(shyVideos1); | |
| 146 | + } | |
| 135 | 147 | } |
| 136 | 148 | boolean result = videosService.impotVideo(shyVideos1); |
| 137 | 149 | if (result == true) { |
| ... | ... | @@ -162,8 +174,25 @@ public class VideosControllerApi { |
| 162 | 174 | |
| 163 | 175 | JSONObject attach = new JSONObject(); |
| 164 | 176 | JSONObject extParam = new JSONObject(); |
| 165 | - attach.put("interval", 10); | |
| 166 | - attach.put("strategy", 1); | |
| 177 | + | |
| 178 | + if(!video.getCategory().equals(CommonConst.CATEGORY_WITNESS)){//非“目击者”视频 | |
| 179 | + attach.put("interval", 10); | |
| 180 | + attach.put("strategy", 1); | |
| 181 | + attach.put("duration", video.getDuration()); | |
| 182 | + }else{ | |
| 183 | + if(video.getDuration()>4){//“目击者”视频时间大于4秒 | |
| 184 | + attach.put("interval", 4);//间隔 单位s | |
| 185 | + attach.put("num", video.getDuration()/4);//覆盖转码服务的默认抽帧图数量 | |
| 186 | + attach.put("duration", video.getDuration()); | |
| 187 | +// attach.put("strategy", 1);//是否从头抽到尾(1:是,优先级大于num) | |
| 188 | + }else{ | |
| 189 | + attach.put("num", 1);//抽帧图片张数 | |
| 190 | + attach.put("first", 0);//是否首帧,0:是。num=1时有效 | |
| 191 | + } | |
| 192 | + } | |
| 193 | + | |
| 194 | + | |
| 195 | + logger.info("抽帧attach参数:attach:{}", attach); | |
| 167 | 196 | extParam.put("domain", domian); |
| 168 | 197 | if (CommonConst.KS_PLAT == plat) { |
| 169 | 198 | //金山 |
| ... | ... | @@ -185,6 +214,7 @@ public class VideosControllerApi { |
| 185 | 214 | params.put("cbUrl", callback); |
| 186 | 215 | params.put("attach", attach); |
| 187 | 216 | params.put("extParam", extParam); |
| 217 | + logger.info("抽帧params参数:params:{}", params); | |
| 188 | 218 | long timestamp = new Date().getTime(); |
| 189 | 219 | String sign = CommonUtils.md5(URLEncoder.encode(appkey + timestamp + params.toJSONString() + appSecret, "utf-8")); |
| 190 | 220 | Map<String, String> dataMap = new HashMap<>(); |
| ... | ... | @@ -192,6 +222,7 @@ public class VideosControllerApi { |
| 192 | 222 | dataMap.put("params", params.toJSONString()); |
| 193 | 223 | dataMap.put("appKey", appkey); |
| 194 | 224 | dataMap.put("sign", sign); |
| 225 | + logger.info("抽帧dataMap参数:dataMap:{}", dataMap); | |
| 195 | 226 | HttpUtil httpUtil = HttpUtil.init(); |
| 196 | 227 | httpUtil.setParamMap(dataMap); |
| 197 | 228 | Map<String, String> resultMap = httpUtil.post(url); | ... | ... |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| ... | ... | @@ -81,19 +81,19 @@ public class CommentsController { |
| 81 | 81 | if (!list.isEmpty()) { |
| 82 | 82 | for (ShyComments comment : list) { |
| 83 | 83 | if (comment.getState() != CommonConst.AUDIT_INTT) { |
| 84 | - String auditor = "白名单"; | |
| 84 | + String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater())? "白名单":comment.getUpdater(); | |
| 85 | 85 | String auditor_id = comment.getAuditor_id(); |
| 86 | 86 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 87 | 87 | ShyUsers user = new ShyUsers(); |
| 88 | 88 | user.setUser_id(auditor_id); |
| 89 | 89 | user = usersService.select(user); |
| 90 | 90 | if (CommonUtils.isNotNull(user)) { |
| 91 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? "" : user.getUsername(); | |
| 92 | - String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); | |
| 93 | - auditor = userName + email; | |
| 91 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 92 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 93 | + updater = userName ; | |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | - comment.setAuditor(auditor); | |
| 96 | + comment.setUpdater(updater); | |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } | ... | ... |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| ... | ... | @@ -70,7 +70,7 @@ public class VideosController { |
| 70 | 70 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 71 | 71 | String userId = sessionUser.getUserId(); |
| 72 | 72 | ShyVideos shyVideos = videosService.selectByPrimaryKey(id); |
| 73 | - if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { | |
| 73 | +// if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { | |
| 74 | 74 | JSONObject result = null; |
| 75 | 75 | try { |
| 76 | 76 | result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); |
| ... | ... | @@ -89,14 +89,14 @@ public class VideosController { |
| 89 | 89 | return new ResponseBean(code, result.getString("msg")); |
| 90 | 90 | } |
| 91 | 91 | state = state == 4 ? 2 : 1; |
| 92 | - int i = videosService.updateVideo(id, userId, state, msg); | |
| 92 | + int i = videosService.updateVideo(id, userId,null, state, msg); | |
| 93 | 93 | if (i == 0) { |
| 94 | 94 | return new ResponseBean(ErrorEnum.ERROR); |
| 95 | 95 | } |
| 96 | 96 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 97 | - } | |
| 98 | - logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); | |
| 99 | - return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "领取逻辑不符,不能审核"); | |
| 97 | +// } | |
| 98 | +// logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); | |
| 99 | +// return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "领取逻辑不符,不能审核"); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
| ... | ... | @@ -128,19 +128,19 @@ public class VideosController { |
| 128 | 128 | if (!list.isEmpty()) { |
| 129 | 129 | for (ShyVideos videos : list) { |
| 130 | 130 | if (videos.getState() != CommonConst.AUDIT_INTT) { |
| 131 | - String auditor = "白名单"; | |
| 131 | + String updater =CommonUtils.isEmpty(videos.getUpdater()) || "null".equals(videos.getUpdater())? "白名单":videos.getUpdater(); | |
| 132 | 132 | String auditor_id = videos.getAuditor_id(); |
| 133 | 133 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 134 | 134 | ShyUsers user = new ShyUsers(); |
| 135 | 135 | user.setUser_id(auditor_id); |
| 136 | 136 | user = usersService.select(user); |
| 137 | 137 | if (CommonUtils.isNotNull(user)) { |
| 138 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? "" : user.getUsername(); | |
| 139 | - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 140 | - auditor = userName + email; | |
| 138 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 139 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 140 | + updater = userName; | |
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | - videos.setAuditor(auditor); | |
| 143 | + videos.setUpdater(updater); | |
| 144 | 144 | } |
| 145 | 145 | //显示spid简称 |
| 146 | 146 | ShySites shySites = sitesService.findspidDescByspid(videos.getSpid()); |
| ... | ... | @@ -223,6 +223,12 @@ public class VideosController { |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
| 226 | + /** | |
| 227 | + * 退领 | |
| 228 | + * @param ids | |
| 229 | + * @param session | |
| 230 | + * @return | |
| 231 | + */ | |
| 226 | 232 | @PostMapping("/retReceive") |
| 227 | 233 | @ResponseBody |
| 228 | 234 | public ResponseBean retReceive(String ids, HttpSession session) { |
| ... | ... | @@ -260,7 +266,7 @@ public class VideosController { |
| 260 | 266 | if (spid == 0) spid = null; |
| 261 | 267 | List<ShyVideos> shyVideosList = videosService.findByCondition(video_title, start_date, end_date, state, receive, video_priority, orderByClause, spid, userId); |
| 262 | 268 | String fileName = "点播数据"; |
| 263 | - String auditor = "";//审核员名字 | |
| 269 | + String updater = "";//审核员名字 | |
| 264 | 270 | String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核 |
| 265 | 271 | XSSFWorkbook wb = new XSSFWorkbook(); |
| 266 | 272 | ServletOutputStream out = null; |
| ... | ... | @@ -316,20 +322,20 @@ public class VideosController { |
| 316 | 322 | cell = row.createCell(5);//列 |
| 317 | 323 | /* 审核员需要做处理*/ |
| 318 | 324 | if (shyVideosList.get(i).getState() != CommonConst.AUDIT_INTT) { |
| 319 | - auditor = "白名单"; | |
| 325 | + updater = CommonUtils.isEmpty(shyVideosList.get(i).getUpdater()) || "null".equals(shyVideosList.get(i).getUpdater())? "白名单":shyVideosList.get(i).getUpdater(); | |
| 320 | 326 | String auditor_id = shyVideosList.get(i).getAuditor_id(); |
| 321 | 327 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 322 | 328 | ShyUsers user = new ShyUsers(); |
| 323 | 329 | user.setUser_id(auditor_id); |
| 324 | 330 | user = usersService.select(user); |
| 325 | 331 | if (CommonUtils.isNotNull(user)) { |
| 326 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? "" : user.getUsername(); | |
| 327 | - String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 328 | - auditor = userName + email; | |
| 332 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 333 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 334 | + updater = userName ; | |
| 329 | 335 | } |
| 330 | 336 | } |
| 331 | 337 | } |
| 332 | - cell.setCellValue(auditor); | |
| 338 | + cell.setCellValue(updater); | |
| 333 | 339 | cell = row.createCell(6);//列 |
| 334 | 340 | cell.setCellValue(shyVideosList.get(i).getMsg()); |
| 335 | 341 | cell = row.createCell(7);//列 |
| ... | ... | @@ -433,7 +439,7 @@ public class VideosController { |
| 433 | 439 | showMsg = showMsg + "," + shyVideos.getVideo_title() + " " + result.getString("msg"); |
| 434 | 440 | break; |
| 435 | 441 | } |
| 436 | - int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId, 2, msg); | |
| 442 | + int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId,null, 2, msg); | |
| 437 | 443 | if (i == 0) { |
| 438 | 444 | showMsg = showMsg + "," + shyVideos.getVideo_title() + " 更新失败"; |
| 439 | 445 | break; | ... | ... |
src/main/java/com/cnlive/shenhe/entity/ShyComments.java
| 1 | 1 | package com.cnlive.shenhe.entity; |
| 2 | 2 | |
| 3 | -import javax.persistence.Id; | |
| 4 | -import javax.persistence.Table; | |
| 5 | -import javax.persistence.Transient; | |
| 6 | 3 | import java.util.Date; |
| 4 | +import javax.persistence.*; | |
| 7 | 5 | |
| 8 | 6 | @Table(name = "shy_comments") |
| 9 | 7 | public class ShyComments { |
| ... | ... | @@ -115,12 +113,7 @@ public class ShyComments { |
| 115 | 113 | * 领取人id |
| 116 | 114 | */ |
| 117 | 115 | private String receive_user_id; |
| 118 | - | |
| 119 | - /** | |
| 120 | - * 审核员 | |
| 121 | - */ | |
| 122 | - @Transient | |
| 123 | - private String auditor; | |
| 116 | + | |
| 124 | 117 | |
| 125 | 118 | /** |
| 126 | 119 | * @return id |
| ... | ... | @@ -538,11 +531,5 @@ public class ShyComments { |
| 538 | 531 | this.receive_user_id = receive_user_id; |
| 539 | 532 | } |
| 540 | 533 | |
| 541 | - public String getAuditor() { | |
| 542 | - return auditor; | |
| 543 | - } | |
| 544 | - | |
| 545 | - public void setAuditor(String auditor) { | |
| 546 | - this.auditor = auditor; | |
| 547 | - } | |
| 534 | + | |
| 548 | 535 | } |
| 549 | 536 | \ No newline at end of file | ... | ... |
src/main/java/com/cnlive/shenhe/entity/ShySites.java
| 1 | 1 | package com.cnlive.shenhe.entity; |
| 2 | 2 | |
| 3 | -import javax.persistence.Id; | |
| 4 | -import javax.persistence.Table; | |
| 5 | -import javax.persistence.Transient; | |
| 6 | 3 | import java.util.Date; |
| 4 | +import javax.persistence.*; | |
| 7 | 5 | |
| 8 | 6 | @Table(name = "shy_sites") |
| 9 | 7 | public class ShySites { |
| ... | ... | @@ -32,11 +30,13 @@ public class ShySites { |
| 32 | 30 | * 免审业务,多种用,分割 |
| 33 | 31 | */ |
| 34 | 32 | private String write_business; |
| 33 | + | |
| 35 | 34 | /** |
| 36 | 35 | * 免审业务名称 |
| 37 | 36 | */ |
| 38 | 37 | @Transient |
| 39 | 38 | private String write_business_name; |
| 39 | + | |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * @return id |
| ... | ... | @@ -162,11 +162,12 @@ public class ShySites { |
| 162 | 162 | this.write_business = write_business; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - public String getWrite_business_name() { | |
| 166 | - return write_business_name; | |
| 167 | - } | |
| 165 | + public String getWrite_business_name() { | |
| 166 | + return write_business_name; | |
| 167 | + } | |
| 168 | 168 | |
| 169 | - public void setWrite_business_name(String write_business_name) { | |
| 170 | - this.write_business_name = write_business_name; | |
| 171 | - } | |
| 169 | + public void setWrite_business_name(String write_business_name) { | |
| 170 | + this.write_business_name = write_business_name; | |
| 171 | + } | |
| 172 | + | |
| 172 | 173 | } |
| 173 | 174 | \ No newline at end of file | ... | ... |
src/main/java/com/cnlive/shenhe/entity/ShyUsers.java
src/main/java/com/cnlive/shenhe/entity/ShyVideofilter.java
0 → 100644
| 1 | +package com.cnlive.shenhe.entity; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +import javax.persistence.*; | |
| 6 | + | |
| 7 | +@Table(name = "shy_videofilter") | |
| 8 | +public class ShyVideofilter { | |
| 9 | + @Id | |
| 10 | + private Integer id; | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * videos表id | |
| 14 | + */ | |
| 15 | + private Integer videos_id; | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * tokenId | |
| 19 | + */ | |
| 20 | + private String token_id; | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 尺度,空:null(最严),用户:DYNAMIC_USER,商家:DYNAMIC_BUSINESS,新闻:DYNAMIC_NEWS | |
| 24 | + */ | |
| 25 | + private String channel; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 结果状态:通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 29 | + */ | |
| 30 | + private String result_type; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 详情消息 | |
| 34 | + */ | |
| 35 | + private String desc_msg; | |
| 36 | + | |
| 37 | + private Date created_at; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * @return id | |
| 41 | + */ | |
| 42 | + public Integer getId() { | |
| 43 | + return id; | |
| 44 | + } | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * @param id | |
| 48 | + */ | |
| 49 | + public void setId(Integer id) { | |
| 50 | + this.id = id; | |
| 51 | + } | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 获取videos表id | |
| 55 | + * | |
| 56 | + * @return videos_id - videos表id | |
| 57 | + */ | |
| 58 | + public Integer getVideos_id() { | |
| 59 | + return videos_id; | |
| 60 | + } | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 设置videos表id | |
| 64 | + * | |
| 65 | + * @param videos_id videos表id | |
| 66 | + */ | |
| 67 | + public void setVideos_id(Integer videos_id) { | |
| 68 | + this.videos_id = videos_id; | |
| 69 | + } | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 获取tokenId | |
| 73 | + * | |
| 74 | + * @return token_id - tokenId | |
| 75 | + */ | |
| 76 | + public String getToken_id() { | |
| 77 | + return token_id; | |
| 78 | + } | |
| 79 | + | |
| 80 | + /** | |
| 81 | + * 设置tokenId | |
| 82 | + * | |
| 83 | + * @param token_id tokenId | |
| 84 | + */ | |
| 85 | + public void setToken_id(String token_id) { | |
| 86 | + this.token_id = token_id; | |
| 87 | + } | |
| 88 | + | |
| 89 | + /** | |
| 90 | + * 获取尺度,空:null(最严),用户:DYNAMIC_USER,商家:DYNAMIC_BUSINESS,新闻:DYNAMIC_NEWS | |
| 91 | + * | |
| 92 | + * @return channel - 尺度,空:null(最严),用户:DYNAMIC_USER,商家:DYNAMIC_BUSINESS,新闻:DYNAMIC_NEWS | |
| 93 | + */ | |
| 94 | + public String getChannel() { | |
| 95 | + return channel; | |
| 96 | + } | |
| 97 | + | |
| 98 | + /** | |
| 99 | + * 设置尺度,空:null(最严),用户:DYNAMIC_USER,商家:DYNAMIC_BUSINESS,新闻:DYNAMIC_NEWS | |
| 100 | + * | |
| 101 | + * @param channel 尺度,空:null(最严),用户:DYNAMIC_USER,商家:DYNAMIC_BUSINESS,新闻:DYNAMIC_NEWS | |
| 102 | + */ | |
| 103 | + public void setChannel(String channel) { | |
| 104 | + this.channel = channel; | |
| 105 | + } | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * 获取结果状态:通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 109 | + * | |
| 110 | + * @return result_type - 结果状态:通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 111 | + */ | |
| 112 | + public String getResult_type() { | |
| 113 | + return result_type; | |
| 114 | + } | |
| 115 | + | |
| 116 | + /** | |
| 117 | + * 设置结果状态:通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 118 | + * | |
| 119 | + * @param result_type 结果状态:通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 120 | + */ | |
| 121 | + public void setResult_type(String result_type) { | |
| 122 | + this.result_type = result_type; | |
| 123 | + } | |
| 124 | + | |
| 125 | + /** | |
| 126 | + * 获取详情消息 | |
| 127 | + * | |
| 128 | + * @return desc_msg - 详情消息 | |
| 129 | + */ | |
| 130 | + public String getDesc_msg() { | |
| 131 | + return desc_msg; | |
| 132 | + } | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * 设置详情消息 | |
| 136 | + * | |
| 137 | + * @param desc_msg 详情消息 | |
| 138 | + */ | |
| 139 | + public void setDesc_msg(String desc_msg) { | |
| 140 | + this.desc_msg = desc_msg; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public Date getCreated_at() { | |
| 144 | + return created_at; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setCreated_at(Date created_at) { | |
| 148 | + this.created_at = created_at; | |
| 149 | + } | |
| 150 | + | |
| 151 | +} | |
| 0 | 152 | \ No newline at end of file | ... | ... |
src/main/java/com/cnlive/shenhe/entity/ShyVideos.java
| ... | ... | @@ -94,21 +94,11 @@ public class ShyVideos { |
| 94 | 94 | private String receive_user_id; |
| 95 | 95 | |
| 96 | 96 | /** |
| 97 | - * 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败 | |
| 97 | + * 是否抽帧 | |
| 98 | 98 | */ |
| 99 | 99 | private Integer avsample; |
| 100 | 100 | |
| 101 | 101 | /** |
| 102 | - * 抽帧图片地址 | |
| 103 | - */ | |
| 104 | - private String avsample_imgs; | |
| 105 | - | |
| 106 | - /** | |
| 107 | - * 抽帧返回信息(主要找问题时使用) | |
| 108 | - */ | |
| 109 | - private String avsample_msg; | |
| 110 | - | |
| 111 | - /** | |
| 112 | 102 | * 抽帧请求标记 |
| 113 | 103 | */ |
| 114 | 104 | private String task_id; |
| ... | ... | @@ -128,27 +118,24 @@ public class ShyVideos { |
| 128 | 118 | */ |
| 129 | 119 | private Integer duration; |
| 130 | 120 | |
| 131 | - @Transient | |
| 132 | - private String auditor; | |
| 121 | + /** | |
| 122 | + * 栏目分类 | |
| 123 | + */ | |
| 124 | + private String category; | |
| 133 | 125 | |
| 126 | + /** | |
| 127 | + * 抽帧图片地址 | |
| 128 | + */ | |
| 129 | + private String avsample_imgs; | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * 抽帧返回信息(主要找问题时使用) | |
| 133 | + */ | |
| 134 | + private String avsample_msg; | |
| 135 | + | |
| 134 | 136 | @Transient |
| 135 | 137 | private String spid_desc; |
| 136 | - | |
| 137 | - public String getSpid_desc() { | |
| 138 | - return spid_desc; | |
| 139 | - } | |
| 140 | - | |
| 141 | - public void setSpid_desc(String spid_desc) { | |
| 142 | - this.spid_desc = spid_desc; | |
| 143 | - } | |
| 144 | - | |
| 145 | - public String getAuditor() { | |
| 146 | - return auditor; | |
| 147 | - } | |
| 148 | - | |
| 149 | - public void setAuditor(String auditor) { | |
| 150 | - this.auditor = auditor; | |
| 151 | - } | |
| 138 | + | |
| 152 | 139 | |
| 153 | 140 | /** |
| 154 | 141 | * @return id |
| ... | ... | @@ -505,60 +492,24 @@ public class ShyVideos { |
| 505 | 492 | } |
| 506 | 493 | |
| 507 | 494 | /** |
| 508 | - * 获取抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败 | |
| 495 | + * 获取是否抽帧 | |
| 509 | 496 | * |
| 510 | - * @return avsample - 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败 | |
| 497 | + * @return avsample - 是否抽帧 | |
| 511 | 498 | */ |
| 512 | 499 | public Integer getAvsample() { |
| 513 | 500 | return avsample; |
| 514 | 501 | } |
| 515 | 502 | |
| 516 | 503 | /** |
| 517 | - * 设置抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败 | |
| 504 | + * 设置是否抽帧 | |
| 518 | 505 | * |
| 519 | - * @param avsample 抽帧状态:0:未抽帧;1:抽帧中;2:抽帧成功;3:抽帧失败 | |
| 506 | + * @param avsample 是否抽帧 | |
| 520 | 507 | */ |
| 521 | 508 | public void setAvsample(Integer avsample) { |
| 522 | 509 | this.avsample = avsample; |
| 523 | 510 | } |
| 524 | 511 | |
| 525 | 512 | /** |
| 526 | - * 获取抽帧图片地址 | |
| 527 | - * | |
| 528 | - * @return avsample_imgs - 抽帧图片地址 | |
| 529 | - */ | |
| 530 | - public String getAvsample_imgs() { | |
| 531 | - return avsample_imgs; | |
| 532 | - } | |
| 533 | - | |
| 534 | - /** | |
| 535 | - * 设置抽帧图片地址 | |
| 536 | - * | |
| 537 | - * @param avsample_imgs 抽帧图片地址 | |
| 538 | - */ | |
| 539 | - public void setAvsample_imgs(String avsample_imgs) { | |
| 540 | - this.avsample_imgs = avsample_imgs; | |
| 541 | - } | |
| 542 | - | |
| 543 | - /** | |
| 544 | - * 获取抽帧返回信息(主要找问题时使用) | |
| 545 | - * | |
| 546 | - * @return avsample_msg - 抽帧返回信息(主要找问题时使用) | |
| 547 | - */ | |
| 548 | - public String getAvsample_msg() { | |
| 549 | - return avsample_msg; | |
| 550 | - } | |
| 551 | - | |
| 552 | - /** | |
| 553 | - * 设置抽帧返回信息(主要找问题时使用) | |
| 554 | - * | |
| 555 | - * @param avsample_msg 抽帧返回信息(主要找问题时使用) | |
| 556 | - */ | |
| 557 | - public void setAvsample_msg(String avsample_msg) { | |
| 558 | - this.avsample_msg = avsample_msg; | |
| 559 | - } | |
| 560 | - | |
| 561 | - /** | |
| 562 | 513 | * 获取抽帧请求标记 |
| 563 | 514 | * |
| 564 | 515 | * @return task_id - 抽帧请求标记 |
| ... | ... | @@ -629,4 +580,67 @@ public class ShyVideos { |
| 629 | 580 | public void setDuration(Integer duration) { |
| 630 | 581 | this.duration = duration; |
| 631 | 582 | } |
| 583 | + | |
| 584 | + /** | |
| 585 | + * 获取栏目分类 | |
| 586 | + * | |
| 587 | + * @return category - 栏目分类 | |
| 588 | + */ | |
| 589 | + public String getCategory() { | |
| 590 | + return category; | |
| 591 | + } | |
| 592 | + | |
| 593 | + /** | |
| 594 | + * 设置栏目分类 | |
| 595 | + * | |
| 596 | + * @param category 栏目分类 | |
| 597 | + */ | |
| 598 | + public void setCategory(String category) { | |
| 599 | + this.category = category; | |
| 600 | + } | |
| 601 | + | |
| 602 | + /** | |
| 603 | + * 获取抽帧图片地址 | |
| 604 | + * | |
| 605 | + * @return avsample_imgs - 抽帧图片地址 | |
| 606 | + */ | |
| 607 | + public String getAvsample_imgs() { | |
| 608 | + return avsample_imgs; | |
| 609 | + } | |
| 610 | + | |
| 611 | + /** | |
| 612 | + * 设置抽帧图片地址 | |
| 613 | + * | |
| 614 | + * @param avsample_imgs 抽帧图片地址 | |
| 615 | + */ | |
| 616 | + public void setAvsample_imgs(String avsample_imgs) { | |
| 617 | + this.avsample_imgs = avsample_imgs; | |
| 618 | + } | |
| 619 | + | |
| 620 | + /** | |
| 621 | + * 获取抽帧返回信息(主要找问题时使用) | |
| 622 | + * | |
| 623 | + * @return avsample_msg - 抽帧返回信息(主要找问题时使用) | |
| 624 | + */ | |
| 625 | + public String getAvsample_msg() { | |
| 626 | + return avsample_msg; | |
| 627 | + } | |
| 628 | + | |
| 629 | + /** | |
| 630 | + * 设置抽帧返回信息(主要找问题时使用) | |
| 631 | + * | |
| 632 | + * @param avsample_msg 抽帧返回信息(主要找问题时使用) | |
| 633 | + */ | |
| 634 | + public void setAvsample_msg(String avsample_msg) { | |
| 635 | + this.avsample_msg = avsample_msg; | |
| 636 | + } | |
| 637 | + | |
| 638 | + public String getSpid_desc() { | |
| 639 | + return spid_desc; | |
| 640 | + } | |
| 641 | + | |
| 642 | + public void setSpid_desc(String spid_desc) { | |
| 643 | + this.spid_desc = spid_desc; | |
| 644 | + } | |
| 645 | + | |
| 632 | 646 | } |
| 633 | 647 | \ No newline at end of file | ... | ... |
src/main/java/com/cnlive/shenhe/job/VideosJob.java
| 1 | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | |
| 3 | -import com.alibaba.fastjson.JSONObject; | |
| 4 | -import com.cnlive.shenhe.entity.ShySites; | |
| 5 | 3 | import com.cnlive.shenhe.entity.ShyVideos; |
| 6 | 4 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 7 | 5 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| ... | ... | @@ -9,15 +7,12 @@ import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 9 | 7 | import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; |
| 10 | 8 | import com.cnlive.shenhe.utils.AuditPass; |
| 11 | 9 | import com.cnlive.shenhe.utils.CommonConst; |
| 12 | -import com.cnlive.shenhe.utils.CommonUtils; | |
| 13 | 10 | import org.slf4j.Logger; |
| 14 | 11 | import org.slf4j.LoggerFactory; |
| 15 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | 13 | import org.springframework.scheduling.annotation.Scheduled; |
| 17 | 14 | import org.springframework.stereotype.Component; |
| 18 | 15 | |
| 19 | -import java.util.ArrayList; | |
| 20 | -import java.util.Arrays; | |
| 21 | 16 | import java.util.List; |
| 22 | 17 | |
| 23 | 18 | @Component |
| ... | ... | @@ -35,20 +30,13 @@ public class VideosJob { |
| 35 | 30 | VideosServiceImpl videosService; |
| 36 | 31 | |
| 37 | 32 | |
| 33 | + /** | |
| 34 | + * 白名单sp视频通过 | |
| 35 | + */ | |
| 38 | 36 | @Scheduled(fixedRate = 60 * 1000) |
| 39 | 37 | public void updateVideos() { |
| 40 | - //收集免审的spid | |
| 41 | - List<ShySites> sitesList = sitesService.findAll(); | |
| 42 | - ArrayList<Integer> sites = new ArrayList<Integer>(); | |
| 43 | - for (ShySites shySites : sitesList) { | |
| 44 | - if (CommonUtils.isNotEmpty(shySites.getWrite_business())) { | |
| 45 | - String[] business = shySites.getWrite_business().split(","); | |
| 46 | - List<String> asList = Arrays.asList(business); | |
| 47 | - if (asList.contains(CommonConst.BUSINESS_VIDEO + "")) { | |
| 48 | - sites.add(shySites.getSpid()); | |
| 49 | - } | |
| 50 | - } | |
| 51 | - } | |
| 38 | + //获取所有点播免审sp | |
| 39 | + List<Integer> sites = sitesService.getBusinessList(); | |
| 52 | 40 | //遍历免审的spid去更改状态值 |
| 53 | 41 | ShyVideos shyVideos = new ShyVideos(); |
| 54 | 42 | for (int spid : sites) { |
| ... | ... | @@ -57,25 +45,55 @@ public class VideosJob { |
| 57 | 45 | List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); |
| 58 | 46 | if (shyVideosList.size() > 0) { |
| 59 | 47 | for (ShyVideos video : shyVideosList) { |
| 60 | - JSONObject result = new JSONObject(); | |
| 61 | - try { | |
| 62 | - result = Pass.auditPass(video.getVideo_id(), 3, "", "", video.getCallback()); | |
| 63 | - Integer code = result.getInteger("code"); | |
| 64 | - if (0 == code) { | |
| 65 | - int i = videosService.updateVideo(video.getId(), null, CommonConst.AUDIT_SUCCESS, result.getString("msg")); | |
| 66 | - if (i != 1) { | |
| 67 | - logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id()); | |
| 68 | - } | |
| 69 | - } else { | |
| 70 | - videosService.updateVideo(video.getId(), null, CommonConst.AUDIT_CALLBACK_FAIL, "白名单回调失败"); | |
| 71 | - logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg")); | |
| 72 | - } | |
| 73 | - } catch (Exception e) { | |
| 74 | - logger.error("点播视频回调失败,activity_id:{}", video.getVideo_id(),e); | |
| 75 | - } | |
| 48 | + logger.info("白名单自动通过的videos_id:"+video.getId()); | |
| 49 | + video.setUpdater("白名单"); | |
| 50 | + //更新点播和审核的视频状态 | |
| 51 | + videosService.updateDianboAndShenhe(video,3); | |
| 76 | 52 | } |
| 77 | 53 | } |
| 78 | 54 | } |
| 79 | 55 | } |
| 80 | - | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 定时发送数美检测视频 | |
| 59 | + */ | |
| 60 | + @Scheduled(cron="0 0/1 7-23 * * ? ")//每天7点到23点执行,每分钟一次 | |
| 61 | + public void videofilter() { | |
| 62 | + ShyVideos shyVideos = new ShyVideos(); | |
| 63 | + shyVideos.setCategory(CommonConst.CATEGORY_WITNESS);//目击者 | |
| 64 | + shyVideos.setState(CommonConst.AUDIT_INTT);//待审核状态 | |
| 65 | + shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS);//抽帧完成 | |
| 66 | + List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | |
| 67 | + //获取所有点播免审sp | |
| 68 | + List<Integer> sites = sitesService.getBusinessList(); | |
| 69 | + if (shyVideosList.size() > 0) { | |
| 70 | + for (ShyVideos video : shyVideosList) { | |
| 71 | + if(sites.contains(video.getSpid())){//点播免审sp里面包含视频的sp,则跳过 | |
| 72 | + continue; | |
| 73 | + } | |
| 74 | + logger.info("定时发送数美检测的videos_id:"+video.getId()); | |
| 75 | + //数美图片过滤 | |
| 76 | + videosService.videoFilter(video.getId(),CommonConst.DYNAMIC_USER); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + } | |
| 80 | + | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * 自动退领 | |
| 84 | + */ | |
| 85 | + @Scheduled(cron="0 0 0 * * ? ")//每天0点执行 | |
| 86 | + public void autoRetReceive() { | |
| 87 | + ShyVideos shyVideos = new ShyVideos(); | |
| 88 | + shyVideos.setState(CommonConst.AUDIT_INTT);//审核状态:未审核 | |
| 89 | + shyVideos.setReceive(CommonConst.RECEIVE_AFTER);//已领取 | |
| 90 | + List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); | |
| 91 | + for (ShyVideos shyVideos2 : shyVideosList) { | |
| 92 | + logger.info("自动退领的videos_id:"+shyVideos2.getId()); | |
| 93 | + shyVideos2.setReceive(CommonConst.RECEIVE_BEFORE);//未领取 | |
| 94 | + shyVideos2.setReceive_user_id(null); | |
| 95 | + videosService.updateshyVideos(shyVideos2); | |
| 96 | + } | |
| 97 | + } | |
| 98 | + | |
| 81 | 99 | } | ... | ... |
src/main/java/com/cnlive/shenhe/mapper/ShyVideofilterMapper.java
0 → 100644
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| ... | ... | @@ -75,7 +75,7 @@ public class CommentsServiceImpl { |
| 75 | 75 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, String states, Boolean receive, String auditor, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { | |
| 78 | + public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, String states, Boolean receive, String updater, Integer page, Integer pageSize, String orderByClause, Integer spid, String userId) { | |
| 79 | 79 | Example example = new Example(ShyComments.class); |
| 80 | 80 | Example.Criteria criteria = example.createCriteria(); |
| 81 | 81 | if (CommonUtils.isNotEmpty(orderByClause)) { |
| ... | ... | @@ -90,8 +90,8 @@ public class CommentsServiceImpl { |
| 90 | 90 | if (CommonUtils.isNotEmpty(content)) { |
| 91 | 91 | criteria.andLike("comment_content", "%" + content + "%"); |
| 92 | 92 | } |
| 93 | - if (CommonUtils.isNotEmpty(auditor)) { | |
| 94 | - criteria.andEqualTo("auditor", auditor); | |
| 93 | + if (CommonUtils.isNotEmpty(updater)) { | |
| 94 | + criteria.andEqualTo("updater", updater); | |
| 95 | 95 | } |
| 96 | 96 | if (CommonUtils.isNotNull(spid)) { |
| 97 | 97 | criteria.andEqualTo("spid", spid); |
| ... | ... | @@ -127,17 +127,17 @@ public class CommentsServiceImpl { |
| 127 | 127 | public ShyComments getDetailsComment(Integer id) { |
| 128 | 128 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); |
| 129 | 129 | if (comment.getState() != CommonConst.AUDIT_INTT) { |
| 130 | - String auditorName = "白名单"; | |
| 130 | + String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater())? "白名单":comment.getUpdater(); | |
| 131 | 131 | String auditor_id = comment.getAuditor_id(); |
| 132 | 132 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 133 | 133 | ShyUsers user = new ShyUsers(); |
| 134 | 134 | user.setUser_id(auditor_id); |
| 135 | 135 | user = shyUsersMapper.selectOne(user); |
| 136 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? "" : user.getUsername(); | |
| 137 | - String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); | |
| 138 | - auditorName = userName + email; | |
| 136 | + String email = CommonUtils.isEmpty(user.getEmail())|| "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 137 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 138 | + updater = userName ; | |
| 139 | 139 | } |
| 140 | - comment.setAuditor(auditorName); | |
| 140 | + comment.setUpdater(updater); | |
| 141 | 141 | } |
| 142 | 142 | return comment; |
| 143 | 143 | } |
| ... | ... | @@ -147,11 +147,11 @@ public class CommentsServiceImpl { |
| 147 | 147 | String[] commentIds = ids.split(","); |
| 148 | 148 | for (String commentId : commentIds) { |
| 149 | 149 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(Integer.parseInt(commentId)); |
| 150 | - if (!comment.getReceive() || CommonUtils.isEmpty(comment.getReceive_user_id()) || !userId.equals(comment.getReceive_user_id())) { | |
| 151 | - logger.error("领取逻辑不符,不能审核,activity_id:{}", comment.getActivity_id()); | |
| 152 | - success = false; | |
| 153 | - break; | |
| 154 | - } | |
| 150 | +// if (!comment.getReceive() || CommonUtils.isEmpty(comment.getReceive_user_id()) || !userId.equals(comment.getReceive_user_id())) { | |
| 151 | +// logger.error("领取逻辑不符,不能审核,activity_id:{}", comment.getActivity_id()); | |
| 152 | +// success = false; | |
| 153 | +// break; | |
| 154 | +// } | |
| 155 | 155 | |
| 156 | 156 | JSONObject json = new JSONObject(); |
| 157 | 157 | json.put("activity_id", comment.getActivity_id()); | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
| ... | ... | @@ -2,6 +2,7 @@ package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | 3 | import com.cnlive.shenhe.entity.ShySites; |
| 4 | 4 | import com.cnlive.shenhe.mapper.ShySitesMapper; |
| 5 | +import com.cnlive.shenhe.utils.CommonConst; | |
| 5 | 6 | import com.cnlive.shenhe.utils.CommonUtils; |
| 6 | 7 | import com.github.pagehelper.PageHelper; |
| 7 | 8 | import com.github.pagehelper.PageInfo; |
| ... | ... | @@ -9,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 10 | import org.springframework.stereotype.Service; |
| 10 | 11 | import tk.mybatis.mapper.entity.Example; |
| 11 | 12 | |
| 13 | +import java.util.ArrayList; | |
| 14 | +import java.util.Arrays; | |
| 12 | 15 | import java.util.List; |
| 13 | 16 | |
| 14 | 17 | /** |
| ... | ... | @@ -70,4 +73,23 @@ public class SitesServiceImpl { |
| 70 | 73 | List<ShySites> shySites = shySitesMapper.selectByExample(example); |
| 71 | 74 | return shySites.get(0); |
| 72 | 75 | } |
| 76 | + /** | |
| 77 | + * 获取免审白名单列表(点播) | |
| 78 | + * @return | |
| 79 | + */ | |
| 80 | + public List<Integer> getBusinessList() { | |
| 81 | + List<ShySites> sitesList = shySitesMapper.selectAll(); | |
| 82 | + List<Integer> sites = new ArrayList<Integer>(); | |
| 83 | + for (ShySites shySites : sitesList) { | |
| 84 | + if (CommonUtils.isNotEmpty(shySites.getWrite_business())) { | |
| 85 | + String[] business = shySites.getWrite_business().split(","); | |
| 86 | + List<String> asList = Arrays.asList(business); | |
| 87 | + if (asList.contains(CommonConst.BUSINESS_VIDEO + "")) { | |
| 88 | + sites.add(shySites.getSpid()); | |
| 89 | + } | |
| 90 | + } | |
| 91 | + } | |
| 92 | + return sites; | |
| 93 | + } | |
| 94 | + | |
| 73 | 95 | } | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideofilterServiceImpl.java
0 → 100644
| 1 | +package com.cnlive.shenhe.serviceImpl; | |
| 2 | + | |
| 3 | +import com.cnlive.shenhe.entity.ShyComments; | |
| 4 | +import com.cnlive.shenhe.entity.ShySites; | |
| 5 | +import com.cnlive.shenhe.entity.ShyVideofilter; | |
| 6 | +import com.cnlive.shenhe.mapper.ShySitesMapper; | |
| 7 | +import com.cnlive.shenhe.mapper.ShyVideofilterMapper; | |
| 8 | +import com.cnlive.shenhe.utils.CommonUtils; | |
| 9 | +import com.github.pagehelper.PageHelper; | |
| 10 | +import com.github.pagehelper.PageInfo; | |
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 12 | +import org.springframework.stereotype.Service; | |
| 13 | +import tk.mybatis.mapper.entity.Example; | |
| 14 | + | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * @Auther: liwei | |
| 19 | + * @Date: 2019/04/22 14:23 | |
| 20 | + * @Description: | |
| 21 | + */ | |
| 22 | +@Service | |
| 23 | +public class VideofilterServiceImpl { | |
| 24 | + @Autowired | |
| 25 | + ShyVideofilterMapper shyVideofilterMapper; | |
| 26 | + | |
| 27 | + | |
| 28 | + public ShyVideofilter get(Integer id) { | |
| 29 | + return shyVideofilterMapper.selectByPrimaryKey(id); | |
| 30 | + } | |
| 31 | + | |
| 32 | + public boolean update(ShyVideofilter videofilter) { | |
| 33 | + return shyVideofilterMapper.updateByPrimaryKeySelective(videofilter) == 1; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public List<ShyVideofilter> findAll() { | |
| 37 | + List<ShyVideofilter> shySites = shyVideofilterMapper.selectAll(); | |
| 38 | + return shySites; | |
| 39 | + } | |
| 40 | + | |
| 41 | + public boolean impotVideofilter(ShyVideofilter videofilter) { | |
| 42 | + int result = shyVideofilterMapper.insertSelective(videofilter); | |
| 43 | + if (result == 0) { | |
| 44 | + return false; | |
| 45 | + } | |
| 46 | + return true; | |
| 47 | + } | |
| 48 | + | |
| 49 | + | |
| 50 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| 1 | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 4 | +import com.alibaba.fastjson.JSONArray; | |
| 5 | +import com.alibaba.fastjson.JSONObject; | |
| 3 | 6 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 4 | 7 | import com.cnlive.shenhe.bean.ResponseBean; |
| 5 | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 6 | 9 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | +import com.cnlive.shenhe.entity.ShyVideofilter; | |
| 7 | 11 | import com.cnlive.shenhe.entity.ShyVideos; |
| 12 | +import com.cnlive.shenhe.job.VideosJob; | |
| 8 | 13 | import com.cnlive.shenhe.mapper.ShySitesMapper; |
| 9 | 14 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 10 | 15 | import com.cnlive.shenhe.mapper.ShyVideosMapper; |
| 16 | +import com.cnlive.shenhe.utils.AntiFraudUtil; | |
| 17 | +import com.cnlive.shenhe.utils.AuditPass; | |
| 11 | 18 | import com.cnlive.shenhe.utils.CommonConst; |
| 12 | 19 | import com.cnlive.shenhe.utils.CommonUtils; |
| 13 | 20 | import com.github.pagehelper.PageHelper; |
| 14 | 21 | import com.github.pagehelper.PageInfo; |
| 22 | + | |
| 23 | + | |
| 15 | 24 | import org.apache.ibatis.session.RowBounds; |
| 25 | +import org.slf4j.Logger; | |
| 26 | +import org.slf4j.LoggerFactory; | |
| 16 | 27 | import org.springframework.beans.factory.annotation.Autowired; |
| 28 | +import org.springframework.beans.factory.annotation.Value; | |
| 17 | 29 | import org.springframework.stereotype.Service; |
| 18 | 30 | import tk.mybatis.mapper.entity.Example; |
| 19 | 31 | |
| 20 | 32 | import java.sql.Timestamp; |
| 21 | 33 | import java.text.ParseException; |
| 34 | +import java.util.ArrayList; | |
| 35 | +import java.util.Arrays; | |
| 36 | +import java.util.HashMap; | |
| 22 | 37 | import java.util.List; |
| 38 | +import java.util.Map; | |
| 23 | 39 | |
| 24 | 40 | /** |
| 25 | 41 | * @Auther: chenhao |
| ... | ... | @@ -28,12 +44,28 @@ import java.util.List; |
| 28 | 44 | */ |
| 29 | 45 | @Service |
| 30 | 46 | public class VideosServiceImpl { |
| 47 | + private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class); | |
| 31 | 48 | @Autowired |
| 32 | 49 | ShyVideosMapper shyVideosMapper; |
| 33 | 50 | @Autowired |
| 34 | 51 | ShySitesMapper shySitesMapper; |
| 35 | 52 | @Autowired |
| 36 | 53 | ShyUsersMapper shyUsersMapper; |
| 54 | + | |
| 55 | + @Autowired | |
| 56 | + VideosServiceImpl videosService; | |
| 57 | + | |
| 58 | + @Autowired | |
| 59 | + VideofilterServiceImpl videofilterServiceImpl; | |
| 60 | + | |
| 61 | + @Value("${qn_domain}") | |
| 62 | + String qn_domain; | |
| 63 | + | |
| 64 | + @Value("${ks_domain}") | |
| 65 | + String ks_domain; | |
| 66 | + | |
| 67 | + @Autowired | |
| 68 | + AuditPass Pass; | |
| 37 | 69 | |
| 38 | 70 | public boolean impotVideo(ShyVideos shyVideos) { |
| 39 | 71 | int result = shyVideosMapper.insertSelective(shyVideos); |
| ... | ... | @@ -54,19 +86,20 @@ public class VideosServiceImpl { |
| 54 | 86 | } |
| 55 | 87 | |
| 56 | 88 | public boolean updateshyVideos(ShyVideos shyVideos) { |
| 57 | - int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); | |
| 89 | + int i = shyVideosMapper.updateByPrimaryKey(shyVideos); | |
| 58 | 90 | if (i == 0) { |
| 59 | 91 | return false; |
| 60 | 92 | } |
| 61 | 93 | return true; |
| 62 | 94 | } |
| 63 | 95 | |
| 64 | - public int updateVideo(Integer id, String auditor_id, Integer state, String msg) { | |
| 96 | + public int updateVideo(Integer id, String auditor_id,String updater, Integer state, String msg) { | |
| 65 | 97 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 66 | 98 | shyVideos.setAuditor_id(auditor_id); |
| 67 | 99 | shyVideos.setState(state); |
| 68 | 100 | shyVideos.setMsg(msg); |
| 69 | - return shyVideosMapper.updateByPrimaryKeySelective(shyVideos); | |
| 101 | + shyVideos.setUpdater(updater); | |
| 102 | + return shyVideosMapper.updateByPrimaryKey(shyVideos); | |
| 70 | 103 | } |
| 71 | 104 | |
| 72 | 105 | public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Boolean receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId) { |
| ... | ... | @@ -121,17 +154,17 @@ public class VideosServiceImpl { |
| 121 | 154 | public ShyVideos getDetailsContent(Integer id) { |
| 122 | 155 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 123 | 156 | if (shyVideos.getState() != CommonConst.AUDIT_INTT) { |
| 124 | - String auditorName = "白名单"; | |
| 157 | + String updater = CommonUtils.isEmpty(shyVideos.getUpdater()) || "null".equals(shyVideos.getUpdater())? "白名单":shyVideos.getUpdater(); | |
| 125 | 158 | String auditor_id = shyVideos.getAuditor_id(); |
| 126 | 159 | if (CommonUtils.isNotEmpty(auditor_id)) { |
| 127 | 160 | ShyUsers user = new ShyUsers(); |
| 128 | 161 | user.setUser_id(auditor_id); |
| 129 | 162 | user = shyUsersMapper.selectOne(user); |
| 130 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? "" : user.getUsername(); | |
| 131 | - String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); | |
| 132 | - auditorName = userName + email; | |
| 163 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail())? "" : user.getEmail(); | |
| 164 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email: user.getUsername(); | |
| 165 | + updater = userName; | |
| 133 | 166 | } |
| 134 | - shyVideos.setAuditor(auditorName); | |
| 167 | + shyVideos.setUpdater(updater); | |
| 135 | 168 | } |
| 136 | 169 | return shyVideos; |
| 137 | 170 | } |
| ... | ... | @@ -176,7 +209,7 @@ public class VideosServiceImpl { |
| 176 | 209 | if (shyVideos.getState() == CommonConst.AUDIT_INTT && shyVideos.getReceive() && shyVideos.getReceive_user_id().equals(userId)) { |
| 177 | 210 | shyVideos.setReceive(CommonConst.RECEIVE_BEFORE); |
| 178 | 211 | shyVideos.setReceive_user_id(null); |
| 179 | - int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); | |
| 212 | + int i = shyVideosMapper.updateByPrimaryKey(shyVideos); | |
| 180 | 213 | if (i != 1) { |
| 181 | 214 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,请重试"); |
| 182 | 215 | } |
| ... | ... | @@ -247,6 +280,81 @@ public class VideosServiceImpl { |
| 247 | 280 | List<ShyVideos> shyVideosList = shyVideosMapper.selectByExample(example); |
| 248 | 281 | return shyVideosList; |
| 249 | 282 | } |
| 283 | + | |
| 284 | + /** | |
| 285 | + * 数美视频(图片)过滤 | |
| 286 | + * @param cid 审核云中视频的id | |
| 287 | + * @param channel 尺度 | |
| 288 | + * @return | |
| 289 | + */ | |
| 290 | + public int videoFilter(Integer cid,String channel){ | |
| 291 | + ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid); | |
| 292 | + shyVideos.setUpdater("自动审核"); | |
| 293 | + Integer plat = shyVideos.getPlat(); | |
| 294 | + String yuming = ""; | |
| 295 | + if (plat == CommonConst.QINIU_PLAT) { | |
| 296 | + yuming = qn_domain + "/"; | |
| 297 | + } else if (plat == CommonConst.KS_PLAT) { | |
| 298 | + yuming = ks_domain + "/"; | |
| 299 | + } | |
| 300 | + List<String> imgList =JSONArray.parseArray(shyVideos.getAvsample_imgs(),String.class); | |
| 301 | + List<Map<String,Object>> list=new ArrayList<>(); | |
| 302 | + for (String imgStr : imgList) { | |
| 303 | + String imgUrl=yuming+imgStr; | |
| 304 | + Map<String,Object> map=new HashMap<>(); | |
| 305 | + map.put("imageUrl", imgUrl); | |
| 306 | + list.add(map); | |
| 307 | + } | |
| 308 | + String jsonList = JSONArray.toJSONString(list); | |
| 309 | + //调用数美接口 | |
| 310 | + JSONObject result = AntiFraudUtil.filterImg(shyVideos.getTask_id(),jsonList,CommonConst.DYNAMIC_USER); | |
| 311 | + String type=result.getString("type"); | |
| 312 | + if(type.toLowerCase().equals(CommonConst.PASS)){//数美通过 | |
| 313 | + //修改点播云视频状态 | |
| 314 | + videosService.updateDianboAndShenhe(shyVideos,3); | |
| 315 | + }else if(type.toLowerCase().equals(CommonConst.REJECT)){//数美拒绝 | |
| 316 | + videosService.updateDianboAndShenhe(shyVideos,4); | |
| 317 | + } | |
| 318 | + ShyVideofilter videofilter=new ShyVideofilter(); | |
| 319 | + videofilter.setChannel(channel); | |
| 320 | + videofilter.setDesc_msg(result.getString("desc")); | |
| 321 | + videofilter.setResult_type(type); | |
| 322 | + videofilter.setToken_id(shyVideos.getTask_id()); | |
| 323 | + videofilter.setVideos_id(cid); | |
| 324 | + videofilter.setCreated_at(CommonUtils.getCurrentTime()); | |
| 325 | + videofilterServiceImpl.impotVideofilter(videofilter); | |
| 326 | + | |
| 327 | + return 0; | |
| 328 | + } | |
| 329 | + | |
| 330 | + /** | |
| 331 | + * 更新点播和审核的视频状态 | |
| 332 | + * @param video | |
| 333 | + * @param dianboState 视频状态,3通过,4不通过 | |
| 334 | + * @return | |
| 335 | + */ | |
| 336 | + public int updateDianboAndShenhe(ShyVideos video,int dianboState) { | |
| 337 | + //修改点播云的视频状态 | |
| 338 | + JSONObject result = Pass.auditPass(video.getVideo_id(), dianboState, "", "", video.getCallback()); | |
| 339 | + Integer code = result.getInteger("code"); | |
| 340 | + Integer shenheState=CommonConst.AUDIT_REFUSE; | |
| 341 | + if (0 == code) { | |
| 342 | + if(dianboState==3){ | |
| 343 | + shenheState=CommonConst.AUDIT_SUCCESS; | |
| 344 | + } | |
| 345 | + //修改审核云的视频状态 | |
| 346 | + int i = videosService.updateVideo(video.getId(), null,video.getUpdater(), shenheState, result.getString("msg")); | |
| 347 | + if (i != 1) { | |
| 348 | + logger.error("点播视频更改失败,activity_id:{}", video.getVideo_id()); | |
| 349 | + } | |
| 350 | + return i; | |
| 351 | + } else { | |
| 352 | + videosService.updateVideo(video.getId(), null,video.getUpdater(), CommonConst.AUDIT_CALLBACK_FAIL, result.getString("msg")); | |
| 353 | + logger.error("点播视频回调失败,activity_id:{},code:{},msg:{}", video.getVideo_id(), code, result.getString("msg")); | |
| 354 | + } | |
| 355 | + | |
| 356 | + return 0; | |
| 357 | + } | |
| 250 | 358 | |
| 251 | 359 | |
| 252 | 360 | } | ... | ... |
src/main/java/com/cnlive/shenhe/utils/AntiFraudUtil.java
0 → 100644
| 1 | +package com.cnlive.shenhe.utils; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 4 | +import com.alibaba.fastjson.JSONArray; | |
| 5 | +import com.alibaba.fastjson.JSONObject; | |
| 6 | +import org.apache.commons.lang3.StringUtils; | |
| 7 | + | |
| 8 | +import java.util.UUID; | |
| 9 | + | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 数美 反欺诈工具类 | |
| 13 | + * | |
| 14 | + * @author GuoYaqi | |
| 15 | + */ | |
| 16 | +public class AntiFraudUtil { | |
| 17 | + | |
| 18 | + //把变量配置到属性文件 | |
| 19 | + | |
| 20 | + private static final String ACCESSKEY = "DU0tyaqrO5Vuiuiq4i8E"; // 商户的 accessKey | |
| 21 | + private static final String REQUEST_URL_TEXT = "http://api.fengkongcloud.com/v2/saas/anti_fraud/text"; | |
| 22 | + private static final String REQUEST_URL_ARTICLE = "http://img-api.fengkongcloud.com/v1/saas/anti_fraud/article"; | |
| 23 | + private static final String REQUEST_URL_IMG = "http://img-api-bj.fengkongcloud.com/v2/saas/anti_fraud/imgs"; | |
| 24 | + private static final String REQUEST_URL_VIDEO = "http://video-api-bj.fengkongcloud.com/v2/saas/anti_fraud/video"; | |
| 25 | + private static final String RESPONSE_URL_VIDEO = "http://video-api-bj.fengkongcloud.com/v2/saas/anti_fraud/query_video"; | |
| 26 | + public static void main(String[] args) { | |
| 27 | + String jsonArray = "[{\"imageUrl\":\"http://ffyl.ys2.cnliveimg.com/223/img/2018/0820/ff80808164a7163a016555c9a6ac0208/000002.jpg?imageView2/1/w/704/h/396\"},\n" + | |
| 28 | + "{\"imageUrl\":\"https://wjj.ys1.cnliveimg.com/769/img/2018/0129/fitnessPhotos.jpg\"},{\"imageUrl\":\"http://ffyl.ys2.cnliveimg.com/223/img/2018/0820/ff80808164a7163a016555c9a6ac0208/000002.jpg?imageView2/1/w/704/h/396\"},{\"imageUrl\":\"http://yweb3.cnliveimg.com/828/img/2018/0802/180802161358328_692.jpg\"},{\"imageUrl\":\"http://ffyl.ys2.cnliveimg.com/223/img/2018/0820/ff80808164a7163a016555c9a6ac0208/000002.jpg?imageView2/1/w/704/h/396\"},\n" + | |
| 29 | + "{\"imageUrl\":\"http://yweb3.cnliveimg.com/828/img/2018/0802/180802161358328_692.jpg\"},{\"imageUrl\":\"http://ffyl.ys2.cnliveimg.com/223/img/2018/0820/ff80808164a7163a016555c9a6ac0208/000002.jpg?imageView2/1/w/704/h/396\"},{\"imageUrl\":\"http://yweb3.cnliveimg.com/828/img/2018/0802/180802161358328_692.jpg\"},{\"imageUrl\":\"http://yweb3.cnliveimg.com/828/img/2018/0802/180802161358328_692.jpg\"}]"; | |
| 30 | + UUID uuid = UUID.randomUUID(); | |
| 31 | + String btId = uuid.toString(); | |
| 32 | + | |
| 33 | +// System.out.println("文本:"+AntiFraudUtil.filterText("0000001", "王八蛋", "DYNAMIC_USER") + "---"); | |
| 34 | + System.out.println(AntiFraudUtil.filterArticle("000111","3g.huabian.com/api/hz0227/show/2225530.html",null)); | |
| 35 | + //System.out.println("图片:"+AntiFraudUtil.filterImg("0000001", jsonArray,"DYNAMIC_BUSINESS") + "---"); | |
| 36 | + //System.out.println("视频:"+AntiFraudUtil.filterVideo("http://wjj.ys1.cnliveimg.com/testVideo/test1.mp4",btId,null) + "---"); | |
| 37 | + //queryVideoResult("02b649b7-3451-403e-abd0-592302cec2a0"); | |
| 38 | + | |
| 39 | + } | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 智能文本过滤 | |
| 43 | + * | |
| 44 | + * @param text 需要过滤的文本 | |
| 45 | + * @param tokenId 建议传UID | |
| 46 | + * @param channel COMMENT,DYNAMIC_BUSINESS,DYNAMIC_USER,不传为COMMENT | |
| 47 | + * @return 通过:PASS 拒绝:REJECT 可疑:REVIEW 数美异常:null | |
| 48 | + */ | |
| 49 | + public static JSONObject filterText(String tokenId, String text, String channel) { | |
| 50 | + try { | |
| 51 | + JSONObject result = reqTextFilter(tokenId, text, channel); | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 接口会返回code, code=1100 时说明请求成功,根据不同的 riskLevel 风险级别进行业务处理 | |
| 55 | + * 当 code!=1100 时,如果是 1902 错误,需要检查参数配置 | |
| 56 | + * 其余情况需要根据错误码进行重试或者其它异常处理 | |
| 57 | + */ | |
| 58 | + if (result != null) { | |
| 59 | + Integer code = result.getInteger("code"); | |
| 60 | + | |
| 61 | + if (code != null && code == 1100) { //请求成功 | |
| 62 | + String riskLevel = result.getString("riskLevel"); | |
| 63 | + | |
| 64 | + if ("PASS".equals(riskLevel)) { | |
| 65 | + return result; | |
| 66 | + } | |
| 67 | + | |
| 68 | + if ("REJECT".equals(riskLevel)) { | |
| 69 | + JSONObject detail = result.getJSONObject("detail"); | |
| 70 | + | |
| 71 | + result.put("desc", | |
| 72 | + String.format("(%s)", detail.getString("riskTypeDesc"))); | |
| 73 | + return result; | |
| 74 | + } | |
| 75 | + | |
| 76 | + if ("REVIEW".equals(riskLevel)) { | |
| 77 | + return result; | |
| 78 | + } | |
| 79 | + } | |
| 80 | + } | |
| 81 | + return null; | |
| 82 | + } catch (Exception e) { | |
| 83 | + return null; | |
| 84 | + } | |
| 85 | + } | |
| 86 | + | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 智能图文过滤 | |
| 90 | + * @param channel COMMENT,NEWS(新闻),CULTURE_SPORTS(娱乐/体育),不传为COMMENT | |
| 91 | + * @param contents 要检测的网页内容,url链接或文本内容 | |
| 92 | + * @param tokenId 建议传UID | |
| 93 | + * @return 通过:PASS 拒绝:REJECT 可疑:REVIEW 数美异常:null | |
| 94 | + */ | |
| 95 | + public static JSONObject filterArticle(String tokenId, String contents ,String channel) { | |
| 96 | + try { | |
| 97 | + JSONObject result = reqArticleFilter(tokenId, contents ,channel); | |
| 98 | + /** | |
| 99 | + * 接口会返回code, code=1100 时说明请求成功,根据不同的 riskLevel 风险级别进行业务处理 | |
| 100 | + * 当 code!=1100 时,如果是 1902 错误,需要检查参数配置 | |
| 101 | + * 其余情况需要根据错误码进行重试或者其它异常处理 | |
| 102 | + */ | |
| 103 | + return getResult(result); | |
| 104 | + } catch (Exception e) { | |
| 105 | + return null; | |
| 106 | + } | |
| 107 | + } | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 智能图片过滤 | |
| 111 | + * | |
| 112 | + * @param picArray 需要过滤的图片的集合 | |
| 113 | + * @param tokenId 建议传UID | |
| 114 | + * @return 通过:PASS 拒绝:REJECT 异常:REVIEW | |
| 115 | + */ | |
| 116 | + public static JSONObject filterImg(String tokenId, String picArray, String channel) { | |
| 117 | + try { | |
| 118 | + JSONArray imgArray = getJSONArray(picArray); | |
| 119 | + JSONObject result = reqImgFilter(tokenId, imgArray, channel); | |
| 120 | + /** | |
| 121 | + * 接口会返回code, code=1100 时说明请求成功,根据不同的 riskLevel 风险级别进行业务处理 | |
| 122 | + * 当 code!=1100 时,如果是 1902 错误,需要检查参数配置 | |
| 123 | + * 其余情况需要根据错误码进行重试或者其它异常处理 | |
| 124 | + */ | |
| 125 | + if (result != null) { | |
| 126 | + System.out.println("数美图片过滤返回结果" + result); | |
| 127 | + JSONObject jsonObj = new JSONObject(); | |
| 128 | + StringBuffer strBuffer = new StringBuffer(); | |
| 129 | + int count = 0; | |
| 130 | + Integer code = result.getInteger("code"); | |
| 131 | + if (code != null && code == 1100) { //请求成功 | |
| 132 | + JSONArray jsonArray = result.getJSONArray("imgs"); | |
| 133 | + if (jsonArray.size() > 0) { | |
| 134 | + for (int i = 0; i < jsonArray.size(); i++) { | |
| 135 | + JSONObject json = jsonArray.getJSONObject(i); | |
| 136 | + String riskLevel = json.getString("riskLevel"); | |
| 137 | + | |
| 138 | + if ("PASS".equals(riskLevel)) { | |
| 139 | + continue; | |
| 140 | + } | |
| 141 | + | |
| 142 | + if ("REJECT".equals(riskLevel) || "REVIEW".equals(riskLevel)) { | |
| 143 | + JSONObject detail = json.getJSONObject("detail"); | |
| 144 | + for (int j = 0; j < imgArray.size(); j++) { | |
| 145 | + String btId = json.getString("btId"); | |
| 146 | + if (imgArray.getJSONObject(j).containsValue(btId)) { | |
| 147 | + strBuffer.append("(第" + (j + 1) + "张-" + detail.getString("description") + ")"); | |
| 148 | + } | |
| 149 | + } | |
| 150 | + jsonObj.put("desc", strBuffer); | |
| 151 | + count++; | |
| 152 | + continue; | |
| 153 | + } | |
| 154 | + } | |
| 155 | + } | |
| 156 | + if (count > 0) { | |
| 157 | + jsonObj.put("type", "REJECT"); | |
| 158 | + } else { | |
| 159 | + jsonObj.put("type", "PASS"); | |
| 160 | + } | |
| 161 | + return jsonObj; | |
| 162 | + } | |
| 163 | + } | |
| 164 | + } catch (Exception e) { | |
| 165 | + e.printStackTrace(); | |
| 166 | + } | |
| 167 | + return null; | |
| 168 | + } | |
| 169 | + | |
| 170 | + /** | |
| 171 | + * 智能视频过滤 | |
| 172 | + * | |
| 173 | + * @param url 需要过滤的视频的url | |
| 174 | + * @param uuid 需要过滤的视频的唯一标识 | |
| 175 | + * @return 通过:PASS 拒绝:REJECT 异常:null | |
| 176 | + */ | |
| 177 | + public static JSONObject filterVideo(String url,String uuid, String channel) { | |
| 178 | + try { | |
| 179 | + JSONObject result = reqVideoFilter(url, uuid, channel); | |
| 180 | + /** | |
| 181 | + * 接口会返回code, code=1100 时说明请求成功,根据不同的 riskLevel 风险级别进行业务处理 | |
| 182 | + * 当 code!=1100 时,如果是 1902 错误,需要检查参数配置 | |
| 183 | + * 其余情况需要根据错误码进行重试或者其它异常处理 | |
| 184 | + */ | |
| 185 | + return result; | |
| 186 | + } catch (Exception e) { | |
| 187 | + return null; | |
| 188 | + } | |
| 189 | + } | |
| 190 | + | |
| 191 | + /** | |
| 192 | + * 智能视频过滤 | |
| 193 | + * | |
| 194 | + * @param uuid 需要查看的视频的唯一标识 | |
| 195 | + * @return 通过:PASS 拒绝:REJECT 异常:null | |
| 196 | + */ | |
| 197 | + public static JSONObject queryVideoResult(String uuid) { | |
| 198 | + try { | |
| 199 | + JSONObject userData = new JSONObject(); | |
| 200 | + userData.put("accessKey", ACCESSKEY); | |
| 201 | + userData.put("btId", uuid); | |
| 202 | + JSONObject result = HttpClientUtils.httpPost(RESPONSE_URL_VIDEO, userData,false); | |
| 203 | + System.out.println("响应:" + result); | |
| 204 | + return result; | |
| 205 | + } catch (Exception e) { | |
| 206 | + System.out.println("...................接口请求失败:"); | |
| 207 | + e.printStackTrace(); | |
| 208 | + return null; | |
| 209 | + } | |
| 210 | + } | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + private static JSONObject reqTextFilter(String tokenId, String text, String channel) throws Exception { | |
| 215 | + JSONObject userData = new JSONObject(); | |
| 216 | + | |
| 217 | + userData.put("accessKey", ACCESSKEY); | |
| 218 | + userData.put("type", "SOCIAL"); | |
| 219 | + | |
| 220 | + JSONObject data = new JSONObject(); | |
| 221 | + data.put("tokenId", tokenId); | |
| 222 | + data.put("text", text); | |
| 223 | + data.put("channel", StringUtils.isNotEmpty(channel) ? channel : "COMMENT"); | |
| 224 | + userData.put("data", data); | |
| 225 | + | |
| 226 | + return HttpClientUtils.httpPost(REQUEST_URL_TEXT, userData,false); | |
| 227 | + } | |
| 228 | + | |
| 229 | + private static JSONObject reqImgFilter(String tokenId, JSONArray imgs, String channel) throws Exception { | |
| 230 | + JSONObject userData = new JSONObject(); | |
| 231 | + userData.put("accessKey", ACCESSKEY); | |
| 232 | + userData.put("type", "AD_PORN_PERSON"); | |
| 233 | + | |
| 234 | + JSONObject data = new JSONObject(); | |
| 235 | + data.put("tokenId", tokenId); | |
| 236 | + | |
| 237 | + data.put("imgs", imgs); | |
| 238 | + data.put("channel", StringUtils.isNotEmpty(channel) ? channel : "COMMENT"); | |
| 239 | + userData.put("data", data); | |
| 240 | + | |
| 241 | + return HttpClientUtils.httpPost(REQUEST_URL_IMG, userData,false); | |
| 242 | + } | |
| 243 | + | |
| 244 | + private static JSONObject reqVideoFilter(String url,String uuid, String channel) throws Exception { | |
| 245 | + JSONObject userData = new JSONObject(); | |
| 246 | + userData.put("accessKey", ACCESSKEY); | |
| 247 | + userData.put("btId", uuid); | |
| 248 | + userData.put("callback","http://apiwjjtest.cnlive.com/Daren/filterVideoResult/callbackVideoResult.action"); | |
| 249 | + userData.put("type", "AD_PORN_PERSON_VIOLENCE"); | |
| 250 | + | |
| 251 | + | |
| 252 | + JSONObject data = new JSONObject(); | |
| 253 | + data.put("url", url); | |
| 254 | + data.put("addition","AUDIO"); | |
| 255 | + data.put("channel", StringUtils.isNotEmpty(channel) ? channel : "COMMENT"); | |
| 256 | + userData.put("data", data); | |
| 257 | + | |
| 258 | + return HttpClientUtils.httpPost(REQUEST_URL_VIDEO, userData,false); | |
| 259 | + } | |
| 260 | + | |
| 261 | + private static JSONObject reqArticleFilter(String tokenId,String contents ,String channel) throws Exception { | |
| 262 | + JSONObject userData = new JSONObject(); | |
| 263 | + userData.put("accessKey", ACCESSKEY); | |
| 264 | + | |
| 265 | + JSONObject data = new JSONObject(); | |
| 266 | + data.put("contents", contents); | |
| 267 | + data.put("tokenId", tokenId); | |
| 268 | + data.put("channel", StringUtils.isNotEmpty(channel) ? channel : "COMMENT"); | |
| 269 | + userData.put("data", data); | |
| 270 | + | |
| 271 | + return HttpClientUtils.httpPost(REQUEST_URL_ARTICLE, userData,false); | |
| 272 | + } | |
| 273 | + | |
| 274 | + private static JSONObject getResult(JSONObject result) { | |
| 275 | + if (result != null) { | |
| 276 | + System.out.println(result); | |
| 277 | + Integer code = result.getInteger("code"); | |
| 278 | + | |
| 279 | + if (code != null && code == 1100) { //请求成功 | |
| 280 | + String riskLevel = result.getString("riskLevel"); | |
| 281 | + | |
| 282 | + if ("PASS".equals(riskLevel)) { | |
| 283 | + return result; | |
| 284 | + } | |
| 285 | + | |
| 286 | + if ("REJECT".equals(riskLevel)) { | |
| 287 | + JSONObject detail = result.getJSONObject("detail"); | |
| 288 | + | |
| 289 | + result.put("desc", String.format("(%s)", detail.getString("description"))); | |
| 290 | + return result; | |
| 291 | + } | |
| 292 | + | |
| 293 | + if ("REVIEW".equals(riskLevel)) { | |
| 294 | + return result; | |
| 295 | + } | |
| 296 | + } | |
| 297 | + } | |
| 298 | + return null; | |
| 299 | + } | |
| 300 | + | |
| 301 | + private static JSONArray getJSONArray(String json){ | |
| 302 | + JSONArray picJson = JSON.parseArray(json); | |
| 303 | + JSONArray imgs = new JSONArray(); | |
| 304 | + for (int i = 0; i < picJson.size(); i++) { | |
| 305 | + UUID uuid = UUID.randomUUID(); | |
| 306 | + String btId = uuid.toString(); | |
| 307 | + JSONObject jsonObject = new JSONObject(); | |
| 308 | + JSONObject jsonObj = picJson.getJSONObject(i); | |
| 309 | + String img = jsonObj.getString("imageUrl"); | |
| 310 | + jsonObject.put("img",img); | |
| 311 | + jsonObject.put("btId",btId); | |
| 312 | + imgs.add(jsonObject); | |
| 313 | + } | |
| 314 | + return imgs; | |
| 315 | + } | |
| 316 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/utils/AuditPass.java
| ... | ... | @@ -57,6 +57,12 @@ public class AuditPass { |
| 57 | 57 | return JSONObject.parseObject(post.get("result")); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | + /** | |
| 61 | + * 评论打回回调 | |
| 62 | + * @param json | |
| 63 | + * @param callBack | |
| 64 | + * @return | |
| 65 | + */ | |
| 60 | 66 | public JSONObject commentPass(JSONObject json, String callBack) { |
| 61 | 67 | Map<String, String> map = new HashMap<>(); |
| 62 | 68 | map.put("param", json.toJSONString()); | ... | ... |
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
| ... | ... | @@ -85,5 +85,55 @@ public class CommonConst { |
| 85 | 85 | */ |
| 86 | 86 | public static Integer QINIU_PLAT = 2; |
| 87 | 87 | |
| 88 | + /** | |
| 89 | + * 栏目分类,目击者 | |
| 90 | + */ | |
| 91 | + public static String CATEGORY_WITNESS = "witness"; | |
| 92 | + /** | |
| 93 | + * 栏目分类,用户 | |
| 94 | + */ | |
| 95 | + public static String CATEGORY_MOMENT = "moment"; | |
| 96 | + /** | |
| 97 | + * 栏目分类,达人 | |
| 98 | + */ | |
| 99 | + public static String CATEGORY_SUB = "sub"; | |
| 100 | + /** | |
| 101 | + * 栏目分类,上冰雪 | |
| 102 | + */ | |
| 103 | + public static String CATEGORY_SNOW = "snow"; | |
| 104 | + /** | |
| 105 | + * 栏目分类,航空节 | |
| 106 | + */ | |
| 107 | + public static String CATEGORY_AVIATION = "aviation"; | |
| 108 | + | |
| 109 | + /** | |
| 110 | + * 数美过滤器尺度状态:用户 | |
| 111 | + */ | |
| 112 | + public static String DYNAMIC_USER = "DYNAMIC_USER"; | |
| 113 | + | |
| 114 | + /** | |
| 115 | + * 数美过滤器尺度状态:商户 | |
| 116 | + */ | |
| 117 | + public static String DYNAMIC_BUSINESS = "DYNAMIC_BUSINESS"; | |
| 118 | + | |
| 119 | + /** | |
| 120 | + * 数美过滤器尺度状态:新闻 | |
| 121 | + */ | |
| 122 | + public static String DYNAMIC_NEWS = "DYNAMIC_NEWS"; | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 数美过滤器返回结果:通过 | |
| 126 | + */ | |
| 127 | + public static String PASS = "pass"; | |
| 128 | + | |
| 129 | + /** | |
| 130 | + * 数美过滤器返回结果:拒绝 | |
| 131 | + */ | |
| 132 | + public static String REJECT = "reject"; | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * 数美过滤器返回结果:异常 | |
| 136 | + */ | |
| 137 | + public static String REVIEW = "review"; | |
| 88 | 138 | |
| 89 | 139 | } | ... | ... |
src/main/java/com/cnlive/shenhe/utils/HttpClientUtils.java
0 → 100644
| 1 | +package com.cnlive.shenhe.utils; | |
| 2 | + | |
| 3 | +import com.alibaba.fastjson.JSON; | |
| 4 | +import com.alibaba.fastjson.JSONObject; | |
| 5 | +import org.apache.http.HttpEntity; | |
| 6 | +import org.apache.http.HttpResponse; | |
| 7 | +import org.apache.http.NameValuePair; | |
| 8 | +import org.apache.http.client.HttpClient; | |
| 9 | +import org.apache.http.client.entity.UrlEncodedFormEntity; | |
| 10 | +import org.apache.http.client.methods.CloseableHttpResponse; | |
| 11 | +import org.apache.http.client.methods.HttpGet; | |
| 12 | +import org.apache.http.client.methods.HttpPost; | |
| 13 | +import org.apache.http.entity.StringEntity; | |
| 14 | +import org.apache.http.impl.client.CloseableHttpClient; | |
| 15 | +import org.apache.http.impl.client.HttpClients; | |
| 16 | +import org.apache.http.message.BasicHeader; | |
| 17 | +import org.apache.http.message.BasicNameValuePair; | |
| 18 | +import org.apache.http.protocol.HTTP; | |
| 19 | +import org.apache.http.util.EntityUtils; | |
| 20 | + | |
| 21 | +import java.io.IOException; | |
| 22 | +import java.net.URLDecoder; | |
| 23 | +import java.util.ArrayList; | |
| 24 | +import java.util.List; | |
| 25 | +import java.util.Map; | |
| 26 | + | |
| 27 | +public class HttpClientUtils { | |
| 28 | + public static String post(String url, Map<String, Object> map) { | |
| 29 | + HttpPost post = new HttpPost(url);// 创建post请求 | |
| 30 | + String text = "请求失败"; | |
| 31 | + try { | |
| 32 | + HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | |
| 33 | + List<NameValuePair> param = new ArrayList<>(); | |
| 34 | + if(map!=null&&map.size()>0){ | |
| 35 | + for (Map.Entry<String, Object> entry : map.entrySet()) { | |
| 36 | + param.add(new BasicNameValuePair(entry.getKey(), entry.getValue().toString())); | |
| 37 | + } | |
| 38 | + } | |
| 39 | + HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8");// 用参数构造请求实体 | |
| 40 | + post.setEntity(postEntity);// 把请求实体放到post请求中 | |
| 41 | + HttpResponse response = client.execute(post); // 执行post请求 | |
| 42 | + HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | |
| 43 | + text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | |
| 44 | + } catch (Exception e) { | |
| 45 | + e.printStackTrace(); | |
| 46 | + } finally { | |
| 47 | + post.releaseConnection();// 释放连接 | |
| 48 | + } | |
| 49 | + return text; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public static String get(String url) { | |
| 53 | + String text = "请求失败"; | |
| 54 | + HttpGet httpGet = null; | |
| 55 | + try { | |
| 56 | + HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | |
| 57 | + httpGet = new HttpGet(url); | |
| 58 | + HttpResponse response = client.execute(httpGet); // 执行get请求 | |
| 59 | + HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | |
| 60 | + text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | |
| 61 | + } catch (Exception e) { | |
| 62 | + e.printStackTrace(); | |
| 63 | + } finally { | |
| 64 | + httpGet.releaseConnection();// 释放连接 | |
| 65 | + } | |
| 66 | + return text; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public static String get(String url, Map<String, String> map) { | |
| 70 | + String text = "请求失败"; | |
| 71 | + HttpGet httpGet = null; | |
| 72 | + try { | |
| 73 | + HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | |
| 74 | + List<NameValuePair> params = new ArrayList<NameValuePair>(); | |
| 75 | + if (map != null && map.size() > 0) { | |
| 76 | + for (Map.Entry<String, String> entry : map.entrySet()) { | |
| 77 | + params.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); | |
| 78 | + } | |
| 79 | + } | |
| 80 | + String paramsStr = EntityUtils.toString(new UrlEncodedFormEntity(params, "UTF-8")); | |
| 81 | + httpGet = new HttpGet(url + "?" + paramsStr); | |
| 82 | + HttpResponse response = client.execute(httpGet); // 执行get请求 | |
| 83 | + HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | |
| 84 | + text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | |
| 85 | + } catch (Exception e) { | |
| 86 | + e.printStackTrace(); | |
| 87 | + } finally { | |
| 88 | + httpGet.releaseConnection();// 释放连接 | |
| 89 | + } | |
| 90 | + return text; | |
| 91 | + } | |
| 92 | + | |
| 93 | + public static String post_str(String url, Map<String, String> map) { | |
| 94 | + HttpPost post = null; | |
| 95 | + String text = "请求失败"; | |
| 96 | + try { | |
| 97 | + HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | |
| 98 | + List<NameValuePair> param = new ArrayList<>(); | |
| 99 | + if (map != null && map.size() > 0) { | |
| 100 | + for (Map.Entry<String, String> entry : map.entrySet()) { | |
| 101 | + param.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8");// 用参数构造请求实体 | |
| 105 | + post = new HttpPost(url);// 创建post请求 | |
| 106 | + post.setEntity(postEntity);// 把请求实体放到post请求中 | |
| 107 | + HttpResponse response = client.execute(post); // 执行post请求 | |
| 108 | + HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | |
| 109 | + text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | |
| 110 | + } catch (Exception e) { | |
| 111 | + e.printStackTrace(); | |
| 112 | + } finally { | |
| 113 | + post.releaseConnection();// 释放连接 | |
| 114 | + } | |
| 115 | + return text; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public static String HttpPostWithJson(String url, String json) { | |
| 119 | + | |
| 120 | + CloseableHttpClient httpClient = null; | |
| 121 | + try { | |
| 122 | + httpClient = HttpClients.createDefault(); | |
| 123 | + | |
| 124 | + HttpPost httpPost = new HttpPost(url); | |
| 125 | + httpPost.setHeader("Content-Type", "application/json;charset=utf-8"); | |
| 126 | + | |
| 127 | + StringEntity se = new StringEntity(json, "UTF-8"); | |
| 128 | + se.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, | |
| 129 | + "application/json")); | |
| 130 | + httpPost.setEntity(se); | |
| 131 | + CloseableHttpResponse response = httpClient.execute(httpPost); | |
| 132 | + // 返回数据 | |
| 133 | + HttpEntity entity = response.getEntity(); | |
| 134 | + String result = EntityUtils.toString(entity, "UTF-8"); | |
| 135 | + return result; | |
| 136 | + } catch (Exception e) { | |
| 137 | + e.printStackTrace(); | |
| 138 | + return null; | |
| 139 | + } finally { | |
| 140 | + if (httpClient != null) { | |
| 141 | + try { | |
| 142 | + httpClient.close(); | |
| 143 | + } catch (IOException e) { | |
| 144 | + e.printStackTrace(); | |
| 145 | + } | |
| 146 | + } | |
| 147 | + } | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * httpPost | |
| 152 | + * @param url 请求url | |
| 153 | + * @param jsonParam | |
| 154 | + * @param noNeedResponse 是否获取接口response | |
| 155 | + * @return | |
| 156 | + * @throws Exception | |
| 157 | + */ | |
| 158 | + public static JSONObject httpPost(String url, JSONObject jsonParam, boolean noNeedResponse) throws Exception{ | |
| 159 | + CloseableHttpClient httpClient = HttpClients.createDefault(); | |
| 160 | + | |
| 161 | + JSONObject jsonResult = null; | |
| 162 | + HttpPost method = new HttpPost(url); | |
| 163 | + try { | |
| 164 | + if (null != jsonParam) { | |
| 165 | + StringEntity entity = new StringEntity(jsonParam.toString(), "UTF-8"); | |
| 166 | + entity.setContentEncoding("UTF-8"); | |
| 167 | + entity.setContentType("application/json"); | |
| 168 | + method.setEntity(entity); | |
| 169 | + } | |
| 170 | + HttpResponse result = httpClient.execute(method); | |
| 171 | + url = URLDecoder.decode(url, "UTF-8"); | |
| 172 | + if (result.getStatusLine().getStatusCode() == 200) { | |
| 173 | + String str = ""; | |
| 174 | + try { | |
| 175 | + str = EntityUtils.toString(result.getEntity()); | |
| 176 | + if (noNeedResponse) { | |
| 177 | + return null; | |
| 178 | + } | |
| 179 | + jsonResult = JSON.parseObject(str); | |
| 180 | + } catch (Exception e) { | |
| 181 | + System.out.println("posturl:" + url + ", err=" + e.getMessage()); | |
| 182 | + throw new Exception(e); | |
| 183 | + } | |
| 184 | + } | |
| 185 | + } catch (IOException e) { | |
| 186 | + System.out.println("posturl:" + url + ", err=" + e.getMessage()); | |
| 187 | + throw new IOException(e); | |
| 188 | + } | |
| 189 | + return jsonResult; | |
| 190 | + } | |
| 191 | + | |
| 192 | + | |
| 193 | +} | ... | ... |
src/main/resources/application.properties
| 1 | 1 | #spring.datasource.url=jdbc:mysql://120.92.102.31:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false |
| 2 | 2 | #spring.datasource.username=root |
| 3 | 3 | #spring.datasource.password=M345sdfss4! |
| 4 | + | |
| 5 | +#spring.datasource.url=jdbc:mysql://127.0.0.1:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false | |
| 6 | +#spring.datasource.username=root | |
| 7 | +#spring.datasource.password=nbLdyO.79 | |
| 8 | + | |
| 4 | 9 | spring.datasource.url=jdbc:mysql://10.137.192.2:3306/new_shy?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useSSL=false |
| 5 | 10 | spring.datasource.username=admin |
| 6 | 11 | spring.datasource.password=Sre#45iU7kJ |
| 12 | + | |
| 7 | 13 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
| 8 | 14 | |
| 9 | 15 | server.tomcat.protocol_header=x-forwarded-proto |
| ... | ... | @@ -21,9 +27,12 @@ spring.http.encoding.force=true |
| 21 | 27 | spring.thymeleaf.mode=LEGACYHTML5 |
| 22 | 28 | #spring.thymeleaf.encoding=UTF-8 |
| 23 | 29 | #spring.thymeleaf.content-type=text/html |
| 24 | -#开发时关闭缓存,不然没法看到实时页面 | |
| 30 | +#\u5f00\u53d1\u65f6\u5173\u95ed\u7f13\u5b58,\u4e0d\u7136\u6ca1\u6cd5\u770b\u5230\u5b9e\u65f6\u9875\u9762 | |
| 25 | 31 | spring.thymeleaf.cache=false |
| 26 | 32 | |
| 33 | +#\u6253\u5370\u8fd0\u884c\u65f6\u7684sql | |
| 34 | +#logging.level.com.cnlive.shenhe.mapper=debug | |
| 35 | + | |
| 27 | 36 | mybatis.mapper-locations=classpath:mapping/*.xml |
| 28 | 37 | mybatis.type-aliases-package=com.cnlive.shenhe.entity |
| 29 | 38 | server.port=81 |
| ... | ... | @@ -31,22 +40,27 @@ server.port=81 |
| 31 | 40 | sync_users_api=http://api.cnlive.com/open/api2/inner2/shenhe/getuser |
| 32 | 41 | sync_users_app_key=314a9dd4-a9b7-4c12-bbbe-1150a36491ae |
| 33 | 42 | |
| 34 | -#点播云需要的常量 | |
| 43 | +#\u70b9\u64ad\u4e91\u9700\u8981\u7684\u5e38\u91cf | |
| 35 | 44 | url=http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify |
| 36 | 45 | platformKey =AUDIT |
| 37 | 46 | platformValue=10011438 |
| 38 | 47 | |
| 39 | -#抽帧常量 | |
| 48 | +#\u62bd\u5e27\u5e38\u91cf | |
| 40 | 49 | avsmple_appKey=1eac30dfbee311e7a2f0fa163e771cf9 |
| 41 | 50 | avsmple_appSecret=28ce1e1fbee311e7a2f0fa163e771cf92ea58ebfbee311e7a2f0fa163e771cf9 |
| 42 | 51 | avsmple_url=http://transcode.cnlive.com/api/request |
| 43 | 52 | avsmple_callback=http://shen.cnlive.com/api/avsample/callback |
| 44 | 53 | |
| 45 | -#抽帧存放bucket和域名 | |
| 54 | +#\u62bd\u5e27\u5b58\u653ebucket\u548c\u57df\u540d | |
| 55 | +#qn_bucket=cnlivetest | |
| 56 | +#qn_domain=http://test.qnvod.cnlive.com | |
| 57 | +#ks_bucket=cnlive-test | |
| 58 | +#ks_domain=http://test.wideo.cnlive.com | |
| 59 | + | |
| 46 | 60 | qn_bucket=mam-sxzg-82 |
| 47 | 61 | qn_domain=http://sxzg.ys2.cnliveimg.com |
| 48 | 62 | ks_bucket=mam-sxzg-82 |
| 49 | 63 | ks_domain=http://sxzg.ys1.cnliveimg.com |
| 50 | 64 | |
| 51 | -#图片存放根路径 | |
| 65 | +#\u56fe\u7247\u5b58\u653e\u6839\u8def\u5f84 | |
| 52 | 66 | desdir=shen | ... | ... |
src/main/resources/mapper/ShyVideofilterMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.cnlive.shenhe.mapper.ShyVideofilterMapper"> | |
| 4 | + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.ShyVideofilter"> | |
| 5 | + <!-- | |
| 6 | + WARNING - @mbg.generated | |
| 7 | + --> | |
| 8 | + <id column="id" jdbcType="INTEGER" property="id" /> | |
| 9 | + <result column="videos_id" jdbcType="INTEGER" property="videos_id" /> | |
| 10 | + <result column="token_id" jdbcType="VARCHAR" property="token_id" /> | |
| 11 | + <result column="channel" jdbcType="VARCHAR" property="channel" /> | |
| 12 | + <result column="result_type" jdbcType="VARCHAR" property="result_type" /> | |
| 13 | + <result column="desc_msg" jdbcType="VARCHAR" property="desc_msg" /> | |
| 14 | + <result column="created_at" jdbcType="TIMESTAMP" property="created_at" /> | |
| 15 | + </resultMap> | |
| 16 | +</mapper> | |
| 0 | 17 | \ No newline at end of file | ... | ... |
src/main/resources/mapper/ShyVideosMapper.xml
| ... | ... | @@ -27,11 +27,12 @@ |
| 27 | 27 | <result column="receive" jdbcType="BIT" property="receive" /> |
| 28 | 28 | <result column="receive_user_id" jdbcType="VARCHAR" property="receive_user_id" /> |
| 29 | 29 | <result column="avsample" jdbcType="INTEGER" property="avsample" /> |
| 30 | - <result column="avsample_imgs" jdbcType="VARCHAR" property="avsample_imgs" /> | |
| 31 | - <result column="avsample_msg" jdbcType="VARCHAR" property="avsample_msg" /> | |
| 32 | 30 | <result column="task_id" jdbcType="VARCHAR" property="task_id" /> |
| 33 | 31 | <result column="bucket" jdbcType="VARCHAR" property="bucket" /> |
| 34 | 32 | <result column="plat" jdbcType="INTEGER" property="plat" /> |
| 35 | 33 | <result column="duration" jdbcType="INTEGER" property="duration" /> |
| 34 | + <result column="category" jdbcType="VARCHAR" property="category" /> | |
| 35 | + <result column="avsample_imgs" jdbcType="LONGVARCHAR" property="avsample_imgs" /> | |
| 36 | + <result column="avsample_msg" jdbcType="LONGVARCHAR" property="avsample_msg" /> | |
| 36 | 37 | </resultMap> |
| 37 | 38 | </mapper> |
| 38 | 39 | \ No newline at end of file | ... | ... |
src/main/resources/templates/page/comment.html
| ... | ... | @@ -39,10 +39,10 @@ |
| 39 | 39 | onclick="receive(0);">认领 |
| 40 | 40 | </button> |
| 41 | 41 | <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" |
| 42 | - onclick="receive(100);">认领100条 | |
| 42 | + onclick="receive(10);">认领10条 | |
| 43 | 43 | </button> |
| 44 | 44 | <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" |
| 45 | - onclick="receive(1000);">认领1000条 | |
| 45 | + onclick="receive(100);">认领100条 | |
| 46 | 46 | </button> |
| 47 | 47 | <button type="button" class="btn btn-warning btn-sm margin-r-5 action_bottom" |
| 48 | 48 | onclick="retReceive();">退领 |
| ... | ... | @@ -204,7 +204,7 @@ |
| 204 | 204 | </div> |
| 205 | 205 | <div class="fht-cell"></div> |
| 206 | 206 | </th> |
| 207 | - <th style="text-align: center; width: 6%; " data-field="auditor" | |
| 207 | + <th style="text-align: center; width: 6%; " data-field="updater" | |
| 208 | 208 | tabindex="0"> |
| 209 | 209 | <div class="th-inner ">审核员</div> |
| 210 | 210 | <div class="fht-cell"></div> |
| ... | ... | @@ -264,7 +264,7 @@ |
| 264 | 264 | <td style="text-align: center; width: 15%;" |
| 265 | 265 | th:text="${comment.comment_title}"> |
| 266 | 266 | </td> |
| 267 | - <td style="text-align: center; width: 6%;" th:text="${comment.auditor}"> | |
| 267 | + <td style="text-align: center; width: 6%;" th:text="${comment.updater}"> | |
| 268 | 268 | 发布 |
| 269 | 269 | openadmin9@cnlive.com |
| 270 | 270 | </td> |
| ... | ... | @@ -307,19 +307,19 @@ |
| 307 | 307 | <button class="btn btn-warning btn-sm">退领</button> |
| 308 | 308 | </a> |
| 309 | 309 | |
| 310 | - <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> </span> | |
| 311 | - <a class="pass_one" | |
| 312 | - th:href="@{'javascript:comment('+${comment.id}+',1)'}" | |
| 313 | - th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> | |
| 314 | - <button class="btn btn-success btn-sm">通过</button> | |
| 315 | - </a> | |
| 316 | - | |
| 317 | - <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> </span> | |
| 318 | - <a class="failed_one" | |
| 319 | - th:href="@{'javascript:comment('+${comment.id}+',2)'}" | |
| 320 | - th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> | |
| 321 | - <button class="btn btn-danger btn-sm">拒绝</button> | |
| 322 | - </a> | |
| 310 | +<!-- <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> </span> --> | |
| 311 | +<!-- <a class="pass_one" --> | |
| 312 | +<!-- th:href="@{'javascript:comment('+${comment.id}+',1)'}" --> | |
| 313 | +<!-- th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> --> | |
| 314 | +<!-- <button class="btn btn-success btn-sm">通过</button> --> | |
| 315 | +<!-- </a> --> | |
| 316 | + | |
| 317 | +<!-- <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> </span> --> | |
| 318 | +<!-- <a class="failed_one" --> | |
| 319 | +<!-- th:href="@{'javascript:comment('+${comment.id}+',2)'}" --> | |
| 320 | +<!-- th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> --> | |
| 321 | +<!-- <button class="btn btn-danger btn-sm">拒绝</button> --> | |
| 322 | +<!-- </a> --> | |
| 323 | 323 | </td> |
| 324 | 324 | </tr> |
| 325 | 325 | </tbody> | ... | ... |
src/main/resources/templates/page/commentDetail.html
| ... | ... | @@ -140,9 +140,9 @@ |
| 140 | 140 | </div> |
| 141 | 141 | |
| 142 | 142 | <div class="form-group"> |
| 143 | - <label for="auditor" class="control-label col-sm-2">审核员:</label> | |
| 143 | + <label for="updater" class="control-label col-sm-2">审核员:</label> | |
| 144 | 144 | <div class="col-sm-10"> |
| 145 | - <h5 th:text="${comment.auditor}">发布 | |
| 145 | + <h5 th:text="${comment.updater}">发布 | |
| 146 | 146 | openadmin9@cnlive.com</h5> |
| 147 | 147 | </div> |
| 148 | 148 | </div> | ... | ... |
src/main/resources/templates/page/video.html
| ... | ... | @@ -33,11 +33,11 @@ |
| 33 | 33 | </button> |
| 34 | 34 | <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" |
| 35 | 35 | value="2" data="claim100" id="claim100" data-toggle="modal" |
| 36 | - data-target="#modal" onclick="receive(100);">认领100条 | |
| 36 | + data-target="#modal" onclick="receive(10);">认领10条 | |
| 37 | 37 | </button> |
| 38 | 38 | <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" |
| 39 | 39 | value="2" data="claim1000" id="claim1000" data-toggle="modal" |
| 40 | - data-target="#modal" onclick="receive(1000);">认领1000条 | |
| 40 | + data-target="#modal" onclick="receive(100);">认领100条 | |
| 41 | 41 | </button> |
| 42 | 42 | <button type="button" class="btn btn-warning btn-sm margin-r-5 action claim" |
| 43 | 43 | value="2" data="claim1000" id="claim1000" data-toggle="modal" |
| ... | ... | @@ -163,7 +163,7 @@ |
| 163 | 163 | <div class="fht-cell"></div> |
| 164 | 164 | </th> |
| 165 | 165 | <!--<th style="text-align: center; width: 10%; " data-field="video_cover_img" tabindex="0"><div class="th-inner ">点播封面图</div><div class="fht-cell"></div></th>--> |
| 166 | - <th style="text-align: center; width: 6%; " data-field="auditor" | |
| 166 | + <th style="text-align: center; width: 6%; " data-field="updater" | |
| 167 | 167 | tabindex="0"> |
| 168 | 168 | <div class="th-inner ">审核员</div> |
| 169 | 169 | <div class="fht-cell"></div> |
| ... | ... | @@ -202,7 +202,7 @@ |
| 202 | 202 | <!--<td style="text-align: center; width: 10%;">--> |
| 203 | 203 | <!--<div width="160px" height="90px"><img th:src="@{${video.video_poster}}" width="160px" alt="封面图"></div>--> |
| 204 | 204 | <!--</td>--> |
| 205 | - <td style="text-align: center; width: 6%;" th:text="${video.auditor}">审核员 | |
| 205 | + <td style="text-align: center; width: 6%;" th:text="${video.updater}">审核员 | |
| 206 | 206 | </td> |
| 207 | 207 | <td style="text-align: center; width: 3%;" |
| 208 | 208 | th:text="${video.video_priority=='1'?'是':'否'}">是 | ... | ... |
src/main/resources/templates/page/videoDetail.html
| ... | ... | @@ -167,7 +167,7 @@ |
| 167 | 167 | <div class="form-group "> |
| 168 | 168 | <label for="auditor_id" class="control-label col-sm-3">审核员:</label> |
| 169 | 169 | <div class="col-sm-9 "> |
| 170 | - <h5 id="auditor_id" th:text="${video.auditor}">系统审核 </h5> | |
| 170 | + <h5 id="auditor_id" th:text="${video.updater}">系统审核 </h5> | |
| 171 | 171 | </div> |
| 172 | 172 | </div> |
| 173 | 173 | ... | ... |