Commit 0779292294f1ee22ce28f79ac4a9971f00e9617f

Authored by 刘基城
2 parents b08f7020 c5506590

Merge branch 'master' of http://bj.gitlab.cnlive.com/liujicheng/cnlive_live_web into v532

# Conflicts:
#	target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
.settings/org.eclipse.wst.common.component
@@ -8,15 +8,6 @@ @@ -8,15 +8,6 @@
8 <dependent-module archiveName="cnlive_live_model-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_live_model/cnlive_live_model"> 8 <dependent-module archiveName="cnlive_live_model-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_live_model/cnlive_live_model">
9 <dependency-type>uses</dependency-type> 9 <dependency-type>uses</dependency-type>
10 </dependent-module> 10 </dependent-module>
11 - <dependent-module archiveName="cnlive_ks3-1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_ks3/cnlive_ks3">  
12 - <dependency-type>uses</dependency-type>  
13 - </dependent-module>  
14 - <dependent-module archiveName="smart-framework-4.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework">  
15 - <dependency-type>uses</dependency-type>  
16 - </dependent-module>  
17 - <dependent-module archiveName="smart-plugin-job-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-job/smart-plugin-job">  
18 - <dependency-type>uses</dependency-type>  
19 - </dependent-module>  
20 <dependent-module archiveName="smart-plugin-dbcp-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-dbcp/smart-plugin-dbcp"> 11 <dependent-module archiveName="smart-plugin-dbcp-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-dbcp/smart-plugin-dbcp">
21 <dependency-type>uses</dependency-type> 12 <dependency-type>uses</dependency-type>
22 </dependent-module> 13 </dependent-module>
src/main/java/com/cnlive/mz/live/action/LiveAction.java
@@ -221,9 +221,4 @@ public class LiveAction { @@ -221,9 +221,4 @@ public class LiveAction {
221 return new View("live/all_live_management.jsp").data("tLive", tLive); 221 return new View("live/all_live_management.jsp").data("tLive", tLive);
222 } 222 }
223 223
224 - @Request.Get("/live/searchg/{page_number}")  
225 - public Result searchq(int page_number) {  
226 -  
227 - return new Result(true);  
228 - }  
229 } 224 }
230 \ No newline at end of file 225 \ No newline at end of file
src/main/java/com/cnlive/mz/live/action/VideoAction.java
@@ -231,4 +231,10 @@ public class VideoAction { @@ -231,4 +231,10 @@ public class VideoAction {
231 } 231 }
232 log.info(sb.toString()); 232 log.info(sb.toString());
233 } 233 }
  234 + @Request.Post("/video/unline")
  235 + public Result underLine(Params params){
  236 + int id = params.getInt("id");
  237 + tVideoService.underLine(id);
  238 + return null;
  239 + }
234 } 240 }
src/main/java/com/cnlive/mz/live/rest/BaseUtil.java
@@ -30,8 +30,8 @@ public class BaseUtil { @@ -30,8 +30,8 @@ public class BaseUtil {
30 private static final String ENCODING = "UTF-8"; 30 private static final String ENCODING = "UTF-8";
31 31
32 // AccessKey、SecretKey 32 // AccessKey、SecretKey
33 - private static final String SECRET_KEY = "iqljE4WxQaSMeSd1QP+PPYSpvtK0uWyH0/r6tgi7";  
34 - private static final String ACCESS_KEY = "I3TC8a4xboN9kSJnUIQh"; 33 + private static final String SECRET_KEY = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC";
  34 + private static final String ACCESS_KEY = "fWUN8KDtJZJGo0ArQ4qo";
35 35
36 /* 36 /*
37 * 计算MD5+BASE64 37 * 计算MD5+BASE64
@@ -74,7 +74,7 @@ public class BaseUtil { @@ -74,7 +74,7 @@ public class BaseUtil {
74 } 74 }
75 75
76 /** 76 /**
77 - * 获取当前时间戳 77 + * 获取当前前一天的时间戳
78 * 78 *
79 * @return 79 * @return
80 */ 80 */
@@ -131,8 +131,6 @@ public class BaseUtil { @@ -131,8 +131,6 @@ public class BaseUtil {
131 String method = "GET"; 131 String method = "GET";
132 String expire = BaseUtil.getTimestamp(); 132 String expire = BaseUtil.getTimestamp();
133 String app = "live"; 133 String app = "live";
134 - // String methodadd = methodNname;  
135 - // String name = streamName;  
136 app = java.net.URLEncoder.encode(app, "utf-8"); 134 app = java.net.URLEncoder.encode(app, "utf-8");
137 methodName = java.net.URLEncoder.encode(methodName, "utf-8"); 135 methodName = java.net.URLEncoder.encode(methodName, "utf-8");
138 streamName = java.net.URLEncoder.encode(streamName, "utf-8"); 136 streamName = java.net.URLEncoder.encode(streamName, "utf-8");
src/main/webapp/pages/live/all_live_management.jsp
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 <h3 class="box-title"></h3> 36 <h3 class="box-title"></h3>
37 <div class="box-tools"> 37 <div class="box-tools">
38 <div class="input-group"> 38 <div class="input-group">
39 - <form role = "form" action="../search/1" method="get"> 39 + <form role = "form">
40 <div class="input-group"> 40 <div class="input-group">
41 <input type="text" name="search_user_id" id="search_user_id" 41 <input type="text" name="search_user_id" id="search_user_id"
42 class="form-control input-sm" style="width: 150px;" 42 class="form-control input-sm" style="width: 150px;"
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 name="search_title" id="search_title" 44 name="search_title" id="search_title"
45 class="form-control input-sm" style="width: 150px;" 45 class="form-control input-sm" style="width: 150px;"
46 placeholder="活动名称" /> 46 placeholder="活动名称" />
47 - <button id="t_activity_search_btn" type="submit" 47 + <button id="t_activity_search_btn" onclick="search()"
48 class="btn btn-sm btn-default"> 48 class="btn btn-sm btn-default">
49 <i class="fa fa-search"></i>搜索 49 <i class="fa fa-search"></i>搜索
50 </button> 50 </button>
@@ -110,4 +110,12 @@ @@ -110,4 +110,12 @@
110 </div> 110 </div>
111 <%@ include file="/pages/common/js.jsp"%> 111 <%@ include file="/pages/common/js.jsp"%>
112 </body> 112 </body>
  113 +<script type="text/javascript">
  114 + function search(){
  115 + var search_user_id = $("#search_user_id").val();
  116 + var search_title = $("#search_title").val();
  117 + window.location.href ="../search/1?search_user_id="+search_user_id+"&search_title="+search_title ;
  118 + alert(window.location.href);
  119 + }
  120 +</script>
113 </html> 121 </html>
src/main/webapp/pages/live/video_management.jsp
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 <div class="box-body"> 36 <div class="box-body">
37 <table class="table table-bordered"> 37 <table class="table table-bordered">
38 <tr> 38 <tr>
39 - <th>名称</th>  
40 - <th>状态</th>  
41 - <th>描述</th>  
42 - <th>操作</th> 39 + <th width ="30%">名称</th>
  40 + <th width ="10%">状态</th>
  41 + <th width ="40%">描述</th>
  42 + <th width ="10%">操作</th>
43 </tr> 43 </tr>
44 <c:forEach var="item" items="${videos.recordList}" 44 <c:forEach var="item" items="${videos.recordList}"
45 varStatus="stat"> 45 varStatus="stat">
@@ -57,9 +57,12 @@ @@ -57,9 +57,12 @@
57 <td>${item.description} 57 <td>${item.description}
58 </td> 58 </td>
59 <td> 59 <td>
60 - <button class="btn btn-minier label-success" 60 + <button class="btn btn-minier btn-sm"
61 onclick="t_live_xq(${item.id});">详细 61 onclick="t_live_xq(${item.id});">详细
62 </button> 62 </button>
  63 + <button class="btn btn-danger btn-sm"
  64 + onclick="t_live_underLine(${item.id});">下线
  65 + </button>
63 </td> 66 </td>
64 67
65 </tr> 68 </tr>
src/main/webapp/static/assets/cnlive/js/live.js
@@ -436,8 +436,6 @@ function do_publishreview(id){ @@ -436,8 +436,6 @@ function do_publishreview(id){
436 } 436 }
437 //断流处理 437 //断流处理
438 function play_close(id,live_url,uuid){ 438 function play_close(id,live_url,uuid){
439 - var id_live_url = $("hidId").val();  
440 - alert(id_live_url);  
441 $.ajax({ 439 $.ajax({
442 url : '../../check/cut/' + id, 440 url : '../../check/cut/' + id,
443 type : 'post', 441 type : 'post',
@@ -459,12 +457,10 @@ function play_close(id,live_url,uuid){ @@ -459,12 +457,10 @@ function play_close(id,live_url,uuid){
459 function changePlay(id,live_url,userId,title,time){ 457 function changePlay(id,live_url,userId,title,time){
460 $("input").attr("id","play_url_"+id); 458 $("input").attr("id","play_url_"+id);
461 $("input").attr("name","play_url_"+id); 459 $("input").attr("name","play_url_"+id);
462 - //$("#play_url_"+id).val(live_url);  
463 $("#hidId").val(live_url); 460 $("#hidId").val(live_url);
464 $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>"); 461 $("li[id='userId']").html("<a><i class='fa fa-file-text-o'></i>用户ID: "+userId+"</a>");
465 $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>"); 462 $("li[id='title']").html("<a><i class='fa fa-file-text-o'></i>TITLE: "+title+"</a>");
466 $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>"); 463 $("li[id='startTime']").html("<a><i class='fa fa-file-text-o'></i>开播时间: "+time+"</a>");
467 - //$("#playId").html("<input type='hidden' name='play_url_"+id+"'id='play_url_"+id+"' value='"+live_url+"'/><span class='mailbox-attachment-icon has-img' id='player_span_"+id+"'><img src='../../static/assets/dist/img/photo2.png' alt='Attachment'></span>");  
468 jwplayer("playId").setup({ 464 jwplayer("playId").setup({
469 file: live_url, 465 file: live_url,
470 height: 260, 466 height: 260,
@@ -480,4 +476,19 @@ function changePlay(id,live_url,userId,title,time){ @@ -480,4 +476,19 @@ function changePlay(id,live_url,userId,title,time){
480 function t_live_xq(id){ 476 function t_live_xq(id){
481 window.location.href="../../video/view/"+id; 477 window.location.href="../../video/view/"+id;
482 } 478 }
  479 +function t_live_underLine(id){
  480 + $.ajax({
  481 + url:'../../video/unline',
  482 + type:'post',
  483 + datatype : 'json',
  484 + data:{"id":id},
  485 + error : function() {
  486 + alert('下线时发生错误!');
  487 + },
  488 + success : function(data) {
  489 + location.href = '../../video/check/1';
  490 + alert("下线成功");
  491 + }
  492 + });
  493 +}
483 494
src/main/webapp/static/assets/cnlive/js/video.js
1 function t_live_xq(id){ 1 function t_live_xq(id){
2 - $,ajax({ 2 + $.ajax({
3 url:'../../video/detail', 3 url:'../../video/detail',
4 type:'post', 4 type:'post',
5 datatype : 'json', 5 datatype : 'json',
6 data:{"id":id}, 6 data:{"id":id},
7 }); 7 });
  8 +}
  9 +function t_live_underLine(id){
  10 + alert(id);
  11 + $.ajax({
  12 + url:'../../video/unline',
  13 + type:'post',
  14 + datatype : 'json',
  15 + data:{"id":id},
  16 + });
8 } 17 }
9 \ No newline at end of file 18 \ No newline at end of file
src/test/java/com/cnlive/test/Test.java
@@ -13,13 +13,18 @@ import com.cnlive.mz.commons.net.HttpReq; @@ -13,13 +13,18 @@ import com.cnlive.mz.commons.net.HttpReq;
13 public class Test { 13 public class Test {
14 14
15 public static void main(String[] args) { 15 public static void main(String[] args) {
16 - String mediaId="123";  
17 - String title="hha";  
18 - String sid="234";  
19 - //String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action?mediaId="+mediaId+"&title="+title+"&sid=?"+sid;  
20 - String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action";  
21 - //String chat_room_id = HttpReq.getRequestWidthResult(url);  
22 - System.out.println(sendGet(url)); 16 +// String mediaId="123";
  17 +// String title="hha";
  18 +// String sid="234";
  19 +// //String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action?mediaId="+mediaId+"&title="+title+"&sid=?"+sid;
  20 +// String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action";
  21 +// //String chat_room_id = HttpReq.getRequestWidthResult(url);
  22 +// System.out.println(sendGet(url));
  23 + String live = "rtmp://cnlive01.rtmplive.ks-cdn.com/live/498122_a9fdb367c6054edc9d2035dc237d28aa";
  24 + int index = live.lastIndexOf("/");
  25 + System.out.println(index);
  26 + String live_url = live.substring(index+1);
  27 + System.out.println(live_url);
23 } 28 }
24 29
25 public static String toGMTString(Date date) { 30 public static String toGMTString(Date date) {
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
@@ -5,3 +5,19 @@ groupId=com.cnlive.mz.live.web @@ -5,3 +5,19 @@ groupId=com.cnlive.mz.live.web
5 m2e.projectName=cnlive_live_web 5 m2e.projectName=cnlive_live_web
6 m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web 6 m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web
7 artifactId=cnlive_live_web 7 artifactId=cnlive_live_web
  8 +#Generated by Maven Integration for Eclipse
  9 +#Tue Jun 21 13:17:57 CST 2016
  10 +version=0.0.1-SNAPSHOT
  11 +groupId=com.cnlive.mz.live.web
  12 +m2e.projectName=cnlive_live_web
  13 +m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web
  14 +artifactId=cnlive_live_web
  15 +#Generated by Maven Integration for Eclipse
  16 +#Mon Jun 20 09:31:18 CST 2016
  17 +#Mon Jun 20 10:10:00 CST 2016
  18 +#Fri Jun 17 09:20:43 CST 2016
  19 +version=0.0.1-SNAPSHOT
  20 +groupId=com.cnlive.mz.live.web
  21 +m2e.projectName=cnlive_live_web
  22 +m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web
  23 +artifactId=cnlive_live_web
8 \ No newline at end of file 24 \ No newline at end of file