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