Commit c534a8a40ba6f0cab577283533974b271f71f1b7
1 parent
d0893e50
添加人工审核拒绝或者通过的记录功能
Showing
2 changed files
with
56 additions
and
31 deletions
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -6,14 +6,8 @@ import com.cnlive.shenhe.bean.ErrorEnum; | @@ -6,14 +6,8 @@ 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.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.ShyActivity; | ||
| 10 | -import com.cnlive.shenhe.entity.ShySites; | ||
| 11 | -import com.cnlive.shenhe.entity.ShyUsers; | ||
| 12 | -import com.cnlive.shenhe.entity.ShyVideos; | ||
| 13 | -import com.cnlive.shenhe.serviceImpl.ShyActivityImpl; | ||
| 14 | -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | ||
| 15 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 16 | -import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; | 9 | +import com.cnlive.shenhe.entity.*; |
| 10 | +import com.cnlive.shenhe.serviceImpl.*; | ||
| 17 | import com.cnlive.shenhe.utils.AuditPass; | 11 | import com.cnlive.shenhe.utils.AuditPass; |
| 18 | import com.cnlive.shenhe.utils.CommonConst; | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 19 | import com.cnlive.shenhe.utils.CommonUtils; | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -23,6 +17,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell; | @@ -23,6 +17,7 @@ import org.apache.poi.xssf.usermodel.XSSFCell; | ||
| 23 | import org.apache.poi.xssf.usermodel.XSSFRow; | 17 | import org.apache.poi.xssf.usermodel.XSSFRow; |
| 24 | import org.apache.poi.xssf.usermodel.XSSFSheet; | 18 | import org.apache.poi.xssf.usermodel.XSSFSheet; |
| 25 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; | 19 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 20 | +import org.jasig.cas.client.authentication.AttributePrincipal; | ||
| 26 | import org.slf4j.Logger; | 21 | import org.slf4j.Logger; |
| 27 | import org.slf4j.LoggerFactory; | 22 | import org.slf4j.LoggerFactory; |
| 28 | import org.springframework.beans.factory.annotation.Autowired; | 23 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -36,9 +31,11 @@ import org.springframework.web.bind.annotation.RequestMapping; | @@ -36,9 +31,11 @@ import org.springframework.web.bind.annotation.RequestMapping; | ||
| 36 | import org.springframework.web.bind.annotation.ResponseBody; | 31 | import org.springframework.web.bind.annotation.ResponseBody; |
| 37 | 32 | ||
| 38 | import javax.servlet.ServletOutputStream; | 33 | import javax.servlet.ServletOutputStream; |
| 34 | +import javax.servlet.http.HttpServletRequest; | ||
| 39 | import javax.servlet.http.HttpServletResponse; | 35 | import javax.servlet.http.HttpServletResponse; |
| 40 | import javax.servlet.http.HttpSession; | 36 | import javax.servlet.http.HttpSession; |
| 41 | import java.io.*; | 37 | import java.io.*; |
| 38 | +import java.util.Date; | ||
| 42 | import java.util.HashMap; | 39 | import java.util.HashMap; |
| 43 | import java.util.List; | 40 | import java.util.List; |
| 44 | import java.util.Map; | 41 | import java.util.Map; |
| @@ -48,24 +45,27 @@ import java.util.Map; | @@ -48,24 +45,27 @@ import java.util.Map; | ||
| 48 | public class VideosController extends BaseController { | 45 | public class VideosController extends BaseController { |
| 49 | private static Logger logger = LoggerFactory.getLogger(VideosController.class); | 46 | private static Logger logger = LoggerFactory.getLogger(VideosController.class); |
| 50 | @Autowired | 47 | @Autowired |
| 51 | - AuditPass pass; | 48 | + private AuditPass pass; |
| 52 | @Autowired | 49 | @Autowired |
| 53 | - VideosServiceImpl videosService; | 50 | + private VideosServiceImpl videosService; |
| 54 | @Autowired | 51 | @Autowired |
| 55 | - UsersServiceImpl usersService; | 52 | + private UsersServiceImpl usersService; |
| 56 | @Autowired | 53 | @Autowired |
| 57 | - SitesServiceImpl sitesService; | 54 | + private SitesServiceImpl sitesService; |
| 58 | @Autowired | 55 | @Autowired |
| 59 | - ShyActivityImpl shyActivityImpl; | 56 | + private ShyActivityImpl shyActivityImpl; |
| 57 | + @Autowired | ||
| 58 | + private ShyLogServiceImpl shyLogService; | ||
| 60 | 59 | ||
| 61 | @Value("${qn_domain}") | 60 | @Value("${qn_domain}") |
| 62 | - String qn_domain; | 61 | + private String qn_domain; |
| 63 | 62 | ||
| 64 | @Value("${ks_domain}") | 63 | @Value("${ks_domain}") |
| 65 | - String ks_domain; | 64 | + private String ks_domain; |
| 66 | 65 | ||
| 67 | @Value("${cms_getVideoAndLiveId}") | 66 | @Value("${cms_getVideoAndLiveId}") |
| 68 | - String cms_getVideoAndLiveId; | 67 | + private String cms_getVideoAndLiveId; |
| 68 | + | ||
| 69 | 69 | ||
| 70 | /** | 70 | /** |
| 71 | * 审核信息返回接口 | 71 | * 审核信息返回接口 |
| @@ -78,13 +78,28 @@ public class VideosController extends BaseController { | @@ -78,13 +78,28 @@ public class VideosController extends BaseController { | ||
| 78 | */ | 78 | */ |
| 79 | @PostMapping("/shenheVideo") | 79 | @PostMapping("/shenheVideo") |
| 80 | @ResponseBody | 80 | @ResponseBody |
| 81 | - public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { | 81 | + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, String video_title, |
| 82 | + HttpSession session, HttpServletRequest request) { | ||
| 82 | logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}", id, activity_id, state, attr_tags, msg, callback); | 83 | logger.info("id:{},activity_id:{},state:{},attr_tags:{},msg:{},callback:{}", id, activity_id, state, attr_tags, msg, callback); |
| 84 | + AttributePrincipal principal = (AttributePrincipal) request.getUserPrincipal(); | ||
| 85 | + String user_id = principal.getName(); | ||
| 83 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 86 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 84 | String userId = sessionUser.getUserId(); | 87 | String userId = sessionUser.getUserId(); |
| 88 | + String userName = sessionUser.getUserName(); | ||
| 89 | + ShyVideos shyVideos = videosService.selectByPrimaryKey(id); | ||
| 85 | JSONObject result; | 90 | JSONObject result; |
| 86 | try { | 91 | try { |
| 87 | result = pass.auditPass(activity_id, state, attr_tags, msg, callback); | 92 | result = pass.auditPass(activity_id, state, attr_tags, msg, callback); |
| 93 | + | ||
| 94 | + ShyLog shyLog = new ShyLog(); | ||
| 95 | + shyLog.setVideoId(activity_id); | ||
| 96 | + shyLog.setVideoName(shyVideos.getVideo_title()); | ||
| 97 | + shyLog.setOperator(userName + "(" + user_id + ")"); | ||
| 98 | + shyLog.setOperationTime(new Date()); | ||
| 99 | + shyLog.setOperationType("人工审核"); | ||
| 100 | + shyLog.setRemark(msg); | ||
| 101 | + shyLogService.addShyLog(shyLog); | ||
| 102 | + | ||
| 88 | } catch (Exception e) { | 103 | } catch (Exception e) { |
| 89 | e.printStackTrace(); | 104 | e.printStackTrace(); |
| 90 | logger.error("视频审核失败", e); | 105 | logger.error("视频审核失败", e); |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| @@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -6,10 +6,7 @@ import com.alibaba.fastjson.JSONObject; | ||
| 6 | import com.cnlive.shenhe.bean.ErrorEnum; | 6 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 7 | import com.cnlive.shenhe.bean.ResponseBean; | 7 | import com.cnlive.shenhe.bean.ResponseBean; |
| 8 | import com.cnlive.shenhe.dto.VideosDTO; | 8 | import com.cnlive.shenhe.dto.VideosDTO; |
| 9 | -import com.cnlive.shenhe.entity.ShyUsers; | ||
| 10 | -import com.cnlive.shenhe.entity.ShyUsersfree; | ||
| 11 | -import com.cnlive.shenhe.entity.ShyVideos; | ||
| 12 | -import com.cnlive.shenhe.entity.ShyYidun; | 9 | +import com.cnlive.shenhe.entity.*; |
| 13 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 10 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 14 | import com.cnlive.shenhe.mapper.ShyVideosMapper; | 11 | import com.cnlive.shenhe.mapper.ShyVideosMapper; |
| 15 | import com.cnlive.shenhe.utils.*; | 12 | import com.cnlive.shenhe.utils.*; |
| @@ -40,31 +37,34 @@ public class VideosServiceImpl { | @@ -40,31 +37,34 @@ public class VideosServiceImpl { | ||
| 40 | 37 | ||
| 41 | private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class); | 38 | private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class); |
| 42 | @Autowired | 39 | @Autowired |
| 43 | - ShyVideosMapper shyVideosMapper; | 40 | + private ShyVideosMapper shyVideosMapper; |
| 44 | @Autowired | 41 | @Autowired |
| 45 | - ShyUsersMapper shyUsersMapper; | 42 | + private ShyUsersMapper shyUsersMapper; |
| 46 | 43 | ||
| 47 | @Autowired | 44 | @Autowired |
| 48 | - VideosServiceImpl videosService; | 45 | + private VideosServiceImpl videosService; |
| 49 | @Autowired | 46 | @Autowired |
| 50 | - SitesServiceImpl sitesService; | 47 | + private SitesServiceImpl sitesService; |
| 51 | 48 | ||
| 52 | @Autowired | 49 | @Autowired |
| 53 | - UsersfreeServiceImpl usersfreeServiceImpl; | 50 | + private UsersfreeServiceImpl usersfreeServiceImpl; |
| 54 | 51 | ||
| 55 | @Autowired | 52 | @Autowired |
| 56 | - YiDunServiceImpl yiDunServiceImpl; | 53 | + private YiDunServiceImpl yiDunServiceImpl; |
| 57 | @Autowired | 54 | @Autowired |
| 58 | - ShyActivityImpl shyActivityImpl; | 55 | + private ShyActivityImpl shyActivityImpl; |
| 59 | 56 | ||
| 60 | @Value("${qn_domain}") | 57 | @Value("${qn_domain}") |
| 61 | - String qn_domain; | 58 | + private String qn_domain; |
| 62 | 59 | ||
| 63 | @Value("${ks_domain}") | 60 | @Value("${ks_domain}") |
| 64 | - String ks_domain; | 61 | + private String ks_domain; |
| 65 | 62 | ||
| 66 | @Autowired | 63 | @Autowired |
| 67 | - AuditPass pass; | 64 | + private AuditPass pass; |
| 65 | + | ||
| 66 | + @Autowired | ||
| 67 | + private ShyLogServiceImpl shyLogService; | ||
| 68 | 68 | ||
| 69 | public boolean impotVideo(ShyVideos shyVideos) { | 69 | public boolean impotVideo(ShyVideos shyVideos) { |
| 70 | int result = shyVideosMapper.insertSelective(shyVideos); | 70 | int result = shyVideosMapper.insertSelective(shyVideos); |
| @@ -333,6 +333,7 @@ public class VideosServiceImpl { | @@ -333,6 +333,7 @@ public class VideosServiceImpl { | ||
| 333 | /** | 333 | /** |
| 334 | * 易盾视频(图片)过滤 | 334 | * 易盾视频(图片)过滤 |
| 335 | * type:1:文本 2:图片 3.网页 4:点播音频 | 335 | * type:1:文本 2:图片 3.网页 4:点播音频 |
| 336 | + * | ||
| 336 | * @param cid 审核云中视频的id | 337 | * @param cid 审核云中视频的id |
| 337 | * @return | 338 | * @return |
| 338 | */ | 339 | */ |
| @@ -523,6 +524,15 @@ public class VideosServiceImpl { | @@ -523,6 +524,15 @@ public class VideosServiceImpl { | ||
| 523 | return false; | 524 | return false; |
| 524 | } | 525 | } |
| 525 | 526 | ||
| 527 | + /** | ||
| 528 | + * 人工审核拒绝方法 | ||
| 529 | + * | ||
| 530 | + * @param shyVideoId | ||
| 531 | + * @param msg | ||
| 532 | + * @param userId | ||
| 533 | + * @param | ||
| 534 | + * @return | ||
| 535 | + */ | ||
| 526 | public String repulse(String shyVideoId, String msg, String userId) { | 536 | public String repulse(String shyVideoId, String msg, String userId) { |
| 527 | String showMsg = ""; | 537 | String showMsg = ""; |
| 528 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); | 538 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); |