Commit fa81cf709bf0d6ea57101be8959dc03d8ce86b40

Authored by 张宗朋
1 parent 302addcb

search

src/main/java/com/cnlive/mz/live/action/LiveAction.java
... ... @@ -124,8 +124,8 @@ public class LiveAction {
124 124 if (live_url.isEmpty()) {
125 125 return null;
126 126 } else {
127   - int index = live_url.lastIndexOf("live");
128   - String streamName = live_url.substring(index + 6);
  127 + int index = live_url.lastIndexOf("/");
  128 + String streamName = live_url.substring(index + 1);
129 129 System.out.println("streamName===" + streamName);
130 130 String accesskey = BaseUtil.getAccessKey();
131 131 accesskey = java.net.URLEncoder.encode(accesskey, "utf-8");
... ... @@ -138,12 +138,12 @@ public class LiveAction {
138 138 // 断流。
139 139 try {
140 140 addBlackList(signature, accesskey, expire, streamName);
141   - delBlackList(delsignature, accesskey, expire, streamName);
  141 + //delBlackList(delsignature, accesskey, expire, streamName);
142 142 } catch (UnsupportedEncodingException e) {
143 143 e.printStackTrace();
144 144 }
145 145 // 直播通知
146   - tLiveService.notify(video_uuid, -1);
  146 + //tLiveService.notify(video_uuid, -1);
147 147 boolean flag = tCheckService.closeLive(id);
148 148 return new Result(flag);
149 149 }
... ... @@ -175,7 +175,6 @@ public class LiveAction {
175 175 public String addBlackList(String signature, String accesskey, String expire, String streamName) throws UnsupportedEncodingException {
176 176 String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey + "&expire=" + expire
177 177 + "&app=live&method=add&name=" + streamName;
178   - System.out.println(url);
179 178 String jsonArrStr = HttpReq.getRequestWidthResult(url);
180 179 int status = HttpReq.getRequest(url);
181 180 System.out.println(status + "......and......" + jsonArrStr);
... ... @@ -195,7 +194,6 @@ public class LiveAction {
195 194 public Object delBlackList(String signature, String accesskey, String expire, String streamName) throws UnsupportedEncodingException {
196 195 String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey + "&expire=" + expire
197 196 + "&app=live&method=del&name=" + streamName;
198   - System.out.println("..url.." + url);
199 197 String jsonArrStr = HttpReq.getRequestWidthResult(url);
200 198 System.out.println("..jsonArrStr.." + jsonArrStr);
201 199 return jsonArrStr;
... ... @@ -216,8 +214,16 @@ public class LiveAction {
216 214 System.out.println("...parmas..." + params);
217 215 String t_user_id = params.getString("search_user_id");
218 216 String title = params.getString("search_title");
  217 +
  218 + try {
  219 + title = new String(title.trim().getBytes("ISO-8859-1"), "utf-8");
  220 + System.out.println("...title.."+title);
  221 + } catch (UnsupportedEncodingException e) {
  222 + e.printStackTrace();
  223 + }
  224 +
219 225 Pager<TLive> tLive = tLiveService.getTLiveAllPager(page_number, Constants.PAGE_SIZE, t_user_id, title);
220   - System.out.println(tLive);
  226 + System.out.println("tLive====="+tLive);
221 227 return new View("live/all_live_management.jsp").data("tLive", tLive);
222 228 }
223 229  
... ...
src/main/webapp/pages/live/all_live_management.jsp
... ... @@ -32,11 +32,11 @@
32 32 <div class="row">
33 33 <div class="col-xs-12">
34 34 <div class="box box-warning">
35   - <div class="box-header with-border">
  35 + <div class="box-header with-border">
36 36 <h3 class="box-title"></h3>
37 37 <div class="box-tools">
38 38 <div class="input-group">
39   - <form role = "form" id="formid" name= "myform" action ="../../live/search/1" method ="get" >
  39 + <form role="form" action="../../live/search/1" method="get">
40 40 <div class="input-group">
41 41 <input type="text" name="search_user_id" id="search_user_id"
42 42 class="form-control input-sm" style="width: 150px;"
... ... @@ -44,10 +44,9 @@
44 44 name="search_title" id="search_title"
45 45 class="form-control input-sm" style="width: 150px;"
46 46 placeholder="活动名称" />
47   - <button id="t_activity_search_btn" type="submit"
48   - class="btn btn-sm btn-default">
  47 + <button type="submit" class="btn btn-sm btn-default">
49 48 <i class="fa fa-search"></i>搜索
50   - </button>
  49 + </button>
51 50 </div>
52 51 </form>
53 52 </div>
... ... @@ -74,8 +73,7 @@
74 73 <td><fmt:formatDate value="${item.start_time}"
75 74 pattern="yyyy-MM-dd HH:mm" /></td>
76 75 <td>${item.end_time}</td>
77   - <td><c:if
78   - test="${item.t_status_id==0}">
  76 + <td><c:if test="${item.t_status_id==0}">
79 77 <span class="badge bg-green">未开始</span>
80 78 </c:if> <c:if test="${item.t_status_id==2}">
81 79 <span class="badge bg-green">正常结束</span>
... ... @@ -86,6 +84,10 @@
86 84 </c:if></td>
87 85  
88 86 <td>
  87 + <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');">
  88 + <i class="icon-upload"></i>下线
  89 + </button> --%>
  90 +
89 91 <button class="btn btn-danger btn-sm"
90 92 onclick="t_live_close('${item.id}','${item.uuid}');">
91 93 <i class="fa fa-close"></i>
... ... @@ -104,7 +106,7 @@
104 106 </div>
105 107 </div>
106 108 </div>
107   - </section>
  109 + </section>
108 110 </div>
109 111 <%@ include file="/pages/common/bottom.jsp"%>
110 112 </div>
... ...
src/main/webapp/static/assets/cnlive/js/all_live.js
... ... @@ -7,7 +7,6 @@ function t_live_close(id, uuid) {
7 7 alert('获取错误!');
8 8 },
9 9 success : function(data) {
10   - alert(data);
11 10 location.href = "../../live/alllive/1";
12 11 }
13 12 });
... ...
src/main/webapp/static/assets/cnlive/js/common.js
... ... @@ -6,20 +6,6 @@
6 6 function next_page(pageNum) {
7 7 window.location.href = "" + pageNum;
8 8 }
9   -function next_pager(pageNum) {
10   - $.ajax({
11   - url : '../../live/searchg/' + pageNum,
12   - type : 'post',
13   - datatype : "json",
14   - async : true,
15   - error : function() {
16   - },
17   - success : function(data) {
18   - location.href = '../../live/search/'+pageNum;
19   - }
20   - });
21   -
22   -}
23 9  
24 10 // 提示
25 11 function showTip(succ) {
... ...
src/main/webapp/static/assets/cnlive/js/global.js
1 1 var BASE; // Context Path(在 script.jsp 中初始化)
2   -
  2 +function next_page(pageNum){
  3 + window.location.href = "" + pageNum+window.location.search;
  4 + alert(window.location.search);
  5 +}
3 6 var Smart = {
4 7 /* -------------------------------------------------- 函数 -------------------------------------------------- */
5 8 Validator: {
... ... @@ -146,7 +149,7 @@ $(function() {
146 149 });
147 150  
148 151 // 设置 form 默认为 post 类型
149   - $('form').attr('method', 'post');
  152 + // $('form').attr('method', 'post');
150 153  
151 154 // 全局 AJAX 设置
152 155 $.ajaxSetup({
... ...
src/main/webapp/static/assets/cnlive/js/live.js
... ... @@ -494,10 +494,6 @@ function t_live_underLine(id){
494 494 function checkUser(){
495 495 var search_user_id = $("#search_user_id").val();
496 496 var search_title = $("#search_title").val();
497   - //var href ="../search/1?search_user_id="+search_user_id+"&search_title="+search_title ;
498   - //window.open(href);
499   - //window.location.href ="../../live/search/1?search_user_id="+search_user_id+"&search_title="+search_title ;
500   -
501 497 $.ajax({
502 498 url:'../../live/search/1',
503 499 type:'post',
... ... @@ -506,8 +502,8 @@ function checkUser(){
506 502 alert('下线时发生错误!');
507 503 },
508 504 success : function(data) {
509   - location.href = "../../live/search/1?search_user_id="+search_user_id+"&search_title="+search_title;
510   - alert("下线成功");
  505 + //location.href = "../../live/search/1?search_user_id="+search_user_id+"&search_title="+search_title;
  506 + //alert(location.href);
511 507 }
512 508 });
513 509 }
... ...
target/m2e-wtp/web-resources/META-INF/MANIFEST.MF
1 1 Manifest-Version: 1.0
2   -Build-Jdk: 1.7.0_79
3   -Built-By: adm
  2 +Build-Jdk: 1.7.0_13
  3 +Built-By: Administrator
4 4 Created-By: Maven Integration for Eclipse
5 5  
... ...
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
1 1 #Generated by Maven Integration for Eclipse
2   -#Thu Jun 23 09:20:00 CST 2016
3   -version=0.0.1-SNAPSHOT
4   -groupId=com.cnlive.mz.live.web
5   -m2e.projectName=cnlive_live_web
6   -m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\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
  2 +#Fri Jun 24 09:13:59 CST 2016
19 3 version=0.0.1-SNAPSHOT
20 4 groupId=com.cnlive.mz.live.web
21 5 m2e.projectName=cnlive_live_web
22 6 m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web
23   -artifactId=cnlive_live_web
24 7 \ No newline at end of file
  8 +artifactId=cnlive_live_web
... ...