Commit 89b55ac32600c94e4524267bfc228533f7cd9a56
1 parent
cd2841d7
jsoup测试
Showing
6 changed files
with
1529 additions
and
0 deletions
pom.xml
| ... | ... | @@ -62,6 +62,13 @@ |
| 62 | 62 | <artifactId>commons-lang3</artifactId> |
| 63 | 63 | <version>3.8</version> |
| 64 | 64 | </dependency> |
| 65 | + | |
| 66 | + <!-- https://mvnrepository.com/artifact/org.jsoup/jsoup --> | |
| 67 | + <dependency> | |
| 68 | + <groupId>org.jsoup</groupId> | |
| 69 | + <artifactId>jsoup</artifactId> | |
| 70 | + <version>1.11.3</version> | |
| 71 | + </dependency> | |
| 65 | 72 | |
| 66 | 73 | <dependency> |
| 67 | 74 | <groupId>org.mybatis.spring.boot</groupId> | ... | ... |
src/main/java/com/cnlive/shenhe/controller/VideosStreamController.java
0 → 100644
| 1 | +package com.cnlive.shenhe.controller; | |
| 2 | + | |
| 3 | +import org.apache.poi.xssf.usermodel.XSSFCell; | |
| 4 | +import org.apache.poi.xssf.usermodel.XSSFRow; | |
| 5 | +import org.apache.poi.xssf.usermodel.XSSFSheet; | |
| 6 | +import org.apache.poi.xssf.usermodel.XSSFWorkbook; | |
| 7 | +import com.alibaba.fastjson.JSON; | |
| 8 | +import com.alibaba.fastjson.JSONObject; | |
| 9 | +import com.cnlive.shenhe.bean.ErrorEnum; | |
| 10 | +import com.cnlive.shenhe.bean.ResponseBean; | |
| 11 | +import com.cnlive.shenhe.bean.SessionUser; | |
| 12 | +import com.cnlive.shenhe.entity.ShySites; | |
| 13 | +import com.cnlive.shenhe.entity.ShyUsers; | |
| 14 | +import com.cnlive.shenhe.entity.ShyVideos; | |
| 15 | +import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | |
| 16 | +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | |
| 17 | +import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; | |
| 18 | +import com.cnlive.shenhe.utils.AuditPass; | |
| 19 | +import com.cnlive.shenhe.utils.CommonConst; | |
| 20 | +import com.cnlive.shenhe.utils.CommonUtils; | |
| 21 | +import com.github.pagehelper.PageInfo; | |
| 22 | +import org.slf4j.Logger; | |
| 23 | +import org.slf4j.LoggerFactory; | |
| 24 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 25 | +import org.springframework.beans.factory.annotation.Value; | |
| 26 | +import org.springframework.stereotype.Controller; | |
| 27 | +import org.springframework.ui.Model; | |
| 28 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 29 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 30 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 31 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 32 | + | |
| 33 | +import javax.servlet.ServletOutputStream; | |
| 34 | +import javax.servlet.http.HttpServletResponse; | |
| 35 | +import javax.servlet.http.HttpSession; | |
| 36 | +import java.io.*; | |
| 37 | +import java.util.List; | |
| 38 | + | |
| 39 | +@Controller | |
| 40 | +@RequestMapping("/live") | |
| 41 | +public class VideosStreamController { | |
| 42 | + private static Logger logger = LoggerFactory.getLogger(VideosStreamController.class); | |
| 43 | + @Autowired | |
| 44 | + AuditPass Pass; | |
| 45 | + @Autowired | |
| 46 | + VideosServiceImpl videosService; | |
| 47 | + @Autowired | |
| 48 | + UsersServiceImpl usersService; | |
| 49 | + @Autowired | |
| 50 | + SitesServiceImpl sitesService; | |
| 51 | + | |
| 52 | + @Value("${qn_domain}") | |
| 53 | + String qn_domain; | |
| 54 | + | |
| 55 | + @Value("${ks_domain}") | |
| 56 | + String ks_domain; | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 审核信息返回接口 | |
| 60 | + * | |
| 61 | + * @param activity_id 视频id | |
| 62 | + * @param state 状态码 | |
| 63 | + * @param attr_tags 标签 | |
| 64 | + * @param msg 备注信息 | |
| 65 | + * @return | |
| 66 | + */ | |
| 67 | + @PostMapping("/shenheVideo") | |
| 68 | + @ResponseBody | |
| 69 | + public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { | |
| 70 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 71 | + String userId = sessionUser.getUserId(); | |
| 72 | +// ShyVideos shyVideos = videosService.selectByPrimaryKey(id); | |
| 73 | +// if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { | |
| 74 | + JSONObject result = null; | |
| 75 | + try { | |
| 76 | + result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | |
| 77 | + } catch (Exception e) { | |
| 78 | + e.printStackTrace(); | |
| 79 | + System.out.println("视频审核失败"); | |
| 80 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 81 | + } | |
| 82 | + if (result == null) { | |
| 83 | + System.out.println("视频审核失败且接口错误没有返回信息"); | |
| 84 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 85 | + } | |
| 86 | + Integer code = result.getInteger("code"); | |
| 87 | + if (code != 0) { | |
| 88 | + System.out.println("审核失败,code==" + code); | |
| 89 | + return new ResponseBean(code, result.getString("msg")); | |
| 90 | + } | |
| 91 | + state = state == 4 ? 2 : 1; | |
| 92 | + int i = videosService.updateVideo(id, userId,null,attr_tags, state, msg); | |
| 93 | + if (i == 0) { | |
| 94 | + return new ResponseBean(ErrorEnum.ERROR); | |
| 95 | + } | |
| 96 | + return new ResponseBean(ErrorEnum.SUCCESS); | |
| 97 | +// } | |
| 98 | +// logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); | |
| 99 | +// return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "领取逻辑不符,不能审核"); | |
| 100 | + } | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * 内容分页列表接口 | |
| 104 | + * | |
| 105 | + * @param video_title | |
| 106 | + * @param start_date | |
| 107 | + * @param end_date | |
| 108 | + * @param state | |
| 109 | + * @param page | |
| 110 | + * @param pageSize | |
| 111 | + * @param orderByClause | |
| 112 | + * @return | |
| 113 | + */ | |
| 114 | + @GetMapping("/page") | |
| 115 | + public Object getListVideos(Model model, String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, String sp_desc, HttpSession session) { | |
| 116 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 117 | + if(CommonUtils.isNull(sessionUser)){ | |
| 118 | + return "redirect:/users/login"; | |
| 119 | + } | |
| 120 | + | |
| 121 | + return "page/videoStream.html"; | |
| 122 | + } | |
| 123 | + | |
| 124 | + /** | |
| 125 | + * 内容详情页接口(查看) | |
| 126 | + * | |
| 127 | + * @param id | |
| 128 | + * @return | |
| 129 | + */ | |
| 130 | + @GetMapping("/details") | |
| 131 | + public Object getDetailsVideo(Model model, Integer id) { | |
| 132 | + ShyVideos detailsContent = videosService.getDetailsContent(id); | |
| 133 | + Object images = JSON.parse(detailsContent.getVideo_imgs()); | |
| 134 | + Object avsampleImgs = JSON.parse(detailsContent.getAvsample_imgs()); | |
| 135 | + String yuming = ""; | |
| 136 | + Integer plat = detailsContent.getPlat(); | |
| 137 | + if (plat == CommonConst.QINIU_PLAT) { | |
| 138 | + yuming = qn_domain + "/"; | |
| 139 | + } else if (plat == CommonConst.KS_PLAT) { | |
| 140 | + yuming = ks_domain + "/"; | |
| 141 | + } | |
| 142 | + detailsContent.setAttr_tags(CommonUtils.isEmpty(detailsContent.getAttr_tags())?"":detailsContent.getAttr_tags()); | |
| 143 | + model.addAttribute("images", images); | |
| 144 | + model.addAttribute("avsampleImgs", avsampleImgs); | |
| 145 | + model.addAttribute("video", detailsContent); | |
| 146 | + model.addAttribute("yuming", yuming); | |
| 147 | + | |
| 148 | + return "page/videoDetail.html"; | |
| 149 | + } | |
| 150 | + | |
| 151 | + /** | |
| 152 | + * 认领 | |
| 153 | + * | |
| 154 | + * @param ids 根据id认领 | |
| 155 | + * @param num 认领条数 | |
| 156 | + * @param session | |
| 157 | + * @return | |
| 158 | + */ | |
| 159 | + @PostMapping("/receive") | |
| 160 | + @ResponseBody | |
| 161 | + public ResponseBean receive(String ids, Integer num, HttpSession session) { | |
| 162 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 163 | + String userId = sessionUser.getUserId(); | |
| 164 | + Integer spid = sessionUser.getSpid(); | |
| 165 | + //领取时要检查领取的数据是否可以领 | |
| 166 | + if (CommonUtils.isNotEmpty(ids)) { | |
| 167 | + String[] cids = ids.split(","); | |
| 168 | + for (String cid : cids) { | |
| 169 | + ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(cid)); | |
| 170 | + if (CommonUtils.isNotNull(shyVideos)) { | |
| 171 | + if (shyVideos.getState() != CommonConst.AUDIT_INTT || shyVideos.getReceive()==CommonConst.RECEIVE_AFTER) { | |
| 172 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容中有已被领取或者已经被审核,请检查并重试"); | |
| 173 | + } | |
| 174 | + } else { | |
| 175 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "您领取的内容不存在,请检查并重试"); | |
| 176 | + | |
| 177 | + } | |
| 178 | + } | |
| 179 | + } | |
| 180 | + Integer n = videosService.receive(ids, num, userId, spid); | |
| 181 | + return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "认领到" + n + "条内容"); | |
| 182 | + } | |
| 183 | + | |
| 184 | + | |
| 185 | + /** | |
| 186 | + * 退领 | |
| 187 | + * @param ids | |
| 188 | + * @param session | |
| 189 | + * @return | |
| 190 | + */ | |
| 191 | + @PostMapping("/retReceive") | |
| 192 | + @ResponseBody | |
| 193 | + public ResponseBean retReceive(String ids, HttpSession session) { | |
| 194 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 195 | + String userId = sessionUser.getUserId(); | |
| 196 | + //在退领操作前先判断是否包含已退领或者已经审核的数据,有则退回检查并重新退领 | |
| 197 | + String[] cids = ids.split(","); | |
| 198 | + for (String cid : cids) { | |
| 199 | + ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(cid)); | |
| 200 | + if (shyVideos.getState() != CommonConst.AUDIT_INTT || shyVideos.getReceive()==CommonConst.RECEIVE_BEFORE || !shyVideos.getReceive_user_id().equals(userId)) { | |
| 201 | + return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "退领失败,您选中的内容包含已退领的或已经审核的"); | |
| 202 | + } | |
| 203 | + } | |
| 204 | + return videosService.retReceive(ids, userId); | |
| 205 | + } | |
| 206 | + | |
| 207 | + /** | |
| 208 | + * 根据条件导出excel | |
| 209 | + * | |
| 210 | + * @param video_title | |
| 211 | + * @param start_date | |
| 212 | + * @param end_date | |
| 213 | + * @param state | |
| 214 | + * @param receive | |
| 215 | + * @param video_priority | |
| 216 | + * @param orderByClause | |
| 217 | + * @param session | |
| 218 | + * @param response | |
| 219 | + */ | |
| 220 | + @GetMapping("excel") | |
| 221 | + public void getExcel(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, HttpSession session, HttpServletResponse response) { | |
| 222 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 223 | + Integer spid = sessionUser.getSpid(); | |
| 224 | + String userId = sessionUser.getUserId(); | |
| 225 | + if (spid == 0) spid = null; | |
| 226 | + List<ShyVideos> shyVideosList = videosService.findByCondition(video_title, start_date, end_date, state, receive, video_priority, orderByClause, spid, userId); | |
| 227 | + String fileName = "点播数据"; | |
| 228 | + String updater = "";//审核员名字 | |
| 229 | + String state1 = "";//审核状态 1已审核 2审核拒绝 0未审核 | |
| 230 | + XSSFWorkbook wb = new XSSFWorkbook(); | |
| 231 | + ServletOutputStream out = null; | |
| 232 | + BufferedInputStream bis = null; | |
| 233 | + BufferedOutputStream bos = null; | |
| 234 | + try { | |
| 235 | + XSSFSheet sheetlist = wb.createSheet(fileName); | |
| 236 | + XSSFRow row = sheetlist.createRow(0);//行 | |
| 237 | + XSSFCell cell = row.createCell(0);//列 | |
| 238 | + cell.setCellValue("id"); | |
| 239 | + cell = row.createCell(1);//列 | |
| 240 | + cell.setCellValue("标题"); | |
| 241 | + cell = row.createCell(2);//列 | |
| 242 | + cell.setCellValue("视频地址"); | |
| 243 | + cell = row.createCell(3);//列 | |
| 244 | + cell.setCellValue("标题图"); | |
| 245 | + cell = row.createCell(4);//列 | |
| 246 | + cell.setCellValue("视频标签"); | |
| 247 | + cell = row.createCell(5);//列 | |
| 248 | + cell.setCellValue("审核员"); | |
| 249 | + cell = row.createCell(6);//增加一列 | |
| 250 | + cell.setCellValue("常用审核意见"); | |
| 251 | + cell = row.createCell(7);//列 | |
| 252 | + cell.setCellValue("审核意见"); | |
| 253 | + cell = row.createCell(8);//列 | |
| 254 | + cell.setCellValue("状态"); | |
| 255 | + cell = row.createCell(9);//列 | |
| 256 | + cell.setCellValue("视频关键字"); | |
| 257 | + cell = row.createCell(10);//列 | |
| 258 | + cell.setCellValue("视频简介"); | |
| 259 | + cell = row.createCell(11);//列 | |
| 260 | + cell.setCellValue("视频id"); | |
| 261 | + cell = row.createCell(12);//列 | |
| 262 | + cell.setCellValue("创建时间"); | |
| 263 | + cell = row.createCell(13);//列 | |
| 264 | + cell.setCellValue("视频上传时间"); | |
| 265 | + cell = row.createCell(14);//列 | |
| 266 | + cell.setCellValue("视频时长(秒)"); | |
| 267 | + cell = row.createCell(15);//列 | |
| 268 | + cell.setCellValue("spid"); | |
| 269 | + cell = row.createCell(16);//列 | |
| 270 | + cell.setCellValue("sp简称"); | |
| 271 | + | |
| 272 | + for (int i = 0; i < shyVideosList.size(); i++) { | |
| 273 | + row = sheetlist.createRow((short) (i + 1));//行 | |
| 274 | + cell = row.createCell(0);//列 | |
| 275 | + cell.setCellValue(shyVideosList.get(i).getId()); | |
| 276 | + cell = row.createCell(1);//列 | |
| 277 | + cell.setCellValue(shyVideosList.get(i).getVideo_title()); | |
| 278 | + cell = row.createCell(2);//列 | |
| 279 | + cell.setCellValue(shyVideosList.get(i).getVideo_url()); | |
| 280 | + cell = row.createCell(3);//列 | |
| 281 | + cell.setCellValue(shyVideosList.get(i).getVideo_poster()); | |
| 282 | + cell = row.createCell(4);//列 | |
| 283 | + cell.setCellValue(shyVideosList.get(i).getVideo_tags()); | |
| 284 | + cell = row.createCell(5);//列 | |
| 285 | + /* 审核员需要做处理*/ | |
| 286 | + if (shyVideosList.get(i).getState() != CommonConst.AUDIT_INTT) { | |
| 287 | + updater = CommonUtils.isEmpty(shyVideosList.get(i).getUpdater()) || "null".equals(shyVideosList.get(i).getUpdater())? "白名单":shyVideosList.get(i).getUpdater(); | |
| 288 | + String auditor_id = shyVideosList.get(i).getAuditor_id(); | |
| 289 | + if (CommonUtils.isNotEmpty(auditor_id)) { | |
| 290 | + ShyUsers user = new ShyUsers(); | |
| 291 | + user.setUser_id(auditor_id); | |
| 292 | + user = usersService.select(user); | |
| 293 | + if (CommonUtils.isNotNull(user)) { | |
| 294 | + String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | |
| 295 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | |
| 296 | + updater = userName ; | |
| 297 | + } | |
| 298 | + } | |
| 299 | + } | |
| 300 | + cell.setCellValue(updater); | |
| 301 | + cell = row.createCell(6);//列、增加一列 | |
| 302 | + cell.setCellValue(shyVideosList.get(i).getAttr_tags()); | |
| 303 | + cell = row.createCell(7);//列 | |
| 304 | + cell.setCellValue(shyVideosList.get(i).getMsg()); | |
| 305 | + cell = row.createCell(8);//列 | |
| 306 | + /*状态需要处理成用户可读*/ | |
| 307 | + if (shyVideosList.get(i).getState() == 0) { | |
| 308 | + state1 = "未审核"; | |
| 309 | + } else if (shyVideosList.get(i).getState() == 1) { | |
| 310 | + state1 = "已审核"; | |
| 311 | + } else { | |
| 312 | + state1 = "审核拒绝"; | |
| 313 | + } | |
| 314 | + cell.setCellValue(state1); | |
| 315 | + cell = row.createCell(9);//列 | |
| 316 | + cell.setCellValue(shyVideosList.get(i).getVideo_keyword()); | |
| 317 | + cell = row.createCell(10);//列 | |
| 318 | + cell.setCellValue(shyVideosList.get(i).getVideo_desc()); | |
| 319 | + cell = row.createCell(11);//列 | |
| 320 | + cell.setCellValue(shyVideosList.get(i).getVideo_id()); | |
| 321 | + cell = row.createCell(12);//列 | |
| 322 | + cell.setCellValue(CommonUtils.formatDate(shyVideosList.get(i).getCreated_at(), "yyyy-MM-dd HH:mm:ss")); | |
| 323 | + cell = row.createCell(13);//列 | |
| 324 | + cell.setCellValue(CommonUtils.formatDate(shyVideosList.get(i).getVideo_upload_time(), "yyyy-MM-dd HH:mm:ss")); | |
| 325 | + cell = row.createCell(14);//列 | |
| 326 | + cell.setCellValue(shyVideosList.get(i).getDuration()); | |
| 327 | + cell = row.createCell(15);//列 | |
| 328 | + cell.setCellValue(shyVideosList.get(i).getSpid()); | |
| 329 | + cell = row.createCell(16);//列 | |
| 330 | + cell.setCellValue(sitesService.findspidDescByspid(shyVideosList.get(i).getSpid()).getName()); | |
| 331 | + } | |
| 332 | + | |
| 333 | + ByteArrayOutputStream os = new ByteArrayOutputStream(); | |
| 334 | + wb.write(os); | |
| 335 | + byte[] content = os.toByteArray(); | |
| 336 | + InputStream is = new ByteArrayInputStream(content); | |
| 337 | + response.setContentType("application/vnd.ms-excel;charset=utf-8"); | |
| 338 | + response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1")); | |
| 339 | + out = response.getOutputStream(); | |
| 340 | + bis = new BufferedInputStream(is); | |
| 341 | + bos = new BufferedOutputStream(out); | |
| 342 | + byte[] buff = new byte[2048]; | |
| 343 | + int bytesRead; | |
| 344 | + while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { | |
| 345 | + bos.write(buff, 0, bytesRead); | |
| 346 | + } | |
| 347 | + } catch (final Exception e) { | |
| 348 | + e.printStackTrace(); | |
| 349 | + try { | |
| 350 | + if (bis != null) | |
| 351 | + bis.close(); | |
| 352 | + if (bos != null) | |
| 353 | + bos.close(); | |
| 354 | + } catch (Exception e1) { | |
| 355 | + e1.printStackTrace(); | |
| 356 | + } | |
| 357 | + } finally { | |
| 358 | + try { | |
| 359 | + if (bis != null) | |
| 360 | + bis.close(); | |
| 361 | + if (bos != null) | |
| 362 | + bos.close(); | |
| 363 | + } catch (Exception e2) { | |
| 364 | + e2.printStackTrace(); | |
| 365 | + } | |
| 366 | + } | |
| 367 | + } | |
| 368 | + | |
| 369 | + /** | |
| 370 | + * 打回(审核拒绝,应要求不加权限、状态等限制) | |
| 371 | + * | |
| 372 | + * @param ids | |
| 373 | + * @param msg | |
| 374 | + * @param session | |
| 375 | + * @return | |
| 376 | + */ | |
| 377 | + @PostMapping("/repulse") | |
| 378 | + @ResponseBody | |
| 379 | + public ResponseBean repulse(String ids, String msg, HttpSession session) { | |
| 380 | + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | |
| 381 | + String userId = sessionUser.getUserId(); | |
| 382 | + ResponseBean responseBean = new ResponseBean(); | |
| 383 | + String[] shyVideoIds = ids.split(","); | |
| 384 | + String showMsg = ""; | |
| 385 | + for (String shyVideoId : shyVideoIds) { | |
| 386 | + ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); | |
| 387 | + JSONObject result = null; | |
| 388 | + try { | |
| 389 | + result = Pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); | |
| 390 | + } catch (Exception e) { | |
| 391 | + logger.error("视频审核失败,id==" + shyVideoId, e); | |
| 392 | + showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; | |
| 393 | + break; | |
| 394 | + } | |
| 395 | + if (result == null) { | |
| 396 | + logger.error("视频审核失败且接口错误没有返回信息,id==" + shyVideoId); | |
| 397 | + showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; | |
| 398 | + break; | |
| 399 | + } | |
| 400 | + Integer code = result.getInteger("code"); | |
| 401 | + if (code != 0) { | |
| 402 | + logger.error("视频审核失败,id:{},code:{}", shyVideoId, code); | |
| 403 | + showMsg = showMsg + "," + shyVideos.getVideo_title() + " " + result.getString("msg"); | |
| 404 | + break; | |
| 405 | + } | |
| 406 | + int i = videosService.updateVideo(Integer.parseInt(shyVideoId), userId,null,"", 2, msg); | |
| 407 | + if (i == 0) { | |
| 408 | + showMsg = showMsg + "," + shyVideos.getVideo_title() + " 更新失败"; | |
| 409 | + break; | |
| 410 | + } | |
| 411 | + } | |
| 412 | + if (CommonUtils.isNotEmpty(showMsg)) { | |
| 413 | + responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode()); | |
| 414 | + responseBean.setErrorMessage(showMsg); | |
| 415 | + } | |
| 416 | + return responseBean; | |
| 417 | + } | |
| 418 | + | |
| 419 | + @PostMapping("/ceshi") | |
| 420 | + @ResponseBody | |
| 421 | + public static String ceshi(String name) { | |
| 422 | + | |
| 423 | + | |
| 424 | + return name; | |
| 425 | + } | |
| 426 | + | |
| 427 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/jsoup/GetData.java
0 → 100644
| 1 | +package com.cnlive.shenhe.jsoup; | |
| 2 | + | |
| 3 | +import org.jsoup.Jsoup; | |
| 4 | +import org.jsoup.nodes.Document; | |
| 5 | +import org.jsoup.nodes.Element; | |
| 6 | +import org.jsoup.select.Elements; | |
| 7 | + | |
| 8 | +import java.net.URL; | |
| 9 | +import java.util.ArrayList; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * @Auther: 陈浩 | |
| 14 | + * @Date: 2019/6/21 14:31 | |
| 15 | + * @Description: | |
| 16 | + */ | |
| 17 | +public class GetData { | |
| 18 | + public static void main(String[] args) { | |
| 19 | + String url = "http://www.chinanews.com/society.shtml"; | |
| 20 | + Document document = getDocument(url); | |
| 21 | + while (true) { | |
| 22 | + List<String> jobList = getJobList(document); | |
| 23 | + for (String joburl : jobList) { | |
| 24 | + System.out.println(joburl); | |
| 25 | + try { | |
| 26 | + new newCrawl().abc(joburl); | |
| 27 | + } catch (Exception e) { | |
| 28 | + e.printStackTrace(); | |
| 29 | + } | |
| 30 | + } | |
| 31 | + try { | |
| 32 | + Thread.sleep(1000); | |
| 33 | + } catch (Exception e) { | |
| 34 | + e.printStackTrace(); | |
| 35 | + } | |
| 36 | + } | |
| 37 | + } | |
| 38 | + | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 通过document获取具体的岗位数据 | |
| 42 | + */ | |
| 43 | + private static List<String> getJobList(Document dom) { | |
| 44 | + String URL ="http://www.chinanews.com"; | |
| 45 | + ArrayList<String> list = new ArrayList<>(); | |
| 46 | + Elements select = dom.select(".content_list ul li");//获取到整个列表数据 | |
| 47 | + for (Element element : select) { | |
| 48 | + /* 处理个别li标签是空格问题,直接跳过不处理*/ | |
| 49 | + if (element.attr("id") != "" && !element.attr("id").equals("")){ | |
| 50 | + continue; | |
| 51 | + } | |
| 52 | + Elements elementa = element.select(".dd_bt a");//得到带连接的a标签 | |
| 53 | + String href = elementa.attr("href");//从a标签里面获取到他的相对路径 | |
| 54 | + href = URL+href; | |
| 55 | +// String jobName = select1.text(); | |
| 56 | +// Elements select2 = element.select(".t2 a"); | |
| 57 | +// String addr = element.select(".t3").text(); | |
| 58 | +// String salary = element.select(".t4").text(); | |
| 59 | +// String date = element.select(".t5").text(); | |
| 60 | +// JobBean jobBean = new JobBean(); | |
| 61 | +// jobBean.set(jobName, companyName, addr, salary, date); | |
| 62 | + list.add(href); | |
| 63 | + } | |
| 64 | + return list; | |
| 65 | + } | |
| 66 | + | |
| 67 | + /** | |
| 68 | + * 获取document | |
| 69 | + * | |
| 70 | + * @param url | |
| 71 | + * @return | |
| 72 | + */ | |
| 73 | + private static Document getDocument(String url) { | |
| 74 | + try { | |
| 75 | + Document document = Jsoup.parse(new URL(url), 4000); | |
| 76 | + return document; | |
| 77 | + } catch (Exception e) { | |
| 78 | + e.printStackTrace(); | |
| 79 | + } | |
| 80 | + return null; | |
| 81 | + | |
| 82 | + } | |
| 83 | +} | ... | ... |
src/main/java/com/cnlive/shenhe/jsoup/newCrawl.java
0 → 100644
| 1 | +package com.cnlive.shenhe.jsoup; | |
| 2 | + | |
| 3 | +import java.io.IOException; | |
| 4 | +import java.net.URL; | |
| 5 | +import java.util.LinkedList; | |
| 6 | +import java.util.regex.Matcher; | |
| 7 | +import java.util.regex.Pattern; | |
| 8 | + | |
| 9 | +import org.jsoup.Jsoup; | |
| 10 | +import org.jsoup.nodes.Document; | |
| 11 | +import org.jsoup.nodes.Element; | |
| 12 | +import org.jsoup.select.Elements; | |
| 13 | + | |
| 14 | +public class newCrawl { | |
| 15 | + public void abc(String url) throws Exception { | |
| 16 | + newCrawl newCl = new newCrawl(); | |
| 17 | + //String url = "http://www.chinanews.com/sh/2019/06-21/8871343.shtml"; | |
| 18 | + //Document doc = Jsoup.connect(url).get(); | |
| 19 | + Document doc = Jsoup.parse(new URL(url), 4000); | |
| 20 | + String title = newCl.getnewTitle(doc);//获取新闻标题 | |
| 21 | + String time = newCl.getTime(doc);//获取新闻发布时间 | |
| 22 | + String text = newCl.getNewtext(doc);//获取新闻内容 | |
| 23 | + String imgurl = newCl.getImgurl(doc);//获取标题图片链接 | |
| 24 | + String source = newCl.getSource(doc);//获取来源 | |
| 25 | + System.out.println("新闻Url:" + url); | |
| 26 | + System.out.println("新闻标题:" + title); | |
| 27 | + System.out.println("新闻标题图片url:" + imgurl); | |
| 28 | + System.out.println("新闻发布时间:" + time); | |
| 29 | + System.out.println("新闻来源:" + source); | |
| 30 | + System.out.println("新闻内容:" + text); | |
| 31 | + } | |
| 32 | + | |
| 33 | + public String getnewTitle(Document doc) { | |
| 34 | + //获取网页的标题 | |
| 35 | + String title = doc.title(); | |
| 36 | + return title; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public String getImgurl(Document doc) throws IOException { | |
| 40 | + //获取图片地址,并保存在ImgUrls链表中 | |
| 41 | + Elements pngs = doc.select(".left_ph img"); | |
| 42 | + String imageUrl = pngs.attr("src"); | |
| 43 | + return imageUrl; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getSource(Document doc) throws IOException { | |
| 47 | + //获取新闻来源 | |
| 48 | + String source = ""; | |
| 49 | + Elements pngs = doc.select(".left-t a:first-child"); | |
| 50 | + source = pngs.text(); | |
| 51 | + return source; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public String getNewtext(Document doc) { | |
| 55 | + //获取新闻内容 | |
| 56 | + String text = doc.select(".left_zw").text(); | |
| 57 | + return text; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public String getTime(Document doc) { | |
| 61 | + //获取新闻发布的时间 | |
| 62 | + String time = null; | |
| 63 | + Elements element = doc.select(".left-t"); | |
| 64 | + String text = element.text(); | |
| 65 | + String s1 = text.replaceAll(" ", "");//完全清除,空格 | |
| 66 | + time = s1.substring(0, 17); | |
| 67 | + return time; | |
| 68 | + } | |
| 69 | + | |
| 70 | +} | |
| 71 | + | ... | ... |
src/main/resources/templates/common/head.html
| ... | ... | @@ -79,5 +79,10 @@ |
| 79 | 79 | |
| 80 | 80 | <link href="../../static/css/app.css" rel="stylesheet"> |
| 81 | 81 | <script src="../../static/js/app.js"></script> |
| 82 | + | |
| 83 | + <!-- 最新的 Bootstrap 核心 JavaScript 文件 --> | |
| 84 | + <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js" | |
| 85 | + integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" | |
| 86 | + crossorigin="anonymous"></script> | |
| 82 | 87 | </head> |
| 83 | 88 | </html> |
| 84 | 89 | \ No newline at end of file | ... | ... |
src/main/resources/templates/page/videoStream.html
0 → 100644
| 1 | +<!DOCTYPE html> | |
| 2 | +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> | |
| 3 | + | |
| 4 | +<head th:replace="../templates/common/head::head"> | |
| 5 | +<!-- 最新版本的 Bootstrap 核心 CSS 文件 --> | |
| 6 | +<!-- <link rel="stylesheet" --> | |
| 7 | +<!-- href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" --> | |
| 8 | +<!-- integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" --> | |
| 9 | +<!-- crossorigin="anonymous"> --> | |
| 10 | +</head> | |
| 11 | + | |
| 12 | +<body class="hold-transition skin-blue sidebar-mini"> | |
| 13 | + | |
| 14 | + <div class="wrapper"> | |
| 15 | + <div th:replace="../templates/common/frame::frame"></div> | |
| 16 | + <div class="content-wrapper" style="min-height: 788px;"> | |
| 17 | + <section class="content-header"> | |
| 18 | + <h1>直播审核</h1> | |
| 19 | + <ol class="breadcrumb"> | |
| 20 | + <li><a href="/index"><i class="fa fa-dashboard"></i> 首页</a></li> | |
| 21 | + <li class="active"><a href="/live">直播审核</a></li> | |
| 22 | + </ol> | |
| 23 | + </section> | |
| 24 | + <section class="content"> | |
| 25 | + <div class="row"> | |
| 26 | + <div class="col-md-12"> | |
| 27 | + <div class="box box-info"> | |
| 28 | + <div class="box-body"> | |
| 29 | + <div class="modal fade" id="modal" tabindex="-1" role="dialog" | |
| 30 | + aria-labelledby="myModalLabel" aria-hidden="true"> | |
| 31 | + <div class="modal-dialog"> | |
| 32 | + <div class="modal-content"> | |
| 33 | + <div class="modal-header"> | |
| 34 | + <button type="button" class="close" data-dismiss="modal" | |
| 35 | + aria-hidden="true">×</button> | |
| 36 | + <h4 class="modal-title">温馨提示</h4> | |
| 37 | + </div> | |
| 38 | + <div class="modal-body" id="msg">您确认认领该条信息吗?</div> | |
| 39 | + <div class="modal-footer"> | |
| 40 | + <button type="button" class="btn btn-default" | |
| 41 | + data-dismiss="modal">取消</button> | |
| 42 | + <button type="button" class="btn btn-primary" | |
| 43 | + id="modal_remove">确认</button> | |
| 44 | + </div> | |
| 45 | + </div> | |
| 46 | + </div> | |
| 47 | + </div> | |
| 48 | + <div class="clearfix"> | |
| 49 | + <div class="btn-group margin-bottom" id="hide_select_area_2"> | |
| 50 | + <div class="cb-toolbar"> | |
| 51 | + <input type="checkbox" id="check">全选 | |
| 52 | + </div> | |
| 53 | + <div class="btn-group margin-bottom pull-left" style=> | |
| 54 | + <input type="hidden" name="state" id="state" value="" /> | |
| 55 | + | |
| 56 | + <button type="button" | |
| 57 | + class="btn btn-success btn-sm margin-r-5 action claim" | |
| 58 | + value="2" data="claim" id="claim" data-toggle="modal" | |
| 59 | + data-target="#modal">认领</button> | |
| 60 | + <button type="button" | |
| 61 | + class="btn btn-success btn-sm margin-r-5 action claim" | |
| 62 | + value="2" data="claim100" id="claim100" data-toggle="modal" | |
| 63 | + data-target="#modal">认领100条</button> | |
| 64 | + <button type="button" | |
| 65 | + class="btn btn-success btn-sm margin-r-5 action claim" | |
| 66 | + value="2" data="claim1000" id="claim1000" | |
| 67 | + data-toggle="modal" data-target="#modal">认领1000条</button> | |
| 68 | + </div> | |
| 69 | + </div> | |
| 70 | + | |
| 71 | + <div class="btn-group margin-bottom pull-right"> | |
| 72 | + <button type="button" class="btn btn-sm margin-r-5 filter ?>" | |
| 73 | + value="0" id="all" data="all">全部</button> | |
| 74 | + <button type="button" | |
| 75 | + class="btn btn-sm margin-r-5 filter btn-info ?>" value="1">全部待领 | |
| 76 | + </button> | |
| 77 | + <button type="button" | |
| 78 | + class="btn btn-sm margin-r-5 filter ?>" value="2">我的待审 | |
| 79 | + </button> | |
| 80 | + <!--<button type="button" class="btn btn-sm margin-r-5 filter" | |
| 81 | + value="4">我的未通过 | |
| 82 | + </button> --> | |
| 83 | + <button type="button" | |
| 84 | + class="btn btn-sm margin-r-5 filter ?>" value="7">我的已审 | |
| 85 | + </button> | |
| 86 | + <button type="button" | |
| 87 | + class="btn btn-primary btn-sm margin-r-5" id="query" | |
| 88 | + onclick="openOrClose('forms')"> | |
| 89 | + 查询 <span id="a_up">▼</span><span id="a_down">▲</span> | |
| 90 | + </button> | |
| 91 | + </div> | |
| 92 | + | |
| 93 | + </div> | |
| 94 | + | |
| 95 | + <div class="clearfix"> | |
| 96 | + <div class="form-horizontal form-group-sm" id="forms" | |
| 97 | + style="display: none;"> | |
| 98 | + <div class="btn-group margin-bottom col-md-7" | |
| 99 | + style="padding: 0;"> | |
| 100 | + <div class="col-md-3" style="padding: 0"> | |
| 101 | + <label for="activity_id" class="control-label cb-toolbar">直播id:</label> | |
| 102 | + <div class="col-sm-7" style="padding: 0;"> | |
| 103 | + <input class="form-control" name="activity_id" type="text" | |
| 104 | + id="activity_id"> | |
| 105 | + </div> | |
| 106 | + </div> | |
| 107 | + <div class="col-md-3" style="padding: 0"> | |
| 108 | + <label for="activity_name" class="control-label cb-toolbar">直播名称:</label> | |
| 109 | + <div class="col-sm-7" style="padding: 0;"> | |
| 110 | + <input class="form-control col-sm-2" name="activity_name" | |
| 111 | + type="text" id="activity_name"> | |
| 112 | + </div> | |
| 113 | + </div> | |
| 114 | + | |
| 115 | + <div class="col-md-3" style="padding: 0"> | |
| 116 | + <label for="is_hot" class="control-label cb-toolbar">是否热点:</label> | |
| 117 | + <div class="col-sm-6" style="padding: 0;"> | |
| 118 | + <select class="form-control" id="is_hot" name="is_hot"><option | |
| 119 | + value="0">全部</option> | |
| 120 | + <option value="2">是</option> | |
| 121 | + <option value="1">否</option></select> | |
| 122 | + </div> | |
| 123 | + </div> | |
| 124 | + <div class="col-md-3" style="padding: 0"> | |
| 125 | + <label for="activity_status" | |
| 126 | + class="control-label cb-toolbar">直播状态:</label> | |
| 127 | + <div class="col-sm-6" style="padding: 0;"> | |
| 128 | + <select class="form-control col-sm-2" id="activity_status" | |
| 129 | + name="activity_status"><option value="0">全部</option> | |
| 130 | + <option value="2">直播中</option> | |
| 131 | + <option value="3">已结束</option> | |
| 132 | + <option value="4">已下线</option></select> | |
| 133 | + </div> | |
| 134 | + </div> | |
| 135 | + | |
| 136 | + </div> | |
| 137 | + | |
| 138 | + <div class="btn-group margin-bottom col-md-5 pull-right" | |
| 139 | + style="padding: 0"> | |
| 140 | + <div class="col-md-11" style="width: 88%; padding: 0;"> | |
| 141 | + <div class="col-md-5" style="padding: 0"> | |
| 142 | + <label for="start_date" class="control-label cb-toolbar">时间:</label> | |
| 143 | + <div class='input-group col-md-9 date'> | |
| 144 | + <input class="form-control date" name="start_date" | |
| 145 | + type="text" id="start_date"> <span | |
| 146 | + class="input-group-addon"> <span | |
| 147 | + class="glyphicon glyphicon-calendar"></span> | |
| 148 | + </span> | |
| 149 | + </div> | |
| 150 | + </div> | |
| 151 | + <div class="col-md-5" style="padding: 0"> | |
| 152 | + <label for="start_date" class="control-label cb-toolbar">至</label> | |
| 153 | + <div class='input-group col-md-9 date'> | |
| 154 | + <input class="form-control date" name="end_date" | |
| 155 | + type="text"> <span class="input-group-addon"> | |
| 156 | + <span class="glyphicon glyphicon-calendar"></span> | |
| 157 | + </span> | |
| 158 | + </div> | |
| 159 | + </div> | |
| 160 | + </div> | |
| 161 | + | |
| 162 | + <div class="col-md-1 text-center" | |
| 163 | + style="width: 12%; padding: 0"> | |
| 164 | + <button type="button" class="btn btn-primary btn-sm" | |
| 165 | + id="live_query">查 询</button> | |
| 166 | + </div> | |
| 167 | + | |
| 168 | + </div> | |
| 169 | + | |
| 170 | + <div class="btn-group margin-bottom col-md-6" | |
| 171 | + style="padding: 0;"></div> | |
| 172 | + </div> | |
| 173 | + </div> | |
| 174 | + <script> | |
| 175 | + | |
| 176 | + //定义serializeObject方法,序列化表单 | |
| 177 | + $.fn.serializeObject = function() { | |
| 178 | + var o = {}; | |
| 179 | + var a = this.serializeArray(); | |
| 180 | + $.each(a, function() { | |
| 181 | + if (o[this.name]) { | |
| 182 | + if (!o[this.name].push) { | |
| 183 | + o[this.name] = [ o[this.name] ]; | |
| 184 | + } | |
| 185 | + o[this.name].push(this.value || ''); | |
| 186 | + } else { | |
| 187 | + o[this.name] = this.value || ''; | |
| 188 | + } | |
| 189 | + }); | |
| 190 | + return o; | |
| 191 | + }; | |
| 192 | + //定义serializeObject方法结束 | |
| 193 | + | |
| 194 | + var global_state = 1; //全局状态 默认为全部 | |
| 195 | + | |
| 196 | + /* 筛选 */ | |
| 197 | + $('#live_query').click( | |
| 198 | + function() { | |
| 199 | + var object = $('#forms input').serializeObject(); | |
| 200 | + object['is_hot'] = $('#is_hot').val(); | |
| 201 | + object['activity_status'] = $('#activity_status').val(); | |
| 202 | + | |
| 203 | + var arrK = []; | |
| 204 | + for ( var item in object) { | |
| 205 | + arrK.push(item); | |
| 206 | + } | |
| 207 | + var arrV = []; | |
| 208 | + for ( var item in object) { | |
| 209 | + arrV.push(object[item]); | |
| 210 | + } | |
| 211 | + //全局状态传过去 | |
| 212 | + arrK.push('gstate'); | |
| 213 | + arrV.push(global_state); | |
| 214 | +// window.location.href = '/live/filter_list/'+ arrK+ '='+ arrV; | |
| 215 | + }); | |
| 216 | + | |
| 217 | + $('#a_down').hide(); | |
| 218 | + /*查询*/ | |
| 219 | + function openOrClose(id_name_str) { | |
| 220 | + var id_name = '#' + id_name_str; | |
| 221 | + if ($(id_name).css('display') == 'block') { | |
| 222 | + $(id_name).slideUp(350); | |
| 223 | + $('#a_up').show(); | |
| 224 | + $('#a_down').hide(); | |
| 225 | + } else { | |
| 226 | + $(id_name).slideDown(350); | |
| 227 | + $('#a_up').hide(); | |
| 228 | + $('#a_down').show(); | |
| 229 | + } | |
| 230 | + } | |
| 231 | + | |
| 232 | + /*时间插件*/ | |
| 233 | + $('.date').datetimepicker({ | |
| 234 | + format : 'YYYY-MM-DD HH:mm', | |
| 235 | + locale : "zh-CN", | |
| 236 | + toolbarPlacement : 'bottom', | |
| 237 | + showClear : true, | |
| 238 | + }); | |
| 239 | + | |
| 240 | + /*大图列表图切换*/ | |
| 241 | +// $('#big').click(function() { | |
| 242 | +// window.location.href = '/live/big_list'; | |
| 243 | +// }) | |
| 244 | +// $('#list').click(function() { | |
| 245 | +// window.location.href = '/live'; | |
| 246 | +// }) | |
| 247 | + | |
| 248 | + /*全选的操作*/ | |
| 249 | + $('#check').click(function() { | |
| 250 | + if ($(this).prop('checked')) { | |
| 251 | + $('.check').each(function() { | |
| 252 | + $(this).prop('checked', true); | |
| 253 | + }); | |
| 254 | + } else { | |
| 255 | + $('.check').each(function() { | |
| 256 | + $(this).removeAttr('checked'); | |
| 257 | + }); | |
| 258 | + } | |
| 259 | + }); | |
| 260 | + | |
| 261 | + /*批量认领操作*/ | |
| 262 | + $('.action').click(function() { | |
| 263 | + var flag = $(this).attr('data'); | |
| 264 | + if (flag == 'claim') { | |
| 265 | + var ids = []; | |
| 266 | + $('.check').each(function() { | |
| 267 | + if ($(this).prop('checked')) { | |
| 268 | + ids[ids.length] = $(this).attr('value'); | |
| 269 | + } | |
| 270 | + }); | |
| 271 | + } else if (flag == 'claim100') { | |
| 272 | + ids = 100; | |
| 273 | + } else { | |
| 274 | + ids = 1000; | |
| 275 | + } | |
| 276 | + if (ids.length > 0|| ids > 0) { | |
| 277 | + if (flag == 'claim') { | |
| 278 | + $('#msg').html('您确认认领这<strong><span class="text-danger">' | |
| 279 | + + ids.length+ '</span></strong>条信息吗?'); | |
| 280 | + $('#modal_remove').show(); | |
| 281 | + $('#modal_remove').attr('claim','claim'); | |
| 282 | + } else if (flag == 'claim100') { | |
| 283 | + $('#msg').html('您确认认领这前<strong><span class="text-danger">' | |
| 284 | + + ids+ '</span></strong>条信息吗?'); | |
| 285 | + $('#modal_remove').show(); | |
| 286 | + $('#modal_remove').attr('claim','claim100'); | |
| 287 | + } else { | |
| 288 | + $('#msg').html('您确认认领这前<strong><span class="text-danger">' | |
| 289 | + + ids+ '</span></strong>条信息吗?'); | |
| 290 | + $('#modal_remove').show(); | |
| 291 | + $('#modal_remove').attr('claim','claim1000'); | |
| 292 | + } | |
| 293 | + } else { | |
| 294 | + alert('请选择要认领的数据'); | |
| 295 | + return false; | |
| 296 | + } | |
| 297 | + }); | |
| 298 | + | |
| 299 | + /*批量*/ | |
| 300 | + /*批量操作 --认领*/ | |
| 301 | + // var claim_open = false; | |
| 302 | + // var remove_open = false; | |
| 303 | + $("#modal_remove").delegate(this,"click",function() { | |
| 304 | + // if (claim_open == true) { | |
| 305 | + // return false; | |
| 306 | + // } | |
| 307 | + // if (remove_open == true) { //这样的话是true,就是单个操作 | |
| 308 | + // return false; | |
| 309 | + // } | |
| 310 | + var status = $('.action').val(); | |
| 311 | + var flag = $(this).attr('claim'); | |
| 312 | + // var flag = $(this).attr('data'); | |
| 313 | + if (flag == 'claim') { | |
| 314 | + var ids = []; | |
| 315 | + $('.check').each(function() { | |
| 316 | + if ($(this).prop('checked')) { | |
| 317 | + ids[ids.length] = $(this).attr('value'); | |
| 318 | + } | |
| 319 | + }); | |
| 320 | + } else if (flag == 'claim100') { | |
| 321 | + ids = 100; | |
| 322 | + } else { | |
| 323 | + ids = 1000; | |
| 324 | + } | |
| 325 | + var state = 2; | |
| 326 | + $.ajax({ | |
| 327 | + url : '/live/status/'+ status, | |
| 328 | + type : 'POST', | |
| 329 | + data : {'_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 330 | + 'flag' : flag, | |
| 331 | + 'ids' : ids | |
| 332 | + }, | |
| 333 | + success : function() { | |
| 334 | + // window.location.reload(); | |
| 335 | + window.location.href = '/live/filter/'+ state; | |
| 336 | + } | |
| 337 | + }); | |
| 338 | + }); | |
| 339 | + /*批量*/ | |
| 340 | + | |
| 341 | + /*批量调用的方法*/ | |
| 342 | + function ajaxAction(action, flag) { | |
| 343 | + var ids = []; | |
| 344 | + $('.check').each(function() { | |
| 345 | + if ($(this).prop('checked')) { | |
| 346 | + ids[ids.length] = $(this).attr('value'); | |
| 347 | + } | |
| 348 | + }); | |
| 349 | + | |
| 350 | + if (ids.length > 0) { | |
| 351 | + $.ajax({ | |
| 352 | + url : '/live/status/'+ action, | |
| 353 | + type : 'POST', | |
| 354 | + data : {'_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 355 | + 'ids' : ids, | |
| 356 | + 'flag' : flag | |
| 357 | + }, | |
| 358 | + success : function(data) { | |
| 359 | + window.location.reload(); | |
| 360 | + // window.location.href = '/live/big_list'; | |
| 361 | + } | |
| 362 | + }); | |
| 363 | + } | |
| 364 | + } | |
| 365 | + | |
| 366 | + $('#all').click( | |
| 367 | + function() { | |
| 368 | + $(this).addClass('btn-info'); | |
| 369 | + $(this).siblings().removeClass('btn-info'); | |
| 370 | + window.location.href = '/live'; | |
| 371 | + }); | |
| 372 | + | |
| 373 | + //刷新功能 | |
| 374 | +// $('#refresh').click( | |
| 375 | +// function() { | |
| 376 | +// // var id =$('#refresh').attr('data-id'); | |
| 377 | +// $.ajax({ | |
| 378 | +// url : '/live/big_list', | |
| 379 | +// type : 'POST', | |
| 380 | +// data : { | |
| 381 | +// '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74' | |
| 382 | +// }, | |
| 383 | +// success : function(data) { | |
| 384 | +// window.location.reload(); | |
| 385 | +// } | |
| 386 | +// }); | |
| 387 | +// window.location.href = '/live'; | |
| 388 | +// }) | |
| 389 | + //是否显示待领选项 | |
| 390 | + $('#hide_select_area_2').show(); | |
| 391 | + | |
| 392 | + /* 筛选 状态 */ | |
| 393 | + $('.filter').click(function() { | |
| 394 | + var state = $(this).val(); | |
| 395 | + global_state = state; | |
| 396 | + switch (state) { | |
| 397 | + case "1": | |
| 398 | + $('#hide_select_area_2').show(); | |
| 399 | + $(this).addClass('btn-info'); | |
| 400 | + $(this).siblings().removeClass('btn-info'); | |
| 401 | + $.ajax({ | |
| 402 | + url : '/live/filter/'+ state, | |
| 403 | + type : 'POST', | |
| 404 | + data : { | |
| 405 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 406 | + 'state' : state | |
| 407 | + }, | |
| 408 | + success : function(data) { | |
| 409 | + window.location.reload(); | |
| 410 | + } | |
| 411 | + }); | |
| 412 | + window.location.href = '/live/filter/'+ state; | |
| 413 | + break; | |
| 414 | + case "2": | |
| 415 | + $('#hide_select_area_2').hide(); | |
| 416 | + $(this).addClass('btn-info'); | |
| 417 | + $(this).siblings().removeClass('btn-info'); | |
| 418 | + window.location.href = '/live/filter/'+ state; | |
| 419 | + break; | |
| 420 | + case "3": | |
| 421 | + $('#hide_select_area_2').hide(); | |
| 422 | + $(this).addClass('btn-info'); | |
| 423 | + $(this).siblings().removeClass('btn-info'); | |
| 424 | + window.location.href = '/live/filter/'+ state; | |
| 425 | + break; | |
| 426 | + case "4": | |
| 427 | + $('#hide_select_area_2').hide(); | |
| 428 | + $(this).addClass('btn-info'); | |
| 429 | + $(this).siblings().removeClass('btn-info'); | |
| 430 | + window.location.href = '/live/filter/'+ state; | |
| 431 | + break; | |
| 432 | + case "7": | |
| 433 | + $('#hide_select_area_2').hide(); | |
| 434 | + $(this).addClass('btn-info'); | |
| 435 | + $(this).siblings().removeClass('btn-info'); | |
| 436 | + window.location.href = '/live/filter/'+ state; | |
| 437 | + break; | |
| 438 | + case '0': | |
| 439 | + $('#hide_select_area_2').hide(); | |
| 440 | + $(this).addClass('btn-info'); | |
| 441 | + $(this).siblings().removeClass('btn-info'); | |
| 442 | + window.location.href = '/live/filter/'+ state; | |
| 443 | + break; | |
| 444 | + } | |
| 445 | + }); | |
| 446 | + </script> | |
| 447 | + <div class="modal fade common" id="modal_remove" tabindex="-1" | |
| 448 | + role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
| 449 | + <div class="modal-dialog"> | |
| 450 | + <div class="modal-content"> | |
| 451 | + <div class="modal-header"> | |
| 452 | + <button type="button" class="close" data-dismiss="modal" | |
| 453 | + aria-hidden="true">×</button> | |
| 454 | + <h4 class="modal-title" id="modal_title"></h4> | |
| 455 | + </div> | |
| 456 | + <div class="modal-body"> | |
| 457 | + <div class="alert alert-danger" id="window_msg" | |
| 458 | + style="display: none;"> | |
| 459 | + <p></p> | |
| 460 | + </div> | |
| 461 | + <div id="contents"></div> | |
| 462 | + </div> | |
| 463 | + </div> | |
| 464 | + </div> | |
| 465 | + </div> | |
| 466 | + | |
| 467 | + <table id="table"> | |
| 468 | + <div> | |
| 469 | + <div class="col-xs-2 col-lg-2 margin-bottom action"> | |
| 470 | + <a href="#" class="thumbnail margin-bottom" | |
| 471 | + onclick="preview('rtmp://hyyy.rtmps2.cnlive.com/live-hyyy-604/604_000007')"> | |
| 472 | + <div style="text-align: center"> | |
| 473 | + <img src='http://app.scio.gov.cn/upload/img/2019/06/2ef0a5dc-a98c-469c-a419-04eeb866a401.png' | |
| 474 | + alt="封面图" width="134px" height="100px"> | |
| 475 | + </div> | |
| 476 | + | |
| 477 | + </a> | |
| 478 | + <div> | |
| 479 | + <p style="line-height: 0"> | |
| 480 | + <span class="text-success">待审</span> <span | |
| 481 | + class="text-primary pull-right">2019-06-26 14:56:33</span> | |
| 482 | + </p> | |
| 483 | + <p class="info-box-text"> | |
| 484 | + <input type="checkbox" class="check" value="10225"> | |
| 485 | + 国新办举行新时代人民满意公务员代表中外记者见面会 | |
| 486 | + </p> | |
| 487 | + <p class="info-box-text"> | |
| 488 | + <span style="float: left;">id:10225 </span> <span | |
| 489 | + style="margin-left: 60px;"> <span>直播中</span> | |
| 490 | + </span> <span style="float: right;"> <span></span> | |
| 491 | + </span> | |
| 492 | + </p> | |
| 493 | + <p class="info-box-text"> | |
| 494 | + <span style="float: left;"> <span>SP简称:</span> | |
| 495 | + </span> <span style="float: right;"> <span>国新客户端</span> | |
| 496 | + </span> | |
| 497 | + </p> | |
| 498 | + | |
| 499 | + </div> | |
| 500 | + <div class="width-10p pull-left padding-r-5"> | |
| 501 | + <button class="btn btn-primary btn-xs btn-block" title="认领" | |
| 502 | + onclick="claim('10225')" data-field="action" | |
| 503 | + data-formatter="actionFormatter" data-events="actionEvents" | |
| 504 | + data-toggle="tooltip" data-placement="top" value="2" | |
| 505 | + id="claim_10225"> | |
| 506 | + <i class="fa fa-hand-pointer-o"></i> | |
| 507 | + </button> | |
| 508 | + </div> | |
| 509 | + | |
| 510 | + <div class="width-10p pull-left padding-r-5"> | |
| 511 | + <button class="btn btn-success btn-xs btn-block " | |
| 512 | + disabled="disabled" title="查看" onclick="detail('10225')" | |
| 513 | + data-toggle="tooltip" data-placement="top"> | |
| 514 | + <i class="fa fa-eye"></i> | |
| 515 | + </button> | |
| 516 | + </div> | |
| 517 | + <div class="width-10p pull-left padding-r-5"> | |
| 518 | + <button class="btn btn-danger btn-xs btn-block" | |
| 519 | + disabled="disabled" title="退领" onclick="back('10225')" | |
| 520 | + data-toggle="tooltip" data-placement="top"> | |
| 521 | + <i class="fa fa-mail-reply"></i> | |
| 522 | + </button> | |
| 523 | + </div> | |
| 524 | + | |
| 525 | + <div class="width-10p pull-right padding-r-5"> | |
| 526 | + <button class="btn btn-primary btn-xs btn-block" | |
| 527 | + disabled="disabled" title="日志" | |
| 528 | + onclick="reject('38_09471046aa7f4835a734f1d6208249fc')"> | |
| 529 | + <i class="fa fa-bullseye"></i> | |
| 530 | + </button> | |
| 531 | + </div> | |
| 532 | + | |
| 533 | + <div class="width-10p pull-right padding-r-5"> | |
| 534 | + <button class="btn btn-danger btn-xs btn-block" title="下线直播" | |
| 535 | + onclick="offline_live('10225')" data-toggle="tooltip" | |
| 536 | + data-placement="top" | |
| 537 | + data-target="#modal"> | |
| 538 | + <i class="fa fa-arrow-down"></i> | |
| 539 | + </button> | |
| 540 | + </div> | |
| 541 | + | |
| 542 | + <div class="width-10p pull-right padding-r-5"> | |
| 543 | + <button class="btn btn-danger btn-xs btn-block" title="下线主播" | |
| 544 | + onclick="offline_anchor('10225')" data-toggle="tooltip" | |
| 545 | + data-placement="top"> | |
| 546 | + <i class="glyphicon glyphicon-user"></i> | |
| 547 | + </button> | |
| 548 | + </div> | |
| 549 | + </div> | |
| 550 | + <div class="col-xs-2 col-lg-2 margin-bottom action"> | |
| 551 | + <a href="#" class="thumbnail margin-bottom" | |
| 552 | + onclick="preview('rtmp://sxzg.rtmps2.cnlive.com/live-sxzg-82/82_liveshow01')"> | |
| 553 | + <div style="text-align: center"> | |
| 554 | + <img | |
| 555 | + src='http://yweb3.cnliveimg.com/bc/82/2019/0621/1561102155567_1507.jpg' | |
| 556 | + alt="封面图" width="134px" height="100px"> | |
| 557 | + </div> | |
| 558 | + | |
| 559 | + </a> | |
| 560 | + <div> | |
| 561 | + <p style="line-height: 0"> | |
| 562 | + <span class="text-success">待审</span> <span | |
| 563 | + class="text-primary pull-right">2019-06-24 13:30:00</span> | |
| 564 | + </p> | |
| 565 | + <p class="info-box-text"> | |
| 566 | + <input type="checkbox" class="check" value="10179"> | |
| 567 | + 第四届世界厨师艺术节-2 | |
| 568 | + </p> | |
| 569 | + <p class="info-box-text"> | |
| 570 | + <span style="float: left;">id:10179 </span> <span | |
| 571 | + style="margin-left: 60px;"> <span>直播中</span> | |
| 572 | + </span> <span style="float: right;"> <span></span> | |
| 573 | + </span> | |
| 574 | + </p> | |
| 575 | + <p class="info-box-text"> | |
| 576 | + <span style="float: left;"> <span>SP简称:</span> | |
| 577 | + </span> <span style="float: right;"> <span>视讯中国</span> | |
| 578 | + </span> | |
| 579 | + </p> | |
| 580 | + | |
| 581 | + </div> | |
| 582 | + <div class="width-10p pull-left padding-r-5"> | |
| 583 | + <button class="btn btn-primary btn-xs btn-block" title="认领" | |
| 584 | + onclick="claim('10179')" data-field="action" | |
| 585 | + data-formatter="actionFormatter" data-events="actionEvents" | |
| 586 | + data-toggle="tooltip" data-placement="top" value="2" | |
| 587 | + id="claim_10179"> | |
| 588 | + <i class="fa fa-hand-pointer-o"></i> | |
| 589 | + </button> | |
| 590 | + </div> | |
| 591 | + | |
| 592 | + <div class="width-10p pull-left padding-r-5"> | |
| 593 | + <button class="btn btn-success btn-xs btn-block " | |
| 594 | + disabled="disabled" title="查看" onclick="detail('10179')" | |
| 595 | + data-toggle="tooltip" data-placement="top"> | |
| 596 | + <i class="fa fa-eye"></i> | |
| 597 | + </button> | |
| 598 | + </div> | |
| 599 | + <div class="width-10p pull-left padding-r-5"> | |
| 600 | + <button class="btn btn-danger btn-xs btn-block" | |
| 601 | + disabled="disabled" title="退领" onclick="back('10179')" | |
| 602 | + data-toggle="tooltip" data-placement="top"> | |
| 603 | + <i class="fa fa-mail-reply"></i> | |
| 604 | + </button> | |
| 605 | + </div> | |
| 606 | + | |
| 607 | + <div class="width-10p pull-right padding-r-5"> | |
| 608 | + <button class="btn btn-primary btn-xs btn-block" | |
| 609 | + disabled="disabled" title="日志" | |
| 610 | + onclick="reject('82_YKJ-0624-2')"> | |
| 611 | + <i class="fa fa-bullseye"></i> | |
| 612 | + </button> | |
| 613 | + </div> | |
| 614 | + | |
| 615 | + <div class="width-10p pull-right padding-r-5"> | |
| 616 | + <button class="btn btn-danger btn-xs btn-block" title="下线直播" | |
| 617 | + onclick="offline_live('10179')" data-toggle="tooltip" | |
| 618 | + data-placement="top" | |
| 619 | + data-target="#modal"> | |
| 620 | + <i class="fa fa-arrow-down"></i> | |
| 621 | + </button> | |
| 622 | + </div> | |
| 623 | + | |
| 624 | + <div class="width-10p pull-right padding-r-5"> | |
| 625 | + <button class="btn btn-danger btn-xs btn-block" title="下线主播" | |
| 626 | + onclick="offline_anchor('10179')" data-toggle="tooltip" | |
| 627 | + data-placement="top"> | |
| 628 | + <i class="glyphicon glyphicon-user"></i> | |
| 629 | + </button> | |
| 630 | + </div> | |
| 631 | + </div> | |
| 632 | + </div> | |
| 633 | + </table> | |
| 634 | + | |
| 635 | + </div> | |
| 636 | + </div> | |
| 637 | + </div> | |
| 638 | + </div> | |
| 639 | + </section> | |
| 640 | + <!-- /.content --> | |
| 641 | +<!-- <div class="box-footer"> --> | |
| 642 | +<!-- <div class="pull-right"></div> --> | |
| 643 | +<!-- </div> --> | |
| 644 | + </div> | |
| 645 | + <!-- /.content-wrapper --> | |
| 646 | + | |
| 647 | + <!-- 预览对话框 --> | |
| 648 | + <div class="modal fade" id="preview" role="dialog" aria-hidden="true"> | |
| 649 | + <div class="modal-dialog" style="width: 670px;"> | |
| 650 | + <div class="modal-content"> | |
| 651 | + <div class="modal-header"> | |
| 652 | + <button type="button" class="close" data-dismiss="modal" | |
| 653 | + aria-hidden="true">×</button> | |
| 654 | + <h5 class="modal-title" id="myModalLabel">视频预览</h5> | |
| 655 | + </div> | |
| 656 | + <div class="modal-body"> | |
| 657 | + <embed name="cnlive" width="640" height="450" id="cnlive" volume="0" | |
| 658 | + src="http://data.cnlive.com/export/UuidPlayerMain.swf" | |
| 659 | + flashVars="" type="application/x-shockwave-flash" wmode="window" | |
| 660 | + quility="high" allowscriptaccess="always" allowfullscreen="true"> | |
| 661 | + </div> | |
| 662 | + </div> | |
| 663 | + <!-- /.modal-content --> | |
| 664 | + </div> | |
| 665 | + <!-- /.modal --> | |
| 666 | + </div> | |
| 667 | + | |
| 668 | + <!-- 确认直播下线,直播下线 --> | |
| 669 | + <div class="modal" id="action_note" role="dialog" | |
| 670 | + aria-labelledby="myModalLabel"> | |
| 671 | + <div class="modal-dialog"> | |
| 672 | + <div class="modal-content"> | |
| 673 | + <div class="modal-header"> | |
| 674 | + <h4 class="modal-title">温馨提示</h4> | |
| 675 | + </div> | |
| 676 | + <div class="modal-body" id="msg2"></div> | |
| 677 | + | |
| 678 | + <div class="modal-footer"> | |
| 679 | + <button type="button" class="btn btn-default " | |
| 680 | + data-dismiss="modal" id="action_note_no">取消</button> | |
| 681 | + <button type="button" class="btn btn-primary" id="action_note_yes">确认</button> | |
| 682 | + <input type="hidden" name="action_note_type" id="action_note_type" | |
| 683 | + value="" /> <input type="hidden" name="action_note_id" | |
| 684 | + id="action_note_id" value="" /> | |
| 685 | + </div> | |
| 686 | + </div> | |
| 687 | + </div> | |
| 688 | + </div> | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + <script> | |
| 694 | + /*查询字段效果*/ | |
| 695 | + $('#videos_query').click(function() { | |
| 696 | + $('#table').bootstrapTable('selectPage', 1); | |
| 697 | + }); | |
| 698 | + | |
| 699 | + // $('#modal').modal('hide'); | |
| 700 | + $('#modal').on('hide.bs.modal', function(event) { | |
| 701 | + | |
| 702 | + }); | |
| 703 | + | |
| 704 | + //列表中的操作 ---预览,审核,查看,退领 | |
| 705 | + function preview(url) { | |
| 706 | + $('#cnlive').attr('flashVars', | |
| 707 | + "hasBorder=false&appid=82_irej0pbo53&type=live&model=2&videoURL=" | |
| 708 | + + url); | |
| 709 | + $('#preview').modal('show'); | |
| 710 | + $('.close').click(function() { | |
| 711 | + $('.preview').attr('display', 'none'); | |
| 712 | + }) | |
| 713 | + } | |
| 714 | + | |
| 715 | + /*认领*/ | |
| 716 | + function claim(id) { | |
| 717 | + var source_state = global_state; //当前按钮状态 | |
| 718 | + var current_state = $("#claim_" + id).val() //当前直播状态 | |
| 719 | + if (source_state == 0) { //从全部点认领让其跳转到我的已审 | |
| 720 | + if (current_state == 2) { //直播中 | |
| 721 | + var state = 2; | |
| 722 | + $.ajax({ | |
| 723 | + type : 'get', | |
| 724 | + data : { | |
| 725 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74' | |
| 726 | + }, | |
| 727 | + url : '/live/claim/' + id+ "?current_state=" + current_state, | |
| 728 | + success : function(data) { | |
| 729 | + // window.location.href = '/live/filter/' + state; | |
| 730 | + if (data['status_code'] == 403) { | |
| 731 | + window.location.href = '/live/filter/' + 0; | |
| 732 | + } else { | |
| 733 | + window.location.href = '/live/filter/'+ state; | |
| 734 | + } | |
| 735 | + } | |
| 736 | + }); | |
| 737 | + } else { //已结束 | |
| 738 | + var state = 7; | |
| 739 | + $.ajax({ | |
| 740 | + type : 'get', | |
| 741 | + data : { | |
| 742 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74' | |
| 743 | + }, | |
| 744 | + url : '/live/claim/' + id+ "?source_state=" + source_state, | |
| 745 | + success : function(data) { | |
| 746 | + // window.location.href = '/live/filter/' + state; | |
| 747 | + if (data['status_code'] == 403) { | |
| 748 | + window.location.href = '/live/filter/' + 0; | |
| 749 | + } else { | |
| 750 | + window.location.href = '/live/filter/'+ state; | |
| 751 | + } | |
| 752 | + } | |
| 753 | + }); | |
| 754 | + } | |
| 755 | + } else { | |
| 756 | + //我的待领页面中,点击认领就跳转到我的待审 | |
| 757 | + var state = 2; | |
| 758 | + $.ajax({ | |
| 759 | + type : 'get', | |
| 760 | + data : {'_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74' | |
| 761 | + }, | |
| 762 | + url : '/live/claim/' + id, | |
| 763 | + success : function(data) { | |
| 764 | + // window.location.href = '/live/filter/' + state; | |
| 765 | + if (data['status_code'] == 403) { | |
| 766 | + window.location.href = '/live/filter/' + 1; | |
| 767 | + } else { | |
| 768 | + window.location.href = '/live/filter/'+ state; | |
| 769 | + } | |
| 770 | + } | |
| 771 | + }); | |
| 772 | + } | |
| 773 | + } | |
| 774 | + | |
| 775 | + /*查看*/ | |
| 776 | + function detail(id) { | |
| 777 | + // var flag = 'big-list'; | |
| 778 | + var state = global_state; | |
| 779 | + var time = Date.parse(new Date()); | |
| 780 | + if (typeof (id) == "undefined") { | |
| 781 | + return false; | |
| 782 | + } | |
| 783 | + window.open('/live/detail/' + id + '/' + time + '?state='+ state); | |
| 784 | + } | |
| 785 | + | |
| 786 | + /*退领*/ | |
| 787 | + function back(id) { | |
| 788 | + var state = global_state; | |
| 789 | + $.ajax({ | |
| 790 | + type : 'get', | |
| 791 | + data : { | |
| 792 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74' | |
| 793 | + }, | |
| 794 | + url : '/live/back/' + id, | |
| 795 | + success : function(data) { | |
| 796 | + window.location.href = '/live' + '?state=' + state; | |
| 797 | + } | |
| 798 | + }); | |
| 799 | + } | |
| 800 | + /*拒绝*/ | |
| 801 | + function reject(id) { | |
| 802 | + // var act_id = row.activity_id; | |
| 803 | + $.ajax({ | |
| 804 | + type : 'get', | |
| 805 | + data : { | |
| 806 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 807 | + 'act_id' : id | |
| 808 | + }, | |
| 809 | + url : '/live/get_msg/', | |
| 810 | + success : function(data) { | |
| 811 | + if (data['status_code'] == 200) { | |
| 812 | + var msg = eval("(" + data['data'] + ")") | |
| 813 | + console.log(msg) | |
| 814 | + if (msg == '') { | |
| 815 | + alert('没有审核记录'); | |
| 816 | + return false; | |
| 817 | + } else { | |
| 818 | + alert(msg); | |
| 819 | + } | |
| 820 | + } | |
| 821 | + } | |
| 822 | + }); | |
| 823 | + } | |
| 824 | + /*下线主播*/ | |
| 825 | + function offline_anchor(id) { | |
| 826 | + $('#msg2').html('您确认下线该主播吗?'); | |
| 827 | + $('#action_note').show(); | |
| 828 | + $("#action_note_type").val('offline_anchor'); | |
| 829 | + $("#action_note_id").val(id); | |
| 830 | + } | |
| 831 | + | |
| 832 | + /*下线直播*/ | |
| 833 | + function offline_live(id) { | |
| 834 | + | |
| 835 | + $('#msg2').html('您确认下线该直播吗?'); | |
| 836 | + $('#action_note').show(); | |
| 837 | + $("#action_note_type").val('offline_live'); | |
| 838 | + $("#action_note_id").val(id); | |
| 839 | + $('#modal_remove').attr('claim', 'claim'); | |
| 840 | + } | |
| 841 | + | |
| 842 | + $("#action_note_no").click(function() { | |
| 843 | + $("#action_note").hide(); | |
| 844 | + }); | |
| 845 | + | |
| 846 | + $("#action_note_yes").click(function() { | |
| 847 | + var action_note_type = $("#action_note_type").val(); | |
| 848 | + var id = $("#action_note_id").val(); | |
| 849 | + var state = global_state; | |
| 850 | + if (action_note_type == 'offline_live') { | |
| 851 | + $.ajax({ | |
| 852 | + type : 'get', | |
| 853 | + data : { | |
| 854 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 855 | + 'msg' : '首页-下线直播-操作' | |
| 856 | + }, | |
| 857 | + url : '/live/offline_live/'+ id, | |
| 858 | + success : function(data) { | |
| 859 | + window.location.href = '/live'+ '?state=' + state; | |
| 860 | + } | |
| 861 | + }); | |
| 862 | + } else if (action_note_type == 'offline_anchor') { | |
| 863 | + $.ajax({ | |
| 864 | + type : 'get', | |
| 865 | + data : { | |
| 866 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 867 | + 'msg' : '首页-下线主播-操作' | |
| 868 | + }, | |
| 869 | + url : '/live/offline_anchor/'+ id, | |
| 870 | + success : function(data) { | |
| 871 | + window.location.href = '/live'+ '?state=' + state; | |
| 872 | + } | |
| 873 | + }); | |
| 874 | + } else if (action_note_type = 'reject') { | |
| 875 | + $.ajax({ | |
| 876 | + type : 'get', | |
| 877 | + data : { | |
| 878 | + '_token' : 'VljOVtqOXq8KDlkbyDxOSyDSx1VLv40V5TrDob74', | |
| 879 | + 'msg' : '首页-拒绝-操作' | |
| 880 | + }, | |
| 881 | + url : '/live/reject/' + id, | |
| 882 | + success : function(data) { | |
| 883 | + window.location.href = '/live'+ '?state=' + state; | |
| 884 | + } | |
| 885 | + }); | |
| 886 | + } | |
| 887 | + }) | |
| 888 | + </script> | |
| 889 | + <script> | |
| 890 | + $(function() { | |
| 891 | + $("[data-toggle='tooltip']").tooltip(); | |
| 892 | + }); | |
| 893 | + </script> | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + <footer th:replace="../templates/common/foot::foot"></footer> | |
| 898 | + | |
| 899 | + | |
| 900 | + <!-- Control Sidebar --> | |
| 901 | + <aside class="control-sidebar control-sidebar-dark"> | |
| 902 | + <!-- Create the tabs --> | |
| 903 | + <ul class="nav nav-tabs nav-justified control-sidebar-tabs"> | |
| 904 | + <li><a href="#control-sidebar-home-tab" data-toggle="tab"><i | |
| 905 | + class="fa fa-home"></i></a></li> | |
| 906 | + <li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i | |
| 907 | + class="fa fa-gears"></i></a></li> | |
| 908 | + </ul> | |
| 909 | + <!-- Tab panes --> | |
| 910 | + <div class="tab-content"> | |
| 911 | + <!-- Home tab content --> | |
| 912 | + <div class="tab-pane" id="control-sidebar-home-tab"></div> | |
| 913 | + <!-- /.tab-pane --> | |
| 914 | + </div> | |
| 915 | + </aside> | |
| 916 | + <!-- /.control-sidebar --> | |
| 917 | + <!-- Add the sidebar's background. This div must be placed | |
| 918 | + immediately after the control sidebar --> | |
| 919 | + <div class="control-sidebar-bg"></div> | |
| 920 | + | |
| 921 | + </div> | |
| 922 | + <!-- ./wrapper --> | |
| 923 | +</body> | |
| 924 | + | |
| 925 | + | |
| 926 | +<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> | |
| 927 | +<script type="text/javascript"> | |
| 928 | + $('div.alert').not('.alert-danger').delay(3000).slideUp(300); | |
| 929 | +</script> | |
| 930 | + | |
| 931 | +<!-- AdminLTE App --> | |
| 932 | +<script src="./../../static/js/app.min.js"></script> | |
| 933 | +<!-- AdminLTE for demo purposes --> | |
| 934 | +<script src="./../../static/js/sidebar.js"></script> | |
| 935 | + | |
| 936 | +</html> | ... | ... |