Commit 4a5f410b65d95aebaec9a776623ab420c7c5d8fc

Authored by 张宗朋
2 parents dc6255d7 f50134db

Merge

src/main/java/com/cnlive/mz/live/action/HttpPostArgumentTest2.java
... ... @@ -67,7 +67,7 @@ public class HttpPostArgumentTest2 {
67 67 NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"),
68 68 new NameValuePair("user_access_key", user_access_key),
69 69 new NameValuePair("app_access_key", app_access_key) };
70   - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/redirect", param);
  70 + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param);
71 71 System.out.println(c);
72 72 }
73 73  
... ... @@ -84,12 +84,12 @@ public class HttpPostArgumentTest2 {
84 84  
85 85 public static void supload() {
86 86 NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key),
87   - new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "2"),
  87 + new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"),
88 88 new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5),
89 89 new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"),
90 90 new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"),
91 91 new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") };
92   - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/supload", param);
  92 + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param);
93 93 System.out.println(c);
94 94 }
95 95  
... ...
src/main/java/com/cnlive/mz/live/action/LiveAction.java
... ... @@ -130,14 +130,14 @@ public class LiveAction {
130 130 String accesskey = BaseUtil.getAccessKey();
131 131 accesskey = java.net.URLEncoder.encode(accesskey, "utf-8");
132 132 String add = "add";
133   - String signature = BaseUtil.signature(add, streamName);
  133 + String addsignature = BaseUtil.signature(add, streamName);
134 134 String del = "del";
135 135 String delsignature = BaseUtil.signature(del, streamName);
136 136 String expire = BaseUtil.getTimestamp();
137 137 System.out.println(expire + "---expire---");
138 138 // 断流。
139 139 try {
140   - addBlackList(signature, accesskey, expire, streamName);
  140 + addBlackList(addsignature, accesskey, expire, streamName);
141 141 //delBlackList(delsignature, accesskey, expire, streamName);
142 142 } catch (UnsupportedEncodingException e) {
143 143 e.printStackTrace();
... ... @@ -195,7 +195,6 @@ public class LiveAction {
195 195 String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey + "&expire=" + expire
196 196 + "&app=live&method=del&name=" + streamName;
197 197 String jsonArrStr = HttpReq.getRequestWidthResult(url);
198   - System.out.println("..jsonArrStr.." + jsonArrStr);
199 198 return jsonArrStr;
200 199  
201 200 }
... ... @@ -210,21 +209,19 @@ public class LiveAction {
210 209 @Request.Get("/live/search/{page_number}")
211 210 public View search(int page_number, Params params) {
212 211 int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID));
213   - System.out.println(user_id);
214   - System.out.println("...parmas..." + params);
215 212 String t_user_id = params.getString("search_user_id");
216 213 String title = params.getString("search_title");
217 214  
218 215 try {
219 216 title = new String(title.trim().getBytes("ISO-8859-1"), "utf-8");
220   - System.out.println("...title.."+title);
221 217 } catch (UnsupportedEncodingException e) {
222 218 e.printStackTrace();
223 219 }
224 220  
225 221 Pager<TLive> tLive = tLiveService.getTLiveAllPager(page_number, Constants.PAGE_SIZE, t_user_id, title);
226   - System.out.println("tLive====="+tLive);
227 222 return new View("live/all_live_management.jsp").data("tLive", tLive);
228 223 }
  224 +
  225 + //live/epg
229 226  
230 227 }
231 228 \ No newline at end of file
... ...
src/main/java/com/cnlive/mz/live/action/UserAction.java
... ... @@ -24,19 +24,19 @@ public class UserAction {
24 24 * @return
25 25 */
26 26 @Request.Get("/user/list/{pageNumber}")
27   - public View getUsers(int pageNumber) {
  27 + public View list(int pageNumber) {
28 28 Pager<TUser> userPage = tUserService.getTUserPage(pageNumber);
29 29 return new View("user/user_list.jsp").data("userPage", userPage);
30 30 }
31 31  
32 32 @Request.Get("/user/live/{userId}/{pageNumber}")
33   - public View getLiveList(int userId, int pageNumber) {
  33 + public View livelist(int userId, int pageNumber) {
34 34 Pager<TLive> userPage = tUserService.getTLivePage(userId, pageNumber);
35 35 return new View("user/user_live_list.jsp").data("userPage", userPage);
36 36 }
37 37  
38 38 @Request.Get("/user/report/{userId}/{type}")
39   - public Result getUserByReport(int userId,int type) {
40   - return new Result(tUserService.addReport(userId));
  39 + public Result report(int userId,String type) {
  40 + return new Result(tUserService.addReport(userId,type));
41 41 }
42 42 }
... ...
src/main/java/com/cnlive/mz/live/action/VideoAction.java
... ... @@ -18,6 +18,8 @@ import org.smart4j.framework.mvc.bean.View;
18 18 import org.smart4j.framework.util.CastUtil;
19 19  
20 20 import com.cnlive.mz.commons.CnliveUtil;
  21 +import com.cnlive.mz.commons.sensitive.FilteredResult;
  22 +import com.cnlive.mz.commons.sensitive.WordFilterUtil;
21 23 import com.cnlive.mz.live.common.Constants;
22 24 import com.cnlive.mz.live.common.LiveUtils;
23 25 import com.cnlive.mz.live.entity.TLive;
... ... @@ -70,13 +72,19 @@ public class VideoAction {
70 72 if (title.length() > 50) {
71 73 title = title.substring(0, 50);
72 74 }
73   - String direct = params.getString("direct");
74 75 String description = params.getString("description");
  76 + WordFilterUtil wf = new WordFilterUtil();
  77 + FilteredResult resTitle = wf.filterHtml(title, '*');
  78 + title = resTitle.getFilteredContent().toString();
  79 + FilteredResult resDescr = wf.filterHtml(description, '*');
  80 + description = resDescr.getFilteredContent().toString();
  81 +
  82 + String direct = params.getString("direct");
75 83 String custom_args = params.getString("custom_args");
76 84 String md5 = params.getString("md5");
77 85 String relation_id = params.getString("relation_id");
78 86 String uuid = "";
79   - boolean success=true;
  87 + boolean success = true;
80 88 if (video_type.equals("2")) {
81 89 // 2:sdk上传录播文件
82 90 TVideo tVideo = new TVideo();
... ... @@ -108,14 +116,14 @@ public class VideoAction {
108 116 tLive.setDirect(Integer.parseInt(direct));
109 117 }
110 118 tLive.setLive_url(Constants.KS_HOST_RTMP + tLive.getT_user_id() + "_" + uuid);
111   - success=tLiveService.startLive(tLive);
  119 + success = tLiveService.startLive(tLive);
112 120 }
113 121 data.put("video_uuid", uuid);
114 122 ApiBean apiBean = new ApiBean();
115 123 if (success) {
116 124 apiBean.setCode(100);
117 125 apiBean.setMessage("请求成功");
118   - }else{
  126 + } else {
119 127 apiBean.setCode(201);
120 128 apiBean.setMessage("发起直播失败");
121 129 }
... ... @@ -161,10 +169,10 @@ public class VideoAction {
161 169 @Request.Get("/video/view/{id}")
162 170 public View view(int id) {
163 171 TVideo tVideo = tVideoService.getVideoById(id);
164   - System.out.println("------"+tVideo);
  172 + System.out.println("------" + tVideo);
165 173 return new View("live/video_view.jsp").data("tVideo", tVideo);
166 174 }
167   -
  175 +
168 176 @Request.Post("/api/video/one")
169 177 public ApiBean one(Params params) {
170 178 String app_access_key = params.getString("app_access_key");
... ... @@ -190,7 +198,7 @@ public class VideoAction {
190 198 tVideoService.notify(video_uuid);
191 199 } else if (video_type.equals("3")) {
192 200 // 直播通知
193   - //tLiveService.notify(video_uuid);
  201 + // tLiveService.notify(video_uuid);
194 202 // 直播正常结束
195 203 tLiveService.notify(video_uuid, 2);
196 204 }
... ... @@ -231,9 +239,9 @@ public class VideoAction {
231 239 }
232 240 log.info(sb.toString());
233 241 }
234   - @Request.Post("/video/unline")
235   - public Result underLine(Params params){
236   - int id = params.getInt("id");
  242 +
  243 + @Request.Get("/video/unline/{id}")
  244 + public Result underLine(int id) {
237 245 boolean flag = tVideoService.underLine(id);
238 246 return new Result(flag);
239 247 }
... ...
src/main/java/com/cnlive/mz/live/action/VodIpsAction.java 0 → 100644
  1 +package com.cnlive.mz.live.action;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.Map;
  5 +
  6 +import org.apache.log4j.Logger;
  7 +import org.apache.xalan.lib.Redirect;
  8 +import org.smart4j.framework.mvc.annotation.Action;
  9 +import org.smart4j.framework.mvc.annotation.Request;
  10 +import org.smart4j.framework.mvc.bean.Params;
  11 +
  12 +
  13 +/**
  14 + * 点播调度
  15 + * @author adm
  16 + *
  17 + */
  18 +@Action
  19 +public class VodIpsAction {
  20 +
  21 + private Logger log = Logger.getLogger("VodIpsAction");
  22 +
  23 + @Request.Get("/vodips/h5/{id}")
  24 + public Redirect h5(int id,Params params) {
  25 + Redirect r=new Redirect();
  26 + r.setRedirectUrl("http://wideo03.cnlive.com/video/data1/2016/0808/141118/1500/878e13fc40754c2caf1476f7cad5f7b9_141118_1500.m3u8");
  27 + return r;
  28 + }
  29 +
  30 + @Request.Get("/vodips/app/{id}")
  31 + public Redirect app(int id,Params params) {
  32 + Redirect r=new Redirect();
  33 + r.setRedirectUrl("http://wideo03.cnlive.com/video/data1/2016/0808/141118/1500/878e13fc40754c2caf1476f7cad5f7b9_141118_1500.m3u8");
  34 + return r;
  35 + }
  36 +
  37 + @Request.Get("/vodips/flash/{id}")
  38 + public ResultBean flash(int id,Params params) {
  39 + ResultBean rb =new ResultBean();
  40 + Map map =new HashMap();
  41 + map.put("\"location\"", "http://wideo01.cnlive.com/video/data1/2016/0524/124025/800/b7e34cfee140449f9e04c5e85b66aa56_124025_800.mp4");
  42 + rb.setData(map);
  43 + rb.setErrorCode("0");
  44 + rb.setErrorMessage("成功");
  45 + return rb;
  46 + }
  47 +}
... ...
src/main/java/com/cnlive/mz/live/action/WordAction.java 0 → 100644
  1 +package com.cnlive.mz.live.action;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +import java.util.Map.Entry;
  6 +
  7 +import org.smart4j.framework.ioc.annotation.Inject;
  8 +import org.smart4j.framework.mvc.annotation.Action;
  9 +import org.smart4j.framework.mvc.annotation.Request;
  10 +import org.smart4j.framework.mvc.bean.Params;
  11 +import org.smart4j.framework.mvc.bean.Result;
  12 +import org.smart4j.framework.mvc.bean.View;
  13 +
  14 +import com.cnlive.mz.live.entity.TRoom;
  15 +import com.cnlive.mz.live.service.SensitiveWordService;
  16 +
  17 +@Action
  18 +public class WordAction {
  19 +
  20 + @Inject
  21 + private SensitiveWordService sensitiveWord;
  22 +
  23 + @Request.Post("/word/add")
  24 + public Result add(Params params){
  25 + Map map = params.getFieldMap();
  26 + String str = (String) map.get("words");
  27 + str=str.replace(",", ",3.");
  28 + str=str+",3.";
  29 + return new Result(sensitiveWord.add(str));
  30 + }
  31 +
  32 + @Request.Get("/word/list")
  33 + public View list(){
  34 + View view = new View("word/word_management.jsp");
  35 + List<String> str = sensitiveWord.list();
  36 + view.data("str", str);
  37 + return view;
  38 + }
  39 +}
... ...
src/main/java/com/cnlive/mz/live/aspect/AuthFilter.java
... ... @@ -52,12 +52,14 @@ public class AuthFilter implements Filter {
52 52 String requestUrl = request.getRequestURI();
53 53 HttpSession session = request.getSession();
54 54 String webUrl = ConfigHelper.getString("website.url");
55   - if (session.getAttribute(LiveUtils.SESSION_KEY_NAME) == null) {
  55 + String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ;
  56 + if (a== null) {
56 57 boolean authEnable = ConfigHelper.getBoolean("auth.enable");
57 58 String loginUrl = ConfigHelper.getString("auth.login.url");
58 59 if (authEnable) {
59 60 //去登录认证
60   - response.sendRedirect(loginUrl + webUrl+"/login/success");
  61 + String url=loginUrl + webUrl+"/login/success";
  62 + response.sendRedirect(url);
61 63 return;
62 64 } else {
63 65 String userName = "liujicheng";
... ...
src/main/resources/log4j.properties
1 1 log4j.rootLogger=INFO,console,file,action,content,video,httpreq
2   -
3 2 #Console
4   -log4j.appender.Threshold=INFO
5 3 log4j.appender.console.Target=System.out
6 4 log4j.appender.console=org.apache.log4j.ConsoleAppender
7 5 log4j.appender.console.layout=org.apache.log4j.PatternLayout
8   -log4j.appender.console.layout.ConversionPattern=%d %-5p [%c] (%t:%x) %m%n
  6 +log4j.appender.console.layout.ConversionPattern=%m%n
9 7  
10 8  
11 9 log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
12   -log4j.appender.file.File=${catalina.base}/logs/cnlive_live_web/log
  10 +log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log
13 11 log4j.appender.file.DatePattern='_'yyyyMMdd
14 12 log4j.appender.file.encoding=UTF-8
15 13 log4j.appender.file.layout=org.apache.log4j.PatternLayout
... ... @@ -20,6 +18,7 @@ log4j.logger.org.smart4j=DEBUG
20 18  
21 19  
22 20 #action
  21 +
23 22 log4j.appender.action=org.apache.log4j.DailyRollingFileAppender
24 23 log4j.appender.action.File=${catalina.home}/logs/action.log
25 24 log4j.appender.action.layout=org.apache.log4j.PatternLayout
... ...
src/main/webapp/WEB-INF/web.xml
... ... @@ -12,4 +12,31 @@
12 12 </init-param>
13 13 <load-on-startup>2</load-on-startup>
14 14 </servlet>
  15 + <servlet>
  16 + <servlet-name>TokenServlet</servlet-name>
  17 + <servlet-class>com.cnlive.stream.servlet.TokenServlet</servlet-class>
  18 + <load-on-startup>0</load-on-startup>
  19 + </servlet>
  20 + <servlet-mapping>
  21 + <servlet-name>TokenServlet</servlet-name>
  22 + <url-pattern>/tk</url-pattern>
  23 + </servlet-mapping>
  24 + <servlet>
  25 + <servlet-name>StreamServlet</servlet-name>
  26 + <servlet-class>com.cnlive.stream.servlet.StreamServlet</servlet-class>
  27 + <load-on-startup>0</load-on-startup>
  28 + </servlet>
  29 + <servlet-mapping>
  30 + <servlet-name>StreamServlet</servlet-name>
  31 + <url-pattern>/upload</url-pattern>
  32 + </servlet-mapping>
  33 + <servlet>
  34 + <servlet-name>FormDataServlet</servlet-name>
  35 + <servlet-class>com.cnlive.stream.servlet.FormDataServlet</servlet-class>
  36 + <load-on-startup>0</load-on-startup>
  37 + </servlet>
  38 + <servlet-mapping>
  39 + <servlet-name>FormDataServlet</servlet-name>
  40 + <url-pattern>/fd</url-pattern>
  41 + </servlet-mapping>
15 42 </web-app>
16 43 \ No newline at end of file
... ...
src/main/webapp/pages/common/left.jsp
... ... @@ -18,21 +18,22 @@
18 18 </div>
19 19 </div>
20 20 <ul class="sidebar-menu">
21   - <c:if test="${sessionScope.roleId=='0'}">
22   - <li class="header">导航栏</li>
  21 + <c:if test="${sessionScope.roleId=='1'}">
  22 + <li class="header">导航栏</li>
23 23 <li>
24 24 <a href="${BASE}/switch"><i class="fa fa-circle-o text-blue"></i>全局切换</a>
25 25 </li>
26 26 <li>
27   - <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a>
  27 + <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a>
28 28 </li>
29 29 <li>
30   - <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-yellow"></i>活动管理</a>
  30 + <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a>
31 31 </li>
32   - <li class="header">系统设置</li>
33 32 <li>
34   - <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a>
  33 + <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-red"></i>活动管理</a>
35 34 </li>
  35 +
  36 + <li class="header">系统设置</li>
36 37 <li>
37 38 <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a>
38 39 </li>
... ... @@ -42,22 +43,8 @@
42 43 <li>
43 44 <a href="${BASE}/signal/list/1"><i class="fa fa-circle-o text-red"></i>信源管理</a>
44 45 </li>
45   - <li class="header">导航栏</li>
46   - <li>
47   - <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a>
48   - </li>
49   - <li>
50   - <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-yellow"></i>活动管理</a>
51   - </li>
52   - <li class="header">系统设置</li>
53   - <li>
54   - <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a>
55   - </li>
56   - <li>
57   - <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a>
58   - </li>
59 46 </c:if>
60   - <c:if test="true">
  47 + <c:if test="${sessionScope.roleId=='2'}">
61 48 <li class="header">UGC直播审查</li>
62 49 <li>
63 50 <a href="${BASE}/user/list/1"><i class="fa fa-circle-o text-yellow"></i>主播管理</a>
... ... @@ -71,6 +58,9 @@
71 58 <li>
72 59 <a href="${BASE}/live/alllive/1"><i class="fa fa-circle-o text-yellow"></i>直播管理</a>
73 60 </li>
  61 + <li>
  62 + <a href="${BASE}/word/list"><i class="fa fa-circle-o text-yellow"></i>敏感词管理</a>
  63 + </li>
74 64 </c:if>
75 65 </ul>
76 66 </section>
... ...
src/main/webapp/pages/live/all_live_management.jsp
... ... @@ -81,7 +81,13 @@
81 81 <span class="badge bg-yellow">直播中</span>
82 82 </c:if> <c:if test="${item.t_status_id==-2}">
83 83 <span class="badge bg-red">异常结束</span>
84   - </c:if></td>
  84 + </c:if>
  85 +
  86 + <c:if test="${item.t_status_id==-3}">
  87 + <span class="badge bg-yellow">已经下线</span>
  88 + </c:if>
  89 +
  90 + </td>
85 91  
86 92 <td>
87 93 <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');">
... ...
src/main/webapp/pages/live/video_management.jsp
... ... @@ -36,35 +36,28 @@
36 36 <div class="box-body">
37 37 <table class="table table-bordered">
38 38 <tr>
39   - <th width ="30%">名称</th>
40   - <th width ="10%">状态</th>
41   - <th width ="40%">描述</th>
42   - <th width ="10%">操作</th>
  39 + <th width="30%">名称</th>
  40 + <th width="30%">relation_id</th>
  41 + <th width="30%">审核状态</th>
  42 + <th width="10%">操作</th>
43 43 </tr>
44 44 <c:forEach var="item" items="${videos.recordList}"
45 45 varStatus="stat">
46 46 <tr>
47   - <td>${item.title}</td>
48   - <td><c:if test="${item.state==205}">
49   - <span class="badge bg-green">未开始</span>
50   - </c:if> <c:if test="${item.state==207}">
51   - <span class="badge bg-red">直播中</span>
52   - </c:if> <c:if test="${item.state==302}">
53   - <span class="badge">直播结束</span>
54   - </c:if> <c:if test="${item.state==600}">
55   - <span class="badge">回放同步中</span>
56   - </c:if></td>
57   - <td>${item.description}
58   - </td>
  47 + <td><a onclick="t_live_xq(${item.id});">${item.title}</a></td>
  48 + <td>${item.relation_id}</td>
  49 + <td><c:choose>
  50 + <c:when test="${item.check_state==1}">
  51 + <span class="badge bg-green">审核通过</span>
  52 + </c:when>
  53 + <c:otherwise>
  54 + <span class="badge bg-red">未审核</span>
  55 + </c:otherwise>
  56 + </c:choose></td>
59 57 <td>
60   - <button class="btn btn-minier btn-sm"
61   - onclick="t_live_xq(${item.id});">详细
62   - </button>
63 58 <button class="btn btn-danger btn-sm"
64   - onclick="t_live_underLine(${item.id});">下线
65   - </button>
  59 + onclick="t_live_underLine(${item.id});">下线</button>
66 60 </td>
67   -
68 61 </tr>
69 62 </c:forEach>
70 63 </table>
... ...
src/main/webapp/pages/live/video_view.jsp
... ... @@ -42,7 +42,7 @@
42 42 <table class="table table-bordered">
43 43 <tr>
44 44 <td colspan="3" align='center'><h2>${tVideo.title}</h2></td>
45   -
  45 +
46 46 </tr>
47 47 <tr>
48 48 <td><b>id:</b></td>
... ... @@ -57,7 +57,7 @@
57 57 <td><b>relation_id:</b></td>
58 58 <td colspan="1">${tVideo.relation_id}</td>
59 59 </tr>
60   -
  60 +
61 61 <tr>
62 62 <td><b>t_user_id:</b></td>
63 63 <td colspan="1">${tVideo.t_user_id}</td>
... ... @@ -98,6 +98,13 @@
98 98 <td><b>direct:</b></td>
99 99 <td colspan="2">${tVideo.direct}</td>
100 100 </tr>
  101 + <tr>
  102 + <td><button class="btn btn-success"
  103 + onclick="to_video_pass(${tVideo.id});">通过</button></td>
  104 + <td colspan="2"><button
  105 + class="btn btn-danger"
  106 + onclick="unline(${tVideo.id});">下线</button></td>
  107 + </tr>
101 108 </table>
102 109 </div>
103 110 </div>
... ... @@ -113,70 +120,110 @@
113 120 </section>
114 121 </div>
115 122 </div>
116   - <script type="text/javascript" src="../../pages/check/js/ckplayer.js" charset="utf-8"></script>
  123 + <script type="text/javascript" src="../../pages/check/js/ckplayer.js"
  124 + charset="utf-8"></script>
117 125 <!-- <script type="text/javascript" src="../../pages/check/js/offlights.js" charset="utf-8"></script> -->
118   -<script type="text/javascript">
119   -/* jwplayer("player").setup({
120   - file: '${tVideo.play_url}',
121   - height: 260,
122   - image: "/assets/myVideo.jpg",
123   - autostart:true,
124   - rtmp: {
125   - bufferlength: 0.1
126   - },
127   - width: 370
128   -}); */
  126 + <script type="text/javascript">
  127 +
129 128  
130   - var BASE_URL = "http://localhost:8080/cnlive_live_web/static/assets/ck/",
131   - prefix = "http",
132   - isHLS = true,
133   - url = '${tVideo.play_url}';
134   - var isMobile = function () {
135   - var check = false;
136   - (function (a) {
137   - if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
138   - check = true
139   - })(navigator.userAgent || navigator.vendor || window.opera);
140   - return check;
141   - }
142   - if (isMobile()){
143   - new ksVideo({
144   - container:"player",
145   - url: url,
146   - width:600,
147   - height:200,
148   - face:"mp4.png"
  129 + function unline(id){
  130 + $.ajax({
  131 + url:'../../video/unline/'+id,
  132 + type:'get',
  133 + error : function() {
  134 + alert('获取错误!');
  135 + },
  136 + success : function(data) {
  137 + alert("下线成功");
  138 + window.location.href="../check/1";
  139 + }
149 140 });
150   - } else {
151   - var flashvars;
152   - // 播放器参数说明地址:http://www.ckplayer.com/tool/help/29.htm
153   - if (prefix == "http" && isHLS){
154   - flashvars = {
155   - f : BASE_URL + 'ckplayer/m3u8.swf',
156   - a : url || 'http://kssws.ks-cdn.com/20121218/abc.mp4-640x480-b211ebb6.mp4',
157   - c : 0,
158   - p : 1,
159   - e : 1,
160   - s : 4,
161   - lv: 0//注意,是否锁定进度栏 0:不锁定,1:锁定。如果是直播,需设置lv:1
162   - }
163   - } else if (prefix == "rtmp" || !isHLS){
164   - flashvars = {
165   - f : url || 'http://kssws.ks-cdn.com/20121218/abc.mp4-640x480-b211ebb6.mp4',
166   - p : 1,
167   - c : 0, //调用配置方式 =0:调用ckplayer.js
168   - lv: 0
169   - }
170   - }
171   - var params = {
172   - bgcolor:'#FFF',
173   - allowFullScreen:true,
174   - allowScriptAccess:'always',
175   - wmode:'transparent'
176   - };
177   - CKobject.embed('http://localhost:8080/cnlive_live_web/static/assets/ck/ckplayer/ckplayer.swf','player','ckplayer_a1','400', '350', false, flashvars)
178   - }
179   -</script>
  141 + }
  142 +
  143 +
  144 + function to_video_pass(id) {
  145 + $.ajax({
  146 + url : BASE+'/video/pass/'+id,
  147 + type : 'get',
  148 + async : true,
  149 + error : function() {
  150 + alert('获取错误!');
  151 + },
  152 + success : function(data) {
  153 + alert("通过");
  154 + window.location.href="../check/1";
  155 + }
  156 + });
  157 + }
  158 +
  159 + /* jwplayer("player").setup({
  160 + file: '${tVideo.play_url}',
  161 + height: 260,
  162 + image: "/assets/myVideo.jpg",
  163 + autostart:true,
  164 + rtmp: {
  165 + bufferlength: 0.1
  166 + },
  167 + width: 370
  168 + }); */
  169 +
  170 + var BASE_URL = "http://bc.cnlive.com/static/assets/ck/", prefix = "http", isHLS = true, url = '${tVideo.play_url}';
  171 + var isMobile = function() {
  172 + var check = false;
  173 + (function(a) {
  174 + if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i
  175 + .test(a)
  176 + || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i
  177 + .test(a.substr(0, 4)))
  178 + check = true
  179 + })(navigator.userAgent || navigator.vendor || window.opera);
  180 + return check;
  181 + }
  182 + if (isMobile()) {
  183 + new ksVideo({
  184 + container : "player",
  185 + url : url,
  186 + width : 600,
  187 + height : 200,
  188 + face : "mp4.png"
  189 + });
  190 + } else {
  191 + var flashvars;
  192 + // 播放器参数说明地址:http://www.ckplayer.com/tool/help/29.htm
  193 + if (prefix == "http" && isHLS) {
  194 + flashvars = {
  195 + f : BASE_URL + 'ckplayer/m3u8.swf',
  196 + a : url
  197 + || 'http://kssws.ks-cdn.com/20121218/abc.mp4-640x480-b211ebb6.mp4',
  198 + c : 0,
  199 + p : 1,
  200 + e : 1,
  201 + s : 4,
  202 + lv : 0
  203 + //注意,是否锁定进度栏 0:不锁定,1:锁定。如果是直播,需设置lv:1
  204 + }
  205 + } else if (prefix == "rtmp" || !isHLS) {
  206 + flashvars = {
  207 + f : url
  208 + || 'http://kssws.ks-cdn.com/20121218/abc.mp4-640x480-b211ebb6.mp4',
  209 + p : 1,
  210 + c : 0, //调用配置方式 =0:调用ckplayer.js
  211 + lv : 0
  212 + }
  213 + }
  214 + var params = {
  215 + bgcolor : '#FFF',
  216 + allowFullScreen : true,
  217 + allowScriptAccess : 'always',
  218 + wmode : 'transparent'
  219 + };
  220 + CKobject
  221 + .embed(
  222 + 'http://bc.cnlive.com/static/assets/ck/ckplayer/ckplayer.swf',
  223 + 'player', 'ckplayer_a1', '400', '350', false,
  224 + flashvars)
  225 + }
  226 + </script>
180 227 </body>
181 228  
182 229 </html>
... ...
src/main/webapp/pages/user/user_list.jsp
... ... @@ -45,6 +45,7 @@
45 45 <th>用户权限</th>
46 46 <th>创建日期</th>
47 47 <th>举报次数</th>
  48 + <th>举报原因</th>
48 49 <th>播放列表</th>
49 50 </tr>
50 51 <c:forEach var="item" items="${userPage.recordList}"
... ... @@ -52,11 +53,16 @@
52 53 <tr>
53 54 <td>${item.name}</td>
54 55 <td>${item.is_admin}</td>
55   - <td>${item.create_time}</td>
  56 + <td>${item.create_time}</td>
56 57 <td>
57 58 <c:if test="${item.reported_count<=5}"><span class="badge">${item.reported_count}</span></c:if>
58 59 <c:if test="${item.reported_count>5}"><span class="badge bg-red">${item.reported_count}</span></c:if>
59 60 </td>
  61 + <td>
  62 + <c:forEach items="${fn:split(item.reported_reason,',')}" var="tags">
  63 + ${tags}
  64 + </c:forEach>
  65 + </td>
60 66 <td><a href="${BASE}/user/live/${item.id}/1">查看</a></td>
61 67 </tr>
62 68 </c:forEach>
... ...
src/main/webapp/pages/word/word_add.jsp 0 → 100644
  1 +<%@ page language="java" pageEncoding="UTF-8"%>
  2 +<%@ include file="/pages/common/taglib.jsp"%>
  3 +<!DOCTYPE html>
  4 +<html>
  5 +<head>
  6 +<meta charset="UTF-8">
  7 +<title>添加敏感词 | <f:message key="common.title" /></title>
  8 +<meta
  9 + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
  10 + name='viewport'>
  11 +<%@ include file="/pages/common/css.jsp"%>
  12 +<link href="${BASE}/static/assets/plugins/uploadfile/css/fileinput.css"
  13 + media="all" rel="stylesheet" type="text/css" />
  14 +<!--[if IE]>
  15 + <script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
  16 + <![endif]-->
  17 +</head>
  18 +<body class="skin-blue sidebar-mini">
  19 + <div class="wrapper">
  20 + <%@ include file="/pages/common/top.jsp"%>
  21 + <%@ include file="/pages/common/left.jsp"%>
  22 + <div class="content-wrapper">
  23 + <!-- Content Header (Page header) -->
  24 + <section class="content-header">
  25 + <h1>
  26 + <small>添加敏感词</small> <small
  27 + class="label label-warning" style="display: none"
  28 + id="info_tab_span"><i class="fa fa-bell-o"></i>保存成功</small>
  29 + </h1>
  30 + <ol class="breadcrumb">
  31 + <li><a><i class="fa fa-dashboard"></i> 首页</a></li>
  32 + <li class="active">添加敏感词</li>
  33 + </ol>
  34 + </section>
  35 + <!-- Main content -->
  36 + <section class="content">
  37 + <div class="row">
  38 + <div class="col-md-12">
  39 + <form id="create_form" method="post">
  40 + <div class="box box-success">
  41 + <div class="box-body">
  42 + <div class="form-group">
  43 + <label>请输入关键词 </label>
  44 + <div class="input-group">
  45 + <span class="input-group-addon"><i class="fa fa-font"></i>
  46 + </span> <textarea id="words" name="words" class="form-control" rows="3" placeholder="北京,上海,天津"></textarea>
  47 + </div>
  48 + </div>
  49 + </div>
  50 + <button type="submit" id="t_channel_save_btn"
  51 + class="btn btn-primary">
  52 + <i class="fa fa-save "></i> 保存
  53 + </button>
  54 + </form>
  55 + </div>
  56 + </div>
  57 + </section>
  58 + </div>
  59 + <%@ include file="/pages/common/bottom.jsp"%>
  60 + </div>
  61 + <%@ include file="/pages/common/js.jsp"%>
  62 + <script type="text/javascript">
  63 + $(function() {
  64 + $('#create_form').ajaxForm({
  65 + type : 'post',
  66 + url : '../../word/add',
  67 + beforeSubmit : function() {
  68 + return true;
  69 + },
  70 + error : function(XMLHttpRequest, textStatus, errorThrown) {
  71 + alert("错误");
  72 + },
  73 + success : function(result) {
  74 + alert("添加成功");
  75 + location.href = '../../word/list';
  76 + }
  77 + });
  78 + });
  79 +
  80 + </script>
  81 +</body>
  82 +</html>
... ...
src/main/webapp/pages/word/word_management.jsp 0 → 100644
  1 +<%@ page language="java" pageEncoding="UTF-8"%>
  2 +<%@ include file="/pages/common/taglib.jsp"%>
  3 +<!DOCTYPE html>
  4 +<html>
  5 +<head>
  6 +<meta charset="UTF-8">
  7 +<title>所有关键词 | <f:message key="common.title" /></title>
  8 +<meta
  9 + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
  10 + name='viewport'>
  11 +<%@ include file="/pages/common/css.jsp"%>
  12 +<link href="${BASE}/static/assets/plugins/uploadfile/css/fileinput.css"
  13 + media="all" rel="stylesheet" type="text/css" />
  14 +<!--[if IE]>
  15 + <script src="http://libs.useso.com/js/html5shiv/3.7/html5shiv.min.js"></script>
  16 + <![endif]-->
  17 +</head>
  18 +<body class="skin-blue sidebar-mini">
  19 + <div class="wrapper">
  20 + <%@ include file="/pages/common/top.jsp"%>
  21 + <%@ include file="/pages/common/left.jsp"%>
  22 + <div class="content-wrapper">
  23 + <!-- Content Header (Page header) -->
  24 + <section class="content-header">
  25 + <h1>
  26 + 所有关键词 <small><a href="../pages/word/word_add.jsp"><i
  27 + class="fa fa-plus"></i>新增</a> </small><small class="label label-warning" style="display: none"
  28 + id="info_tab_span"><i class="fa fa-bell-o"></i>保存成功</small>
  29 + </h1>
  30 + <ol class="breadcrumb">
  31 + <li><a><i class="fa fa-dashboard"></i> 首页</a></li>
  32 + <li class="active">所有关键词</li>
  33 + </ol>
  34 + </section>
  35 + <!-- Main content -->
  36 + <section class="content">
  37 + <div class="row">
  38 + <div class="col-md-12">
  39 + <div class="box box-success">
  40 + <div class="box-body">
  41 + <div class="form-group">
  42 + <table class="table table-bordered">
  43 + <tr>
  44 + <!-- <th>过滤</th>-->
  45 + </tr>
  46 + <c:forEach var="str" items="${str}"
  47 + varStatus="stat">
  48 + <tr>
  49 + <td>${str}</td>
  50 + </tr>
  51 + </c:forEach>
  52 + </table>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + </div>
  57 + </section>
  58 + </div>
  59 + <%@ include file="/pages/common/bottom.jsp"%>
  60 + </div>
  61 +</body>
  62 +</html>
... ...
src/main/webapp/static/assets/cnlive/js/global.js
1 1 var BASE; // Context Path(在 script.jsp 中初始化)
2 2 function next_page(pageNum){
3 3 window.location.href = "" + pageNum+window.location.search;
4   - alert(window.location.search);
5 4 }
6 5 var Smart = {
7 6 /* -------------------------------------------------- 函数 -------------------------------------------------- */
... ...
src/main/webapp/static/assets/cnlive/js/video.js
... ... @@ -5,13 +5,4 @@ function t_live_xq(id){
5 5 datatype : 'json',
6 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   - });
17 8 }
18 9 \ No newline at end of file
... ...
src/test/java/com/cnlive/test/Test.java
1 1 package com.cnlive.test;
2 2  
3 3 import java.io.BufferedReader;
  4 +import java.io.File;
  5 +import java.io.FileInputStream;
4 6 import java.io.InputStreamReader;
5 7 import java.net.URL;
6 8 import java.net.URLConnection;
... ... @@ -12,7 +14,7 @@ import com.cnlive.mz.commons.net.HttpReq;
12 14  
13 15 public class Test {
14 16  
15   - public static void main(String[] args) {
  17 + public static void main(String[] args) throws Exception {
16 18 // String mediaId="123";
17 19 // String title="hha";
18 20 // String sid="234";
... ... @@ -20,13 +22,30 @@ public class Test {
20 22 // String url = "https://mobile.cnlive.com/CnliveMobile/hd/applyChatRoomId.action";
21 23 // //String chat_room_id = HttpReq.getRequestWidthResult(url);
22 24 // 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);
  25 +// String live = "rtmp://cnlive01.rtmplive.ks-cdn.com/live/498122_a9fdb367c6054edc9d2035dc237d28aa";
  26 +// int index = live.lastIndexOf("/");
  27 +// System.out.println(index);
  28 +// String live_url = live.substring(index+1);
  29 +// System.out.println(live_url);
  30 + //bcb0bf1603664092b4724b4fa90fde7a_14520164246087.mpg
  31 + //7416e88e23f6c6e959142_14658980239250.mpg
  32 + File file = new File("D:/video/b.mpg");
  33 + getFileSizes(file);
  34 + System.out.println(file.length());
28 35 }
29   -
  36 + public static long getFileSizes(File f) throws Exception{//取得文件大小
  37 + long s=0;
  38 + if (f.exists()) {
  39 + FileInputStream fis = null;
  40 + fis = new FileInputStream(f);
  41 + s= fis.available();
  42 + System.out.println(s);
  43 + } else {
  44 + f.createNewFile();
  45 + System.out.println("文件不存在");
  46 + }
  47 + return s;
  48 + }
30 49 public static String toGMTString(Date date) {
31 50 SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK);
32 51 df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT"));
... ...
target/classes/com/cnlive/mz/live/aspect/AuthFilter.class
No preview for this file type
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   -#Tue Aug 09 09:08:18 CST 2016
  2 +#Tue Aug 09 13:53:14 CST 2016
3 3 version=0.0.1-SNAPSHOT
4 4 groupId=com.cnlive.mz.live.web
5 5 m2e.projectName=cnlive_live_web
... ...