Commit ea9898ed11e4f44d8417cb58c91e3182befe29df

Authored by 王言钊
1 parent 7831ad1e

开发点播service接口测试并优化代码

src/main/java/com/cnlive/shenhe/api/AvsampleCallBackControllerApi.java
@@ -2,18 +2,22 @@ package com.cnlive.shenhe.api; @@ -2,18 +2,22 @@ package com.cnlive.shenhe.api;
2 2
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
4 import com.cnlive.shenhe.entity.ShyVideos; 4 import com.cnlive.shenhe.entity.ShyVideos;
5 -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; 5 +import com.cnlive.shenhe.service.VideosService;
6 import com.cnlive.shenhe.utils.CommonConst; 6 import com.cnlive.shenhe.utils.CommonConst;
7 import com.cnlive.shenhe.utils.CommonUtils; 7 import com.cnlive.shenhe.utils.CommonUtils;
8 import org.slf4j.Logger; 8 import org.slf4j.Logger;
9 import org.slf4j.LoggerFactory; 9 import org.slf4j.LoggerFactory;
10 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
11 import org.springframework.stereotype.Controller; 11 import org.springframework.stereotype.Controller;
12 -import org.springframework.web.bind.annotation.*; 12 +import org.springframework.web.bind.annotation.PostMapping;
  13 +import org.springframework.web.bind.annotation.RequestBody;
  14 +import org.springframework.web.bind.annotation.RequestMapping;
  15 +import org.springframework.web.bind.annotation.ResponseBody;
13 16
14 import java.util.List; 17 import java.util.List;
15 18
16 /** 19 /**
  20 + * @author Administrator
17 * @Auther: 周伟鹏 21 * @Auther: 周伟鹏
18 * @Date: 2018/12/21 13:43 22 * @Date: 2018/12/21 13:43
19 * @Description:抽帧回调接口 23 * @Description:抽帧回调接口
@@ -25,7 +29,7 @@ public class AvsampleCallBackControllerApi { @@ -25,7 +29,7 @@ public class AvsampleCallBackControllerApi {
25 private static Logger logger = LoggerFactory.getLogger(AvsampleCallBackControllerApi.class); 29 private static Logger logger = LoggerFactory.getLogger(AvsampleCallBackControllerApi.class);
26 30
27 @Autowired 31 @Autowired
28 - VideosServiceImpl videosService; 32 + VideosService videosService;
29 33
30 /** 34 /**
31 * 接收抽帧结果 35 * 接收抽帧结果
@@ -43,7 +47,7 @@ public class AvsampleCallBackControllerApi { @@ -43,7 +47,7 @@ public class AvsampleCallBackControllerApi {
43 if (CommonUtils.isNotEmpty(taskId)) { 47 if (CommonUtils.isNotEmpty(taskId)) {
44 ShyVideos shyVideo = new ShyVideos(); 48 ShyVideos shyVideo = new ShyVideos();
45 shyVideo.setTask_id(taskId); 49 shyVideo.setTask_id(taskId);
46 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideo); 50 + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideo);
47 if (!shyVideosList.isEmpty()) { 51 if (!shyVideosList.isEmpty()) {
48 ShyVideos video = shyVideosList.get(0); 52 ShyVideos video = shyVideosList.get(0);
49 Integer code = json.getInteger("code"); 53 Integer code = json.getInteger("code");
@@ -58,7 +62,7 @@ public class AvsampleCallBackControllerApi { @@ -58,7 +62,7 @@ public class AvsampleCallBackControllerApi {
58 video.setMsg("抽帧失败,改为人工审核,失败消息:" + json.getString("errorMsg")); 62 video.setMsg("抽帧失败,改为人工审核,失败消息:" + json.getString("errorMsg"));
59 } 63 }
60 video.setAvsample_msg(json.toJSONString()); 64 video.setAvsample_msg(json.toJSONString());
61 - boolean success = videosService.updateshyVideos(video); 65 + boolean success = videosService.updateShyVideos(video);
62 if (!success) { 66 if (!success) {
63 result.put("code", -1); 67 result.put("code", -1);
64 } 68 }
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject; @@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 import com.cnlive.shenhe.bean.ErrorEnum; 5 import com.cnlive.shenhe.bean.ErrorEnum;
6 import com.cnlive.shenhe.bean.ResponseBean; 6 import com.cnlive.shenhe.bean.ResponseBean;
7 import com.cnlive.shenhe.entity.ShyVideos; 7 import com.cnlive.shenhe.entity.ShyVideos;
8 -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; 8 +import com.cnlive.shenhe.service.VideosService;
9 import com.cnlive.shenhe.utils.CommonConst; 9 import com.cnlive.shenhe.utils.CommonConst;
10 import com.cnlive.shenhe.utils.CommonUtils; 10 import com.cnlive.shenhe.utils.CommonUtils;
11 import com.cnlive.shenhe.utils.HttpUtil; 11 import com.cnlive.shenhe.utils.HttpUtil;
@@ -33,7 +33,7 @@ import java.util.Map; @@ -33,7 +33,7 @@ import java.util.Map;
33 public class VideosControllerApi { 33 public class VideosControllerApi {
34 private static Logger logger = LoggerFactory.getLogger(VideosControllerApi.class); 34 private static Logger logger = LoggerFactory.getLogger(VideosControllerApi.class);
35 @Autowired 35 @Autowired
36 - VideosServiceImpl videosService; 36 + VideosService videosService;
37 37
38 @Value("${avsmple_appKey}") 38 @Value("${avsmple_appKey}")
39 String appkey; 39 String appkey;
@@ -80,7 +80,7 @@ public class VideosControllerApi { @@ -80,7 +80,7 @@ public class VideosControllerApi {
80 //g得到id去查询是否已有 80 //g得到id去查询是否已有
81 String videoId = json.getString("videoId"); 81 String videoId = json.getString("videoId");
82 shyVideos.setVideo_id(videoId); 82 shyVideos.setVideo_id(videoId);
83 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); 83 + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos);
84 if (shyVideosList.size() > 0) { 84 if (shyVideosList.size() > 0) {
85 logger.info("点播入库更新开始............................"); 85 logger.info("点播入库更新开始............................");
86 ShyVideos shyVideos1 = shyVideosList.get(0); 86 ShyVideos shyVideos1 = shyVideosList.get(0);
@@ -149,7 +149,7 @@ public class VideosControllerApi { @@ -149,7 +149,7 @@ public class VideosControllerApi {
149 return videosService.impotVideo(shyVideos); 149 return videosService.impotVideo(shyVideos);
150 } else { 150 } else {
151 logger.info("当前视频类型是:" + shyVideos.getShenhe_type()); 151 logger.info("当前视频类型是:" + shyVideos.getShenhe_type());
152 - return videosService.updateshyVideos(shyVideos); 152 + return videosService.updateShyVideos(shyVideos);
153 } 153 }
154 } 154 }
155 155
src/main/java/com/cnlive/shenhe/controller/LiveController.java
@@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers; @@ -12,7 +12,7 @@ import com.cnlive.shenhe.entity.ShyUsers;
12 import com.cnlive.shenhe.service.LiveService; 12 import com.cnlive.shenhe.service.LiveService;
13 import com.cnlive.shenhe.service.SitesService; 13 import com.cnlive.shenhe.service.SitesService;
14 import com.cnlive.shenhe.service.UsersService; 14 import com.cnlive.shenhe.service.UsersService;
15 -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; 15 +import com.cnlive.shenhe.service.VideosService;
16 import com.cnlive.shenhe.utils.AuditPass; 16 import com.cnlive.shenhe.utils.AuditPass;
17 import com.cnlive.shenhe.utils.CommonConst; 17 import com.cnlive.shenhe.utils.CommonConst;
18 import com.cnlive.shenhe.utils.CommonUtils; 18 import com.cnlive.shenhe.utils.CommonUtils;
@@ -51,7 +51,7 @@ public class LiveController extends BaseController { @@ -51,7 +51,7 @@ public class LiveController extends BaseController {
51 @Autowired 51 @Autowired
52 AuditPass pass; 52 AuditPass pass;
53 @Autowired 53 @Autowired
54 - VideosServiceImpl videosService; 54 + VideosService videosService;
55 @Autowired 55 @Autowired
56 UsersService usersService; 56 UsersService usersService;
57 @Autowired 57 @Autowired
@@ -134,18 +134,23 @@ public class LiveController extends BaseController { @@ -134,18 +134,23 @@ public class LiveController extends BaseController {
134 } else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && liveDTO.getSpid() == 0) { 134 } else if (CommonUtils.isEmpty(liveDTO.getSp_desc()) && liveDTO.getSpid() == 0) {
135 liveDTO.setSpid(null); 135 liveDTO.setSpid(null);
136 } 136 }
137 - String orderByClause = ""; 137 + StringBuilder orderByClause = new StringBuilder();
  138 + //String orderByClause = "";
138 //审核状态:全部待领 139 //审核状态:全部待领
139 if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 0) { 140 if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 0) {
140 - orderByClause = "field(activity_status,1,3,2,0,4), pre_start_time ";  
141 - } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 1) {//审核状态:待审核  
142 - orderByClause = "field(activity_status,1,3,2,0,4), pre_start_time ";  
143 - } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 2) {//审核状态:已审核  
144 - orderByClause = "pre_start_time desc";  
145 - } else {//审核状态:全部  
146 - orderByClause = "is_hot desc, pre_start_time ";  
147 - if (liveDTO.getActivity_status() != null && (liveDTO.getActivity_status() == 0 || liveDTO.getActivity_status() == 2 || liveDTO.getActivity_status() == 4)) {//直播状态:结束、撤销、下线  
148 - orderByClause = "is_hot desc, pre_start_time desc"; 141 + orderByClause.append("field(activity_status,1,3,2,0,4), pre_start_time");
  142 + //审核状态:待审核
  143 + } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 1) {
  144 + orderByClause.append("field(activity_status,1,3,2,0,4), pre_start_time");
  145 + //审核状态:已审核
  146 + } else if (liveDTO.getShenhe_state() != null && liveDTO.getShenhe_state() == 2) {
  147 + orderByClause.append("pre_start_time desc");
  148 + //审核状态:全部
  149 + } else {
  150 + orderByClause.append("is_hot desc, pre_start_time");
  151 + //直播状态:结束、撤销、下线
  152 + if (liveDTO.getActivity_status() != null && (liveDTO.getActivity_status() == 0 || liveDTO.getActivity_status() == 2 || liveDTO.getActivity_status() == 4)) {
  153 + orderByClause.append("is_hot desc, pre_start_time desc");
149 } 154 }
150 } 155 }
151 if (CommonUtils.isNotNull(liveDTO.getContentId())) { 156 if (CommonUtils.isNotNull(liveDTO.getContentId())) {
src/main/java/com/cnlive/shenhe/controller/VideosController.java
@@ -7,11 +7,7 @@ import com.cnlive.shenhe.bean.ResponseBean; @@ -7,11 +7,7 @@ import com.cnlive.shenhe.bean.ResponseBean;
7 import com.cnlive.shenhe.bean.SessionUser; 7 import com.cnlive.shenhe.bean.SessionUser;
8 import com.cnlive.shenhe.dto.VideosDTO; 8 import com.cnlive.shenhe.dto.VideosDTO;
9 import com.cnlive.shenhe.entity.*; 9 import com.cnlive.shenhe.entity.*;
10 -import com.cnlive.shenhe.service.ShyActivityService;  
11 -import com.cnlive.shenhe.service.ShyLogService;  
12 -import com.cnlive.shenhe.service.SitesService;  
13 -import com.cnlive.shenhe.service.UsersService;  
14 -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; 10 +import com.cnlive.shenhe.service.*;
15 import com.cnlive.shenhe.utils.AuditPass; 11 import com.cnlive.shenhe.utils.AuditPass;
16 import com.cnlive.shenhe.utils.CommonConst; 12 import com.cnlive.shenhe.utils.CommonConst;
17 import com.cnlive.shenhe.utils.CommonUtils; 13 import com.cnlive.shenhe.utils.CommonUtils;
@@ -51,7 +47,7 @@ public class VideosController extends BaseController { @@ -51,7 +47,7 @@ public class VideosController extends BaseController {
51 @Autowired 47 @Autowired
52 private AuditPass pass; 48 private AuditPass pass;
53 @Autowired 49 @Autowired
54 - private VideosServiceImpl videosService; 50 + private VideosService videosService;
55 @Autowired 51 @Autowired
56 private UsersService usersService; 52 private UsersService usersService;
57 @Autowired 53 @Autowired
src/main/java/com/cnlive/shenhe/job/VideosJob.java
1 package com.cnlive.shenhe.job; 1 package com.cnlive.shenhe.job;
2 2
3 import com.cnlive.shenhe.entity.ShyVideos; 3 import com.cnlive.shenhe.entity.ShyVideos;
4 -import com.cnlive.shenhe.service.serviceImpl.VideosServiceImpl; 4 +import com.cnlive.shenhe.service.VideosService;
5 import com.cnlive.shenhe.utils.CommonConst; 5 import com.cnlive.shenhe.utils.CommonConst;
6 import com.cnlive.shenhe.utils.CommonConstStates; 6 import com.cnlive.shenhe.utils.CommonConstStates;
7 import org.slf4j.Logger; 7 import org.slf4j.Logger;
@@ -20,7 +20,7 @@ public class VideosJob { @@ -20,7 +20,7 @@ public class VideosJob {
20 20
21 private static Logger logger = LoggerFactory.getLogger(VideosJob.class); 21 private static Logger logger = LoggerFactory.getLogger(VideosJob.class);
22 @Autowired 22 @Autowired
23 - VideosServiceImpl videosService; 23 + VideosService videosService;
24 24
25 /** 25 /**
26 * 白名单sp视频通过 26 * 白名单sp视频通过
@@ -33,7 +33,7 @@ public class VideosJob { @@ -33,7 +33,7 @@ public class VideosJob {
33 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_FREE); 33 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_FREE);
34 // 审核状态为未审核 34 // 审核状态为未审核
35 shyVideos.setState(CommonConst.AUDIT_INTT); 35 shyVideos.setState(CommonConst.AUDIT_INTT);
36 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); 36 + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos);
37 if (shyVideosList.size() > 0) { 37 if (shyVideosList.size() > 0) {
38 for (ShyVideos video : shyVideosList) { 38 for (ShyVideos video : shyVideosList) {
39 logger.info("当前白名单通过的videos_id:" + video.getId()); 39 logger.info("当前白名单通过的videos_id:" + video.getId());
@@ -50,7 +50,7 @@ public class VideosJob { @@ -50,7 +50,7 @@ public class VideosJob {
50 * 每天8点到23点执行,每分钟一次 50 * 每天8点到23点执行,每分钟一次
51 */ 51 */
52 @Scheduled(cron = "0 0/1 8-23 * * ? ") 52 @Scheduled(cron = "0 0/1 8-23 * * ? ")
53 - public void videofilter() { 53 + public void videoFilter() {
54 ShyVideos shyVideos = new ShyVideos(); 54 ShyVideos shyVideos = new ShyVideos();
55 //审核类型为机审 55 //审核类型为机审
56 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); 56 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);
@@ -58,7 +58,7 @@ public class VideosJob { @@ -58,7 +58,7 @@ public class VideosJob {
58 shyVideos.setState(CommonConst.AUDIT_INTT); 58 shyVideos.setState(CommonConst.AUDIT_INTT);
59 //抽帧完成 59 //抽帧完成
60 shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS); 60 shyVideos.setAvsample(CommonConst.AVSAMPLE_SUCCESS);
61 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); 61 + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos);
62 if (shyVideosList != null && shyVideosList.size() > 0) { 62 if (shyVideosList != null && shyVideosList.size() > 0) {
63 for (ShyVideos video : shyVideosList) { 63 for (ShyVideos video : shyVideosList) {
64 logger.info("定时向易盾发送检测视频的videos_id:{}", video.getId()); 64 logger.info("定时向易盾发送检测视频的videos_id:{}", video.getId());
@@ -82,14 +82,14 @@ public class VideosJob { @@ -82,14 +82,14 @@ public class VideosJob {
82 shyVideos.setState(CommonConst.AUDIT_INTT); 82 shyVideos.setState(CommonConst.AUDIT_INTT);
83 //已领取 83 //已领取
84 shyVideos.setReceive(CommonConst.RECEIVE_AFTER); 84 shyVideos.setReceive(CommonConst.RECEIVE_AFTER);
85 - List<ShyVideos> shyVideosList = videosService.findshyVideo(shyVideos); 85 + List<ShyVideos> shyVideosList = videosService.findShyVideo(shyVideos);
86 if (shyVideosList.size() > 0) { 86 if (shyVideosList.size() > 0) {
87 for (ShyVideos shyVideos2 : shyVideosList) { 87 for (ShyVideos shyVideos2 : shyVideosList) {
88 logger.info("自动退领的videos_id:" + shyVideos2.getId()); 88 logger.info("自动退领的videos_id:" + shyVideos2.getId());
89 //未领取 89 //未领取
90 shyVideos2.setReceive(CommonConst.RECEIVE_BEFORE); 90 shyVideos2.setReceive(CommonConst.RECEIVE_BEFORE);
91 shyVideos2.setReceive_user_id(null); 91 shyVideos2.setReceive_user_id(null);
92 - videosService.updateshyVideos(shyVideos2); 92 + videosService.updateShyVideos(shyVideos2);
93 } 93 }
94 } 94 }
95 } 95 }
src/main/java/com/cnlive/shenhe/service/VideosService.java 0 → 100644
  1 +package com.cnlive.shenhe.service;
  2 +
  3 +import com.cnlive.shenhe.bean.ResponseBean;
  4 +import com.cnlive.shenhe.dto.VideosDTO;
  5 +import com.cnlive.shenhe.entity.ShyVideos;
  6 +import com.github.pagehelper.PageInfo;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * @Author: yan-zhao-wang
  12 + * @DateTime: 2022-11-10 9:05
  13 + */
  14 +public interface VideosService {
  15 + /**
  16 + * 导入点播视频 返回布尔类型
  17 + *
  18 + * @param shyVideos
  19 + * @return
  20 + */
  21 + boolean impotVideo(ShyVideos shyVideos);
  22 +
  23 + /**
  24 + * 根据主键id查询video对象
  25 + *
  26 + * @param id
  27 + * @return
  28 + */
  29 + ShyVideos selectByPrimaryKey(Integer id);
  30 +
  31 + /**
  32 + * 根据对象查询 返回video列表集合
  33 + *
  34 + * @param shyVideos
  35 + * @return
  36 + */
  37 + List<ShyVideos> findShyVideo(ShyVideos shyVideos);
  38 +
  39 + /**
  40 + * 根据主键修改点播 返回布尔类型
  41 + *
  42 + * @param shyVideos
  43 + * @return
  44 + */
  45 + boolean updateShyVideos(ShyVideos shyVideos);
  46 +
  47 + /**
  48 + * 根据条件修改video 返回int类型
  49 + *
  50 + * @param id
  51 + * @param auditorId
  52 + * @param updater
  53 + * @param attrTags
  54 + * @param state
  55 + * @param msg
  56 + * @return
  57 + */
  58 + int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg);
  59 +
  60 + /**
  61 + * video分页、条件查询 返回列表集合
  62 + *
  63 + * @param videosDTO
  64 + * @return
  65 + */
  66 + PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO);
  67 +
  68 + /**
  69 + * 获取video详情
  70 + *
  71 + * @param id
  72 + * @return
  73 + */
  74 + ShyVideos getDetailsVideo(Integer id);
  75 +
  76 + /**
  77 + * 认领video
  78 + *
  79 + * @param ids
  80 + * @param num
  81 + * @param userId
  82 + * @param spid
  83 + * @return
  84 + */
  85 + Integer receive(String ids, Integer num, String userId, Integer spid);
  86 +
  87 + /**
  88 + * 退领video
  89 + *
  90 + * @param ids
  91 + * @param userId
  92 + * @return
  93 + */
  94 + ResponseBean retReceive(String ids, String userId);
  95 +
  96 + /**
  97 + * 根据条件导出数据excel
  98 + *
  99 + * @param videosDTO
  100 + * @return
  101 + */
  102 + List<ShyVideos> findByCondition(VideosDTO videosDTO);
  103 +
  104 + /**
  105 + * 易盾视频(图片)过滤
  106 + * type:1:文本 2:图片 3.网页 4:点播音频
  107 + *
  108 + * @param cid 审核云中视频的id
  109 + */
  110 + void videoFilter(Integer cid);
  111 +
  112 + /**
  113 + * 更新点播和审核的视频状态
  114 + *
  115 + * @param video
  116 + * @param dianboState 视频状态,1通过,2不通过
  117 + */
  118 + void updateDianboAndShenhe(ShyVideos video, int dianboState);
  119 +
  120 + /**
  121 + * 根据sp、栏目、用户id来判断审核类型
  122 + *
  123 + * @param shyVideo
  124 + */
  125 + void getShenheType(ShyVideos shyVideo);
  126 +
  127 + /**
  128 + * 人工审核拒绝方法
  129 + *
  130 + * @param shyVideoId
  131 + * @param msg
  132 + * @param userId
  133 + * @param
  134 + * @return
  135 + */
  136 + String repulse(String shyVideoId, String msg, String userId);
  137 +}
src/main/java/com/cnlive/shenhe/service/serviceImpl/ContentServiceImpl.java
@@ -8,6 +8,7 @@ import com.cnlive.shenhe.mapper.ShyContentMapper; @@ -8,6 +8,7 @@ import com.cnlive.shenhe.mapper.ShyContentMapper;
8 import com.cnlive.shenhe.mapper.ShyUsersMapper; 8 import com.cnlive.shenhe.mapper.ShyUsersMapper;
9 import com.cnlive.shenhe.service.ContentService; 9 import com.cnlive.shenhe.service.ContentService;
10 import com.cnlive.shenhe.service.SitesService; 10 import com.cnlive.shenhe.service.SitesService;
  11 +import com.cnlive.shenhe.service.VideosService;
11 import com.cnlive.shenhe.service.YiDunService; 12 import com.cnlive.shenhe.service.YiDunService;
12 import com.cnlive.shenhe.utils.*; 13 import com.cnlive.shenhe.utils.*;
13 import com.github.pagehelper.PageHelper; 14 import com.github.pagehelper.PageHelper;
@@ -41,7 +42,7 @@ public class ContentServiceImpl implements ContentService { @@ -41,7 +42,7 @@ public class ContentServiceImpl implements ContentService {
41 @Autowired 42 @Autowired
42 SitesService sitesService; 43 SitesService sitesService;
43 @Autowired 44 @Autowired
44 - VideosServiceImpl videosService; 45 + VideosService videosService;
45 @Autowired 46 @Autowired
46 YiDunService yiDunService; 47 YiDunService yiDunService;
47 48
@@ -286,9 +287,9 @@ public class ContentServiceImpl implements ContentService { @@ -286,9 +287,9 @@ public class ContentServiceImpl implements ContentService {
286 && state.equals(CommonConst.AUDIT_REFUSE)) { 287 && state.equals(CommonConst.AUDIT_REFUSE)) {
287 ShyVideos shyVideos1 = new ShyVideos(); 288 ShyVideos shyVideos1 = new ShyVideos();
288 shyVideos1.setVideo_id(content.getVideo_id()); 289 shyVideos1.setVideo_id(content.getVideo_id());
289 - List<ShyVideos> listshyVideos = videosService.findshyVideo(shyVideos1);  
290 - if (listshyVideos.size() > 0) {  
291 - ShyVideos shyVideos = listshyVideos.get(0); 290 + List<ShyVideos> listShyVideos = videosService.findShyVideo(shyVideos1);
  291 + if (listShyVideos.size() > 0) {
  292 + ShyVideos shyVideos = listShyVideos.get(0);
292 String showMsg = videosService.repulse(shyVideos.getId().toString(), msg, userId); 293 String showMsg = videosService.repulse(shyVideos.getId().toString(), msg, userId);
293 if (CommonUtils.isNotEmpty(showMsg)) { 294 if (CommonUtils.isNotEmpty(showMsg)) {
294 success = false; 295 success = false;
src/main/java/com/cnlive/shenhe/service/serviceImpl/VideosServiceImpl.java
@@ -12,10 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos; @@ -12,10 +12,7 @@ import com.cnlive.shenhe.entity.ShyVideos;
12 import com.cnlive.shenhe.entity.ShyYidun; 12 import com.cnlive.shenhe.entity.ShyYidun;
13 import com.cnlive.shenhe.mapper.ShyUsersMapper; 13 import com.cnlive.shenhe.mapper.ShyUsersMapper;
14 import com.cnlive.shenhe.mapper.ShyVideosMapper; 14 import com.cnlive.shenhe.mapper.ShyVideosMapper;
15 -import com.cnlive.shenhe.service.ShyActivityService;  
16 -import com.cnlive.shenhe.service.SitesService;  
17 -import com.cnlive.shenhe.service.UsersfreeService;  
18 -import com.cnlive.shenhe.service.YiDunService; 15 +import com.cnlive.shenhe.service.*;
19 import com.cnlive.shenhe.utils.*; 16 import com.cnlive.shenhe.utils.*;
20 import com.github.pagehelper.PageHelper; 17 import com.github.pagehelper.PageHelper;
21 import com.github.pagehelper.PageInfo; 18 import com.github.pagehelper.PageInfo;
@@ -34,12 +31,13 @@ import java.util.List; @@ -34,12 +31,13 @@ import java.util.List;
34 import java.util.UUID; 31 import java.util.UUID;
35 32
36 /** 33 /**
  34 + * @author Administrator
37 * @Auther: chenhao 35 * @Auther: chenhao
38 * @Date: 2018/11/30 14:23 36 * @Date: 2018/11/30 14:23
39 * @Description: 37 * @Description:
40 */ 38 */
41 @Service 39 @Service
42 -public class VideosServiceImpl { 40 +public class VideosServiceImpl implements VideosService {
43 41
44 private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class); 42 private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class);
45 @Autowired 43 @Autowired
@@ -47,7 +45,7 @@ public class VideosServiceImpl { @@ -47,7 +45,7 @@ public class VideosServiceImpl {
47 @Autowired 45 @Autowired
48 private ShyUsersMapper shyUsersMapper; 46 private ShyUsersMapper shyUsersMapper;
49 @Autowired 47 @Autowired
50 - private VideosServiceImpl videosService; 48 + private VideosService videosService;
51 @Autowired 49 @Autowired
52 private SitesService sitesService; 50 private SitesService sitesService;
53 @Autowired 51 @Autowired
@@ -69,6 +67,7 @@ public class VideosServiceImpl { @@ -69,6 +67,7 @@ public class VideosServiceImpl {
69 * @param shyVideos 67 * @param shyVideos
70 * @return 68 * @return
71 */ 69 */
  70 + @Override
72 public boolean impotVideo(ShyVideos shyVideos) { 71 public boolean impotVideo(ShyVideos shyVideos) {
73 int result = shyVideosMapper.insertSelective(shyVideos); 72 int result = shyVideosMapper.insertSelective(shyVideos);
74 return result != 0; 73 return result != 0;
@@ -80,6 +79,7 @@ public class VideosServiceImpl { @@ -80,6 +79,7 @@ public class VideosServiceImpl {
80 * @param id 79 * @param id
81 * @return 80 * @return
82 */ 81 */
  82 + @Override
83 public ShyVideos selectByPrimaryKey(Integer id) { 83 public ShyVideos selectByPrimaryKey(Integer id) {
84 return shyVideosMapper.selectByPrimaryKey(id); 84 return shyVideosMapper.selectByPrimaryKey(id);
85 } 85 }
@@ -90,7 +90,8 @@ public class VideosServiceImpl { @@ -90,7 +90,8 @@ public class VideosServiceImpl {
90 * @param shyVideos 90 * @param shyVideos
91 * @return 91 * @return
92 */ 92 */
93 - public List<ShyVideos> findshyVideo(ShyVideos shyVideos) { 93 + @Override
  94 + public List<ShyVideos> findShyVideo(ShyVideos shyVideos) {
94 return shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100)); 95 return shyVideosMapper.selectByRowBounds(shyVideos, new RowBounds(0, 100));
95 } 96 }
96 97
@@ -100,7 +101,8 @@ public class VideosServiceImpl { @@ -100,7 +101,8 @@ public class VideosServiceImpl {
100 * @param shyVideos 101 * @param shyVideos
101 * @return 102 * @return
102 */ 103 */
103 - public boolean updateshyVideos(ShyVideos shyVideos) { 104 + @Override
  105 + public boolean updateShyVideos(ShyVideos shyVideos) {
104 int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos); 106 int i = shyVideosMapper.updateByPrimaryKeySelective(shyVideos);
105 return i != 0; 107 return i != 0;
106 } 108 }
@@ -116,6 +118,7 @@ public class VideosServiceImpl { @@ -116,6 +118,7 @@ public class VideosServiceImpl {
116 * @param msg 118 * @param msg
117 * @return 119 * @return
118 */ 120 */
  121 + @Override
119 public int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) { 122 public int updateVideo(Integer id, String auditorId, String updater, String attrTags, Integer state, String msg) {
120 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); 123 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id);
121 shyVideos.setAuditor_id(auditorId); 124 shyVideos.setAuditor_id(auditorId);
@@ -141,6 +144,7 @@ public class VideosServiceImpl { @@ -141,6 +144,7 @@ public class VideosServiceImpl {
141 * @param videosDTO 144 * @param videosDTO
142 * @return 145 * @return
143 */ 146 */
  147 + @Override
144 public PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO) { 148 public PageInfo<ShyVideos> getListVideo(VideosDTO videosDTO) {
145 logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO)); 149 logger.info("接受点播列表为,VideosDTO:{}", JSON.toJSONString(videosDTO));
146 Example example = new Example(ShyVideos.class); 150 Example example = new Example(ShyVideos.class);
@@ -225,6 +229,7 @@ public class VideosServiceImpl { @@ -225,6 +229,7 @@ public class VideosServiceImpl {
225 * @param id 229 * @param id
226 * @return 230 * @return
227 */ 231 */
  232 + @Override
228 public ShyVideos getDetailsVideo(Integer id) { 233 public ShyVideos getDetailsVideo(Integer id) {
229 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); 234 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id);
230 if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { 235 if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) {
@@ -251,6 +256,7 @@ public class VideosServiceImpl { @@ -251,6 +256,7 @@ public class VideosServiceImpl {
251 * @param spid 256 * @param spid
252 * @return 257 * @return
253 */ 258 */
  259 + @Override
254 public Integer receive(String ids, Integer num, String userId, Integer spid) { 260 public Integer receive(String ids, Integer num, String userId, Integer spid) {
255 Integer n = 0; 261 Integer n = 0;
256 if (CommonUtils.isNotEmpty(ids)) { 262 if (CommonUtils.isNotEmpty(ids)) {
@@ -292,6 +298,7 @@ public class VideosServiceImpl { @@ -292,6 +298,7 @@ public class VideosServiceImpl {
292 * @param userId 298 * @param userId
293 * @return 299 * @return
294 */ 300 */
  301 + @Override
295 public ResponseBean retReceive(String ids, String userId) { 302 public ResponseBean retReceive(String ids, String userId) {
296 String[] cids = ids.split(","); 303 String[] cids = ids.split(",");
297 for (String cid : cids) { 304 for (String cid : cids) {
@@ -316,6 +323,7 @@ public class VideosServiceImpl { @@ -316,6 +323,7 @@ public class VideosServiceImpl {
316 * @param videosDTO 323 * @param videosDTO
317 * @return 324 * @return
318 */ 325 */
  326 + @Override
319 public List<ShyVideos> findByCondition(VideosDTO videosDTO) { 327 public List<ShyVideos> findByCondition(VideosDTO videosDTO) {
320 Example example = new Example(ShyVideos.class); 328 Example example = new Example(ShyVideos.class);
321 Example.Criteria criteria = example.createCriteria(); 329 Example.Criteria criteria = example.createCriteria();
@@ -369,6 +377,7 @@ public class VideosServiceImpl { @@ -369,6 +377,7 @@ public class VideosServiceImpl {
369 * 377 *
370 * @param cid 审核云中视频的id 378 * @param cid 审核云中视频的id
371 */ 379 */
  380 + @Override
372 public void videoFilter(Integer cid) { 381 public void videoFilter(Integer cid) {
373 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid); 382 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(cid);
374 shyVideos.setUpdater("自动审核"); 383 shyVideos.setUpdater("自动审核");
@@ -410,7 +419,7 @@ public class VideosServiceImpl { @@ -410,7 +419,7 @@ public class VideosServiceImpl {
410 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER); 419 shyVideos.setShenhe_type(CommonConst.AUDIT_TYPE_USER);
411 //拒绝原因 420 //拒绝原因
412 shyVideos.setMsg(desc); 421 shyVideos.setMsg(desc);
413 - boolean b = videosService.updateshyVideos(shyVideos); 422 + boolean b = videosService.updateShyVideos(shyVideos);
414 logger.info("进入拒绝方法:{},返回布尔类型{}", desc, b); 423 logger.info("进入拒绝方法:{},返回布尔类型{}", desc, b);
415 } 424 }
416 try { 425 try {
@@ -435,6 +444,7 @@ public class VideosServiceImpl { @@ -435,6 +444,7 @@ public class VideosServiceImpl {
435 * @param video 444 * @param video
436 * @param dianboState 视频状态,1通过,2不通过 445 * @param dianboState 视频状态,1通过,2不通过
437 */ 446 */
  447 + @Override
438 public void updateDianboAndShenhe(ShyVideos video, int dianboState) { 448 public void updateDianboAndShenhe(ShyVideos video, int dianboState) {
439 //修改点播云的视频状态 449 //修改点播云的视频状态
440 JSONObject result = pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback()); 450 JSONObject result = pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback());
@@ -482,6 +492,7 @@ public class VideosServiceImpl { @@ -482,6 +492,7 @@ public class VideosServiceImpl {
482 * 492 *
483 * @param shyVideo 493 * @param shyVideo
484 */ 494 */
  495 + @Override
485 public void getShenheType(ShyVideos shyVideo) { 496 public void getShenheType(ShyVideos shyVideo) {
486 //获取点播免审sp 497 //获取点播免审sp
487 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO); 498 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO);
@@ -536,6 +547,7 @@ public class VideosServiceImpl { @@ -536,6 +547,7 @@ public class VideosServiceImpl {
536 * @param 547 * @param
537 * @return 548 * @return
538 */ 549 */
  550 + @Override
539 public String repulse(String shyVideoId, String msg, String userId) { 551 public String repulse(String shyVideoId, String msg, String userId) {
540 StringBuilder showMsg = new StringBuilder(); 552 StringBuilder showMsg = new StringBuilder();
541 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); 553 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId));