Commit 78a6fadf5519f36841a12bc95124cf07891a973f
Merge branch 'master' of
Showing
25 changed files
with
2255 additions
and
2393 deletions
Too many changes to show.
To preserve performance only 25 of 45 files are displayed.
.classpath
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<classpath> | ||
| 3 | - <classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
| 4 | - <attributes> | ||
| 5 | - <attribute name="optional" value="true"/> | ||
| 6 | - <attribute name="maven.pomderived" value="true"/> | ||
| 7 | - </attributes> | ||
| 8 | - </classpathentry> | ||
| 9 | - <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
| 10 | - <attributes> | ||
| 11 | - <attribute name="optional" value="true"/> | ||
| 12 | - <attribute name="maven.pomderived" value="true"/> | ||
| 13 | - </attributes> | ||
| 14 | - </classpathentry> | ||
| 15 | - <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
| 16 | - <attributes> | ||
| 17 | - <attribute name="maven.pomderived" value="true"/> | ||
| 18 | - </attributes> | ||
| 19 | - </classpathentry> | ||
| 20 | - <classpathentry kind="src" path="src/main/resources/i18n"/> | ||
| 21 | - <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
| 22 | - <attributes> | ||
| 23 | - <attribute name="maven.pomderived" value="true"/> | ||
| 24 | - <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | ||
| 25 | - </attributes> | ||
| 26 | - </classpathentry> | ||
| 27 | - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> | ||
| 28 | - <attributes> | ||
| 29 | - <attribute name="owner.project.facets" value="java"/> | ||
| 30 | - </attributes> | ||
| 31 | - </classpathentry> | ||
| 32 | - <classpathentry kind="output" path="target/classes"/> | ||
| 33 | -</classpath> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<classpath> | ||
| 3 | + <classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
| 4 | + <attributes> | ||
| 5 | + <attribute name="optional" value="true"/> | ||
| 6 | + <attribute name="maven.pomderived" value="true"/> | ||
| 7 | + </attributes> | ||
| 8 | + </classpathentry> | ||
| 9 | + <classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
| 10 | + <attributes> | ||
| 11 | + <attribute name="optional" value="true"/> | ||
| 12 | + <attribute name="maven.pomderived" value="true"/> | ||
| 13 | + </attributes> | ||
| 14 | + </classpathentry> | ||
| 15 | + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
| 16 | + <attributes> | ||
| 17 | + <attribute name="maven.pomderived" value="true"/> | ||
| 18 | + </attributes> | ||
| 19 | + </classpathentry> | ||
| 20 | + <classpathentry kind="src" path="src/main/resources/i18n"/> | ||
| 21 | + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
| 22 | + <attributes> | ||
| 23 | + <attribute name="maven.pomderived" value="true"/> | ||
| 24 | + <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | ||
| 25 | + </attributes> | ||
| 26 | + </classpathentry> | ||
| 27 | + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> | ||
| 28 | + <attributes> | ||
| 29 | + <attribute name="owner.project.facets" value="java"/> | ||
| 30 | + </attributes> | ||
| 31 | + </classpathentry> | ||
| 32 | + <classpathentry kind="output" path="target/classes"/> | ||
| 33 | +</classpath> |
.settings/org.eclipse.core.resources.prefs
.settings/org.eclipse.wst.common.component
| 1 | -<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | ||
| 2 | - <wb-module deploy-name="cnlive_live_web"> | ||
| 3 | - <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | ||
| 4 | - <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> | ||
| 5 | - <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> | ||
| 6 | - <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> | ||
| 7 | - <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources/i18n"/> | ||
| 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> | ||
| 10 | - </dependent-module> | ||
| 11 | - <dependent-module archiveName="smart-framework-4.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework"> | ||
| 12 | - <dependency-type>uses</dependency-type> | ||
| 13 | - </dependent-module> | ||
| 14 | - <dependent-module archiveName="smart-plugin-dbcp-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-dbcp/smart-plugin-dbcp"> | ||
| 15 | - <dependency-type>uses</dependency-type> | ||
| 16 | - </dependent-module> | ||
| 17 | - <dependent-module archiveName="smart-plugin-rest-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-rest/smart-plugin-rest"> | ||
| 18 | - <dependency-type>uses</dependency-type> | ||
| 19 | - </dependent-module> | ||
| 20 | - <dependent-module archiveName="smart-plugin-i18n-1.0.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-plugin-i18n/smart-plugin-i18n"> | ||
| 21 | - <dependency-type>uses</dependency-type> | ||
| 22 | - </dependent-module> | ||
| 23 | - <dependent-module archiveName="cnlive_mam_commons-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_mam_commons/cnlive_mam_commons"> | ||
| 24 | - <dependency-type>uses</dependency-type> | ||
| 25 | - </dependent-module> | ||
| 26 | - <property name="java-output-path" value="/cnlive_live_web/target/classes"/> | ||
| 27 | - <property name="context-root" value="cnlive_live_web"/> | ||
| 28 | - </wb-module> | ||
| 29 | -</project-modules> | 1 | +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> |
| 2 | + <wb-module deploy-name="cnlive_live_web"> | ||
| 3 | + <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> | ||
| 4 | + <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> | ||
| 5 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | ||
| 6 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/> | ||
| 7 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> | ||
| 8 | + <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources/i18n"/> | ||
| 9 | + <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"> | ||
| 10 | + <dependency-type>uses</dependency-type> | ||
| 11 | + </dependent-module> | ||
| 12 | + <dependent-module archiveName="cnlive_ks3-1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_ks3/cnlive_ks3"> | ||
| 13 | + <dependency-type>uses</dependency-type> | ||
| 14 | + </dependent-module> | ||
| 15 | + <dependent-module archiveName="smart-framework-4.0.1.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/smart-framework/smart-framework"> | ||
| 16 | + <dependency-type>uses</dependency-type> | ||
| 17 | + </dependent-module> | ||
| 18 | + <dependent-module archiveName="cnlive_mam_commons-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/cnlive_mam_commons/cnlive_mam_commons"> | ||
| 19 | + <dependency-type>uses</dependency-type> | ||
| 20 | + </dependent-module> | ||
| 21 | + <property name="java-output-path" value="/cnlive_live_web/target/classes"/> | ||
| 22 | + <property name="context-root" value="cnlive_live_web"/> | ||
| 23 | + </wb-module> | ||
| 24 | +</project-modules> |
.settings/org.eclipse.wst.common.project.facet.core.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<faceted-project> | ||
| 3 | - <installed facet="jst.web" version="3.0"/> | ||
| 4 | - <installed facet="wst.jsdt.web" version="1.0"/> | ||
| 5 | - <installed facet="jst.jaxrs" version="1.1"/> | ||
| 6 | - <installed facet="java" version="1.7"/> | ||
| 7 | -</faceted-project> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<faceted-project> | ||
| 3 | + <installed facet="jst.web" version="3.0"/> | ||
| 4 | + <installed facet="wst.jsdt.web" version="1.0"/> | ||
| 5 | + <installed facet="jst.jaxrs" version="1.1"/> | ||
| 6 | + <installed facet="java" version="1.7"/> | ||
| 7 | +</faceted-project> |
WebContent/META-INF/MANIFEST.MF
src/main/java/com/cnlive/mz/live/action/CheckAction.java
| 1 | package com.cnlive.mz.live.action; | 1 | package com.cnlive.mz.live.action; |
| 2 | 2 | ||
| 3 | -import java.io.UnsupportedEncodingException; | ||
| 4 | -import java.net.URLEncoder; | ||
| 5 | -import java.util.List; | ||
| 6 | -import java.util.Map; | ||
| 7 | - | ||
| 8 | import org.smart4j.framework.dao.bean.Pager; | 3 | import org.smart4j.framework.dao.bean.Pager; |
| 9 | import org.smart4j.framework.ioc.annotation.Inject; | 4 | import org.smart4j.framework.ioc.annotation.Inject; |
| 10 | import org.smart4j.framework.mvc.DataContext; | 5 | import org.smart4j.framework.mvc.DataContext; |
| @@ -15,11 +10,8 @@ import org.smart4j.framework.mvc.bean.Result; | @@ -15,11 +10,8 @@ import org.smart4j.framework.mvc.bean.Result; | ||
| 15 | import org.smart4j.framework.mvc.bean.View; | 10 | import org.smart4j.framework.mvc.bean.View; |
| 16 | import org.smart4j.framework.util.CastUtil; | 11 | import org.smart4j.framework.util.CastUtil; |
| 17 | 12 | ||
| 18 | -import com.cnlive.mz.commons.JsonUtil; | ||
| 19 | -import com.cnlive.mz.commons.net.HttpReq; | ||
| 20 | import com.cnlive.mz.live.common.LiveUtils; | 13 | import com.cnlive.mz.live.common.LiveUtils; |
| 21 | import com.cnlive.mz.live.entity.TLive; | 14 | import com.cnlive.mz.live.entity.TLive; |
| 22 | -import com.cnlive.mz.live.rest.BaseUtil; | ||
| 23 | import com.cnlive.mz.live.service.TCheckService; | 15 | import com.cnlive.mz.live.service.TCheckService; |
| 24 | import com.cnlive.mz.live.service.TLiveService; | 16 | import com.cnlive.mz.live.service.TLiveService; |
| 25 | import com.cnlive.mz.live.service.TRoomService; | 17 | import com.cnlive.mz.live.service.TRoomService; |
| @@ -34,89 +26,61 @@ public class CheckAction { | @@ -34,89 +26,61 @@ public class CheckAction { | ||
| 34 | @Inject | 26 | @Inject |
| 35 | private TCheckService tCheckService; | 27 | private TCheckService tCheckService; |
| 36 | 28 | ||
| 37 | - // @Request.Get("/check/list/{page_number}") | ||
| 38 | - // public View list(int page_number) { | ||
| 39 | - // int user_id = | ||
| 40 | - // CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 41 | - // System.out.println(user_id); | ||
| 42 | - // Pager<TLive> tLive = tCheckService.getTCheckLivePager(page_number, 9, | ||
| 43 | - // user_id); | ||
| 44 | - // List list = tLiveService.getLives(user_id); | ||
| 45 | - // View view = new View("check/check_management.jsp"); | ||
| 46 | - // view.data("tLive", tLive); | ||
| 47 | - // view.data("list", list); | ||
| 48 | - // return view; | ||
| 49 | - // //return new View("check/demo.html"); | ||
| 50 | - // } | 29 | + /** |
| 30 | + * 切断直播流 | ||
| 31 | + * @param id | ||
| 32 | + * @param params | ||
| 33 | + * @return | ||
| 34 | + */ | ||
| 51 | @Request.Post("/check/close/{id}") | 35 | @Request.Post("/check/close/{id}") |
| 52 | - public Result coseLive(int id, Params params) throws UnsupportedEncodingException { | ||
| 53 | - String userId = params.getString("user_id"); | ||
| 54 | - String streamName = userId + "_" + id; | ||
| 55 | - String accesskey = BaseUtil.getAccessKey(); | ||
| 56 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | ||
| 57 | - String signature = BaseUtil.signature(streamName); | ||
| 58 | - String del = "del"; | ||
| 59 | - String delsignature = BaseUtil.signature(del, streamName); | ||
| 60 | - String expire = BaseUtil.getTimestamp(); | ||
| 61 | - System.out.println(expire + "---expire---"); | ||
| 62 | - // ��ӵ������� | ||
| 63 | - try { | ||
| 64 | - addBlackList(signature, accesskey, expire, streamName); | ||
| 65 | - delBlackList(delsignature, accesskey, expire, streamName); | ||
| 66 | - } catch (UnsupportedEncodingException e) { | ||
| 67 | - e.printStackTrace(); | ||
| 68 | - } | ||
| 69 | - boolean flag = tCheckService.closeLive(id); | 36 | + public Result cose(int id, Params params) { |
| 37 | + String streamName = params.getString("user_id"); | ||
| 38 | + String uuid = params.getString("uuid"); | ||
| 39 | + boolean flag = tCheckService.close(streamName,id,uuid); | ||
| 70 | return new Result(flag); | 40 | return new Result(flag); |
| 71 | } | 41 | } |
| 72 | 42 | ||
| 73 | /** | 43 | /** |
| 74 | - * ��ӵ����� | ||
| 75 | - * | ||
| 76 | - * @param signature | ||
| 77 | - * @param accesskey | ||
| 78 | - * @param expire | ||
| 79 | - * @param streamName | 44 | + * 回复黑名单 |
| 45 | + * @param id | ||
| 46 | + * @param params | ||
| 80 | * @return | 47 | * @return |
| 81 | - * @throws UnsupportedEncodingException | ||
| 82 | */ | 48 | */ |
| 83 | - public String addBlackList(String signature, String accesskey, String expire, String streamName) | ||
| 84 | - throws UnsupportedEncodingException { | ||
| 85 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | ||
| 86 | - + "&expire=" + expire + "&app=live&method=add&name=" + streamName; | ||
| 87 | - System.out.println(url); | ||
| 88 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | ||
| 89 | - int status = HttpReq.getRequest(url); | ||
| 90 | - System.out.println(status + "......and......" + jsonArrStr); | ||
| 91 | - /* | ||
| 92 | - * Map map = JsonUtil.getMapFromJsonObjStr(jsonArrStr); String | ||
| 93 | - * chatRoomid = (String) map.get("Content-Length"); | ||
| 94 | - */ | ||
| 95 | - return jsonArrStr; | 49 | + @Request.Post("/check/resume/{id}") |
| 50 | + public Result resume(int id, Params params){ | ||
| 51 | + String streamName = params.getString("user_id"); | ||
| 52 | + boolean flag = tCheckService.resume(streamName,id); | ||
| 53 | + return new Result(flag); | ||
| 96 | } | 54 | } |
| 55 | + | ||
| 97 | 56 | ||
| 98 | - /** | ||
| 99 | - * �Ӻ���ɾ�� | ||
| 100 | - * | ||
| 101 | - * @param signature | ||
| 102 | - * @param accesskey | ||
| 103 | - * @param expire | ||
| 104 | - * @param streamName | ||
| 105 | - * @return | ||
| 106 | - * @throws UnsupportedEncodingException | ||
| 107 | - */ | ||
| 108 | - public Object delBlackList(String signature, String accesskey, String expire, String streamName) | ||
| 109 | - throws UnsupportedEncodingException { | ||
| 110 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | ||
| 111 | - + "&expire=" + expire + "&app=live&method=del&name=" + streamName; | ||
| 112 | - System.out.println("..url.." + url); | ||
| 113 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | ||
| 114 | - System.out.println("..jsonArrStr.." + jsonArrStr); | ||
| 115 | - /* | ||
| 116 | - * Map map = JsonUtil.getMapFromJsonObjStr(jsonArrStr); String | ||
| 117 | - * chatRoomid = (String) map.get("Content-Length"); | ||
| 118 | - */ | ||
| 119 | - return jsonArrStr; | 57 | + @Request.Get("/check/list/{page_number}") |
| 58 | + public View check(int page_number) { | ||
| 59 | + int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 60 | + Pager<TLive> tLive = tLiveService.getTCheckLivePager(page_number, 12, user_id); | ||
| 61 | + View view = new View("check/monitor.jsp"); | ||
| 62 | + view.data("tLive", tLive); | ||
| 63 | + return view; | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + // 置顶 | ||
| 67 | + @Request.Get("/check/top/{id}") | ||
| 68 | + public Result top(int id) { | ||
| 69 | + tLiveService.top(id); | ||
| 70 | + return new Result(true); | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + // 通过审核 | ||
| 74 | + @Request.Get("/check/pass/{id}") | ||
| 75 | + public Result pass(int id) { | ||
| 76 | + tLiveService.pass(id); | ||
| 77 | + return new Result(true); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + @Request.Post("/check/close/{id}/{uuid}") | ||
| 81 | + public Result coseLive(int id, String uuid) { | ||
| 82 | + boolean flag = tLiveService.closeLive(id, uuid); | ||
| 83 | + return new Result(flag); | ||
| 120 | } | 84 | } |
| 121 | 85 | ||
| 122 | } | 86 | } |
src/main/java/com/cnlive/mz/live/action/HttpPostArgumentTest2.java
| 1 | -package com.cnlive.mz.live.action; | ||
| 2 | - | ||
| 3 | -import java.io.File; | ||
| 4 | -import java.io.IOException; | ||
| 5 | - | ||
| 6 | -import org.apache.commons.httpclient.NameValuePair; | ||
| 7 | -import org.apache.commons.httpclient.params.HttpMethodParams; | ||
| 8 | -import org.apache.http.HttpEntity; | ||
| 9 | -import org.apache.http.HttpResponse; | ||
| 10 | -import org.apache.http.HttpStatus; | ||
| 11 | -import org.apache.http.ParseException; | ||
| 12 | -import org.apache.http.client.HttpClient; | ||
| 13 | -import org.apache.http.client.methods.HttpPost; | ||
| 14 | -import org.apache.http.entity.mime.MultipartEntity; | ||
| 15 | -import org.apache.http.entity.mime.content.FileBody; | ||
| 16 | -import org.apache.http.entity.mime.content.StringBody; | ||
| 17 | -import org.apache.http.impl.client.DefaultHttpClient; | ||
| 18 | -import org.apache.http.util.EntityUtils; | ||
| 19 | - | ||
| 20 | -import com.cnlive.mz.commons.net.HttpReq; | ||
| 21 | - | ||
| 22 | -public class HttpPostArgumentTest2 { | ||
| 23 | - | ||
| 24 | - private static String user_access_key = "cf34f28db21b46678237bfa849e239ea"; | ||
| 25 | - private static String app_access_key = "7338ebf9cab441c0843e437a18d85549"; | ||
| 26 | - | ||
| 27 | - public void SubmitPost(String url, String filepath) { | ||
| 28 | - HttpClient httpclient = new DefaultHttpClient(); | ||
| 29 | - try { | ||
| 30 | - HttpPost httppost = new HttpPost(url); | ||
| 31 | - FileBody bin = new FileBody(new File(filepath)); | ||
| 32 | - MultipartEntity reqEntity = new MultipartEntity(); | ||
| 33 | - // reqEntity.addPart("file", bin); | ||
| 34 | - reqEntity.addPart("app_access_key", new StringBody("7338ebf9cab441c0843e437a18d85549")); | ||
| 35 | - reqEntity.addPart("user_access_key", new StringBody("cf34f28db21b46678237bfa849e239ea")); | ||
| 36 | - reqEntity.addPart("direct", new StringBody("0")); | ||
| 37 | - reqEntity.addPart("upload_type", new StringBody("1")); | ||
| 38 | - reqEntity.addPart("md5", new StringBody("liujicheng")); | ||
| 39 | - reqEntity.addPart("title", new StringBody("title")); | ||
| 40 | - reqEntity.addPart("name", new StringBody("中投视频宣传片熊猫test")); | ||
| 41 | - reqEntity.addPart("server_access_key", new StringBody("3830ce241dad4b9f844d131c890231ae")); | ||
| 42 | - | ||
| 43 | - httppost.setEntity(reqEntity); | ||
| 44 | - HttpResponse response = httpclient.execute(httppost); | ||
| 45 | - int statusCode = response.getStatusLine().getStatusCode(); | ||
| 46 | - System.out.println(statusCode); | ||
| 47 | - System.out.println("服务器正常响应....."); | ||
| 48 | - HttpEntity resEntity = response.getEntity(); | ||
| 49 | - System.out.println(EntityUtils.toString(resEntity)); | ||
| 50 | - System.out.println(resEntity.getContent()); | ||
| 51 | - EntityUtils.consume(resEntity); | ||
| 52 | - | ||
| 53 | - } catch (ParseException e) { | ||
| 54 | - e.printStackTrace(); | ||
| 55 | - } catch (IOException e) { | ||
| 56 | - e.printStackTrace(); | ||
| 57 | - } finally { | ||
| 58 | - try { | ||
| 59 | - httpclient.getConnectionManager().shutdown(); | ||
| 60 | - } catch (Exception ignore) { | ||
| 61 | - ignore.printStackTrace(); | ||
| 62 | - } | ||
| 63 | - } | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - public static void redirect() { | ||
| 67 | - NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), | ||
| 68 | - new NameValuePair("user_access_key", user_access_key), | ||
| 69 | - new NameValuePair("app_access_key", app_access_key) }; | ||
| 70 | - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param); | ||
| 71 | - System.out.println(c); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - public static void delete() { | ||
| 75 | - NameValuePair[] param = { new NameValuePair("video_type", "2"), | ||
| 76 | - new NameValuePair("app_access_key", "7338ebf9cab441c0843e437a18d85549"), | ||
| 77 | - new NameValuePair("user_access_key", "cf34f28db21b46678237bfa849e239ea"), | ||
| 78 | - new NameValuePair("video_uuid", "a8794762b3e92c7d6589a6157cf1ef27,7e26dee78a584f8c5ab1d93a9c878f1d") }; | ||
| 79 | - String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/delete", param); | ||
| 80 | - System.out.println(c); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - private static String md5 = "ffa699fb66750acab30b71b8ceb0172d1"; | ||
| 84 | - | ||
| 85 | - public static void supload() { | ||
| 86 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 87 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"), | ||
| 88 | - new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), | ||
| 89 | - new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), | ||
| 90 | - new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), | ||
| 91 | - new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; | ||
| 92 | - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param); | ||
| 93 | - System.out.println(c); | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public static void uploadNotify() { | ||
| 97 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 98 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | ||
| 99 | - new NameValuePair("video_type", "2"), new NameValuePair("state", "200"), | ||
| 100 | - new NameValuePair("video_uuid", md5) }; | ||
| 101 | - String c = HttpReq | ||
| 102 | - .postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/uploadNotify", param); | ||
| 103 | - System.out.println(c); | ||
| 104 | - } | ||
| 105 | - | ||
| 106 | - public static void all() { | ||
| 107 | - NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 108 | - new NameValuePair("relation_id", "498122"), | ||
| 109 | - | ||
| 110 | - new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | ||
| 111 | - new NameValuePair("video_type", "2"), new NameValuePair("page_no", "1"), | ||
| 112 | - new NameValuePair("video_uuid", md5) }; | ||
| 113 | - String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/all", param); | ||
| 114 | - System.out.println(c); | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - public static void main(String[] args) { | ||
| 118 | - // new HttpPostArgumentTest2().delete(); | ||
| 119 | - //HttpPostArgumentTest2.all(); | ||
| 120 | - HttpPostArgumentTest2.redirect(); | ||
| 121 | - // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", | ||
| 122 | - // "json", "jsonjsonjsonjson");r | ||
| 123 | - } | ||
| 124 | - | ||
| 125 | -} | 1 | +package com.cnlive.mz.live.action; |
| 2 | + | ||
| 3 | +import java.io.File; | ||
| 4 | +import java.io.IOException; | ||
| 5 | + | ||
| 6 | +import org.apache.commons.httpclient.NameValuePair; | ||
| 7 | +import org.apache.commons.httpclient.params.HttpMethodParams; | ||
| 8 | +import org.apache.http.HttpEntity; | ||
| 9 | +import org.apache.http.HttpResponse; | ||
| 10 | +import org.apache.http.HttpStatus; | ||
| 11 | +import org.apache.http.ParseException; | ||
| 12 | +import org.apache.http.client.HttpClient; | ||
| 13 | +import org.apache.http.client.methods.HttpPost; | ||
| 14 | +import org.apache.http.entity.mime.MultipartEntity; | ||
| 15 | +import org.apache.http.entity.mime.content.FileBody; | ||
| 16 | +import org.apache.http.entity.mime.content.StringBody; | ||
| 17 | +import org.apache.http.impl.client.DefaultHttpClient; | ||
| 18 | +import org.apache.http.util.EntityUtils; | ||
| 19 | + | ||
| 20 | +import com.cnlive.mz.commons.net.HttpReq; | ||
| 21 | + | ||
| 22 | +public class HttpPostArgumentTest2 { | ||
| 23 | + | ||
| 24 | + private static String user_access_key = "cf34f28db21b46678237bfa849e239ea"; | ||
| 25 | + private static String app_access_key = "7338ebf9cab441c0843e437a18d85549"; | ||
| 26 | + | ||
| 27 | + public void SubmitPost(String url, String filepath) { | ||
| 28 | + HttpClient httpclient = new DefaultHttpClient(); | ||
| 29 | + try { | ||
| 30 | + HttpPost httppost = new HttpPost(url); | ||
| 31 | + FileBody bin = new FileBody(new File(filepath)); | ||
| 32 | + MultipartEntity reqEntity = new MultipartEntity(); | ||
| 33 | + // reqEntity.addPart("file", bin); | ||
| 34 | + reqEntity.addPart("app_access_key", new StringBody("7338ebf9cab441c0843e437a18d85549")); | ||
| 35 | + reqEntity.addPart("user_access_key", new StringBody("cf34f28db21b46678237bfa849e239ea")); | ||
| 36 | + reqEntity.addPart("direct", new StringBody("0")); | ||
| 37 | + reqEntity.addPart("upload_type", new StringBody("1")); | ||
| 38 | + reqEntity.addPart("md5", new StringBody("liujicheng")); | ||
| 39 | + reqEntity.addPart("title", new StringBody("title")); | ||
| 40 | + reqEntity.addPart("name", new StringBody("中投视频宣传片熊猫test")); | ||
| 41 | + reqEntity.addPart("server_access_key", new StringBody("3830ce241dad4b9f844d131c890231ae")); | ||
| 42 | + | ||
| 43 | + httppost.setEntity(reqEntity); | ||
| 44 | + HttpResponse response = httpclient.execute(httppost); | ||
| 45 | + int statusCode = response.getStatusLine().getStatusCode(); | ||
| 46 | + System.out.println(statusCode); | ||
| 47 | + System.out.println("服务器正常响应....."); | ||
| 48 | + HttpEntity resEntity = response.getEntity(); | ||
| 49 | + System.out.println(EntityUtils.toString(resEntity)); | ||
| 50 | + System.out.println(resEntity.getContent()); | ||
| 51 | + EntityUtils.consume(resEntity); | ||
| 52 | + | ||
| 53 | + } catch (ParseException e) { | ||
| 54 | + e.printStackTrace(); | ||
| 55 | + } catch (IOException e) { | ||
| 56 | + e.printStackTrace(); | ||
| 57 | + } finally { | ||
| 58 | + try { | ||
| 59 | + httpclient.getConnectionManager().shutdown(); | ||
| 60 | + } catch (Exception ignore) { | ||
| 61 | + ignore.printStackTrace(); | ||
| 62 | + } | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + public static void redirect() { | ||
| 67 | + NameValuePair[] param = { new NameValuePair("relation_id", "283645"), new NameValuePair("video_type", "3"), | ||
| 68 | + new NameValuePair("user_access_key", user_access_key), | ||
| 69 | + new NameValuePair("app_access_key", app_access_key) }; | ||
| 70 | + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/redirect", param); | ||
| 71 | + System.out.println(c); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + public static void delete() { | ||
| 75 | + NameValuePair[] param = { new NameValuePair("video_type", "2"), | ||
| 76 | + new NameValuePair("app_access_key", "7338ebf9cab441c0843e437a18d85549"), | ||
| 77 | + new NameValuePair("user_access_key", "cf34f28db21b46678237bfa849e239ea"), | ||
| 78 | + new NameValuePair("video_uuid", "a8794762b3e92c7d6589a6157cf1ef27,7e26dee78a584f8c5ab1d93a9c878f1d") }; | ||
| 79 | + String c = HttpReq.postRequestWidthResult("http://bc.cnlive.com/api/video/delete", param); | ||
| 80 | + System.out.println(c); | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + private static String md5 = "ffa699fb66750acab30b71b8ceb0172d1"; | ||
| 84 | + | ||
| 85 | + public static void supload() { | ||
| 86 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 87 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("video_type", "3"), | ||
| 88 | + new NameValuePair("upload_type", "0"), new NameValuePair("direct", "1"), new NameValuePair("md5", md5), | ||
| 89 | + new NameValuePair("title", "tit三道恩le1"), new NameValuePair("relation_id", "615207"), | ||
| 90 | + new NameValuePair("custom_args", "custom_args1"), new NameValuePair("name", "VID_20151224_105421.mp4"), | ||
| 91 | + new NameValuePair("server_access_key", "3830ce241dad4b9f844d131c890231ae") }; | ||
| 92 | + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/supload", param); | ||
| 93 | + System.out.println(c); | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + public static void uploadNotify() { | ||
| 97 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 98 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | ||
| 99 | + new NameValuePair("video_type", "2"), new NameValuePair("state", "200"), | ||
| 100 | + new NameValuePair("video_uuid", md5) }; | ||
| 101 | + String c = HttpReq | ||
| 102 | + .postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/uploadNotify", param); | ||
| 103 | + System.out.println(c); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + public static void all() { | ||
| 107 | + NameValuePair[] param = { new NameValuePair("app_access_key", app_access_key), | ||
| 108 | + new NameValuePair("relation_id", "498122"), | ||
| 109 | + | ||
| 110 | + new NameValuePair("user_access_key", user_access_key), new NameValuePair("upload_type", "1"), | ||
| 111 | + new NameValuePair("video_type", "2"), new NameValuePair("page_no", "1"), | ||
| 112 | + new NameValuePair("video_uuid", md5) }; | ||
| 113 | + String c = HttpReq.postRequestWidthResult("http://localhost:8080/cnlive_live_web/api/video/all", param); | ||
| 114 | + System.out.println(c); | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public static void main(String[] args) { | ||
| 118 | + // new HttpPostArgumentTest2().delete(); | ||
| 119 | + //HttpPostArgumentTest2.all(); | ||
| 120 | + HttpPostArgumentTest2.redirect(); | ||
| 121 | + // HttpReq.postRequestWidthResult("http://120.132.76.51:9696/cnlive_encoding_job/task", | ||
| 122 | + // "json", "jsonjsonjsonjson");r | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | +} |
src/main/java/com/cnlive/mz/live/action/LiveAction.java
| @@ -32,7 +32,6 @@ import org.smart4j.framework.mvc.bean.Params; | @@ -32,7 +32,6 @@ import org.smart4j.framework.mvc.bean.Params; | ||
| 32 | import org.smart4j.framework.mvc.bean.Result; | 32 | import org.smart4j.framework.mvc.bean.Result; |
| 33 | import org.smart4j.framework.mvc.bean.ResultBean; | 33 | import org.smart4j.framework.mvc.bean.ResultBean; |
| 34 | import org.smart4j.framework.mvc.bean.View; | 34 | import org.smart4j.framework.mvc.bean.View; |
| 35 | -import org.smart4j.framework.orm.DataSet; | ||
| 36 | import org.smart4j.framework.util.CastUtil; | 35 | import org.smart4j.framework.util.CastUtil; |
| 37 | 36 | ||
| 38 | import com.cnlive.mz.commons.Constants; | 37 | import com.cnlive.mz.commons.Constants; |
| @@ -114,107 +113,6 @@ public class LiveAction { | @@ -114,107 +113,6 @@ public class LiveAction { | ||
| 114 | return view; | 113 | return view; |
| 115 | } | 114 | } |
| 116 | 115 | ||
| 117 | - @Request.Get("/check/list/{page_number}") | ||
| 118 | - public View check(int page_number) { | ||
| 119 | - int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | ||
| 120 | - Pager<TLive> tLive = tLiveService.getTCheckLivePager(page_number, 12, user_id); | ||
| 121 | - View view = new View("check/monitor.jsp"); | ||
| 122 | - view.data("tLive", tLive); | ||
| 123 | - return view; | ||
| 124 | - } | ||
| 125 | - | ||
| 126 | - // 置顶 | ||
| 127 | - @Request.Get("/check/top/{id}") | ||
| 128 | - public Result top(int id) { | ||
| 129 | - tLiveService.top(id); | ||
| 130 | - return new Result(true); | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - // 切断 | ||
| 134 | - @Request.Post("/check/cut/{id}") | ||
| 135 | - public Result cut(int id, Params params) throws UnsupportedEncodingException { | ||
| 136 | - String live_url = params.getString("live_url"); | ||
| 137 | - if (live_url.isEmpty()) { | ||
| 138 | - return null; | ||
| 139 | - } else { | ||
| 140 | - int index = live_url.lastIndexOf("/"); | ||
| 141 | - String streamName = live_url.substring(index + 1); | ||
| 142 | - System.out.println("streamName===" + streamName); | ||
| 143 | - String accesskey = BaseUtil.getAccessKey(); | ||
| 144 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | ||
| 145 | - String add = "add"; | ||
| 146 | - String signature = BaseUtil.signature(add, streamName); | ||
| 147 | - String del = "del"; | ||
| 148 | - String delsignature = BaseUtil.signature(del, streamName); | ||
| 149 | - String expire = BaseUtil.getTimestamp(); | ||
| 150 | - System.out.println(expire + "---expire---"); | ||
| 151 | - // 断流。 | ||
| 152 | - try { | ||
| 153 | - addBlackList(signature, accesskey, expire, streamName); | ||
| 154 | - // delBlackList(delsignature, accesskey, expire, streamName); | ||
| 155 | - } catch (UnsupportedEncodingException e) { | ||
| 156 | - e.printStackTrace(); | ||
| 157 | - } | ||
| 158 | - // 直播通知 | ||
| 159 | - // tLiveService.notify(video_uuid, -1); | ||
| 160 | - boolean flag = tCheckService.closeLive(id); | ||
| 161 | - return new Result(flag); | ||
| 162 | - } | ||
| 163 | - } | ||
| 164 | - | ||
| 165 | - // 通过审核 | ||
| 166 | - @Request.Get("/check/pass/{id}") | ||
| 167 | - public Result pass(int id) { | ||
| 168 | - tLiveService.pass(id); | ||
| 169 | - return new Result(true); | ||
| 170 | - } | ||
| 171 | - | ||
| 172 | - @Request.Post("/check/close/{id}/{uuid}") | ||
| 173 | - public Result coseLive(int id, String uuid) { | ||
| 174 | - boolean flag = tLiveService.closeLive(id, uuid); | ||
| 175 | - return new Result(flag); | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - /** | ||
| 179 | - * 添加到黑名单 | ||
| 180 | - * | ||
| 181 | - * @param signature | ||
| 182 | - * @param accesskey | ||
| 183 | - * @param expire | ||
| 184 | - * @param streamName | ||
| 185 | - * @return | ||
| 186 | - * @throws UnsupportedEncodingException | ||
| 187 | - */ | ||
| 188 | - public String addBlackList(String signature, String accesskey, String expire, String streamName) | ||
| 189 | - throws UnsupportedEncodingException { | ||
| 190 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | ||
| 191 | - + "&expire=" + expire + "&app=live&method=add&name=" + streamName; | ||
| 192 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | ||
| 193 | - int status = HttpReq.getRequest(url); | ||
| 194 | - System.out.println(status + "......and......" + jsonArrStr); | ||
| 195 | - return jsonArrStr; | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - /** | ||
| 199 | - * 从黑名单删除 | ||
| 200 | - * | ||
| 201 | - * @param signature | ||
| 202 | - * @param accesskey | ||
| 203 | - * @param expire | ||
| 204 | - * @param streamName | ||
| 205 | - * @return | ||
| 206 | - * @throws UnsupportedEncodingException | ||
| 207 | - */ | ||
| 208 | - public Object delBlackList(String signature, String accesskey, String expire, String streamName) | ||
| 209 | - throws UnsupportedEncodingException { | ||
| 210 | - String url = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=" + signature + "&accesskey=" + accesskey | ||
| 211 | - + "&expire=" + expire + "&app=live&method=del&name=" + streamName; | ||
| 212 | - String jsonArrStr = HttpReq.getRequestWidthResult(url); | ||
| 213 | - System.out.println("..jsonArrStr.." + jsonArrStr); | ||
| 214 | - return jsonArrStr; | ||
| 215 | - | ||
| 216 | - } | ||
| 217 | - | ||
| 218 | @Request.Get("/live/alllive/{page_number}") | 116 | @Request.Get("/live/alllive/{page_number}") |
| 219 | public View liveList(int page_number) { | 117 | public View liveList(int page_number) { |
| 220 | int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); | 118 | int user_id = CastUtil.castInt(DataContext.getRequest().getSession().getAttribute(LiveUtils.SESSION_KEY_ID)); |
| @@ -302,11 +200,10 @@ public class LiveAction { | @@ -302,11 +200,10 @@ public class LiveAction { | ||
| 302 | log.error("创建活动失败,活动ID已存在"); | 200 | log.error("创建活动失败,活动ID已存在"); |
| 303 | return rb; | 201 | return rb; |
| 304 | } else { | 202 | } else { |
| 305 | - | ||
| 306 | boolean flag = tLiveService.addAcitvity(params); | 203 | boolean flag = tLiveService.addAcitvity(params); |
| 307 | if (flag) { | 204 | if (flag) { |
| 308 | Map<String, Object> map = new HashMap<String, Object>(); | 205 | Map<String, Object> map = new HashMap<String, Object>(); |
| 309 | - map.put("location", "rtmp://jsrtmp.up.cnlive.com/live/1234"); | 206 | + map.put("location", com.cnlive.mz.live.common.Constants.KS_HOST_UP_RTMP+channelID+"?vdoid=" + activityId); |
| 310 | rb.setData(map); | 207 | rb.setData(map); |
| 311 | rb.setErrorCode("0"); | 208 | rb.setErrorCode("0"); |
| 312 | rb.setErrorMessage("创建活动成功"); | 209 | rb.setErrorMessage("创建活动成功"); |
| @@ -376,6 +273,7 @@ public class LiveAction { | @@ -376,6 +273,7 @@ public class LiveAction { | ||
| 376 | ResultBean rb = new ResultBean(); | 273 | ResultBean rb = new ResultBean(); |
| 377 | String appId = params.getString("appId"); | 274 | String appId = params.getString("appId"); |
| 378 | String activityid = params.getString("activityId"); | 275 | String activityid = params.getString("activityId"); |
| 276 | + TLive tLive = tLiveService.selectByParams(appId, activityid); | ||
| 379 | if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { | 277 | if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) { |
| 380 | Map<String, Object> map = new HashMap<String, Object>(); | 278 | Map<String, Object> map = new HashMap<String, Object>(); |
| 381 | map.put("location", ""); | 279 | map.put("location", ""); |
| @@ -384,30 +282,18 @@ public class LiveAction { | @@ -384,30 +282,18 @@ public class LiveAction { | ||
| 384 | rb.setErrorMessage("停止直播失败,参数不正确"); | 282 | rb.setErrorMessage("停止直播失败,参数不正确"); |
| 385 | return rb; | 283 | return rb; |
| 386 | } else { | 284 | } else { |
| 387 | - TLive tLive = tLiveService.selectByParams(appId, activityid); | 285 | + |
| 388 | String live_url = tLive.getLive_url(); | 286 | String live_url = tLive.getLive_url(); |
| 389 | int index = live_url.lastIndexOf("/"); | 287 | int index = live_url.lastIndexOf("/"); |
| 390 | String streamName = live_url.substring(index + 1); | 288 | String streamName = live_url.substring(index + 1); |
| 391 | System.out.println("streamName===" + streamName); | 289 | System.out.println("streamName===" + streamName); |
| 392 | - String accesskey = BaseUtil.getAccessKey(); | ||
| 393 | - try { | ||
| 394 | - accesskey = java.net.URLEncoder.encode(accesskey, "utf-8"); | ||
| 395 | - String add = "add"; | ||
| 396 | - String signature = BaseUtil.signature(add, streamName); | ||
| 397 | - String del = "del"; | ||
| 398 | - String delsignature = BaseUtil.signature(del, streamName); | ||
| 399 | - String expire = BaseUtil.getTimestamp(); | ||
| 400 | - System.out.println(expire + "---expire---"); | ||
| 401 | // 直播断流。 | 290 | // 直播断流。 |
| 402 | - addBlackList(signature, accesskey, expire, streamName); | 291 | + tCheckService.close(streamName, tLive.getId(), tLive.getUuid()); |
| 403 | //通知cms停止直播 | 292 | //通知cms停止直播 |
| 404 | tLiveService.releaseChatRoom(tLive); | 293 | tLiveService.releaseChatRoom(tLive); |
| 405 | - } catch (UnsupportedEncodingException e1) { | ||
| 406 | - e1.printStackTrace(); | ||
| 407 | } | 294 | } |
| 408 | // 直播通知 | 295 | // 直播通知 |
| 409 | // tLiveService.notify(video_uuid, -1); | 296 | // tLiveService.notify(video_uuid, -1); |
| 410 | - boolean flag = tCheckService.closeLive(Integer.parseInt(activityid)); | ||
| 411 | Map<String, Object> map = new HashMap<String, Object>(); | 297 | Map<String, Object> map = new HashMap<String, Object>(); |
| 412 | map.put("location", tLive.getLive_url()); | 298 | map.put("location", tLive.getLive_url()); |
| 413 | rb.setData(map); | 299 | rb.setData(map); |
| @@ -416,7 +302,6 @@ public class LiveAction { | @@ -416,7 +302,6 @@ public class LiveAction { | ||
| 416 | return rb; | 302 | return rb; |
| 417 | } | 303 | } |
| 418 | 304 | ||
| 419 | - } | ||
| 420 | 305 | ||
| 421 | /** | 306 | /** |
| 422 | * 1.6 获取直播活动列表接口.md | 307 | * 1.6 获取直播活动列表接口.md |
| @@ -678,6 +563,7 @@ public class LiveAction { | @@ -678,6 +563,7 @@ public class LiveAction { | ||
| 678 | HttpServletResponse response =DataContext.getResponse(); | 563 | HttpServletResponse response =DataContext.getResponse(); |
| 679 | redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?activityId=12345"); | 564 | redirect(response, "http://ips.cnlive.com/IPS/liveplayBySWF.action?activityId=12345"); |
| 680 | } | 565 | } |
| 566 | + | ||
| 681 | public static void main(String[] args) { | 567 | public static void main(String[] args) { |
| 682 | 568 | ||
| 683 | /*NameValuePair[] nvp = new NameValuePair[6]; | 569 | /*NameValuePair[] nvp = new NameValuePair[6]; |
| @@ -707,8 +593,11 @@ public class LiveAction { | @@ -707,8 +593,11 @@ public class LiveAction { | ||
| 707 | nvp[5] = nv6; | 593 | nvp[5] = nv6; |
| 708 | String ss = HttpReq.postRequestWidthResult("http://bc.cnlive.com/live/epg/createActivity", nvp); | 594 | String ss = HttpReq.postRequestWidthResult("http://bc.cnlive.com/live/epg/createActivity", nvp); |
| 709 | System.out.println(ss); | 595 | System.out.println(ss); |
| 596 | +<<<<<<< HEAD | ||
| 710 | String aa = HttpReq | 597 | String aa = HttpReq |
| 711 | .getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234"); | 598 | .getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234"); |
| 712 | System.out.println(aa);*/ | 599 | System.out.println(aa);*/ |
| 600 | + String aa = HttpReq.getRequestWidthResult("http://bc.cnlive.com/live/epg/startActivity?appId=123&activityId=234"); | ||
| 601 | + System.out.println(aa); | ||
| 713 | } | 602 | } |
| 714 | } | 603 | } |
| 715 | \ No newline at end of file | 604 | \ No newline at end of file |
src/main/java/com/cnlive/mz/live/action/UserAction.java
| 1 | -package com.cnlive.mz.live.action; | ||
| 2 | - | ||
| 3 | -import org.smart4j.framework.dao.bean.Pager; | ||
| 4 | -import org.smart4j.framework.ioc.annotation.Inject; | ||
| 5 | -import org.smart4j.framework.mvc.annotation.Action; | ||
| 6 | -import org.smart4j.framework.mvc.annotation.Request; | ||
| 7 | -import org.smart4j.framework.mvc.bean.Result; | ||
| 8 | -import org.smart4j.framework.mvc.bean.View; | ||
| 9 | - | ||
| 10 | -import com.cnlive.mz.live.entity.TLive; | ||
| 11 | -import com.cnlive.mz.live.entity.TUser; | ||
| 12 | -import com.cnlive.mz.live.service.TUserService; | ||
| 13 | - | ||
| 14 | -@Action | ||
| 15 | -public class UserAction { | ||
| 16 | - | ||
| 17 | - @Inject | ||
| 18 | - private TUserService tUserService; | ||
| 19 | - | ||
| 20 | - /** | ||
| 21 | - * 获取用户列表页 | ||
| 22 | - * | ||
| 23 | - * @param pageNumber | ||
| 24 | - * @return | ||
| 25 | - */ | ||
| 26 | - @Request.Get("/user/list/{pageNumber}") | ||
| 27 | - public View list(int pageNumber) { | ||
| 28 | - Pager<TUser> userPage = tUserService.getTUserPage(pageNumber); | ||
| 29 | - return new View("user/user_list.jsp").data("userPage", userPage); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - @Request.Get("/user/live/{userId}/{pageNumber}") | ||
| 33 | - public View livelist(int userId, int pageNumber) { | ||
| 34 | - Pager<TLive> userPage = tUserService.getTLivePage(userId, pageNumber); | ||
| 35 | - return new View("user/user_live_list.jsp").data("userPage", userPage); | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - @Request.Get("/user/report/{userId}/{type}") | ||
| 39 | - public Result report(int userId,String type) { | ||
| 40 | - return new Result(tUserService.addReport(userId,type)); | ||
| 41 | - } | ||
| 42 | -} | 1 | +package com.cnlive.mz.live.action; |
| 2 | + | ||
| 3 | +import org.smart4j.framework.dao.bean.Pager; | ||
| 4 | +import org.smart4j.framework.ioc.annotation.Inject; | ||
| 5 | +import org.smart4j.framework.mvc.annotation.Action; | ||
| 6 | +import org.smart4j.framework.mvc.annotation.Request; | ||
| 7 | +import org.smart4j.framework.mvc.bean.Result; | ||
| 8 | +import org.smart4j.framework.mvc.bean.View; | ||
| 9 | + | ||
| 10 | +import com.cnlive.mz.live.entity.TLive; | ||
| 11 | +import com.cnlive.mz.live.entity.TUser; | ||
| 12 | +import com.cnlive.mz.live.service.TUserService; | ||
| 13 | + | ||
| 14 | +@Action | ||
| 15 | +public class UserAction { | ||
| 16 | + | ||
| 17 | + @Inject | ||
| 18 | + private TUserService tUserService; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 获取用户列表页 | ||
| 22 | + * | ||
| 23 | + * @param pageNumber | ||
| 24 | + * @return | ||
| 25 | + */ | ||
| 26 | + @Request.Get("/user/list/{pageNumber}") | ||
| 27 | + public View list(int pageNumber) { | ||
| 28 | + Pager<TUser> userPage = tUserService.getTUserPage(pageNumber); | ||
| 29 | + return new View("user/user_list.jsp").data("userPage", userPage); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + @Request.Get("/user/live/{userId}/{pageNumber}") | ||
| 33 | + public View livelist(int userId, int pageNumber) { | ||
| 34 | + Pager<TLive> userPage = tUserService.getTLivePage(userId, pageNumber); | ||
| 35 | + return new View("user/user_live_list.jsp").data("userPage", userPage); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Request.Get("/user/report/{userId}/{type}") | ||
| 39 | + public Result report(int userId,String type) { | ||
| 40 | + return new Result(tUserService.addReport(userId,type)); | ||
| 41 | + } | ||
| 42 | +} |
src/main/java/com/cnlive/mz/live/action/VodIpsAction.java
| @@ -4,41 +4,56 @@ import java.util.HashMap; | @@ -4,41 +4,56 @@ import java.util.HashMap; | ||
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | import org.apache.log4j.Logger; | 6 | import org.apache.log4j.Logger; |
| 7 | +import org.smart4j.framework.ioc.annotation.Inject; | ||
| 7 | import org.smart4j.framework.mvc.annotation.Action; | 8 | import org.smart4j.framework.mvc.annotation.Action; |
| 8 | import org.smart4j.framework.mvc.annotation.Request; | 9 | import org.smart4j.framework.mvc.annotation.Request; |
| 9 | import org.smart4j.framework.mvc.bean.Params; | 10 | import org.smart4j.framework.mvc.bean.Params; |
| 10 | import org.smart4j.framework.mvc.bean.Redirect; | 11 | import org.smart4j.framework.mvc.bean.Redirect; |
| 11 | import org.smart4j.framework.mvc.bean.ResultBean; | 12 | import org.smart4j.framework.mvc.bean.ResultBean; |
| 12 | 13 | ||
| 14 | +import com.cnlive.mz.live.service.VodIpsServer; | ||
| 15 | + | ||
| 13 | /** | 16 | /** |
| 14 | * 点播调度 | 17 | * 点播调度 |
| 18 | + * | ||
| 15 | * @author adm | 19 | * @author adm |
| 16 | * | 20 | * |
| 17 | */ | 21 | */ |
| 18 | @Action | 22 | @Action |
| 19 | public class VodIpsAction { | 23 | public class VodIpsAction { |
| 24 | + @Inject | ||
| 25 | + VodIpsServer vodIpsServer; | ||
| 20 | 26 | ||
| 21 | private Logger log = Logger.getLogger("VodIpsAction"); | 27 | private Logger log = Logger.getLogger("VodIpsAction"); |
| 22 | - | 28 | + |
| 23 | @Request.Get("/vodips/h5/{id}") | 29 | @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"); | 30 | + public Redirect h5(int id, Params params) { |
| 31 | + String vId=params.getString("vId"); | ||
| 32 | + int rate=params.getInt("rate"); | ||
| 33 | + Redirect r = new Redirect(); | ||
| 34 | + String url=vodIpsServer.getH5PlayUrl(vId, rate); | ||
| 35 | + r.setRedirectUrl(url); | ||
| 27 | return r; | 36 | return r; |
| 28 | } | 37 | } |
| 29 | - | 38 | + |
| 30 | @Request.Get("/vodips/app/{id}") | 39 | @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"); | 40 | + public Redirect app(int id, Params params) { |
| 41 | + String vId=params.getString("vId"); | ||
| 42 | + int rate=params.getInt("rate"); | ||
| 43 | + String url=vodIpsServer.getAppPlayUrl(vId, rate); | ||
| 44 | + Redirect r = new Redirect(); | ||
| 45 | + r.setRedirectUrl(url); | ||
| 34 | return r; | 46 | return r; |
| 35 | } | 47 | } |
| 36 | - | 48 | + |
| 37 | @Request.Get("/vodips/flash/{id}") | 49 | @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"); | 50 | + public ResultBean flash(int id, Params params) { |
| 51 | + String vId=params.getString("vId"); | ||
| 52 | + int rate=params.getInt("rate"); | ||
| 53 | + String url=vodIpsServer.getFlashPlayUrl(vId, rate); | ||
| 54 | + ResultBean rb = new ResultBean(); | ||
| 55 | + Map map = new HashMap(); | ||
| 56 | + map.put("location",url); | ||
| 42 | rb.setData(map); | 57 | rb.setData(map); |
| 43 | rb.setErrorCode("0"); | 58 | rb.setErrorCode("0"); |
| 44 | rb.setErrorMessage("成功"); | 59 | rb.setErrorMessage("成功"); |
src/main/java/com/cnlive/mz/live/action/WordAction.java
| 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 | -} | 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
| 1 | -package com.cnlive.mz.live.aspect; | ||
| 2 | - | ||
| 3 | -import java.io.IOException; | ||
| 4 | - | ||
| 5 | -import javax.servlet.Filter; | ||
| 6 | -import javax.servlet.FilterChain; | ||
| 7 | -import javax.servlet.FilterConfig; | ||
| 8 | -import javax.servlet.ServletException; | ||
| 9 | -import javax.servlet.ServletRequest; | ||
| 10 | -import javax.servlet.ServletResponse; | ||
| 11 | -import javax.servlet.annotation.WebFilter; | ||
| 12 | -import javax.servlet.http.HttpServletRequest; | ||
| 13 | -import javax.servlet.http.HttpServletResponse; | ||
| 14 | -import javax.servlet.http.HttpSession; | ||
| 15 | - | ||
| 16 | -import org.smart4j.framework.core.ConfigHelper; | ||
| 17 | - | ||
| 18 | -import com.cnlive.mz.live.common.LiveUtils; | ||
| 19 | - | ||
| 20 | -/* | ||
| 21 | - * | ||
| 22 | - | ||
| 23 | - 属性 是否必须 说明 | ||
| 24 | - asyncSupported 否 该Filter是否支持异步操作模式 | ||
| 25 | - dispatcherType 否 指定Filter对那种dispatcher模式进行过滤 该属性支持 Async,Error Forward,include,request | ||
| 26 | - displayName 否 File 显示的名称 | ||
| 27 | - filterName 是 Filter的名称 | ||
| 28 | - initParams 否 Filter的配置参数 | ||
| 29 | - servletNames 否 可以指定多个,表示对这几个特定的的serlet 进行过滤 | ||
| 30 | - urlPatterns/value 否 指定 Filter拦截的 URL | ||
| 31 | - | ||
| 32 | - | ||
| 33 | - | ||
| 34 | - | ||
| 35 | - @WebFilter(filterName="log",urlPatterns={"/*"})*/ | ||
| 36 | -@WebFilter(filterName = "AuthFilter", urlPatterns = { "/activity/*", "/channel/*", "/signal/*", "/index/*", | ||
| 37 | - "/switch/*", "/doswitch/*", "/wowza/*" }) | ||
| 38 | -public class AuthFilter implements Filter { | ||
| 39 | - | ||
| 40 | - private FilterConfig config; | ||
| 41 | - | ||
| 42 | - @Override | ||
| 43 | - public void destroy() { | ||
| 44 | - this.config = null; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - @Override | ||
| 48 | - public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws IOException, | ||
| 49 | - ServletException { | ||
| 50 | - HttpServletRequest request = (HttpServletRequest) arg0; | ||
| 51 | - HttpServletResponse response = (HttpServletResponse) arg1; | ||
| 52 | - String requestUrl = request.getRequestURI(); | ||
| 53 | - HttpSession session = request.getSession(); | ||
| 54 | - String webUrl = ConfigHelper.getString("website.url"); | ||
| 55 | - String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ; | ||
| 56 | - if (a== null) { | ||
| 57 | - boolean authEnable = ConfigHelper.getBoolean("auth.enable"); | ||
| 58 | - String loginUrl = ConfigHelper.getString("auth.login.url"); | ||
| 59 | - if (authEnable) { | ||
| 60 | - //去登录认证 | ||
| 61 | - String url=loginUrl + webUrl+"/login/success"; | ||
| 62 | - response.sendRedirect(url); | ||
| 63 | - return; | ||
| 64 | - } else { | ||
| 65 | - String userName = "liujicheng"; | ||
| 66 | - request.getSession().setAttribute(LiveUtils.SESSION_KEY_NAME, userName); | ||
| 67 | - request.getSession().setAttribute(LiveUtils.SESSION_KEY_ID, 1); | ||
| 68 | - } | ||
| 69 | - } else { | ||
| 70 | - chain.doFilter(arg0, arg1); | ||
| 71 | - } | ||
| 72 | - // 验证用户是否是退出,进行sessioin销毁 | ||
| 73 | - if (requestUrl.contains("logout")) { | ||
| 74 | - String logoutUrl = ConfigHelper.getString("auth.logout.url"); | ||
| 75 | - session.removeAttribute(LiveUtils.SESSION_KEY_NAME); | ||
| 76 | - session.removeAttribute(LiveUtils.SESSION_KEY_ID); | ||
| 77 | - session.invalidate(); | ||
| 78 | - response.sendRedirect(logoutUrl); | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - | ||
| 82 | - @Override | ||
| 83 | - public void init(FilterConfig config) throws ServletException { | ||
| 84 | - this.config = config; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | -} | 1 | +package com.cnlive.mz.live.aspect; |
| 2 | + | ||
| 3 | +import java.io.IOException; | ||
| 4 | + | ||
| 5 | +import javax.servlet.Filter; | ||
| 6 | +import javax.servlet.FilterChain; | ||
| 7 | +import javax.servlet.FilterConfig; | ||
| 8 | +import javax.servlet.ServletException; | ||
| 9 | +import javax.servlet.ServletRequest; | ||
| 10 | +import javax.servlet.ServletResponse; | ||
| 11 | +import javax.servlet.annotation.WebFilter; | ||
| 12 | +import javax.servlet.http.HttpServletRequest; | ||
| 13 | +import javax.servlet.http.HttpServletResponse; | ||
| 14 | +import javax.servlet.http.HttpSession; | ||
| 15 | + | ||
| 16 | +import org.smart4j.framework.core.ConfigHelper; | ||
| 17 | + | ||
| 18 | +import com.cnlive.mz.live.common.LiveUtils; | ||
| 19 | + | ||
| 20 | +/* | ||
| 21 | + * | ||
| 22 | + | ||
| 23 | + 属性 是否必须 说明 | ||
| 24 | + asyncSupported 否 该Filter是否支持异步操作模式 | ||
| 25 | + dispatcherType 否 指定Filter对那种dispatcher模式进行过滤 该属性支持 Async,Error Forward,include,request | ||
| 26 | + displayName 否 File 显示的名称 | ||
| 27 | + filterName 是 Filter的名称 | ||
| 28 | + initParams 否 Filter的配置参数 | ||
| 29 | + servletNames 否 可以指定多个,表示对这几个特定的的serlet 进行过滤 | ||
| 30 | + urlPatterns/value 否 指定 Filter拦截的 URL | ||
| 31 | + | ||
| 32 | + | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + @WebFilter(filterName="log",urlPatterns={"/*"})*/ | ||
| 36 | +@WebFilter(filterName = "AuthFilter", urlPatterns = { "/activity/*", "/channel/*", "/signal/*", "/index/*", | ||
| 37 | + "/switch/*", "/doswitch/*", "/wowza/*" }) | ||
| 38 | +public class AuthFilter implements Filter { | ||
| 39 | + | ||
| 40 | + private FilterConfig config; | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public void destroy() { | ||
| 44 | + this.config = null; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @Override | ||
| 48 | + public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain chain) throws IOException, | ||
| 49 | + ServletException { | ||
| 50 | + HttpServletRequest request = (HttpServletRequest) arg0; | ||
| 51 | + HttpServletResponse response = (HttpServletResponse) arg1; | ||
| 52 | + String requestUrl = request.getRequestURI(); | ||
| 53 | + HttpSession session = request.getSession(); | ||
| 54 | + String webUrl = ConfigHelper.getString("website.url"); | ||
| 55 | + String a=(String) session.getAttribute(LiveUtils.SESSION_KEY_NAME) ; | ||
| 56 | + if (a== null) { | ||
| 57 | + boolean authEnable = ConfigHelper.getBoolean("auth.enable"); | ||
| 58 | + String loginUrl = ConfigHelper.getString("auth.login.url"); | ||
| 59 | + if (authEnable) { | ||
| 60 | + //去登录认证 | ||
| 61 | + String url=loginUrl + webUrl+"/login/success"; | ||
| 62 | + response.sendRedirect(url); | ||
| 63 | + return; | ||
| 64 | + } else { | ||
| 65 | + String userName = "liujicheng"; | ||
| 66 | + request.getSession().setAttribute(LiveUtils.SESSION_KEY_NAME, userName); | ||
| 67 | + request.getSession().setAttribute(LiveUtils.SESSION_KEY_ID, 1); | ||
| 68 | + } | ||
| 69 | + } else { | ||
| 70 | + chain.doFilter(arg0, arg1); | ||
| 71 | + } | ||
| 72 | + // 验证用户是否是退出,进行sessioin销毁 | ||
| 73 | + if (requestUrl.contains("logout")) { | ||
| 74 | + String logoutUrl = ConfigHelper.getString("auth.logout.url"); | ||
| 75 | + session.removeAttribute(LiveUtils.SESSION_KEY_NAME); | ||
| 76 | + session.removeAttribute(LiveUtils.SESSION_KEY_ID); | ||
| 77 | + session.invalidate(); | ||
| 78 | + response.sendRedirect(logoutUrl); | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + @Override | ||
| 83 | + public void init(FilterConfig config) throws ServletException { | ||
| 84 | + this.config = config; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | +} |
src/main/java/com/cnlive/mz/live/rest/BaseUtil.java
| 1 | -package com.cnlive.mz.live.rest; | ||
| 2 | - | ||
| 3 | -import java.io.BufferedReader; | ||
| 4 | -import java.io.IOException; | ||
| 5 | -import java.io.InputStreamReader; | ||
| 6 | -import java.io.PrintWriter; | ||
| 7 | -import java.io.UnsupportedEncodingException; | ||
| 8 | -import java.net.URL; | ||
| 9 | -import java.net.URLConnection; | ||
| 10 | -import java.security.MessageDigest; | ||
| 11 | -import java.text.DateFormat; | ||
| 12 | -import java.text.ParseException; | ||
| 13 | -import java.text.SimpleDateFormat; | ||
| 14 | -import java.util.Calendar; | ||
| 15 | -import java.util.Date; | ||
| 16 | -import java.util.Locale; | ||
| 17 | -import java.util.UUID; | ||
| 18 | - | ||
| 19 | -import javax.crypto.Mac; | ||
| 20 | -import javax.crypto.spec.SecretKeySpec; | ||
| 21 | - | ||
| 22 | -import org.apache.commons.codec.binary.Base64; | ||
| 23 | - | ||
| 24 | -import com.cnlive.mz.commons.net.HttpReq; | ||
| 25 | - | ||
| 26 | -import sun.misc.BASE64Encoder; | ||
| 27 | - | ||
| 28 | -public class BaseUtil { | ||
| 29 | - | ||
| 30 | - private static final String ENCODING = "UTF-8"; | ||
| 31 | - | ||
| 32 | - // AccessKey、SecretKey | ||
| 33 | - private static final String SECRET_KEY = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; | ||
| 34 | - private static final String ACCESS_KEY = "fWUN8KDtJZJGo0ArQ4qo"; | ||
| 35 | - | ||
| 36 | - /* | ||
| 37 | - * 计算MD5+BASE64 | ||
| 38 | - */ | ||
| 39 | - public static String MD5Base64(String s) { | ||
| 40 | - if (s == null) | ||
| 41 | - return null; | ||
| 42 | - String encodeStr = ""; | ||
| 43 | - byte[] utfBytes = s.getBytes(); | ||
| 44 | - MessageDigest mdTemp; | ||
| 45 | - try { | ||
| 46 | - mdTemp = MessageDigest.getInstance("MD5"); | ||
| 47 | - mdTemp.update(utfBytes); | ||
| 48 | - byte[] md5Bytes = mdTemp.digest(); | ||
| 49 | - BASE64Encoder b64Encoder = new BASE64Encoder(); | ||
| 50 | - encodeStr = b64Encoder.encode(md5Bytes); | ||
| 51 | - } catch (Exception e) { | ||
| 52 | - throw new Error("Failed to generate MD5 : " + e.getMessage()); | ||
| 53 | - } | ||
| 54 | - return encodeStr; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - /* | ||
| 58 | - * 哈希计算 HMAC-SHA1 base64 | ||
| 59 | - */ | ||
| 60 | - public static String HMACSha1(String data, String key) { | ||
| 61 | - String result; | ||
| 62 | - try { | ||
| 63 | - SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); | ||
| 64 | - Mac mac = Mac.getInstance("HmacSHA1"); | ||
| 65 | - mac.init(signingKey); | ||
| 66 | - byte[] rawHmac = mac.doFinal(data.getBytes()); | ||
| 67 | - // result = new String(Base64.encodeBase64(rawHmac, false), ENCODING); | ||
| 68 | - // result = (new BASE64Encoder()).encode(rawHmac); | ||
| 69 | - result = new String(Base64.encodeBase64(rawHmac), ENCODING); | ||
| 70 | - } catch (Exception e) { | ||
| 71 | - throw new Error("Failed to generate HMAC : " + e.getMessage()); | ||
| 72 | - } | ||
| 73 | - return result; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 获取当前前一天的时间戳 | ||
| 78 | - * | ||
| 79 | - * @return | ||
| 80 | - */ | ||
| 81 | - public static String getTimestamp() { | ||
| 82 | - DateFormat df = new SimpleDateFormat("yyyyMMdd"); | ||
| 83 | - Date date = null; | ||
| 84 | - try { | ||
| 85 | - Calendar calendar = Calendar.getInstance(); | ||
| 86 | - calendar.add(Calendar.DATE, +1); | ||
| 87 | - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | ||
| 88 | - String motoday = sdf.format(calendar.getTime()); | ||
| 89 | - date = df.parse(motoday); | ||
| 90 | - } catch (ParseException e) { | ||
| 91 | - e.printStackTrace(); | ||
| 92 | - } | ||
| 93 | - Calendar cal = Calendar.getInstance(); | ||
| 94 | - cal.setTime(date); | ||
| 95 | - long timestamp = cal.getTimeInMillis(); | ||
| 96 | - System.out.println("------timestamp-----" + timestamp); | ||
| 97 | - return String.valueOf(timestamp); | ||
| 98 | - | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | - /** | ||
| 102 | - * 签名算法:signature 字符串格式,由三部分组成:GET+”\n”+Expire+”\n”+Resource 2016 0602171212 | ||
| 103 | - * | ||
| 104 | - * @return | ||
| 105 | - * @throws UnsupportedEncodingException | ||
| 106 | - */ | ||
| 107 | - public static String signature(String streamName) throws UnsupportedEncodingException { | ||
| 108 | - | ||
| 109 | - String method = "GET"; | ||
| 110 | - String expire = BaseUtil.getTimestamp(); | ||
| 111 | - String app = "live"; | ||
| 112 | - String methodadd = "add"; | ||
| 113 | - String name = streamName; | ||
| 114 | - app = java.net.URLEncoder.encode(app, "utf-8"); | ||
| 115 | - methodadd = java.net.URLEncoder.encode(methodadd, "utf-8"); | ||
| 116 | - name = java.net.URLEncoder.encode(name, "utf-8"); | ||
| 117 | - System.out.println(expire + "---expire----"); | ||
| 118 | - String Resource = "app=" + app + "&method=" + methodadd + "&name=" + name; | ||
| 119 | - // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | ||
| 120 | - String stringToSign = method + "\n" + expire + "\n" + Resource; | ||
| 121 | - System.out.println("--stringToSign--" + stringToSign); | ||
| 122 | - // 2.计算 HMAC-SHA1 | ||
| 123 | - String signature = HMACSha1(stringToSign, SECRET_KEY); | ||
| 124 | - System.out.println("---signature---" + signature); | ||
| 125 | - signature = java.net.URLEncoder.encode(signature, "utf-8"); | ||
| 126 | - return signature; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - public static String signature(String methodName, String streamName) throws UnsupportedEncodingException { | ||
| 130 | - | ||
| 131 | - String method = "GET"; | ||
| 132 | - String expire = BaseUtil.getTimestamp(); | ||
| 133 | - String app = "live"; | ||
| 134 | - app = java.net.URLEncoder.encode(app, "utf-8"); | ||
| 135 | - methodName = java.net.URLEncoder.encode(methodName, "utf-8"); | ||
| 136 | - streamName = java.net.URLEncoder.encode(streamName, "utf-8"); | ||
| 137 | - System.out.println(expire + "---expire----"); | ||
| 138 | - String Resource = "app=" + app + "&method=" + methodName + "&name=" + streamName; | ||
| 139 | - // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | ||
| 140 | - String stringToSign = method + "\n" + expire + "\n" + Resource; | ||
| 141 | - System.out.println("--stringToSign--" + stringToSign); | ||
| 142 | - // 2.计算 HMAC-SHA1 | ||
| 143 | - String signature = HMACSha1(stringToSign, SECRET_KEY); | ||
| 144 | - System.out.println("---signature---" + signature); | ||
| 145 | - signature = java.net.URLEncoder.encode(signature, "utf-8"); | ||
| 146 | - return signature; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - public static String UUid() { | ||
| 150 | - | ||
| 151 | - String uuid = UUID.randomUUID().toString(); | ||
| 152 | - uuid = uuid.replaceAll("-", ""); | ||
| 153 | - return uuid; | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - public static String getAccessKey() { | ||
| 157 | - return ACCESS_KEY; | ||
| 158 | - } | ||
| 159 | - | ||
| 160 | - public static int random_7(int number) { | ||
| 161 | - int x = (int) (Math.random() * 10); | ||
| 162 | - for (int i = 0; i < number; i++) { | ||
| 163 | - String num = Math.random() * 10 + ""; | ||
| 164 | - } | ||
| 165 | - return x; | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - /* | ||
| 169 | - * 等同于javaScript中的 new Date().toUTCString(); | ||
| 170 | - */ | ||
| 171 | - public static String toGMTString(Date date) { | ||
| 172 | - SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | ||
| 173 | - df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | ||
| 174 | - return df.format(date); | ||
| 175 | - } | ||
| 176 | - | ||
| 177 | - /* | ||
| 178 | - * 发送POST请求 | ||
| 179 | - */ | ||
| 180 | - public static String sendPost(String url, String body, String ak_id, String ak_secret) { | ||
| 181 | - PrintWriter out = null; | ||
| 182 | - BufferedReader in = null; | ||
| 183 | - String result = ""; | ||
| 184 | - try { | ||
| 185 | - URL realUrl = new URL(url); | ||
| 186 | - | ||
| 187 | - /* | ||
| 188 | - * http header 参数 | ||
| 189 | - */ | ||
| 190 | - String method = "POST"; | ||
| 191 | - String accept = "json"; | ||
| 192 | - String content_type = "application/json"; | ||
| 193 | - String path = realUrl.getFile(); | ||
| 194 | - String date = toGMTString(new Date()); | ||
| 195 | - | ||
| 196 | - // 1.对body做MD5+BASE64加密 | ||
| 197 | - String bodyMd5 = MD5Base64(body); | ||
| 198 | - String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n" | ||
| 199 | - + path; | ||
| 200 | - // 2.计算 HMAC-SHA1 | ||
| 201 | - String signature = HMACSha1(stringToSign, ak_secret); | ||
| 202 | - // 3.得到 authorization header | ||
| 203 | - String authHeader = "Dataplus " + ak_id + ":" + signature; | ||
| 204 | - | ||
| 205 | - // 打开和URL之间的连接 | ||
| 206 | - URLConnection conn = realUrl.openConnection(); | ||
| 207 | - // 设置通用的请求属性 | ||
| 208 | - conn.setRequestProperty("accept", accept); | ||
| 209 | - conn.setRequestProperty("content-type", content_type); | ||
| 210 | - conn.setRequestProperty("date", date); | ||
| 211 | - conn.setRequestProperty("Authorization", authHeader); | ||
| 212 | - // 发送POST请求必须设置如下两行 | ||
| 213 | - conn.setDoOutput(true); | ||
| 214 | - conn.setDoInput(true); | ||
| 215 | - // 获取URLConnection对象对应的输出流 | ||
| 216 | - out = new PrintWriter(conn.getOutputStream()); | ||
| 217 | - // 发送请求参数 | ||
| 218 | - out.print(body); | ||
| 219 | - // flush输出流的缓冲 | ||
| 220 | - out.flush(); | ||
| 221 | - // 定义BufferedReader输入流来读取URL的响应 | ||
| 222 | - in = new BufferedReader(new InputStreamReader(conn.getInputStream())); | ||
| 223 | - String line; | ||
| 224 | - while ((line = in.readLine()) != null) { | ||
| 225 | - result += line; | ||
| 226 | - } | ||
| 227 | - } catch (Exception e) { | ||
| 228 | - System.out.println("发送 POST 请求出现异常!" + e); | ||
| 229 | - e.printStackTrace(); | ||
| 230 | - } | ||
| 231 | - // 使用finally块来关闭输出流、输入流 | ||
| 232 | - finally { | ||
| 233 | - try { | ||
| 234 | - if (out != null) { | ||
| 235 | - out.close(); | ||
| 236 | - } | ||
| 237 | - if (in != null) { | ||
| 238 | - in.close(); | ||
| 239 | - } | ||
| 240 | - } catch (IOException ex) { | ||
| 241 | - ex.printStackTrace(); | ||
| 242 | - } | ||
| 243 | - } | ||
| 244 | - return result; | ||
| 245 | - } | ||
| 246 | - | ||
| 247 | - /* | ||
| 248 | - * GET请求 | ||
| 249 | - */ | ||
| 250 | - | ||
| 251 | - public static String sendGet(String url, String ak_id, String ak_secret) { | ||
| 252 | - String result = ""; | ||
| 253 | - BufferedReader in = null; | ||
| 254 | - try { | ||
| 255 | - URL realUrl = new URL(url); | ||
| 256 | - /* | ||
| 257 | - * http header 参数 | ||
| 258 | - */ | ||
| 259 | - // String method = "GET"; | ||
| 260 | - // String Expire = "1436976000"; | ||
| 261 | - // String Resource = | ||
| 262 | - // "nonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345"; | ||
| 263 | - // String content_type = "application/json"; | ||
| 264 | - // String path = realUrl.getFile(); | ||
| 265 | - // String date = toGMTString(new Date()); | ||
| 266 | - // // 1.对body做MD5+BASE64加密 | ||
| 267 | - // // String bodyMd5 = MD5Base64(body); | ||
| 268 | - // String stringToSign = method + "\n" + Expire + "\n" + Resource; | ||
| 269 | - // // 2.计算 HMAC-SHA1 | ||
| 270 | - // String signature = HMACSha1(stringToSign, ak_secret); | ||
| 271 | - // // 3.得到 authorization header | ||
| 272 | - // String authHeader = "Dataplus " + ak_id + ":" + signature; | ||
| 273 | - // 打开和URL之间的连接 | ||
| 274 | - URLConnection connection = realUrl.openConnection(); | ||
| 275 | - // 设置通用的请求属性 | ||
| 276 | - // connection.setRequestProperty("accept", "json"); | ||
| 277 | - // connection.setRequestProperty("content-type", content_type); | ||
| 278 | - // connection.setRequestProperty("date", date); | ||
| 279 | - // connection.setRequestProperty("Authorization", authHeader); | ||
| 280 | - // 建立实际的连接 | ||
| 281 | - connection.connect(); | ||
| 282 | - // 定义 BufferedReader输入流来读取URL的响应 | ||
| 283 | - in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | ||
| 284 | - String line; | ||
| 285 | - while ((line = in.readLine()) != null) { | ||
| 286 | - result += line; | ||
| 287 | - } | ||
| 288 | - } catch (Exception e) { | ||
| 289 | - System.out.println("发送GET请求出现异常!" + e); | ||
| 290 | - e.printStackTrace(); | ||
| 291 | - } | ||
| 292 | - // 使用finally块来关闭输入流 | ||
| 293 | - finally { | ||
| 294 | - try { | ||
| 295 | - if (in != null) { | ||
| 296 | - in.close(); | ||
| 297 | - } | ||
| 298 | - } catch (Exception e) { | ||
| 299 | - e.printStackTrace(); | ||
| 300 | - } | ||
| 301 | - } | ||
| 302 | - return result; | ||
| 303 | - } | ||
| 304 | - | ||
| 305 | - public static void main(String[] args) throws Exception { | ||
| 306 | - // 发送POST请求示例 | ||
| 307 | - /* | ||
| 308 | - * String ak_id = "fWUN8KDtJZJGo0ArQ4qo"; // 用户ak String ak_secret = | ||
| 309 | - * "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // 用户ak_secret String url | ||
| 310 | - * = "https://kmr-cn-beijing.ksyun.com"; String body = | ||
| 311 | - * "{\"param1\": \"GET\n1436976000\nnonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345\", \"param2\":\"fWUN8KDtJZJGo0ArQ4qo\"}" | ||
| 312 | - * ; System.out.println("response body:" + sendPost(url, body, AK_ID, | ||
| 313 | - * AK_SECRET)); | ||
| 314 | - */ | ||
| 315 | - | ||
| 316 | - Date date = new Date(); | ||
| 317 | - System.out.println(toGMTString(date)); | ||
| 318 | - String hh = HMACSha1("GET\n1436976124\nnonce=4e1f2519c626cbfbab1520c255830c26&public=1&vdoid=1", | ||
| 319 | - "fWUN8KDtJZJGo0ArQ4qo"); | ||
| 320 | - String hhhh = MD5Base64(hh); | ||
| 321 | - System.out.println(hh); | ||
| 322 | - System.out.println(".............."); | ||
| 323 | - | ||
| 324 | - // String str = signature(); | ||
| 325 | - // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | ||
| 326 | - | ||
| 327 | - // 发送GET请求 | ||
| 328 | - String url1 = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=iDPKaesXXW3A26CScNyjpNkzxZs%3D&accesskey=I3TC8a4xboPUMe5xlp22&expire=1483200000&app=live&method=add&stream=310166_863"; | ||
| 329 | - System.out.println("response body:" + sendGet(url1, ACCESS_KEY, SECRET_KEY)); | ||
| 330 | - | ||
| 331 | - // long d = getTimestamp(); | ||
| 332 | - // System.out.println(d); | ||
| 333 | - | ||
| 334 | - // String str = signature(); | ||
| 335 | - // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | ||
| 336 | - /* | ||
| 337 | - * // 发送GET请求 String ak_id1 = "fWUN8KDtJZJGo0ArQ4qo"; //用户ak String | ||
| 338 | - * ak_secret1 = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // | ||
| 339 | - * 用户ak_secret String url1 = | ||
| 340 | - * "http://cnlive.uplive.ks-cdn.com?signature=L2muBoImPzyvwyzfBtGXEu+wRNE=&accesskey=fWUN8KDtJZJGo0ArQ4qo&expire=1436976000&method=add&app=live&name=498122_57"; | ||
| 341 | - * System.out.println("response body:" +sendGet(url1, ak_id1, | ||
| 342 | - * ak_secret1)); | ||
| 343 | - */ | ||
| 344 | - // long d = getTimestamp(); | ||
| 345 | - // System.out.println(d); | ||
| 346 | - | ||
| 347 | - } | ||
| 348 | -} | 1 | +package com.cnlive.mz.live.rest; |
| 2 | + | ||
| 3 | +import java.io.BufferedReader; | ||
| 4 | +import java.io.IOException; | ||
| 5 | +import java.io.InputStreamReader; | ||
| 6 | +import java.io.PrintWriter; | ||
| 7 | +import java.io.UnsupportedEncodingException; | ||
| 8 | +import java.net.URL; | ||
| 9 | +import java.net.URLConnection; | ||
| 10 | +import java.security.MessageDigest; | ||
| 11 | +import java.text.DateFormat; | ||
| 12 | +import java.text.ParseException; | ||
| 13 | +import java.text.SimpleDateFormat; | ||
| 14 | +import java.util.Calendar; | ||
| 15 | +import java.util.Date; | ||
| 16 | +import java.util.Locale; | ||
| 17 | +import java.util.UUID; | ||
| 18 | + | ||
| 19 | +import javax.crypto.Mac; | ||
| 20 | +import javax.crypto.spec.SecretKeySpec; | ||
| 21 | + | ||
| 22 | +import org.apache.commons.codec.binary.Base64; | ||
| 23 | + | ||
| 24 | +import com.cnlive.mz.commons.net.HttpReq; | ||
| 25 | + | ||
| 26 | +import sun.misc.BASE64Encoder; | ||
| 27 | + | ||
| 28 | +public class BaseUtil { | ||
| 29 | + | ||
| 30 | + private static final String ENCODING = "UTF-8"; | ||
| 31 | + | ||
| 32 | + // AccessKey、SecretKey | ||
| 33 | + private static final String SECRET_KEY = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; | ||
| 34 | + private static final String ACCESS_KEY = "fWUN8KDtJZJGo0ArQ4qo"; | ||
| 35 | + | ||
| 36 | + /* | ||
| 37 | + * 计算MD5+BASE64 | ||
| 38 | + */ | ||
| 39 | + public static String MD5Base64(String s) { | ||
| 40 | + if (s == null) | ||
| 41 | + return null; | ||
| 42 | + String encodeStr = ""; | ||
| 43 | + byte[] utfBytes = s.getBytes(); | ||
| 44 | + MessageDigest mdTemp; | ||
| 45 | + try { | ||
| 46 | + mdTemp = MessageDigest.getInstance("MD5"); | ||
| 47 | + mdTemp.update(utfBytes); | ||
| 48 | + byte[] md5Bytes = mdTemp.digest(); | ||
| 49 | + BASE64Encoder b64Encoder = new BASE64Encoder(); | ||
| 50 | + encodeStr = b64Encoder.encode(md5Bytes); | ||
| 51 | + } catch (Exception e) { | ||
| 52 | + throw new Error("Failed to generate MD5 : " + e.getMessage()); | ||
| 53 | + } | ||
| 54 | + return encodeStr; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + /* | ||
| 58 | + * 哈希计算 HMAC-SHA1 base64 | ||
| 59 | + */ | ||
| 60 | + public static String HMACSha1(String data, String key) { | ||
| 61 | + String result; | ||
| 62 | + try { | ||
| 63 | + SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(), "HmacSHA1"); | ||
| 64 | + Mac mac = Mac.getInstance("HmacSHA1"); | ||
| 65 | + mac.init(signingKey); | ||
| 66 | + byte[] rawHmac = mac.doFinal(data.getBytes()); | ||
| 67 | + // result = new String(Base64.encodeBase64(rawHmac, false), ENCODING); | ||
| 68 | + // result = (new BASE64Encoder()).encode(rawHmac); | ||
| 69 | + result = new String(Base64.encodeBase64(rawHmac), ENCODING); | ||
| 70 | + } catch (Exception e) { | ||
| 71 | + throw new Error("Failed to generate HMAC : " + e.getMessage()); | ||
| 72 | + } | ||
| 73 | + return result; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + /** | ||
| 77 | + * 获取当前前一天的时间戳 | ||
| 78 | + * | ||
| 79 | + * @return | ||
| 80 | + */ | ||
| 81 | + public static String getTimestamp() { | ||
| 82 | + DateFormat df = new SimpleDateFormat("yyyyMMdd"); | ||
| 83 | + Date date = null; | ||
| 84 | + try { | ||
| 85 | + Calendar calendar = Calendar.getInstance(); | ||
| 86 | + calendar.add(Calendar.DATE, +1); | ||
| 87 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); | ||
| 88 | + String motoday = sdf.format(calendar.getTime()); | ||
| 89 | + date = df.parse(motoday); | ||
| 90 | + } catch (ParseException e) { | ||
| 91 | + e.printStackTrace(); | ||
| 92 | + } | ||
| 93 | + Calendar cal = Calendar.getInstance(); | ||
| 94 | + cal.setTime(date); | ||
| 95 | + long timestamp = cal.getTimeInMillis(); | ||
| 96 | + System.out.println("------timestamp-----" + timestamp); | ||
| 97 | + return String.valueOf(timestamp); | ||
| 98 | + | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + /** | ||
| 102 | + * 签名算法:signature 字符串格式,由三部分组成:GET+”\n”+Expire+”\n”+Resource 2016 0602171212 | ||
| 103 | + * | ||
| 104 | + * @return | ||
| 105 | + * @throws UnsupportedEncodingException | ||
| 106 | + */ | ||
| 107 | + public static String signature(String streamName) throws UnsupportedEncodingException { | ||
| 108 | + | ||
| 109 | + String method = "GET"; | ||
| 110 | + String expire = BaseUtil.getTimestamp(); | ||
| 111 | + String app = "live"; | ||
| 112 | + String methodadd = "add"; | ||
| 113 | + String name = streamName; | ||
| 114 | + app = java.net.URLEncoder.encode(app, "utf-8"); | ||
| 115 | + methodadd = java.net.URLEncoder.encode(methodadd, "utf-8"); | ||
| 116 | + name = java.net.URLEncoder.encode(name, "utf-8"); | ||
| 117 | + System.out.println(expire + "---expire----"); | ||
| 118 | + String Resource = "app=" + app + "&method=" + methodadd + "&name=" + name; | ||
| 119 | + // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | ||
| 120 | + String stringToSign = method + "\n" + expire + "\n" + Resource; | ||
| 121 | + System.out.println("--stringToSign--" + stringToSign); | ||
| 122 | + // 2.计算 HMAC-SHA1 | ||
| 123 | + String signature = HMACSha1(stringToSign, SECRET_KEY); | ||
| 124 | + System.out.println("---signature---" + signature); | ||
| 125 | + signature = java.net.URLEncoder.encode(signature, "utf-8"); | ||
| 126 | + return signature; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public static String signature(String methodName, String streamName) throws UnsupportedEncodingException { | ||
| 130 | + | ||
| 131 | + String method = "GET"; | ||
| 132 | + String expire = BaseUtil.getTimestamp(); | ||
| 133 | + String app = "live"; | ||
| 134 | + app = java.net.URLEncoder.encode(app, "utf-8"); | ||
| 135 | + methodName = java.net.URLEncoder.encode(methodName, "utf-8"); | ||
| 136 | + streamName = java.net.URLEncoder.encode(streamName, "utf-8"); | ||
| 137 | + System.out.println(expire + "---expire----"); | ||
| 138 | + String Resource = "app=" + app + "&method=" + methodName + "&name=" + streamName; | ||
| 139 | + // Resource = java.net.URLEncoder.encode(Resource, "utf-8"); | ||
| 140 | + String stringToSign = method + "\n" + expire + "\n" + Resource; | ||
| 141 | + System.out.println("--stringToSign--" + stringToSign); | ||
| 142 | + // 2.计算 HMAC-SHA1 | ||
| 143 | + String signature = HMACSha1(stringToSign, SECRET_KEY); | ||
| 144 | + System.out.println("---signature---" + signature); | ||
| 145 | + signature = java.net.URLEncoder.encode(signature, "utf-8"); | ||
| 146 | + return signature; | ||
| 147 | + } | ||
| 148 | + | ||
| 149 | + public static String UUid() { | ||
| 150 | + | ||
| 151 | + String uuid = UUID.randomUUID().toString(); | ||
| 152 | + uuid = uuid.replaceAll("-", ""); | ||
| 153 | + return uuid; | ||
| 154 | + } | ||
| 155 | + | ||
| 156 | + public static String getAccessKey() { | ||
| 157 | + return ACCESS_KEY; | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + public static int random_7(int number) { | ||
| 161 | + int x = (int) (Math.random() * 10); | ||
| 162 | + for (int i = 0; i < number; i++) { | ||
| 163 | + String num = Math.random() * 10 + ""; | ||
| 164 | + } | ||
| 165 | + return x; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + /* | ||
| 169 | + * 等同于javaScript中的 new Date().toUTCString(); | ||
| 170 | + */ | ||
| 171 | + public static String toGMTString(Date date) { | ||
| 172 | + SimpleDateFormat df = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss z", Locale.UK); | ||
| 173 | + df.setTimeZone(new java.util.SimpleTimeZone(0, "GMT")); | ||
| 174 | + return df.format(date); | ||
| 175 | + } | ||
| 176 | + | ||
| 177 | + /* | ||
| 178 | + * 发送POST请求 | ||
| 179 | + */ | ||
| 180 | + public static String sendPost(String url, String body, String ak_id, String ak_secret) { | ||
| 181 | + PrintWriter out = null; | ||
| 182 | + BufferedReader in = null; | ||
| 183 | + String result = ""; | ||
| 184 | + try { | ||
| 185 | + URL realUrl = new URL(url); | ||
| 186 | + | ||
| 187 | + /* | ||
| 188 | + * http header 参数 | ||
| 189 | + */ | ||
| 190 | + String method = "POST"; | ||
| 191 | + String accept = "json"; | ||
| 192 | + String content_type = "application/json"; | ||
| 193 | + String path = realUrl.getFile(); | ||
| 194 | + String date = toGMTString(new Date()); | ||
| 195 | + | ||
| 196 | + // 1.对body做MD5+BASE64加密 | ||
| 197 | + String bodyMd5 = MD5Base64(body); | ||
| 198 | + String stringToSign = method + "\n" + accept + "\n" + bodyMd5 + "\n" + content_type + "\n" + date + "\n" | ||
| 199 | + + path; | ||
| 200 | + // 2.计算 HMAC-SHA1 | ||
| 201 | + String signature = HMACSha1(stringToSign, ak_secret); | ||
| 202 | + // 3.得到 authorization header | ||
| 203 | + String authHeader = "Dataplus " + ak_id + ":" + signature; | ||
| 204 | + | ||
| 205 | + // 打开和URL之间的连接 | ||
| 206 | + URLConnection conn = realUrl.openConnection(); | ||
| 207 | + // 设置通用的请求属性 | ||
| 208 | + conn.setRequestProperty("accept", accept); | ||
| 209 | + conn.setRequestProperty("content-type", content_type); | ||
| 210 | + conn.setRequestProperty("date", date); | ||
| 211 | + conn.setRequestProperty("Authorization", authHeader); | ||
| 212 | + // 发送POST请求必须设置如下两行 | ||
| 213 | + conn.setDoOutput(true); | ||
| 214 | + conn.setDoInput(true); | ||
| 215 | + // 获取URLConnection对象对应的输出流 | ||
| 216 | + out = new PrintWriter(conn.getOutputStream()); | ||
| 217 | + // 发送请求参数 | ||
| 218 | + out.print(body); | ||
| 219 | + // flush输出流的缓冲 | ||
| 220 | + out.flush(); | ||
| 221 | + // 定义BufferedReader输入流来读取URL的响应 | ||
| 222 | + in = new BufferedReader(new InputStreamReader(conn.getInputStream())); | ||
| 223 | + String line; | ||
| 224 | + while ((line = in.readLine()) != null) { | ||
| 225 | + result += line; | ||
| 226 | + } | ||
| 227 | + } catch (Exception e) { | ||
| 228 | + System.out.println("发送 POST 请求出现异常!" + e); | ||
| 229 | + e.printStackTrace(); | ||
| 230 | + } | ||
| 231 | + // 使用finally块来关闭输出流、输入流 | ||
| 232 | + finally { | ||
| 233 | + try { | ||
| 234 | + if (out != null) { | ||
| 235 | + out.close(); | ||
| 236 | + } | ||
| 237 | + if (in != null) { | ||
| 238 | + in.close(); | ||
| 239 | + } | ||
| 240 | + } catch (IOException ex) { | ||
| 241 | + ex.printStackTrace(); | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | + return result; | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + /* | ||
| 248 | + * GET请求 | ||
| 249 | + */ | ||
| 250 | + | ||
| 251 | + public static String sendGet(String url, String ak_id, String ak_secret) { | ||
| 252 | + String result = ""; | ||
| 253 | + BufferedReader in = null; | ||
| 254 | + try { | ||
| 255 | + URL realUrl = new URL(url); | ||
| 256 | + /* | ||
| 257 | + * http header 参数 | ||
| 258 | + */ | ||
| 259 | + // String method = "GET"; | ||
| 260 | + // String Expire = "1436976000"; | ||
| 261 | + // String Resource = | ||
| 262 | + // "nonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345"; | ||
| 263 | + // String content_type = "application/json"; | ||
| 264 | + // String path = realUrl.getFile(); | ||
| 265 | + // String date = toGMTString(new Date()); | ||
| 266 | + // // 1.对body做MD5+BASE64加密 | ||
| 267 | + // // String bodyMd5 = MD5Base64(body); | ||
| 268 | + // String stringToSign = method + "\n" + Expire + "\n" + Resource; | ||
| 269 | + // // 2.计算 HMAC-SHA1 | ||
| 270 | + // String signature = HMACSha1(stringToSign, ak_secret); | ||
| 271 | + // // 3.得到 authorization header | ||
| 272 | + // String authHeader = "Dataplus " + ak_id + ":" + signature; | ||
| 273 | + // 打开和URL之间的连接 | ||
| 274 | + URLConnection connection = realUrl.openConnection(); | ||
| 275 | + // 设置通用的请求属性 | ||
| 276 | + // connection.setRequestProperty("accept", "json"); | ||
| 277 | + // connection.setRequestProperty("content-type", content_type); | ||
| 278 | + // connection.setRequestProperty("date", date); | ||
| 279 | + // connection.setRequestProperty("Authorization", authHeader); | ||
| 280 | + // 建立实际的连接 | ||
| 281 | + connection.connect(); | ||
| 282 | + // 定义 BufferedReader输入流来读取URL的响应 | ||
| 283 | + in = new BufferedReader(new InputStreamReader(connection.getInputStream())); | ||
| 284 | + String line; | ||
| 285 | + while ((line = in.readLine()) != null) { | ||
| 286 | + result += line; | ||
| 287 | + } | ||
| 288 | + } catch (Exception e) { | ||
| 289 | + System.out.println("发送GET请求出现异常!" + e); | ||
| 290 | + e.printStackTrace(); | ||
| 291 | + } | ||
| 292 | + // 使用finally块来关闭输入流 | ||
| 293 | + finally { | ||
| 294 | + try { | ||
| 295 | + if (in != null) { | ||
| 296 | + in.close(); | ||
| 297 | + } | ||
| 298 | + } catch (Exception e) { | ||
| 299 | + e.printStackTrace(); | ||
| 300 | + } | ||
| 301 | + } | ||
| 302 | + return result; | ||
| 303 | + } | ||
| 304 | + | ||
| 305 | + public static void main(String[] args) throws Exception { | ||
| 306 | + // 发送POST请求示例 | ||
| 307 | + /* | ||
| 308 | + * String ak_id = "fWUN8KDtJZJGo0ArQ4qo"; // 用户ak String ak_secret = | ||
| 309 | + * "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // 用户ak_secret String url | ||
| 310 | + * = "https://kmr-cn-beijing.ksyun.com"; String body = | ||
| 311 | + * "{\"param1\": \"GET\n1436976000\nnonce=4e1f2519c626cbfbab1520c255830c26&public=0&vdoid=12345\", \"param2\":\"fWUN8KDtJZJGo0ArQ4qo\"}" | ||
| 312 | + * ; System.out.println("response body:" + sendPost(url, body, AK_ID, | ||
| 313 | + * AK_SECRET)); | ||
| 314 | + */ | ||
| 315 | + | ||
| 316 | + Date date = new Date(); | ||
| 317 | + System.out.println(toGMTString(date)); | ||
| 318 | + String hh = HMACSha1("GET\n1436976124\nnonce=4e1f2519c626cbfbab1520c255830c26&public=1&vdoid=1", | ||
| 319 | + "fWUN8KDtJZJGo0ArQ4qo"); | ||
| 320 | + String hhhh = MD5Base64(hh); | ||
| 321 | + System.out.println(hh); | ||
| 322 | + System.out.println(".............."); | ||
| 323 | + | ||
| 324 | + // String str = signature(); | ||
| 325 | + // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | ||
| 326 | + | ||
| 327 | + // 发送GET请求 | ||
| 328 | + String url1 = "http://cnlive.dashboard.ks-cdn.com/blacklist?signature=iDPKaesXXW3A26CScNyjpNkzxZs%3D&accesskey=I3TC8a4xboPUMe5xlp22&expire=1483200000&app=live&method=add&stream=310166_863"; | ||
| 329 | + System.out.println("response body:" + sendGet(url1, ACCESS_KEY, SECRET_KEY)); | ||
| 330 | + | ||
| 331 | + // long d = getTimestamp(); | ||
| 332 | + // System.out.println(d); | ||
| 333 | + | ||
| 334 | + // String str = signature(); | ||
| 335 | + // System.out.println(str);//L2muBoImPzyvwyzfBtGXEu+wRNE= | ||
| 336 | + /* | ||
| 337 | + * // 发送GET请求 String ak_id1 = "fWUN8KDtJZJGo0ArQ4qo"; //用户ak String | ||
| 338 | + * ak_secret1 = "UIWPYVeaV8kq2vWImDkLBvWs/pwmTJVF9MCNHDsC"; // | ||
| 339 | + * 用户ak_secret String url1 = | ||
| 340 | + * "http://cnlive.uplive.ks-cdn.com?signature=L2muBoImPzyvwyzfBtGXEu+wRNE=&accesskey=fWUN8KDtJZJGo0ArQ4qo&expire=1436976000&method=add&app=live&name=498122_57"; | ||
| 341 | + * System.out.println("response body:" +sendGet(url1, ak_id1, | ||
| 342 | + * ak_secret1)); | ||
| 343 | + */ | ||
| 344 | + // long d = getTimestamp(); | ||
| 345 | + // System.out.println(d); | ||
| 346 | + | ||
| 347 | + } | ||
| 348 | +} |
src/main/resources/log4j.properties
| 1 | -log4j.rootLogger=INFO,console,file,action,content,video,httpreq | ||
| 2 | -#Console | ||
| 3 | -log4j.appender.console.Target=System.out | ||
| 4 | -log4j.appender.console=org.apache.log4j.ConsoleAppender | ||
| 5 | -log4j.appender.console.layout=org.apache.log4j.PatternLayout | ||
| 6 | -log4j.appender.console.layout.ConversionPattern=%m%n | ||
| 7 | - | ||
| 8 | - | ||
| 9 | -log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | ||
| 10 | -log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log | ||
| 11 | -log4j.appender.file.DatePattern='_'yyyyMMdd | ||
| 12 | -log4j.appender.file.encoding=UTF-8 | ||
| 13 | -log4j.appender.file.layout=org.apache.log4j.PatternLayout | ||
| 14 | -log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss,SSS} %p %c (%L) - %m%n | ||
| 15 | - | ||
| 16 | -#log4j.logger.org.apache=ERROR | ||
| 17 | -log4j.logger.org.smart4j=DEBUG | ||
| 18 | - | ||
| 19 | - | ||
| 20 | -#action | ||
| 21 | - | ||
| 22 | -log4j.appender.action=org.apache.log4j.DailyRollingFileAppender | ||
| 23 | -log4j.appender.action.File=${catalina.home}/logs/action.log | ||
| 24 | -log4j.appender.action.layout=org.apache.log4j.PatternLayout | ||
| 25 | -log4j.appender.action.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 26 | -log4j.appender.action.DatePattern='.'yyyy-MM-dd | ||
| 27 | -log4j.appender.action.Encoding=UTF-8 | ||
| 28 | - | ||
| 29 | -#content | ||
| 30 | -log4j.appender.content=org.apache.log4j.DailyRollingFileAppender | ||
| 31 | -log4j.appender.content.File=${catalina.home}/logs/content.log | ||
| 32 | -log4j.appender.content.layout=org.apache.log4j.PatternLayout | ||
| 33 | -log4j.appender.content.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 34 | -log4j.appender.content.DatePattern='.'yyyy-MM-dd | ||
| 35 | -log4j.appender.content.Encoding=UTF-8 | ||
| 36 | - | ||
| 37 | - | ||
| 38 | - | ||
| 39 | -#video | ||
| 40 | -log4j.appender.video=org.apache.log4j.DailyRollingFileAppender | ||
| 41 | -log4j.appender.video.File=${catalina.home}/logs/video.log | ||
| 42 | -log4j.appender.video.layout=org.apache.log4j.PatternLayout | ||
| 43 | -log4j.appender.video.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 44 | -log4j.appender.video.DatePattern='.'yyyy-MM-dd | ||
| 45 | -log4j.appender.video.Encoding=UTF-8 | ||
| 46 | - | ||
| 47 | - | ||
| 48 | - | ||
| 49 | -#httpreq | ||
| 50 | -log4j.appender.httpreq=org.apache.log4j.DailyRollingFileAppender | ||
| 51 | -log4j.appender.httpreq.File=${catalina.home}/logs/httpreq.log | ||
| 52 | -log4j.appender.httpreq.layout=org.apache.log4j.PatternLayout | ||
| 53 | -log4j.appender.httpreq.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 54 | -log4j.appender.httpreq.DatePattern='.'yyyy-MM-dd | ||
| 55 | -log4j.appender.httpreq.Encoding=UTF-8 | ||
| 56 | - | ||
| 57 | - | ||
| 58 | -#log4j.logger.com.ksyun.ks3=DEBUG,stdout | ||
| 59 | -#log4j.logger.org.apache.http=DEBUG,stdout | ||
| 60 | -#log4j.logger.org.apache.http.wire=ERROR,stdout | ||
| 61 | - | ||
| 62 | -#log4j.addivity.org.apache=true | ||
| 63 | -#log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
| 64 | -#log4j.appender.stdout.Target=System.out | ||
| 65 | -#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | 1 | +log4j.rootLogger=INFO,console,file,action,content,video,httpreq |
| 2 | +#Console | ||
| 3 | +log4j.appender.console.Target=System.out | ||
| 4 | +log4j.appender.console=org.apache.log4j.ConsoleAppender | ||
| 5 | +log4j.appender.console.layout=org.apache.log4j.PatternLayout | ||
| 6 | +log4j.appender.console.layout.ConversionPattern=%m%n | ||
| 7 | + | ||
| 8 | + | ||
| 9 | +log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | ||
| 10 | +log4j.appender.file.File=${catalina.home}/logs/cnlive_live_web/log | ||
| 11 | +log4j.appender.file.DatePattern='_'yyyyMMdd | ||
| 12 | +log4j.appender.file.encoding=UTF-8 | ||
| 13 | +log4j.appender.file.layout=org.apache.log4j.PatternLayout | ||
| 14 | +log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss,SSS} %p %c (%L) - %m%n | ||
| 15 | + | ||
| 16 | +#log4j.logger.org.apache=ERROR | ||
| 17 | +log4j.logger.org.smart4j=DEBUG | ||
| 18 | + | ||
| 19 | + | ||
| 20 | +#action | ||
| 21 | + | ||
| 22 | +log4j.appender.action=org.apache.log4j.DailyRollingFileAppender | ||
| 23 | +log4j.appender.action.File=${catalina.home}/logs/action.log | ||
| 24 | +log4j.appender.action.layout=org.apache.log4j.PatternLayout | ||
| 25 | +log4j.appender.action.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 26 | +log4j.appender.action.DatePattern='.'yyyy-MM-dd | ||
| 27 | +log4j.appender.action.Encoding=UTF-8 | ||
| 28 | + | ||
| 29 | +#content | ||
| 30 | +log4j.appender.content=org.apache.log4j.DailyRollingFileAppender | ||
| 31 | +log4j.appender.content.File=${catalina.home}/logs/content.log | ||
| 32 | +log4j.appender.content.layout=org.apache.log4j.PatternLayout | ||
| 33 | +log4j.appender.content.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 34 | +log4j.appender.content.DatePattern='.'yyyy-MM-dd | ||
| 35 | +log4j.appender.content.Encoding=UTF-8 | ||
| 36 | + | ||
| 37 | + | ||
| 38 | + | ||
| 39 | +#video | ||
| 40 | +log4j.appender.video=org.apache.log4j.DailyRollingFileAppender | ||
| 41 | +log4j.appender.video.File=${catalina.home}/logs/video.log | ||
| 42 | +log4j.appender.video.layout=org.apache.log4j.PatternLayout | ||
| 43 | +log4j.appender.video.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 44 | +log4j.appender.video.DatePattern='.'yyyy-MM-dd | ||
| 45 | +log4j.appender.video.Encoding=UTF-8 | ||
| 46 | + | ||
| 47 | + | ||
| 48 | + | ||
| 49 | +#httpreq | ||
| 50 | +log4j.appender.httpreq=org.apache.log4j.DailyRollingFileAppender | ||
| 51 | +log4j.appender.httpreq.File=${catalina.home}/logs/httpreq.log | ||
| 52 | +log4j.appender.httpreq.layout=org.apache.log4j.PatternLayout | ||
| 53 | +log4j.appender.httpreq.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 54 | +log4j.appender.httpreq.DatePattern='.'yyyy-MM-dd | ||
| 55 | +log4j.appender.httpreq.Encoding=UTF-8 | ||
| 56 | + | ||
| 57 | + | ||
| 58 | +#log4j.logger.com.ksyun.ks3=DEBUG,stdout | ||
| 59 | +#log4j.logger.org.apache.http=DEBUG,stdout | ||
| 60 | +#log4j.logger.org.apache.http.wire=ERROR,stdout | ||
| 61 | + | ||
| 62 | +#log4j.addivity.org.apache=true | ||
| 63 | +#log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
| 64 | +#log4j.appender.stdout.Target=System.out | ||
| 65 | +#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
| 66 | #log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%t]%C{1}.%M(%L) - %m%n | 66 | #log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss SSS} %-5p [%t]%C{1}.%M(%L) - %m%n |
| 67 | \ No newline at end of file | 67 | \ No newline at end of file |
src/main/resources/smart.properties
| 1 | -smart.framework.app.base_package=com.cnlive.mz.live | ||
| 2 | -smart.framework.app.home_page=/index | ||
| 3 | -smart.framework.app.www_path=/static/ | ||
| 4 | -smart.framework.app.jsp_path=/pages/ | ||
| 5 | -smart.framework.custom.ds_factory=org.smart4j.plugin.dbcp.DbcpDataSourceFactory | ||
| 6 | - | ||
| 7 | - | ||
| 8 | -smart.framework.jdbc.type=mysql | ||
| 9 | -smart.framework.jdbc.driver=com.mysql.jdbc.Driver | ||
| 10 | -#smart.framework.jdbc.url=jdbc:mysql://124.193.218.90:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 11 | -#smart.framework.jdbc.username=cnlive_oa | ||
| 12 | -#smart.framework.jdbc.password=H8rf#_3@ccx9( | ||
| 13 | - | ||
| 14 | -smart.framework.jdbc.url=jdbc:mysql://123.59.27.186:23306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 15 | -smart.framework.jdbc.username=ugc | ||
| 16 | -smart.framework.jdbc.password=liujicheng@cnlive.COM | ||
| 17 | - | ||
| 18 | - | ||
| 19 | -#smart.framework.jdbc.url=jdbc:mysql://localhost:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 20 | -#smart.framework.jdbc.username=root | ||
| 21 | -#smart.framework.jdbc.password=root | ||
| 22 | - | ||
| 23 | -# | ||
| 24 | -smart.plugin.i18n.reloadable=true | ||
| 25 | -smart.plugin.rest.log=true | ||
| 26 | -smart.plugin.rest.jsonp=true | ||
| 27 | -smart.plugin.rest.jsonp.function=callback | ||
| 28 | - | ||
| 29 | -#smart.plugin.security.realms=custom | ||
| 30 | -#smart.plugin.security.custom.class=org.smart4j.sample.CustomSmartSecurity | ||
| 31 | -#smart.plugin.security.cacheable=true | ||
| 32 | - | ||
| 33 | -sample.upload_path=/www/upload/ | ||
| 34 | - | ||
| 35 | -mail.template_path=D:/apache-tomcat-7.0.61/webapps/cnlive_live_web/pages/mail.html | ||
| 36 | -website.url=http://localhost:8080/cnlive_live_web/ | ||
| 37 | -auth.enable=true | ||
| 38 | -auth.login.url=http://sso.staff.cnlive.com/CnliveSSO/login?from=mam-live&callbackUrl= | ||
| 39 | -auth.logout.url=http://sso.staff.cnlive.com/CnliveSSO/logOut?from=mam-live&callbackUrl= | ||
| 40 | -auth.userinfo.url=http://sso.staff.cnlive.com/CnliveSSO/getUserInfo?username= | ||
| 41 | - | 1 | +smart.framework.app.base_package=com.cnlive.mz.live |
| 2 | +smart.framework.app.home_page=/index | ||
| 3 | +smart.framework.app.www_path=/static/ | ||
| 4 | +smart.framework.app.jsp_path=/pages/ | ||
| 5 | +smart.framework.custom.ds_factory=org.smart4j.plugin.dbcp.DbcpDataSourceFactory | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +smart.framework.jdbc.type=mysql | ||
| 9 | +smart.framework.jdbc.driver=com.mysql.jdbc.Driver | ||
| 10 | +#smart.framework.jdbc.url=jdbc:mysql://124.193.218.90:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 11 | +#smart.framework.jdbc.username=cnlive_oa | ||
| 12 | +#smart.framework.jdbc.password=H8rf#_3@ccx9( | ||
| 13 | + | ||
| 14 | +smart.framework.jdbc.url=jdbc:mysql://123.59.27.186:23306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 15 | +smart.framework.jdbc.username=ugc | ||
| 16 | +smart.framework.jdbc.password=liujicheng@cnlive.COM | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +#smart.framework.jdbc.url=jdbc:mysql://localhost:3306/cnlive_live?autoReconnect=true&failOverReadOnly=false | ||
| 20 | +#smart.framework.jdbc.username=root | ||
| 21 | +#smart.framework.jdbc.password=root | ||
| 22 | + | ||
| 23 | +# | ||
| 24 | +smart.plugin.i18n.reloadable=true | ||
| 25 | +smart.plugin.rest.log=true | ||
| 26 | +smart.plugin.rest.jsonp=true | ||
| 27 | +smart.plugin.rest.jsonp.function=callback | ||
| 28 | + | ||
| 29 | +#smart.plugin.security.realms=custom | ||
| 30 | +#smart.plugin.security.custom.class=org.smart4j.sample.CustomSmartSecurity | ||
| 31 | +#smart.plugin.security.cacheable=true | ||
| 32 | + | ||
| 33 | +sample.upload_path=/www/upload/ | ||
| 34 | + | ||
| 35 | +mail.template_path=D:/apache-tomcat-7.0.61/webapps/cnlive_live_web/pages/mail.html | ||
| 36 | +website.url=http://localhost:8080/cnlive_live_web/ | ||
| 37 | +auth.enable=true | ||
| 38 | +auth.login.url=http://sso.staff.cnlive.com/CnliveSSO/login?from=mam-live&callbackUrl= | ||
| 39 | +auth.logout.url=http://sso.staff.cnlive.com/CnliveSSO/logOut?from=mam-live&callbackUrl= | ||
| 40 | +auth.userinfo.url=http://sso.staff.cnlive.com/CnliveSSO/getUserInfo?username= | ||
| 41 | + | ||
| 42 | 42 | ||
| 43 | \ No newline at end of file | 43 | \ No newline at end of file |
src/main/webapp/WEB-INF/web.xml
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | -<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
| 3 | - <servlet> | ||
| 4 | - <servlet-name>init_job</servlet-name> | ||
| 5 | - <servlet-class>com.cnlive.mz.live.servlet.InitServlet</servlet-class> | ||
| 6 | - <init-param> | ||
| 7 | - <param-name>shutdown-on-unload</param-name> | ||
| 8 | - <param-value>true</param-value> | ||
| 9 | - </init-param> | ||
| 10 | - <load-on-startup>2</load-on-startup> | ||
| 11 | - </servlet> | ||
| 12 | - <error-page> | ||
| 13 | - <error-code>500</error-code> | ||
| 14 | - <location>/live/epg/error500</location> | ||
| 15 | - </error-page> | 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> | ||
| 3 | + <servlet> | ||
| 4 | + <servlet-name>init_job</servlet-name> | ||
| 5 | + <servlet-class>com.cnlive.mz.live.servlet.InitServlet</servlet-class> | ||
| 6 | + <init-param> | ||
| 7 | + <param-name>shutdown-on-unload</param-name> | ||
| 8 | + <param-value>true</param-value> | ||
| 9 | + </init-param> | ||
| 10 | + <load-on-startup>2</load-on-startup> | ||
| 11 | + </servlet> | ||
| 12 | + <error-page> | ||
| 13 | + <error-code>500</error-code> | ||
| 14 | + <location>/live/epg/error500</location> | ||
| 15 | + </error-page> | ||
| 16 | </web-app> | 16 | </web-app> |
| 17 | \ No newline at end of file | 17 | \ No newline at end of file |
src/main/webapp/pages/check/check_management.jsp
| 1 | -<%@ page language="java" pageEncoding="UTF-8" | ||
| 2 | - deferredSyntaxAllowedAsLiteral="true"%> | ||
| 3 | -<%@ include file="/pages/common/taglib.jsp"%> | ||
| 4 | -<!DOCTYPE html> | ||
| 5 | -<html> | ||
| 6 | -<head> | ||
| 7 | -<meta charset="UTF-8"> | ||
| 8 | -<title>监审管理 | <f:message key="common.title" /></title> | ||
| 9 | -<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | ||
| 10 | - name='viewport'> | ||
| 11 | -<%@ include file="/pages/common/css.jsp"%> | ||
| 12 | -<style type="text/css"> | ||
| 13 | -body { | ||
| 14 | - font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 15 | - font-size: 12px; | ||
| 16 | - line-height: 20px; | ||
| 17 | - color: #000000; | ||
| 18 | -} | ||
| 19 | - | ||
| 20 | -#main_box { | ||
| 21 | - /*正文区大容器*/ | ||
| 22 | - width: 770px; | ||
| 23 | - margin-right: auto; | ||
| 24 | - margin-left: auto; | ||
| 25 | -} | ||
| 26 | - | ||
| 27 | -.row { | ||
| 28 | - /*定义每行*/ | ||
| 29 | - width: 100%; | ||
| 30 | - clear: both; | ||
| 31 | -} | ||
| 32 | - | ||
| 33 | -.left3 { | ||
| 34 | - /*用在五列布局上*/ | ||
| 35 | - border: 1px solid #00ff00; | ||
| 36 | - width: 25%; | ||
| 37 | - height: 150px; | ||
| 38 | - float: left; | ||
| 39 | -} | ||
| 40 | - | ||
| 41 | -.divleft { | ||
| 42 | - width: 24%; | ||
| 43 | - height: 600px; | ||
| 44 | - float: left; | ||
| 45 | -} | ||
| 46 | - | ||
| 47 | -.divright { | ||
| 48 | - width: 74%; | ||
| 49 | - height: 600px; | ||
| 50 | - float: right; | ||
| 51 | -} | ||
| 52 | - | ||
| 53 | -.leftTop { | ||
| 54 | - width: 100%; | ||
| 55 | - height: 340px; | ||
| 56 | - float: right; | ||
| 57 | -} | ||
| 58 | - | ||
| 59 | -.leftBootom { | ||
| 60 | - width: 100%; | ||
| 61 | - height: 250px; | ||
| 62 | - float: right; | ||
| 63 | -} | ||
| 64 | -</style> | ||
| 65 | -</head> | ||
| 66 | -<body class="skin-blue fixed "> | ||
| 67 | - <div class="wrapper"> | ||
| 68 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 69 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 70 | - <div class="content-wrapper"> | ||
| 71 | - <!-- Content Header (Page header) --> | ||
| 72 | - <section class="content-header"> | ||
| 73 | - <h1> | ||
| 74 | - 监审管理<small><a href="../../live/preload"><i | ||
| 75 | - class="fa fa-plus"></i>直播监审</a> </small> <small class="label label-warning" | ||
| 76 | - style="display: none" id="info_tab_span"><i | ||
| 77 | - class="fa fa-bell-o"></i></small> | ||
| 78 | - </h1> | ||
| 79 | - | ||
| 80 | - <ol class="breadcrumb"> | ||
| 81 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 82 | - <li class="active">监审管理</li> | ||
| 83 | - </ol> | ||
| 84 | - </section> | ||
| 85 | - <!-- Main content --> | ||
| 86 | - <section class="content"> | ||
| 87 | - <div class="row"> | ||
| 88 | - <div class="col-xs-12"> | ||
| 89 | - <div class="box box-warning"> | ||
| 90 | - <div class="box-header with-border"> | ||
| 91 | - <h3 class="box-title"></h3> | ||
| 92 | - <div class="box-tools"> | ||
| 93 | - <div class="input-group"> | ||
| 94 | - <div class="box-footer clearfix"> | ||
| 95 | - <center> | ||
| 96 | - <tag:pager3 id="product_pager" pager="${tLive}" /> | ||
| 97 | - </center> | ||
| 98 | - </div> | ||
| 99 | - </div> | ||
| 100 | - </div> | ||
| 101 | - </div> | ||
| 102 | - <!-- /.box-header --> | ||
| 103 | - <div class="box-body"> | ||
| 104 | - | ||
| 105 | - <div class="divleft"> | ||
| 106 | - <div class="leftTop" id="leftTopPlay"></div> | ||
| 107 | - <div class="leftBootom"> | ||
| 108 | - | ||
| 109 | - <table class="table table-bordered"> | ||
| 110 | - | ||
| 111 | - <h4>直播活动详情:</h4> | ||
| 112 | - | ||
| 113 | - <tr> | ||
| 114 | - <th width="30%">活动名称</th> | ||
| 115 | - <th id="live_name"></th> | ||
| 116 | - | ||
| 117 | - </tr> | ||
| 118 | - <tr> | ||
| 119 | - <th width="30%">开始时间</th> | ||
| 120 | - <th id="start_time"></th> | ||
| 121 | - </tr> | ||
| 122 | - <tr> | ||
| 123 | - <th width="30%">结束时间</th> | ||
| 124 | - <th id="end_time"></th> | ||
| 125 | - </tr> | ||
| 126 | - <tr> | ||
| 127 | - <th width="30%">活动简述</th> | ||
| 128 | - <th id="live_desper"></th> | ||
| 129 | - </tr> | ||
| 130 | - <tr> | ||
| 131 | - <th width="30%">live_url</th> | ||
| 132 | - <th id="live_url"></th> | ||
| 133 | - </tr> | ||
| 134 | - <tr> | ||
| 135 | - <th width="30%">活动简述</th> | ||
| 136 | - <th id=""></th> | ||
| 137 | - </tr> | ||
| 138 | - | ||
| 139 | - </table> | ||
| 140 | - </div> | ||
| 141 | - </div> | ||
| 142 | - <div class="divright"> | ||
| 143 | - <!--五列开始--> | ||
| 144 | - <div class="row"> | ||
| 145 | - <c:forEach var="item" items="${tLive.recordList}" | ||
| 146 | - varStatus="stat"> | ||
| 147 | - <!-- <div style="border: 1px solid #00ff00; width: 33%; height: 200px; background: #888; float: left;"> --> | ||
| 148 | - <div class="warp" | ||
| 149 | - style="border: 1px solid #00ff00; width: 33%; height: 203px; float: left;" | ||
| 150 | - id="divShow_${item.id}" | ||
| 151 | - onclick="getParam('${item.id}','${item.title}','${item.live_url}','${item.start_time}','${item.end_time}')"> | ||
| 152 | - <!-- <div class="warp" style="height: 24px; background: #;"> --> | ||
| 153 | - <button type="button" class="close" data-dismiss="modal" | ||
| 154 | - id="colseLive" onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | ||
| 155 | - <span aria-hidden="true">×</span><span | ||
| 156 | - class="sr-only">Close</span> | ||
| 157 | - </button> | ||
| 158 | - <h5 class="modal-title" id="myModalLabel">正在直播:${item.title}</h5> | ||
| 159 | - <!-- </div> --> | ||
| 160 | - <div id="a1_${item.id}" class="a1_class" | ||
| 161 | - style="height: 150px"> | ||
| 162 | - <input type="hidden" value='${item.id}' name="liveid" | ||
| 163 | - id="liveid"> | ||
| 164 | - <input type="hidden"value='${item.title}' name="title" id="title"> | ||
| 165 | - <input type="hidden" value='${item.live_url}' name="live_url" | ||
| 166 | - id="live_url_${item.id}"> | ||
| 167 | - <input type="hidden"value='${item.start_time}' name="start_time" | ||
| 168 | - id="start_time"> | ||
| 169 | - <input type="hidden"value='${item.end_time}' name="end_time" id="end_time"> | ||
| 170 | - <input type="hidden"value='${item.t_user_id}' name="t_user_id" id="t_user_${item.id}"> | ||
| 171 | - <%-- <h4 class="blue smaller"> | ||
| 172 | - <i class="icon-picture orange"></i>视频源 : ${item.title} | ||
| 173 | - </h4> --%> | ||
| 174 | - </div> | ||
| 175 | - <div class="" style="height: 30px;"> | ||
| 176 | - <input type="button" value="置顶" id="makeTop" | ||
| 177 | - onclick="makeTop(event,'${item.id}',this)"> <input | ||
| 178 | - type="button" value="关闭活动" id="closeLive" | ||
| 179 | - onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | ||
| 180 | - </div> | ||
| 181 | - </div> | ||
| 182 | - <!-- </div> --> | ||
| 183 | - </c:forEach> | ||
| 184 | - </div> | ||
| 185 | - </div> | ||
| 186 | - </div> | ||
| 187 | - | ||
| 188 | - </div> | ||
| 189 | - <!-- /.box-body --> | ||
| 190 | - </div> | ||
| 191 | - </div> | ||
| 192 | - </section> | ||
| 193 | - </div> | ||
| 194 | - </div> | ||
| 195 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 196 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 197 | - <script type="text/javascript" src="../../pages/check/js/ckplayer.js" charset="utf-8"></script> | ||
| 198 | - <script type="text/javascript" src="../../pages/check/js/offlights.js" charset="utf-8"></script> | ||
| 199 | - <script type="text/javascript"> | ||
| 200 | - var flashvars = { | ||
| 201 | - p : 1, | ||
| 202 | - e : 1, | ||
| 203 | - hl : '', | ||
| 204 | - ht : '20', | ||
| 205 | - }; | ||
| 206 | - var video = [ '' ]; | ||
| 207 | - var support = [ 'all' ]; | ||
| 208 | - CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, 290, | ||
| 209 | - video, flashvars, support); | ||
| 210 | - | ||
| 211 | - $(".a1_class #liveid").each(function() { | ||
| 212 | - var id = $(this).val(); | ||
| 213 | - var live_url = $('#live_url_' + id).val(); | ||
| 214 | - var t_user_id = $('#t_user_'+id).val(); | ||
| 215 | - | ||
| 216 | - var flashvars = { | ||
| 217 | - p : 1, | ||
| 218 | - e : 1, | ||
| 219 | - hl : live_url, | ||
| 220 | - ht : '20' | ||
| 221 | - }; | ||
| 222 | - var video = [live_url ]; | ||
| 223 | - var support = [ 'all' ]; | ||
| 224 | - CKobject.embedHTML5('a1_' + id, 'ckplayer_' + id,250, 153, video, flashvars, support); | ||
| 225 | - | ||
| 226 | - //m3u8 文件播放 | ||
| 227 | - /* var flashvars={ | ||
| 228 | - f:'http://localhost:8080/cnlive_live_web/static/assets/ckplayer/m3u8.swf', | ||
| 229 | - a:live_url, | ||
| 230 | - s:4, | ||
| 231 | - c:0, | ||
| 232 | - p:1 | ||
| 233 | - }; | ||
| 234 | - var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'}; | ||
| 235 | - var video=[live_url]; | ||
| 236 | - CKobject.embed('http://localhost:8080/cnlive_live_web/static/assets/ckplayer/ckplayer.swf', 'a1_' + id, 'ckplayer_' + id, 250, 153,false,flashvars,video,params); */ | ||
| 237 | - // rtmp 直播流播放。 | ||
| 238 | - /* var flashvars = { | ||
| 239 | - // f:'rtmp://localhost/live/livestreame', | ||
| 240 | - f :'http://cnlive.uplive.ks-cdn.com/live/'+t_user_id+'_'+id, | ||
| 241 | - c : 0 | ||
| 242 | - }; | ||
| 243 | - var video = [ 'http://cnlive.hlslive.ks-cdn.com/live/'+t_user_id+'_'+id+'/index.m3u8']; | ||
| 244 | - CKobject.embed('../../static/assets/ckplayer/ckplayer.swf','a1_' + id, 'ckplayer_' + id, 250, | ||
| 245 | - 153, false, flashvars, video); */ | ||
| 246 | - | ||
| 247 | - }); | ||
| 248 | - | ||
| 249 | - function getParam(id, name, live_url, start_time, end_time) { | ||
| 250 | - | ||
| 251 | - $("#live_name").html(name); | ||
| 252 | - $("#start_time").html(start_time); | ||
| 253 | - $("#end_time").html(end_time); | ||
| 254 | - $("#live_url").html(live_url); | ||
| 255 | - var flashvars = { | ||
| 256 | - p : 1, | ||
| 257 | - e : 1, | ||
| 258 | - hl : 'http://movie.ks.js.cn/flv/other/1_0.mp4', | ||
| 259 | - }; | ||
| 260 | - var video = [ live_url ]; | ||
| 261 | - var support = [ 'all' ]; | ||
| 262 | - CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, | ||
| 263 | - 290, video, flashvars, support); | ||
| 264 | - } | ||
| 265 | - function coseLive(e, id,user_id) { | ||
| 266 | - e.cancelBubble = true; | ||
| 267 | - $.ajax({ | ||
| 268 | - url : '../../check/close/' + id, | ||
| 269 | - type : 'post', | ||
| 270 | - datatype : "json", | ||
| 271 | - async : true, | ||
| 272 | - data:{"user_id":user_id}, | ||
| 273 | - error : function() { | ||
| 274 | - alert('关闭时发生错误!'); | ||
| 275 | - }, | ||
| 276 | - success : function(data) { | ||
| 277 | - location.href = '../../check/list/1'; | ||
| 278 | - alert("关闭成功"); | ||
| 279 | - } | ||
| 280 | - }); | ||
| 281 | - } | ||
| 282 | - /** | ||
| 283 | - 置顶 。。。 | ||
| 284 | - */ | ||
| 285 | - | ||
| 286 | - function makeTop(event, id, obj) { | ||
| 287 | - event.cancelBubble = true; | ||
| 288 | - $(obj.parentElement.parentElement).insertBefore($('.warp').first()) | ||
| 289 | - alert(obj.parentElement.parentElement); | ||
| 290 | - }; | ||
| 291 | - </script> | ||
| 292 | -</body> | ||
| 293 | -</html> | 1 | +<%@ page language="java" pageEncoding="UTF-8" |
| 2 | + deferredSyntaxAllowedAsLiteral="true"%> | ||
| 3 | +<%@ include file="/pages/common/taglib.jsp"%> | ||
| 4 | +<!DOCTYPE html> | ||
| 5 | +<html> | ||
| 6 | +<head> | ||
| 7 | +<meta charset="UTF-8"> | ||
| 8 | +<title>监审管理 | <f:message key="common.title" /></title> | ||
| 9 | +<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | ||
| 10 | + name='viewport'> | ||
| 11 | +<%@ include file="/pages/common/css.jsp"%> | ||
| 12 | +<style type="text/css"> | ||
| 13 | +body { | ||
| 14 | + font-family: Verdana, Arial, Helvetica, sans-serif; | ||
| 15 | + font-size: 12px; | ||
| 16 | + line-height: 20px; | ||
| 17 | + color: #000000; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +#main_box { | ||
| 21 | + /*正文区大容器*/ | ||
| 22 | + width: 770px; | ||
| 23 | + margin-right: auto; | ||
| 24 | + margin-left: auto; | ||
| 25 | +} | ||
| 26 | + | ||
| 27 | +.row { | ||
| 28 | + /*定义每行*/ | ||
| 29 | + width: 100%; | ||
| 30 | + clear: both; | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +.left3 { | ||
| 34 | + /*用在五列布局上*/ | ||
| 35 | + border: 1px solid #00ff00; | ||
| 36 | + width: 25%; | ||
| 37 | + height: 150px; | ||
| 38 | + float: left; | ||
| 39 | +} | ||
| 40 | + | ||
| 41 | +.divleft { | ||
| 42 | + width: 24%; | ||
| 43 | + height: 600px; | ||
| 44 | + float: left; | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +.divright { | ||
| 48 | + width: 74%; | ||
| 49 | + height: 600px; | ||
| 50 | + float: right; | ||
| 51 | +} | ||
| 52 | + | ||
| 53 | +.leftTop { | ||
| 54 | + width: 100%; | ||
| 55 | + height: 340px; | ||
| 56 | + float: right; | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +.leftBootom { | ||
| 60 | + width: 100%; | ||
| 61 | + height: 250px; | ||
| 62 | + float: right; | ||
| 63 | +} | ||
| 64 | +</style> | ||
| 65 | +</head> | ||
| 66 | +<body class="skin-blue fixed "> | ||
| 67 | + <div class="wrapper"> | ||
| 68 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 69 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 70 | + <div class="content-wrapper"> | ||
| 71 | + <!-- Content Header (Page header) --> | ||
| 72 | + <section class="content-header"> | ||
| 73 | + <h1> | ||
| 74 | + 监审管理<small><a href="../../live/preload"><i | ||
| 75 | + class="fa fa-plus"></i>直播监审</a> </small> <small class="label label-warning" | ||
| 76 | + style="display: none" id="info_tab_span"><i | ||
| 77 | + class="fa fa-bell-o"></i></small> | ||
| 78 | + </h1> | ||
| 79 | + | ||
| 80 | + <ol class="breadcrumb"> | ||
| 81 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 82 | + <li class="active">监审管理</li> | ||
| 83 | + </ol> | ||
| 84 | + </section> | ||
| 85 | + <!-- Main content --> | ||
| 86 | + <section class="content"> | ||
| 87 | + <div class="row"> | ||
| 88 | + <div class="col-xs-12"> | ||
| 89 | + <div class="box box-warning"> | ||
| 90 | + <div class="box-header with-border"> | ||
| 91 | + <h3 class="box-title"></h3> | ||
| 92 | + <div class="box-tools"> | ||
| 93 | + <div class="input-group"> | ||
| 94 | + <div class="box-footer clearfix"> | ||
| 95 | + <center> | ||
| 96 | + <tag:pager3 id="product_pager" pager="${tLive}" /> | ||
| 97 | + </center> | ||
| 98 | + </div> | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + <!-- /.box-header --> | ||
| 103 | + <div class="box-body"> | ||
| 104 | + | ||
| 105 | + <div class="divleft"> | ||
| 106 | + <div class="leftTop" id="leftTopPlay"></div> | ||
| 107 | + <div class="leftBootom"> | ||
| 108 | + | ||
| 109 | + <table class="table table-bordered"> | ||
| 110 | + | ||
| 111 | + <h4>直播活动详情:</h4> | ||
| 112 | + | ||
| 113 | + <tr> | ||
| 114 | + <th width="30%">活动名称</th> | ||
| 115 | + <th id="live_name"></th> | ||
| 116 | + | ||
| 117 | + </tr> | ||
| 118 | + <tr> | ||
| 119 | + <th width="30%">开始时间</th> | ||
| 120 | + <th id="start_time"></th> | ||
| 121 | + </tr> | ||
| 122 | + <tr> | ||
| 123 | + <th width="30%">结束时间</th> | ||
| 124 | + <th id="end_time"></th> | ||
| 125 | + </tr> | ||
| 126 | + <tr> | ||
| 127 | + <th width="30%">活动简述</th> | ||
| 128 | + <th id="live_desper"></th> | ||
| 129 | + </tr> | ||
| 130 | + <tr> | ||
| 131 | + <th width="30%">live_url</th> | ||
| 132 | + <th id="live_url"></th> | ||
| 133 | + </tr> | ||
| 134 | + <tr> | ||
| 135 | + <th width="30%">活动简述</th> | ||
| 136 | + <th id=""></th> | ||
| 137 | + </tr> | ||
| 138 | + | ||
| 139 | + </table> | ||
| 140 | + </div> | ||
| 141 | + </div> | ||
| 142 | + <div class="divright"> | ||
| 143 | + <!--五列开始--> | ||
| 144 | + <div class="row"> | ||
| 145 | + <c:forEach var="item" items="${tLive.recordList}" | ||
| 146 | + varStatus="stat"> | ||
| 147 | + <!-- <div style="border: 1px solid #00ff00; width: 33%; height: 200px; background: #888; float: left;"> --> | ||
| 148 | + <div class="warp" | ||
| 149 | + style="border: 1px solid #00ff00; width: 33%; height: 203px; float: left;" | ||
| 150 | + id="divShow_${item.id}" | ||
| 151 | + onclick="getParam('${item.id}','${item.title}','${item.live_url}','${item.start_time}','${item.end_time}')"> | ||
| 152 | + <!-- <div class="warp" style="height: 24px; background: #;"> --> | ||
| 153 | + <button type="button" class="close" data-dismiss="modal" | ||
| 154 | + id="colseLive" onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | ||
| 155 | + <span aria-hidden="true">×</span><span | ||
| 156 | + class="sr-only">Close</span> | ||
| 157 | + </button> | ||
| 158 | + <h5 class="modal-title" id="myModalLabel">正在直播:${item.title}</h5> | ||
| 159 | + <!-- </div> --> | ||
| 160 | + <div id="a1_${item.id}" class="a1_class" | ||
| 161 | + style="height: 150px"> | ||
| 162 | + <input type="hidden" value='${item.id}' name="liveid" | ||
| 163 | + id="liveid"> | ||
| 164 | + <input type="hidden"value='${item.title}' name="title" id="title"> | ||
| 165 | + <input type="hidden" value='${item.live_url}' name="live_url" | ||
| 166 | + id="live_url_${item.id}"> | ||
| 167 | + <input type="hidden"value='${item.start_time}' name="start_time" | ||
| 168 | + id="start_time"> | ||
| 169 | + <input type="hidden"value='${item.end_time}' name="end_time" id="end_time"> | ||
| 170 | + <input type="hidden"value='${item.t_user_id}' name="t_user_id" id="t_user_${item.id}"> | ||
| 171 | + <%-- <h4 class="blue smaller"> | ||
| 172 | + <i class="icon-picture orange"></i>视频源 : ${item.title} | ||
| 173 | + </h4> --%> | ||
| 174 | + </div> | ||
| 175 | + <div class="" style="height: 30px;"> | ||
| 176 | + <input type="button" value="置顶" id="makeTop" | ||
| 177 | + onclick="makeTop(event,'${item.id}',this)"> <input | ||
| 178 | + type="button" value="关闭活动" id="closeLive" | ||
| 179 | + onclick="coseLive(event,'${item.id}','${item.t_user_id}')"> | ||
| 180 | + </div> | ||
| 181 | + </div> | ||
| 182 | + <!-- </div> --> | ||
| 183 | + </c:forEach> | ||
| 184 | + </div> | ||
| 185 | + </div> | ||
| 186 | + </div> | ||
| 187 | + | ||
| 188 | + </div> | ||
| 189 | + <!-- /.box-body --> | ||
| 190 | + </div> | ||
| 191 | + </div> | ||
| 192 | + </section> | ||
| 193 | + </div> | ||
| 194 | + </div> | ||
| 195 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 196 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 197 | + <script type="text/javascript" src="../../pages/check/js/ckplayer.js" charset="utf-8"></script> | ||
| 198 | + <script type="text/javascript" src="../../pages/check/js/offlights.js" charset="utf-8"></script> | ||
| 199 | + <script type="text/javascript"> | ||
| 200 | + var flashvars = { | ||
| 201 | + p : 1, | ||
| 202 | + e : 1, | ||
| 203 | + hl : '', | ||
| 204 | + ht : '20', | ||
| 205 | + }; | ||
| 206 | + var video = [ '' ]; | ||
| 207 | + var support = [ 'all' ]; | ||
| 208 | + CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, 290, | ||
| 209 | + video, flashvars, support); | ||
| 210 | + | ||
| 211 | + $(".a1_class #liveid").each(function() { | ||
| 212 | + var id = $(this).val(); | ||
| 213 | + var live_url = $('#live_url_' + id).val(); | ||
| 214 | + var t_user_id = $('#t_user_'+id).val(); | ||
| 215 | + | ||
| 216 | + var flashvars = { | ||
| 217 | + p : 1, | ||
| 218 | + e : 1, | ||
| 219 | + hl : live_url, | ||
| 220 | + ht : '20' | ||
| 221 | + }; | ||
| 222 | + var video = [live_url ]; | ||
| 223 | + var support = [ 'all' ]; | ||
| 224 | + CKobject.embedHTML5('a1_' + id, 'ckplayer_' + id,250, 153, video, flashvars, support); | ||
| 225 | + | ||
| 226 | + //m3u8 文件播放 | ||
| 227 | + /* var flashvars={ | ||
| 228 | + f:'http://localhost:8080/cnlive_live_web/static/assets/ckplayer/m3u8.swf', | ||
| 229 | + a:live_url, | ||
| 230 | + s:4, | ||
| 231 | + c:0, | ||
| 232 | + p:1 | ||
| 233 | + }; | ||
| 234 | + var params={bgcolor:'#FFF',allowFullScreen:true,allowScriptAccess:'always',wmode:'transparent'}; | ||
| 235 | + var video=[live_url]; | ||
| 236 | + CKobject.embed('http://localhost:8080/cnlive_live_web/static/assets/ckplayer/ckplayer.swf', 'a1_' + id, 'ckplayer_' + id, 250, 153,false,flashvars,video,params); */ | ||
| 237 | + // rtmp 直播流播放。 | ||
| 238 | + /* var flashvars = { | ||
| 239 | + // f:'rtmp://localhost/live/livestreame', | ||
| 240 | + f :'http://cnlive.uplive.ks-cdn.com/live/'+t_user_id+'_'+id, | ||
| 241 | + c : 0 | ||
| 242 | + }; | ||
| 243 | + var video = [ 'http://cnlive.hlslive.ks-cdn.com/live/'+t_user_id+'_'+id+'/index.m3u8']; | ||
| 244 | + CKobject.embed('../../static/assets/ckplayer/ckplayer.swf','a1_' + id, 'ckplayer_' + id, 250, | ||
| 245 | + 153, false, flashvars, video); */ | ||
| 246 | + | ||
| 247 | + }); | ||
| 248 | + | ||
| 249 | + function getParam(id, name, live_url, start_time, end_time) { | ||
| 250 | + | ||
| 251 | + $("#live_name").html(name); | ||
| 252 | + $("#start_time").html(start_time); | ||
| 253 | + $("#end_time").html(end_time); | ||
| 254 | + $("#live_url").html(live_url); | ||
| 255 | + var flashvars = { | ||
| 256 | + p : 1, | ||
| 257 | + e : 1, | ||
| 258 | + hl : 'http://movie.ks.js.cn/flv/other/1_0.mp4', | ||
| 259 | + }; | ||
| 260 | + var video = [ live_url ]; | ||
| 261 | + var support = [ 'all' ]; | ||
| 262 | + CKobject.embedHTML5('leftTopPlay', 'ckplayer_leftTopPlay', 250, | ||
| 263 | + 290, video, flashvars, support); | ||
| 264 | + } | ||
| 265 | + function coseLive(e, id,user_id) { | ||
| 266 | + e.cancelBubble = true; | ||
| 267 | + $.ajax({ | ||
| 268 | + url : '../../check/close/' + id, | ||
| 269 | + type : 'post', | ||
| 270 | + datatype : "json", | ||
| 271 | + async : true, | ||
| 272 | + data:{"user_id":user_id}, | ||
| 273 | + error : function() { | ||
| 274 | + alert('关闭时发生错误!'); | ||
| 275 | + }, | ||
| 276 | + success : function(data) { | ||
| 277 | + location.href = '../../check/list/1'; | ||
| 278 | + alert("关闭成功"); | ||
| 279 | + } | ||
| 280 | + }); | ||
| 281 | + } | ||
| 282 | + /** | ||
| 283 | + 置顶 。。。 | ||
| 284 | + */ | ||
| 285 | + | ||
| 286 | + function makeTop(event, id, obj) { | ||
| 287 | + event.cancelBubble = true; | ||
| 288 | + $(obj.parentElement.parentElement).insertBefore($('.warp').first()) | ||
| 289 | + alert(obj.parentElement.parentElement); | ||
| 290 | + }; | ||
| 291 | + </script> | ||
| 292 | +</body> | ||
| 293 | +</html> |
src/main/webapp/pages/check/monitor.jsp
| 1 | -<%@ page language="java" pageEncoding="UTF-8"%> | ||
| 2 | -<%@ include file="/pages/common/taglib.jsp"%> | ||
| 3 | -<!DOCTYPE html> | ||
| 4 | -<html> | ||
| 5 | -<head> | ||
| 6 | -<style type="text/css"> | ||
| 7 | -.text-overflow { | ||
| 8 | - display: block; /*内联对象需加*/ | ||
| 9 | - width: 31em; | ||
| 10 | - word-break: keep-all; /* 不换行 */ | ||
| 11 | - white-space: nowrap; /* 不换行 */ | ||
| 12 | - overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */ | ||
| 13 | - text-overflow: ellipsis; | ||
| 14 | - /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ | ||
| 15 | -} | ||
| 16 | -</style> | ||
| 17 | -<meta charset="UTF-8"> | ||
| 18 | -<title>监审管理 |<f:message key="common.title" /></title> | ||
| 19 | -<meta | ||
| 20 | - content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | ||
| 21 | - name='viewport'> | ||
| 22 | -<%@ include file="/pages/common/css.jsp"%> | ||
| 23 | -<script src="${BASE}/static/assets/cnlive/js/check.js"></script> | ||
| 24 | -<script src="${BASE}/static/assets/jwplayer/jwplayer.js"></script> | ||
| 25 | -<script src="${BASE}/static/assets/jwplayer/jwplayer.html5.js"></script> | ||
| 26 | -<script type="text/javascript">jwplayer.key="MGAzpXRYxGnaVXhH8jSdKXzDe7ucAAvZGWggIA==";</script> | ||
| 27 | - | ||
| 28 | -</head> | ||
| 29 | -<body class="skin-blue sidebar-collapse sidebar-mini"> | ||
| 30 | - <div class="wrapper"> | ||
| 31 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 32 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 33 | - <!-- Content Wrapper. Contains page content --> | ||
| 34 | - <div class="content-wrapper"> | ||
| 35 | - <!-- Content Header (Page header) --> | ||
| 36 | - <section class="content-header"> | ||
| 37 | - <h1> | ||
| 38 | - 监审管理 <small>monitor panel</small> | ||
| 39 | - </h1> | ||
| 40 | - <ol class="breadcrumb"> | ||
| 41 | - <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 42 | - <li class="active">监审管理</li> | ||
| 43 | - </ol> | ||
| 44 | - </section> | ||
| 45 | - <section class="content"> | ||
| 46 | - <div class="row"> | ||
| 47 | - <div class="col-md-4"> | ||
| 48 | - <div class="box box-solid"> | ||
| 49 | - <div class="box-header with-border"> | ||
| 50 | - <h3 class="box-title">监控平台</h3> | ||
| 51 | - </div> | ||
| 52 | - <div class="box-body no-padding"> | ||
| 53 | - <div class="col-md-12" id="divShow_${item.id}"> | ||
| 54 | - <div class="box box-success box-solid"> | ||
| 55 | - <div class="box-header with-border"> | ||
| 56 | - <div class="text-overflow"> | ||
| 57 | - <h3 class="box-title" id="hidId">${item.title}</h3> | ||
| 58 | - </div> | ||
| 59 | - <div class="box-tools pull-right"> | ||
| 60 | - <button class="btn btn-sm" id="play_button_${item.id}" | ||
| 61 | - onclick="play(${item.id});">重新载入</button> | ||
| 62 | - </div> | ||
| 63 | - </div> | ||
| 64 | - <div id="playId" class="box-body"> | ||
| 65 | - <%-- <input type="hidden" name="play_url_${item.id}" | ||
| 66 | - id="play_url_${item.id}" value="${item.live_url}" /> <span | ||
| 67 | - class="mailbox-attachment-icon has-img" | ||
| 68 | - id="player_span_${item.id}"> <img | ||
| 69 | - src="../../static/assets/dist/img/photo2.png" | ||
| 70 | - alt="Attachment"> | ||
| 71 | - </span> --%> | ||
| 72 | - </div> | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - </div> | ||
| 76 | - </div> | ||
| 77 | - <div class="box-header with-border"> | ||
| 78 | - <h3 class="box-title">直播信息:</h3> | ||
| 79 | - </div> | ||
| 80 | - <div class="box-body no-padding"> | ||
| 81 | - <ul class="nav nav-pills nav-stacked"> | ||
| 82 | - <li id="userId"><a><i class="fa fa-file-text-o"></i>用户ID:</a></li> | ||
| 83 | - <li id="title"><a><i class="fa fa-file-text-o"></i>TITLE: | ||
| 84 | - </a></li> | ||
| 85 | - <li id="startTime"><a><i class="fa fa-file-text-o"></i>开播时间: | ||
| 86 | - </a></li> | ||
| 87 | - </ul> | ||
| 88 | - </div> | ||
| 89 | - </div> | ||
| 90 | - <div class="col-md-8"> | ||
| 91 | - <div class="box box-primary"> | ||
| 92 | - <div class="box-header with-border"> | ||
| 93 | - <h3 class="box-title">监控</h3> | ||
| 94 | - <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 95 | - </div> | ||
| 96 | - <div class="box-body no-padding"> | ||
| 97 | - <div class="row"> | ||
| 98 | - <c:forEach var="item" items="${tLive.recordList}" | ||
| 99 | - varStatus="stat"> | ||
| 100 | - <div class="col-md-3" id="divShow_${item.id}"> | ||
| 101 | - <div | ||
| 102 | - class="box ${item.check_sort eq null ? 'box-warning':'box-success'} box-solid"> | ||
| 103 | - <div class="box-header with-border"> | ||
| 104 | - <div class="text-overflow"> | ||
| 105 | - <h3 class="box-title">${item.title}</h3> | ||
| 106 | - </div> | ||
| 107 | - <div class="box-tools pull-right"> | ||
| 108 | - <button class="btn btn-sm btn-danger" | ||
| 109 | - onclick="changePlay('${item.id}','${item.live_url}','${item.t_user_id}','${item.title}','${item.start_time}');">左</button> | ||
| 110 | - <button class="btn btn-sm btn-danger" | ||
| 111 | - onclick="to_pass(${item.id});">过</button> | ||
| 112 | - <button class="btn btn-sm btn-danger" | ||
| 113 | - onclick="to_top(${item.id});">顶</button> | ||
| 114 | - <button class="btn btn-sm btn-danger" | ||
| 115 | - onclick="play_close('${item.id}','${item.live_url}','${item.uuid}');">断</button> | ||
| 116 | - </div> | ||
| 117 | - </div> | ||
| 118 | - <div class="box-body"> | ||
| 119 | - <input type="hidden" name="play_url_${item.id}" | ||
| 120 | - id="play_url_${item.id}" value="${item.live_url}" /> <span | ||
| 121 | - class="mailbox-attachment-icon has-img" | ||
| 122 | - id="player_span_${item.id}"> <img | ||
| 123 | - src="../../static/assets/dist/img/photo2.png" | ||
| 124 | - alt="Attachment"> | ||
| 125 | - </span> | ||
| 126 | - </div> | ||
| 127 | - </div> | ||
| 128 | - </div> | ||
| 129 | - </c:forEach> | ||
| 130 | - </div> | ||
| 131 | - </div> | ||
| 132 | - </div> | ||
| 133 | - </div> | ||
| 134 | - </div> | ||
| 135 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 136 | - <script src="${BASE}/static/assets/cnlive/js/player_m3u8.js"></script> | ||
| 137 | - </section> | ||
| 138 | - </div> | ||
| 139 | - </div> | ||
| 140 | -</body> | ||
| 141 | -<script type="text/javascript"> | ||
| 142 | -jwplayer("playId").setup({ | ||
| 143 | - file: "", | ||
| 144 | - height: 260, | ||
| 145 | - image: "/assets/myVideo.jpg", | ||
| 146 | - autostart:true, | ||
| 147 | - rtmp: { | ||
| 148 | - bufferlength: 0.1 | ||
| 149 | - }, | ||
| 150 | - width: 370 | ||
| 151 | -}); | ||
| 152 | -</script> | 1 | +<%@ page language="java" pageEncoding="UTF-8"%> |
| 2 | +<%@ include file="/pages/common/taglib.jsp"%> | ||
| 3 | +<!DOCTYPE html> | ||
| 4 | +<html> | ||
| 5 | +<head> | ||
| 6 | +<style type="text/css"> | ||
| 7 | +.text-overflow { | ||
| 8 | + display: block; /*内联对象需加*/ | ||
| 9 | + width: 31em; | ||
| 10 | + word-break: keep-all; /* 不换行 */ | ||
| 11 | + white-space: nowrap; /* 不换行 */ | ||
| 12 | + overflow: hidden; /* 内容超出宽度时隐藏超出部分的内容 */ | ||
| 13 | + text-overflow: ellipsis; | ||
| 14 | + /* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ | ||
| 15 | +} | ||
| 16 | +</style> | ||
| 17 | +<meta charset="UTF-8"> | ||
| 18 | +<title>监审管理 |<f:message key="common.title" /></title> | ||
| 19 | +<meta | ||
| 20 | + content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' | ||
| 21 | + name='viewport'> | ||
| 22 | +<%@ include file="/pages/common/css.jsp"%> | ||
| 23 | +<script src="${BASE}/static/assets/cnlive/js/check.js"></script> | ||
| 24 | +<script src="${BASE}/static/assets/jwplayer/jwplayer.js"></script> | ||
| 25 | +<script src="${BASE}/static/assets/jwplayer/jwplayer.html5.js"></script> | ||
| 26 | +<script type="text/javascript">jwplayer.key="MGAzpXRYxGnaVXhH8jSdKXzDe7ucAAvZGWggIA==";</script> | ||
| 27 | + | ||
| 28 | +</head> | ||
| 29 | +<body class="skin-blue sidebar-collapse sidebar-mini"> | ||
| 30 | + <div class="wrapper"> | ||
| 31 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 32 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 33 | + <!-- Content Wrapper. Contains page content --> | ||
| 34 | + <div class="content-wrapper"> | ||
| 35 | + <!-- Content Header (Page header) --> | ||
| 36 | + <section class="content-header"> | ||
| 37 | + <h1> | ||
| 38 | + 监审管理 <small>monitor panel</small> | ||
| 39 | + </h1> | ||
| 40 | + <ol class="breadcrumb"> | ||
| 41 | + <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 42 | + <li class="active">监审管理</li> | ||
| 43 | + </ol> | ||
| 44 | + </section> | ||
| 45 | + <section class="content"> | ||
| 46 | + <div class="row"> | ||
| 47 | + <div class="col-md-4"> | ||
| 48 | + <div class="box box-solid"> | ||
| 49 | + <div class="box-header with-border"> | ||
| 50 | + <h3 class="box-title">监控平台</h3> | ||
| 51 | + </div> | ||
| 52 | + <div class="box-body no-padding"> | ||
| 53 | + <div class="col-md-12" id="divShow_${item.id}"> | ||
| 54 | + <div class="box box-success box-solid"> | ||
| 55 | + <div class="box-header with-border"> | ||
| 56 | + <div class="text-overflow"> | ||
| 57 | + <h3 class="box-title" id="hidId">${item.title}</h3> | ||
| 58 | + </div> | ||
| 59 | + <div class="box-tools pull-right"> | ||
| 60 | + <button class="btn btn-sm" id="play_button_${item.id}" | ||
| 61 | + onclick="play(${item.id});">重新载入</button> | ||
| 62 | + </div> | ||
| 63 | + </div> | ||
| 64 | + <div id="playId" class="box-body"> | ||
| 65 | + <%-- <input type="hidden" name="play_url_${item.id}" | ||
| 66 | + id="play_url_${item.id}" value="${item.live_url}" /> <span | ||
| 67 | + class="mailbox-attachment-icon has-img" | ||
| 68 | + id="player_span_${item.id}"> <img | ||
| 69 | + src="../../static/assets/dist/img/photo2.png" | ||
| 70 | + alt="Attachment"> | ||
| 71 | + </span> --%> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + <div class="box-header with-border"> | ||
| 78 | + <h3 class="box-title">直播信息:</h3> | ||
| 79 | + </div> | ||
| 80 | + <div class="box-body no-padding"> | ||
| 81 | + <ul class="nav nav-pills nav-stacked"> | ||
| 82 | + <li id="userId"><a><i class="fa fa-file-text-o"></i>用户ID:</a></li> | ||
| 83 | + <li id="title"><a><i class="fa fa-file-text-o"></i>TITLE: | ||
| 84 | + </a></li> | ||
| 85 | + <li id="startTime"><a><i class="fa fa-file-text-o"></i>开播时间: | ||
| 86 | + </a></li> | ||
| 87 | + </ul> | ||
| 88 | + </div> | ||
| 89 | + </div> | ||
| 90 | + <div class="col-md-8"> | ||
| 91 | + <div class="box box-primary"> | ||
| 92 | + <div class="box-header with-border"> | ||
| 93 | + <h3 class="box-title">监控</h3> | ||
| 94 | + <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 95 | + </div> | ||
| 96 | + <div class="box-body no-padding"> | ||
| 97 | + <div class="row"> | ||
| 98 | + <c:forEach var="item" items="${tLive.recordList}" | ||
| 99 | + varStatus="stat"> | ||
| 100 | + <div class="col-md-3" id="divShow_${item.id}"> | ||
| 101 | + <div | ||
| 102 | + class="box ${item.check_sort eq null ? 'box-warning':'box-success'} box-solid"> | ||
| 103 | + <div class="box-header with-border"> | ||
| 104 | + <div class="text-overflow"> | ||
| 105 | + <h3 class="box-title">${item.title}</h3> | ||
| 106 | + </div> | ||
| 107 | + <div class="box-tools pull-right"> | ||
| 108 | + <button class="btn btn-sm btn-danger" | ||
| 109 | + onclick="changePlay('${item.id}','${item.live_url}','${item.t_user_id}','${item.title}','${item.start_time}');">左</button> | ||
| 110 | + <button class="btn btn-sm btn-danger" | ||
| 111 | + onclick="to_pass(${item.id});">过</button> | ||
| 112 | + <button class="btn btn-sm btn-danger" | ||
| 113 | + onclick="to_top(${item.id});">顶</button> | ||
| 114 | + <button class="btn btn-sm btn-danger" | ||
| 115 | + onclick="play_close('${item.id}','${item.live_url}','${item.uuid}');">断</button> | ||
| 116 | + </div> | ||
| 117 | + </div> | ||
| 118 | + <div class="box-body"> | ||
| 119 | + <input type="hidden" name="play_url_${item.id}" | ||
| 120 | + id="play_url_${item.id}" value="${item.live_url}" /> <span | ||
| 121 | + class="mailbox-attachment-icon has-img" | ||
| 122 | + id="player_span_${item.id}"> <img | ||
| 123 | + src="../../static/assets/dist/img/photo2.png" | ||
| 124 | + alt="Attachment"> | ||
| 125 | + </span> | ||
| 126 | + </div> | ||
| 127 | + </div> | ||
| 128 | + </div> | ||
| 129 | + </c:forEach> | ||
| 130 | + </div> | ||
| 131 | + </div> | ||
| 132 | + </div> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 136 | + <script src="${BASE}/static/assets/cnlive/js/player_m3u8.js"></script> | ||
| 137 | + </section> | ||
| 138 | + </div> | ||
| 139 | + </div> | ||
| 140 | +</body> | ||
| 141 | +<script type="text/javascript"> | ||
| 142 | +jwplayer("playId").setup({ | ||
| 143 | + file: "", | ||
| 144 | + height: 260, | ||
| 145 | + image: "/assets/myVideo.jpg", | ||
| 146 | + autostart:true, | ||
| 147 | + rtmp: { | ||
| 148 | + bufferlength: 0.1 | ||
| 149 | + }, | ||
| 150 | + width: 370 | ||
| 151 | +}); | ||
| 152 | +</script> | ||
| 153 | </html> | 153 | </html> |
| 154 | \ No newline at end of file | 154 | \ No newline at end of file |
src/main/webapp/pages/common/js.jsp
| 1 | -<%@ page language="java" pageEncoding="utf-8"%> | ||
| 2 | - | ||
| 3 | -<script src="${BASE}/static/assets/plugins/jQuery/jQuery-2.1.4.min.js"></script> | ||
| 4 | -<!-- Bootstrap 3.3.2 JS --> | ||
| 5 | -<script src="${BASE}/static/assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> | ||
| 6 | -<!-- Slimscroll --> | ||
| 7 | -<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | ||
| 8 | -<!-- FastClick --> | ||
| 9 | -<script src='${BASE}/static/assets/plugins/fastclick/fastclick.min.js'></script> | ||
| 10 | -<!-- AdminLTE App --> | ||
| 11 | -<script src="${BASE}/static/assets/dist/js/app.min.js" type="text/javascript"></script> | ||
| 12 | -<!-- AdminLTE for demo purposes --> | ||
| 13 | -<script src="${BASE}/static/assets/dist/js/demo.js" type="text/javascript"></script> | ||
| 14 | -<script src="${BASE}/static/assets/plugins/iCheck/1.0.2/icheck.js?v=1.0.2"></script> | ||
| 15 | -<!-- InputMask --> | ||
| 16 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script> | ||
| 17 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script> | ||
| 18 | -<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script> | ||
| 19 | -<!-- date-range-picker --> | ||
| 20 | -<script src="${BASE}/static/assets/third-party/moment.min.js" type="text/javascript"></script> | ||
| 21 | -<script src="${BASE}/static/assets/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script> | ||
| 22 | -<!-- bootstrap time picker --> | ||
| 23 | -<script src="${BASE}/static/assets/plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script> | ||
| 24 | -<!-- iCheck 1.0.1 --> | ||
| 25 | -<script src="${BASE}/static/assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script> | ||
| 26 | -<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | ||
| 27 | - | ||
| 28 | -<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.css" /> | ||
| 29 | -<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.min.css" /> | ||
| 30 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput.js"></script> | ||
| 31 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 32 | -<script src="${BASE}/static/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 33 | - | ||
| 34 | -<!-------直播系统所需 js 文件--> | ||
| 35 | -<script src="${BASE}/static/assets/cnlive/js/all_live.js" type="text/javascript"></script> | ||
| 36 | -<script src="${BASE}/static/assets/cnlive/js/live.js" type="text/javascript"></script> | ||
| 37 | -<script src="${BASE}/static/assets/cnlive/js/room.js" type="text/javascript"></script> | ||
| 38 | -<script src="${BASE}/static/assets/cnlive/js/channel.js" type="text/javascript"></script> | ||
| 39 | -<script src="${BASE}/static/assets/cnlive/js/signal.js" type="text/javascript"></script> | ||
| 40 | -<script src="${BASE}/static/assets/cnlive/js/wowza.js" type="text/javascript"></script> | ||
| 41 | -<script src="${BASE}/static/assets/cnlive/js/activity.js" type="text/javascript"></script> | ||
| 42 | -<script src="${BASE}/static/assets/cnlive/js/ajax_rest.js" type="text/javascript"></script> | ||
| 43 | -<!-- cnlive validate --> | ||
| 44 | -<script src="${BASE}/static/assets/plugins/validate/jquery.form.js"></script> | ||
| 45 | -<script src="${BASE}/static/assets/plugins/validate/jquery.metadata.js"></script> | ||
| 46 | -<script src="${BASE}/static/assets/plugins/validate/jquery.validate.js"></script> | ||
| 47 | - | ||
| 48 | -<script src="${BASE}/static/assets/plugins/easytree/easyTree.js"></script> | ||
| 49 | -<script src="${BASE}/static/assets/cnlive/js/common.js"></script> | ||
| 50 | -<script src="${BASE}/static/assets/cnlive/js/global.js"></script> | ||
| 51 | -<script type="text/javascript"> | ||
| 52 | - BASE = '${BASE}'; | 1 | +<%@ page language="java" pageEncoding="utf-8"%> |
| 2 | + | ||
| 3 | +<script src="${BASE}/static/assets/plugins/jQuery/jQuery-2.1.4.min.js"></script> | ||
| 4 | +<!-- Bootstrap 3.3.2 JS --> | ||
| 5 | +<script src="${BASE}/static/assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> | ||
| 6 | +<!-- Slimscroll --> | ||
| 7 | +<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | ||
| 8 | +<!-- FastClick --> | ||
| 9 | +<script src='${BASE}/static/assets/plugins/fastclick/fastclick.min.js'></script> | ||
| 10 | +<!-- AdminLTE App --> | ||
| 11 | +<script src="${BASE}/static/assets/dist/js/app.min.js" type="text/javascript"></script> | ||
| 12 | +<!-- AdminLTE for demo purposes --> | ||
| 13 | +<script src="${BASE}/static/assets/dist/js/demo.js" type="text/javascript"></script> | ||
| 14 | +<script src="${BASE}/static/assets/plugins/iCheck/1.0.2/icheck.js?v=1.0.2"></script> | ||
| 15 | +<!-- InputMask --> | ||
| 16 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script> | ||
| 17 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script> | ||
| 18 | +<script src="${BASE}/static/assets/plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script> | ||
| 19 | +<!-- date-range-picker --> | ||
| 20 | +<script src="${BASE}/static/assets/third-party/moment.min.js" type="text/javascript"></script> | ||
| 21 | +<script src="${BASE}/static/assets/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script> | ||
| 22 | +<!-- bootstrap time picker --> | ||
| 23 | +<script src="${BASE}/static/assets/plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script> | ||
| 24 | +<!-- iCheck 1.0.1 --> | ||
| 25 | +<script src="${BASE}/static/assets/plugins/iCheck/icheck.min.js" type="text/javascript"></script> | ||
| 26 | +<script src="${BASE}/static/assets/plugins/slimScroll/jquery.slimscroll.min.js" type="text/javascript"></script> | ||
| 27 | + | ||
| 28 | +<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.css" /> | ||
| 29 | +<link rel="stylesheet" href="${BASE}/static/assets/plugins/fileinput/fileinput.min.css" /> | ||
| 30 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput.js"></script> | ||
| 31 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput.min.js"></script> | ||
| 32 | +<script src="${BASE}/static/assets/plugins/fileinput/fileinput_locale_zh.js"></script> | ||
| 33 | + | ||
| 34 | +<!-------直播系统所需 js 文件--> | ||
| 35 | +<script src="${BASE}/static/assets/cnlive/js/all_live.js" type="text/javascript"></script> | ||
| 36 | +<script src="${BASE}/static/assets/cnlive/js/live.js" type="text/javascript"></script> | ||
| 37 | +<script src="${BASE}/static/assets/cnlive/js/room.js" type="text/javascript"></script> | ||
| 38 | +<script src="${BASE}/static/assets/cnlive/js/channel.js" type="text/javascript"></script> | ||
| 39 | +<script src="${BASE}/static/assets/cnlive/js/signal.js" type="text/javascript"></script> | ||
| 40 | +<script src="${BASE}/static/assets/cnlive/js/wowza.js" type="text/javascript"></script> | ||
| 41 | +<script src="${BASE}/static/assets/cnlive/js/activity.js" type="text/javascript"></script> | ||
| 42 | +<script src="${BASE}/static/assets/cnlive/js/ajax_rest.js" type="text/javascript"></script> | ||
| 43 | +<!-- cnlive validate --> | ||
| 44 | +<script src="${BASE}/static/assets/plugins/validate/jquery.form.js"></script> | ||
| 45 | +<script src="${BASE}/static/assets/plugins/validate/jquery.metadata.js"></script> | ||
| 46 | +<script src="${BASE}/static/assets/plugins/validate/jquery.validate.js"></script> | ||
| 47 | + | ||
| 48 | +<script src="${BASE}/static/assets/plugins/easytree/easyTree.js"></script> | ||
| 49 | +<script src="${BASE}/static/assets/cnlive/js/common.js"></script> | ||
| 50 | +<script src="${BASE}/static/assets/cnlive/js/global.js"></script> | ||
| 51 | +<script type="text/javascript"> | ||
| 52 | + BASE = '${BASE}'; | ||
| 53 | </script> | 53 | </script> |
| 54 | \ No newline at end of file | 54 | \ No newline at end of file |
src/main/webapp/pages/common/left.jsp
| 1 | -<%@ page language="java" pageEncoding="utf-8"%> | ||
| 2 | -<%@ include file="/pages/common/taglib.jsp"%> | ||
| 3 | -<aside class="main-sidebar"> | ||
| 4 | - <section class="sidebar"> | ||
| 5 | - <div class="user-panel"> | ||
| 6 | - <div class="pull-left image"> | ||
| 7 | - <img src="${BASE}/static/assets/dist/img/user2-160x160.jpg" | ||
| 8 | - class="img-circle" alt="User Image" /> | ||
| 9 | - </div> | ||
| 10 | - <div class="pull-left info"> | ||
| 11 | - <p> | ||
| 12 | - <a href="${BASE}/index">刘基城</a> | ||
| 13 | - </p> | ||
| 14 | - <i class="fa fa-circle text-success"></i> | ||
| 15 | - <c:if test="${sessionScope.roleId=='1'}">超级管理员</c:if> | ||
| 16 | - <c:if test="${sessionScope.roleId=='0'}">普通用户</c:if> | ||
| 17 | - <c:if test="${sessionScope.roleId=='2'}">总编室用户</c:if> | ||
| 18 | - </div> | ||
| 19 | - </div> | ||
| 20 | - <ul class="sidebar-menu"> | ||
| 21 | - <c:if test="${sessionScope.roleId=='1'}"> | ||
| 22 | - <li class="header">导航栏</li> | ||
| 23 | - <li> | ||
| 24 | - <a href="${BASE}/switch"><i class="fa fa-circle-o text-blue"></i>全局切换</a> | ||
| 25 | - </li> | ||
| 26 | - <li> | ||
| 27 | - <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a> | ||
| 28 | - </li> | ||
| 29 | - <li> | ||
| 30 | - <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a> | ||
| 31 | - </li> | ||
| 32 | - <li> | ||
| 33 | - <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-red"></i>活动管理</a> | ||
| 34 | - </li> | ||
| 35 | - | ||
| 36 | - <li class="header">系统设置</li> | ||
| 37 | - <li> | ||
| 38 | - <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a> | ||
| 39 | - </li> | ||
| 40 | - <li> | ||
| 41 | - <a href="${BASE}/wowza/list/1"><i class="fa fa-circle-o text-blue"></i>播出服务管理</a> | ||
| 42 | - </li> | ||
| 43 | - <li> | ||
| 44 | - <a href="${BASE}/signal/list/1"><i class="fa fa-circle-o text-red"></i>信源管理</a> | ||
| 45 | - </li> | ||
| 46 | - </c:if> | ||
| 47 | - <c:if test="${sessionScope.roleId=='2'}"> | ||
| 48 | - <li class="header">UGC直播审查</li> | ||
| 49 | - <li> | ||
| 50 | - <a href="${BASE}/user/list/1"><i class="fa fa-circle-o text-yellow"></i>主播管理</a> | ||
| 51 | - </li> | ||
| 52 | - <li> | ||
| 53 | - <a href="${BASE}/check/list/1"><i class="fa fa-circle-o text-red"></i>直播审查</a> | ||
| 54 | - </li> | ||
| 55 | - <li> | ||
| 56 | - <a href="${BASE}/video/check/1"><i class="fa fa-circle-o text-green"></i>点播审查</a> | ||
| 57 | - </li> | ||
| 58 | - <li> | ||
| 59 | - <a href="${BASE}/live/alllive/1"><i class="fa fa-circle-o text-yellow"></i>直播管理</a> | ||
| 60 | - </li> | ||
| 61 | - <li> | ||
| 62 | - <a href="${BASE}/word/list"><i class="fa fa-circle-o text-yellow"></i>敏感词管理</a> | ||
| 63 | - </li> | ||
| 64 | - </c:if> | ||
| 65 | - </ul> | ||
| 66 | - </section> | ||
| 67 | - <!-- /.sidebar --> | 1 | +<%@ page language="java" pageEncoding="utf-8"%> |
| 2 | +<%@ include file="/pages/common/taglib.jsp"%> | ||
| 3 | +<aside class="main-sidebar"> | ||
| 4 | + <section class="sidebar"> | ||
| 5 | + <div class="user-panel"> | ||
| 6 | + <div class="pull-left image"> | ||
| 7 | + <img src="${BASE}/static/assets/dist/img/user2-160x160.jpg" | ||
| 8 | + class="img-circle" alt="User Image" /> | ||
| 9 | + </div> | ||
| 10 | + <div class="pull-left info"> | ||
| 11 | + <p> | ||
| 12 | + <a href="${BASE}/index">刘基城</a> | ||
| 13 | + </p> | ||
| 14 | + <i class="fa fa-circle text-success"></i> | ||
| 15 | + <c:if test="${sessionScope.roleId=='1'}">超级管理员</c:if> | ||
| 16 | + <c:if test="${sessionScope.roleId=='0'}">普通用户</c:if> | ||
| 17 | + <c:if test="${sessionScope.roleId=='2'}">总编室用户</c:if> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + <ul class="sidebar-menu"> | ||
| 21 | + <c:if test="${sessionScope.roleId=='1'}"> | ||
| 22 | + <li class="header">导航栏</li> | ||
| 23 | + <li> | ||
| 24 | + <a href="${BASE}/switch"><i class="fa fa-circle-o text-blue"></i>全局切换</a> | ||
| 25 | + </li> | ||
| 26 | + <li> | ||
| 27 | + <a href="${BASE}/channel/monitor/1"><i class="fa fa-circle-o text-yellow"></i>直播监控</a> | ||
| 28 | + </li> | ||
| 29 | + <li> | ||
| 30 | + <a href="${BASE}/activity/preload"><i class="fa fa-circle-o"></i>新增活动</a> | ||
| 31 | + </li> | ||
| 32 | + <li> | ||
| 33 | + <a href="${BASE}/activity/list/1"><i class="fa fa-circle-o text-red"></i>活动管理</a> | ||
| 34 | + </li> | ||
| 35 | + | ||
| 36 | + <li class="header">系统设置</li> | ||
| 37 | + <li> | ||
| 38 | + <a href="${BASE}/channel/list/1"><i class="fa fa-circle-o text-green"></i>频道管理</a> | ||
| 39 | + </li> | ||
| 40 | + <li> | ||
| 41 | + <a href="${BASE}/wowza/list/1"><i class="fa fa-circle-o text-blue"></i>播出服务管理</a> | ||
| 42 | + </li> | ||
| 43 | + <li> | ||
| 44 | + <a href="${BASE}/signal/list/1"><i class="fa fa-circle-o text-red"></i>信源管理</a> | ||
| 45 | + </li> | ||
| 46 | + </c:if> | ||
| 47 | + <c:if test="${sessionScope.roleId=='2'}"> | ||
| 48 | + <li class="header">UGC直播审查</li> | ||
| 49 | + <li> | ||
| 50 | + <a href="${BASE}/user/list/1"><i class="fa fa-circle-o text-yellow"></i>主播管理</a> | ||
| 51 | + </li> | ||
| 52 | + <li> | ||
| 53 | + <a href="${BASE}/check/list/1"><i class="fa fa-circle-o text-red"></i>直播审查</a> | ||
| 54 | + </li> | ||
| 55 | + <li> | ||
| 56 | + <a href="${BASE}/video/check/1"><i class="fa fa-circle-o text-green"></i>点播审查</a> | ||
| 57 | + </li> | ||
| 58 | + <li> | ||
| 59 | + <a href="${BASE}/live/alllive/1"><i class="fa fa-circle-o text-yellow"></i>直播管理</a> | ||
| 60 | + </li> | ||
| 61 | + <li> | ||
| 62 | + <a href="${BASE}/word/list"><i class="fa fa-circle-o text-yellow"></i>敏感词管理</a> | ||
| 63 | + </li> | ||
| 64 | + </c:if> | ||
| 65 | + </ul> | ||
| 66 | + </section> | ||
| 67 | + <!-- /.sidebar --> | ||
| 68 | </aside> | 68 | </aside> |
| 69 | \ No newline at end of file | 69 | \ No newline at end of file |
src/main/webapp/pages/live/all_live_management.jsp
| 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 | -</head> | ||
| 13 | -<body class="skin-blue fixed "> | ||
| 14 | - <div class="wrapper"> | ||
| 15 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | - <div class="content-wrapper"> | ||
| 18 | - <!-- Content Header (Page header) --> | ||
| 19 | - <section class="content-header"> | ||
| 20 | - <h1> | ||
| 21 | - 直播管理<small class="label label-warning" style="display: none" | ||
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | - </h1> | ||
| 24 | - | ||
| 25 | - <ol class="breadcrumb"> | ||
| 26 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 27 | - <li class="active">直播管理</li> | ||
| 28 | - </ol> | ||
| 29 | - </section> | ||
| 30 | - <!-- Main content --> | ||
| 31 | - <section class="content"> | ||
| 32 | - <div class="row"> | ||
| 33 | - <div class="col-xs-12"> | ||
| 34 | - <div class="box box-warning"> | ||
| 35 | - <div class="box-header with-border"> | ||
| 36 | - <h3 class="box-title"></h3> | ||
| 37 | - <div class="box-tools"> | ||
| 38 | - <div class="input-group"> | ||
| 39 | - <form role="form" action="../../live/search/1" method="get"> | ||
| 40 | - <div class="input-group"> | ||
| 41 | - <input type="text" name="search_user_id" id="search_user_id" | ||
| 42 | - class="form-control input-sm" style="width: 150px;" | ||
| 43 | - placeholder="用户id" /> <input type="text" | ||
| 44 | - name="search_title" id="search_title" | ||
| 45 | - class="form-control input-sm" style="width: 150px;" | ||
| 46 | - placeholder="活动名称" /> | ||
| 47 | - <button type="submit" class="btn btn-sm btn-default"> | ||
| 48 | - <i class="fa fa-search"></i>搜索 | ||
| 49 | - </button> | ||
| 50 | - </div> | ||
| 51 | - </form> | ||
| 52 | - </div> | ||
| 53 | - </div> | ||
| 54 | - </div> | ||
| 55 | - <!-- /.box-header --> | ||
| 56 | - <div class="box-body"> | ||
| 57 | - <table class="table table-bordered"> | ||
| 58 | - <tr> | ||
| 59 | - <th>活动ID</th> | ||
| 60 | - <th>stream_name</th> | ||
| 61 | - <th>活动名称</th> | ||
| 62 | - <th>开始时间</th> | ||
| 63 | - <th>结束时间</th> | ||
| 64 | - <th>状态</th> | ||
| 65 | - <th>下线</th> | ||
| 66 | - </tr> | ||
| 67 | - <c:forEach var="item" items="${tLive.recordList}" | ||
| 68 | - varStatus="stat"> | ||
| 69 | - <tr> | ||
| 70 | - <td>${item.id}</td> | ||
| 71 | - <td>${item.t_user_id}_${item.uuid}</td> | ||
| 72 | - <td>${item.title}</td> | ||
| 73 | - <td><fmt:formatDate value="${item.start_time}" | ||
| 74 | - pattern="yyyy-MM-dd HH:mm" /></td> | ||
| 75 | - <td>${item.end_time}</td> | ||
| 76 | - <td><c:if test="${item.t_status_id==0}"> | ||
| 77 | - <span class="badge bg-green">未开始</span> | ||
| 78 | - </c:if> <c:if test="${item.t_status_id==2}"> | ||
| 79 | - <span class="badge bg-green">正常结束</span> | ||
| 80 | - </c:if> <c:if test="${item.t_status_id==1}"> | ||
| 81 | - <span class="badge bg-yellow">直播中</span> | ||
| 82 | - </c:if> <c:if test="${item.t_status_id==-2}"> | ||
| 83 | - <span class="badge bg-red">异常结束</span> | ||
| 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> | ||
| 91 | - | ||
| 92 | - <td> | ||
| 93 | - <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');"> | ||
| 94 | - <i class="icon-upload"></i>下线 | ||
| 95 | - </button> --%> | ||
| 96 | - | ||
| 97 | - <button class="btn btn-danger btn-sm" | ||
| 98 | - onclick="t_live_close('${item.id}','${item.uuid}');"> | ||
| 99 | - <i class="fa fa-close"></i> | ||
| 100 | - </button> | ||
| 101 | - </td> | ||
| 102 | - </tr> | ||
| 103 | - </c:forEach> | ||
| 104 | - </table> | ||
| 105 | - </div> | ||
| 106 | - <!-- /.box-body --> | ||
| 107 | - <div class="box-footer clearfix"> | ||
| 108 | - <center> | ||
| 109 | - <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 110 | - </center> | ||
| 111 | - </div> | ||
| 112 | - </div> | ||
| 113 | - </div> | ||
| 114 | - </div> | ||
| 115 | - </section> | ||
| 116 | - </div> | ||
| 117 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 118 | - </div> | ||
| 119 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 120 | -</body> | ||
| 121 | -</html> | 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 | +</head> | ||
| 13 | +<body class="skin-blue fixed "> | ||
| 14 | + <div class="wrapper"> | ||
| 15 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | + <div class="content-wrapper"> | ||
| 18 | + <!-- Content Header (Page header) --> | ||
| 19 | + <section class="content-header"> | ||
| 20 | + <h1> | ||
| 21 | + 直播管理<small class="label label-warning" style="display: none" | ||
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | + </h1> | ||
| 24 | + | ||
| 25 | + <ol class="breadcrumb"> | ||
| 26 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 27 | + <li class="active">直播管理</li> | ||
| 28 | + </ol> | ||
| 29 | + </section> | ||
| 30 | + <!-- Main content --> | ||
| 31 | + <section class="content"> | ||
| 32 | + <div class="row"> | ||
| 33 | + <div class="col-xs-12"> | ||
| 34 | + <div class="box box-warning"> | ||
| 35 | + <div class="box-header with-border"> | ||
| 36 | + <h3 class="box-title"></h3> | ||
| 37 | + <div class="box-tools"> | ||
| 38 | + <div class="input-group"> | ||
| 39 | + <form role="form" action="../../live/search/1" method="get"> | ||
| 40 | + <div class="input-group"> | ||
| 41 | + <input type="text" name="search_user_id" id="search_user_id" | ||
| 42 | + class="form-control input-sm" style="width: 150px;" | ||
| 43 | + placeholder="用户id" /> <input type="text" | ||
| 44 | + name="search_title" id="search_title" | ||
| 45 | + class="form-control input-sm" style="width: 150px;" | ||
| 46 | + placeholder="活动名称" /> | ||
| 47 | + <button type="submit" class="btn btn-sm btn-default"> | ||
| 48 | + <i class="fa fa-search"></i>搜索 | ||
| 49 | + </button> | ||
| 50 | + </div> | ||
| 51 | + </form> | ||
| 52 | + </div> | ||
| 53 | + </div> | ||
| 54 | + </div> | ||
| 55 | + <!-- /.box-header --> | ||
| 56 | + <div class="box-body"> | ||
| 57 | + <table class="table table-bordered"> | ||
| 58 | + <tr> | ||
| 59 | + <th>活动ID</th> | ||
| 60 | + <th>stream_name</th> | ||
| 61 | + <th>活动名称</th> | ||
| 62 | + <th>开始时间</th> | ||
| 63 | + <th>结束时间</th> | ||
| 64 | + <th>状态</th> | ||
| 65 | + <th>下线</th> | ||
| 66 | + </tr> | ||
| 67 | + <c:forEach var="item" items="${tLive.recordList}" | ||
| 68 | + varStatus="stat"> | ||
| 69 | + <tr> | ||
| 70 | + <td>${item.id}</td> | ||
| 71 | + <td>${item.t_user_id}_${item.uuid}</td> | ||
| 72 | + <td>${item.title}</td> | ||
| 73 | + <td><fmt:formatDate value="${item.start_time}" | ||
| 74 | + pattern="yyyy-MM-dd HH:mm" /></td> | ||
| 75 | + <td>${item.end_time}</td> | ||
| 76 | + <td><c:if test="${item.t_status_id==0}"> | ||
| 77 | + <span class="badge bg-green">未开始</span> | ||
| 78 | + </c:if> <c:if test="${item.t_status_id==2}"> | ||
| 79 | + <span class="badge bg-green">正常结束</span> | ||
| 80 | + </c:if> <c:if test="${item.t_status_id==1}"> | ||
| 81 | + <span class="badge bg-yellow">直播中</span> | ||
| 82 | + </c:if> <c:if test="${item.t_status_id==-2}"> | ||
| 83 | + <span class="badge bg-red">异常结束</span> | ||
| 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> | ||
| 91 | + | ||
| 92 | + <td> | ||
| 93 | + <%-- <button type="button" class="btn btn-xs btn-success" id="down" onclick="t_live_close('${item.id}','${item.uuid}');"> | ||
| 94 | + <i class="icon-upload"></i>下线 | ||
| 95 | + </button> --%> | ||
| 96 | + | ||
| 97 | + <button class="btn btn-danger btn-sm" | ||
| 98 | + onclick="t_live_close('${item.id}','${item.uuid}');"> | ||
| 99 | + <i class="fa fa-close"></i> | ||
| 100 | + </button> | ||
| 101 | + </td> | ||
| 102 | + </tr> | ||
| 103 | + </c:forEach> | ||
| 104 | + </table> | ||
| 105 | + </div> | ||
| 106 | + <!-- /.box-body --> | ||
| 107 | + <div class="box-footer clearfix"> | ||
| 108 | + <center> | ||
| 109 | + <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 110 | + </center> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + </section> | ||
| 116 | + </div> | ||
| 117 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 118 | + </div> | ||
| 119 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 120 | +</body> | ||
| 121 | +</html> |
src/main/webapp/pages/live/live_add.jsp
| 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 | - | ||
| 13 | -<style type="text/css"> | ||
| 14 | - span.error{ | ||
| 15 | - padding-left: 15px; | ||
| 16 | - color: red; | ||
| 17 | - } | ||
| 18 | - </style> | ||
| 19 | -<link | ||
| 20 | - href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" | ||
| 21 | - rel="stylesheet"> | ||
| 22 | - <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.config.js"></script> | ||
| 23 | - <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.all.min.js"> </script> | ||
| 24 | - <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/lang/zh-cn/zh-cn.js"></script> | ||
| 25 | - | ||
| 26 | -</head> | ||
| 27 | -<body class="skin-blue fixed "> | ||
| 28 | - <div class="wrapper"> | ||
| 29 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 30 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 31 | - <div class="content-wrapper"> | ||
| 32 | - <section class="content-header"> | ||
| 33 | - <h1>${empty tActivity.id ? '新建活动':'编辑活动'} | ||
| 34 | - <small>${tActivity.name}</small> <small class="label label-warning" | ||
| 35 | - style="display: none" id="info_tab_span"><i | ||
| 36 | - class="fa fa-bell-o"></i>保存成功</small> | ||
| 37 | - </h1> | ||
| 38 | - <ol class="breadcrumb"> | ||
| 39 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 40 | - <li class="active">新增活动</li> | ||
| 41 | - </ol> | ||
| 42 | - </section> | ||
| 43 | - <!-- Main content --> | ||
| 44 | - <section class="content"> | ||
| 45 | - | ||
| 46 | - <form id="create_form" enctype="multipart/form-data" method="post" > | ||
| 47 | - | ||
| 48 | - <div class="row"> | ||
| 49 | - <!-- right column --> | ||
| 50 | - <div class="col-md-12"> | ||
| 51 | - <!-- general form elements disabled --> | ||
| 52 | - <div class="box box-warning"> | ||
| 53 | - <div class="box-body"> | ||
| 54 | - <div class="form-group"> | ||
| 55 | - <label> 活动名称 </label> | ||
| 56 | - <div class="input-group"> | ||
| 57 | - <span class="input-group-addon"><i class="fa fa-font"></i> | ||
| 58 | - </span> <input type="text" value="${tActivity.name }" name="name" | ||
| 59 | - id="name" class="form-control"> | ||
| 60 | - <input type="text" id="activity_id" name="activity_id" value="${tActivity.id}" hidden=""> | ||
| 61 | - </div> | ||
| 62 | - </div> | ||
| 63 | - <div class="form-group"> | ||
| 64 | - <label> 直播时间 </label> | ||
| 65 | - <div class="row"> | ||
| 66 | - <div class="col-lg-6"> | ||
| 67 | - <div class="input-group"> | ||
| 68 | - <span class="input-group-addon"> 开始时间 </span> <input | ||
| 69 | - type="text" class="form-control form_datetime" | ||
| 70 | - value="<fmt:formatDate value="${tActivity.start_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 71 | - name="start_time" id="start_time" | ||
| 72 | - data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask="" /> | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - <div class="col-lg-6"> | ||
| 76 | - <div class="input-group"> | ||
| 77 | - <span class="input-group-addon"> 结束时间</span> <input | ||
| 78 | - type="text" class="form-control form_datetime" | ||
| 79 | - value="<fmt:formatDate value="${tActivity.end_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 80 | - name="end_time" id="end_time" | ||
| 81 | - data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask=""> | ||
| 82 | - </div> | ||
| 83 | - </div> | ||
| 84 | - </div> | ||
| 85 | - </div> | ||
| 86 | - <div class="form-group"> | ||
| 87 | - | ||
| 88 | - <label>封面海报 </label> | ||
| 89 | - <div class="input-group"> | ||
| 90 | - <span class="input-group-addon"><i | ||
| 91 | - class="fa fa-file-word-o"></i> </span> <input id="input-22" type="file" name="input-22" accept="image/*" class="file-loading"> | ||
| 92 | - | ||
| 93 | - </div> | ||
| 94 | - </div> | ||
| 95 | - <div class="form-group"> | ||
| 96 | - <label> 播出直播间 </label> | ||
| 97 | - <div class="box box-warning"> | ||
| 98 | - <div class="box-body"> | ||
| 99 | - <div class="form-group"> | ||
| 100 | - | ||
| 101 | - <select class="form-control" name="t_default_video_id" | ||
| 102 | - id="t_default_video_id"> | ||
| 103 | - | ||
| 104 | - <c:forEach var="item" items="${tRooms}" | ||
| 105 | - varStatus="stat"> | ||
| 106 | - <option id="t_room_id_${item.id}" ${item.id==tLive.t_room_id ? 'selected="selected"':''} value="${item.id}">${item.name}</option> | ||
| 107 | - </c:forEach> | ||
| 108 | - </select> | ||
| 109 | - </div> | ||
| 110 | - </div> | ||
| 111 | - </div> | ||
| 112 | - </div> | ||
| 113 | - | ||
| 114 | - <div class="form-group"> | ||
| 115 | - | ||
| 116 | - <label>活动简述 </label> | ||
| 117 | - | ||
| 118 | - <div class="input-group"> | ||
| 119 | - <span class="input-group-addon"><i | ||
| 120 | - class="fa fa-file-word-o"></i> </span> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> | ||
| 121 | - </div> | ||
| 122 | - </div> | ||
| 123 | - <div class="box-footer"> | ||
| 124 | - <button type="submit" id="t_activity_save_btn" | ||
| 125 | - name="t_activity_save_btn" class="btn btn-success"> | ||
| 126 | - <i class="fa fa-save "></i> 保存 | ||
| 127 | - </button> | ||
| 128 | - </div> | ||
| 129 | - </div> | ||
| 130 | - </div> | ||
| 131 | - </div> | ||
| 132 | - </div> | ||
| 133 | - </form> | ||
| 134 | - </div> | ||
| 135 | - </section> | ||
| 136 | - </div> | ||
| 137 | - </div> | ||
| 138 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 139 | -</div> | ||
| 140 | - <!-- 信号选择结束 --> | ||
| 141 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 142 | - | ||
| 143 | - <script type="text/javascript"> | ||
| 144 | - | ||
| 145 | - | ||
| 146 | - $(function () { | ||
| 147 | - //Money Euro | ||
| 148 | - $("[data-mask]").inputmask(); | ||
| 149 | - }); | ||
| 150 | - | ||
| 151 | - $(function () { | ||
| 152 | - $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); | ||
| 153 | - //Datemask2 mm/dd/yyyy | ||
| 154 | - $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); | ||
| 155 | - //Money Euro | ||
| 156 | - $("[data-mask]").inputmask(); | ||
| 157 | - | ||
| 158 | - //Date range picker | ||
| 159 | - $('#reservation').daterangepicker(); | ||
| 160 | - //Date range picker with time picker | ||
| 161 | - $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); | ||
| 162 | - //Date range as a button | ||
| 163 | - $('#daterange-btn').daterangepicker( | ||
| 164 | - { | ||
| 165 | - ranges: { | ||
| 166 | - 'Today': [moment(), moment()], | ||
| 167 | - 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], | ||
| 168 | - 'Last 7 Days': [moment().subtract('days', 6), moment()], | ||
| 169 | - 'Last 30 Days': [moment().subtract('days', 29), moment()], | ||
| 170 | - 'This Month': [moment().startOf('month'), moment().endOf('month')], | ||
| 171 | - 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] | ||
| 172 | - }, | ||
| 173 | - startDate: moment().subtract('days', 29), | ||
| 174 | - endDate: moment() | ||
| 175 | - }, | ||
| 176 | - function (start, end) { | ||
| 177 | - $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | ||
| 178 | - } | ||
| 179 | - ); | ||
| 180 | - }); | ||
| 181 | - </script> | ||
| 182 | - | ||
| 183 | - | ||
| 184 | - <!-- Le javascript | ||
| 185 | - ================================================== --> | ||
| 186 | - <script | ||
| 187 | - src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> | ||
| 188 | - | ||
| 189 | - <script type="text/javascript"> | ||
| 190 | - $(".form_datetime").datetimepicker({ | ||
| 191 | - //format: "dd MM yyyy - hh:ii", | ||
| 192 | - format: "yyyy-mm-dd hh:ii", | ||
| 193 | - autoclose: true, | ||
| 194 | - todayBtn: true, | ||
| 195 | - pickerPosition: "bottom-right" | ||
| 196 | - }); | ||
| 197 | -</script> | ||
| 198 | - | ||
| 199 | -<script type="text/javascript"> | ||
| 200 | - | ||
| 201 | - //实例化编辑器 | ||
| 202 | - //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 | ||
| 203 | - var ue = UE.getEditor('editor',{ | ||
| 204 | - autoHeightEnabled: true, | ||
| 205 | - autoFloatEnabled: true | ||
| 206 | - }); | ||
| 207 | - | ||
| 208 | - | ||
| 209 | - function isFocus(e){ | ||
| 210 | - alert(UE.getEditor('editor').isFocus()); | ||
| 211 | - UE.dom.domUtils.preventDefault(e) | ||
| 212 | - } | ||
| 213 | - function setblur(e){ | ||
| 214 | - UE.getEditor('editor').blur(); | ||
| 215 | - UE.dom.domUtils.preventDefault(e) | ||
| 216 | - } | ||
| 217 | - function insertHtml() { | ||
| 218 | - var value = prompt('插入html代码', ''); | ||
| 219 | - UE.getEditor('editor').execCommand('insertHtml', value) | ||
| 220 | - } | ||
| 221 | - function createEditor() { | ||
| 222 | - enableBtn(); | ||
| 223 | - UE.getEditor('editor'); | ||
| 224 | - } | ||
| 225 | - function getAllHtml() { | ||
| 226 | - alert(UE.getEditor('editor').getAllHtml()) | ||
| 227 | - } | ||
| 228 | - function getContent() { | ||
| 229 | - var arr = []; | ||
| 230 | - arr.push("使用editor.getContent()方法可以获得编辑器的内容"); | ||
| 231 | - arr.push("内容为:"); | ||
| 232 | - arr.push(UE.getEditor('editor').getContent()); | ||
| 233 | - alert(arr.join("\n")); | ||
| 234 | - } | ||
| 235 | - function getPlainTxt() { | ||
| 236 | - var arr = []; | ||
| 237 | - arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); | ||
| 238 | - arr.push("内容为:"); | ||
| 239 | - arr.push(UE.getEditor('editor').getPlainTxt()); | ||
| 240 | - alert(arr.join('\n')) | ||
| 241 | - } | ||
| 242 | - function setContent(isAppendTo) { | ||
| 243 | - var arr = []; | ||
| 244 | - arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); | ||
| 245 | - UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); | ||
| 246 | - alert(arr.join("\n")); | ||
| 247 | - } | ||
| 248 | - function setDisabled() { | ||
| 249 | - UE.getEditor('editor').setDisabled('fullscreen'); | ||
| 250 | - disableBtn("enable"); | ||
| 251 | - } | ||
| 252 | - | ||
| 253 | - function setEnabled() { | ||
| 254 | - UE.getEditor('editor').setEnabled(); | ||
| 255 | - enableBtn(); | ||
| 256 | - } | ||
| 257 | - | ||
| 258 | - function getText() { | ||
| 259 | - //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 | ||
| 260 | - var range = UE.getEditor('editor').selection.getRange(); | ||
| 261 | - range.select(); | ||
| 262 | - var txt = UE.getEditor('editor').selection.getText(); | ||
| 263 | - alert(txt) | ||
| 264 | - } | ||
| 265 | - | ||
| 266 | - function getContentTxt() { | ||
| 267 | - var arr = []; | ||
| 268 | - arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); | ||
| 269 | - arr.push("编辑器的纯文本内容为:"); | ||
| 270 | - arr.push(UE.getEditor('editor').getContentTxt()); | ||
| 271 | - alert(arr.join("\n")); | ||
| 272 | - } | ||
| 273 | - function hasContent() { | ||
| 274 | - var arr = []; | ||
| 275 | - arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); | ||
| 276 | - arr.push("判断结果为:"); | ||
| 277 | - arr.push(UE.getEditor('editor').hasContents()); | ||
| 278 | - alert(arr.join("\n")); | ||
| 279 | - } | ||
| 280 | - function setFocus() { | ||
| 281 | - UE.getEditor('editor').focus(); | ||
| 282 | - } | ||
| 283 | - function deleteEditor() { | ||
| 284 | - disableBtn(); | ||
| 285 | - UE.getEditor('editor').destroy(); | ||
| 286 | - } | ||
| 287 | - function disableBtn(str) { | ||
| 288 | - var div = document.getElementById('btns'); | ||
| 289 | - var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 290 | - for (var i = 0, btn; btn = btns[i++];) { | ||
| 291 | - if (btn.id == str) { | ||
| 292 | - UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 293 | - } else { | ||
| 294 | - btn.setAttribute("disabled", "true"); | ||
| 295 | - } | ||
| 296 | - } | ||
| 297 | - } | ||
| 298 | - function enableBtn() { | ||
| 299 | - var div = document.getElementById('btns'); | ||
| 300 | - var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 301 | - for (var i = 0, btn; btn = btns[i++];) { | ||
| 302 | - UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 303 | - } | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - function getLocalData () { | ||
| 307 | - alert(UE.getEditor('editor').execCommand( "getlocaldata" )); | ||
| 308 | - } | ||
| 309 | - | ||
| 310 | - function clearLocalData () { | ||
| 311 | - UE.getEditor('editor').execCommand( "clearlocaldata" ); | ||
| 312 | - alert("已清空草稿箱") | ||
| 313 | - } | ||
| 314 | - | ||
| 315 | - $(document).on('ready', function() { | ||
| 316 | - $("#input-22").fileinput({ | ||
| 317 | - previewFileType : "image", | ||
| 318 | - browseClass : "btn btn-success", | ||
| 319 | - browseLabel : "Pick Image", | ||
| 320 | - browseIcon : "<i class=\"glyphicon glyphicon-picture\"></i> ", | ||
| 321 | - removeClass : "btn btn-danger", | ||
| 322 | - removeLabel : "Delete", | ||
| 323 | - removeIcon : "<i class=\"glyphicon glyphicon-trash\"></i> ", | ||
| 324 | - uploadClass : "btn btn-info", | ||
| 325 | - uploadLabel : "Upload", | ||
| 326 | - uploadIcon : "<i class=\"glyphicon glyphicon-upload\"></i> " | ||
| 327 | - }); | ||
| 328 | - | ||
| 329 | - $(function() { | ||
| 330 | - $('#create_form').ajaxForm({ | ||
| 331 | - type : 'post', | ||
| 332 | - url : '../live/save', | ||
| 333 | - enctype : 'multipart/form-data', | ||
| 334 | - beforeSubmit : function() { | ||
| 335 | - return true; | ||
| 336 | - }, | ||
| 337 | - error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 338 | - alert("错误"); | ||
| 339 | - }, | ||
| 340 | - success : function(result) { | ||
| 341 | - location.href = '../live/list/1'; | ||
| 342 | - } | ||
| 343 | - }); | ||
| 344 | - }); | ||
| 345 | - }); | ||
| 346 | - | ||
| 347 | - /* $(function() { | ||
| 348 | - $('#create_form').ajaxForm({ | ||
| 349 | - type : 'post', | ||
| 350 | - url : '../live/save', | ||
| 351 | - enctype : 'multipart/form-data', | ||
| 352 | - beforeSubmit : function() { | ||
| 353 | - var cms_column_ref_id=$("#input-22").val(); | ||
| 354 | - if(cms_column_ref_id==''){ | ||
| 355 | - alert("请输入栏目名称,点击获取,然后选择!"); | ||
| 356 | - return false; | ||
| 357 | - } | ||
| 358 | - }, | ||
| 359 | - error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 360 | - alert("错误"); | ||
| 361 | - }, | ||
| 362 | - success : function(result) { | ||
| 363 | - location.href = '../live/list/1'; | ||
| 364 | - } | ||
| 365 | - }); | ||
| 366 | - }); | ||
| 367 | - */ | ||
| 368 | - | ||
| 369 | -</script> | ||
| 370 | -</body> | ||
| 371 | -</html> | 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 | + | ||
| 13 | +<style type="text/css"> | ||
| 14 | + span.error{ | ||
| 15 | + padding-left: 15px; | ||
| 16 | + color: red; | ||
| 17 | + } | ||
| 18 | + </style> | ||
| 19 | +<link | ||
| 20 | + href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css" | ||
| 21 | + rel="stylesheet"> | ||
| 22 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.config.js"></script> | ||
| 23 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/ueditor.all.min.js"> </script> | ||
| 24 | + <script type="text/javascript" charset="utf-8" src="${BASE}/static/assets/ueditor/lang/zh-cn/zh-cn.js"></script> | ||
| 25 | + | ||
| 26 | +</head> | ||
| 27 | +<body class="skin-blue fixed "> | ||
| 28 | + <div class="wrapper"> | ||
| 29 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 30 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 31 | + <div class="content-wrapper"> | ||
| 32 | + <section class="content-header"> | ||
| 33 | + <h1>${empty tActivity.id ? '新建活动':'编辑活动'} | ||
| 34 | + <small>${tActivity.name}</small> <small class="label label-warning" | ||
| 35 | + style="display: none" id="info_tab_span"><i | ||
| 36 | + class="fa fa-bell-o"></i>保存成功</small> | ||
| 37 | + </h1> | ||
| 38 | + <ol class="breadcrumb"> | ||
| 39 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 40 | + <li class="active">新增活动</li> | ||
| 41 | + </ol> | ||
| 42 | + </section> | ||
| 43 | + <!-- Main content --> | ||
| 44 | + <section class="content"> | ||
| 45 | + | ||
| 46 | + <form id="create_form" enctype="multipart/form-data" method="post" > | ||
| 47 | + | ||
| 48 | + <div class="row"> | ||
| 49 | + <!-- right column --> | ||
| 50 | + <div class="col-md-12"> | ||
| 51 | + <!-- general form elements disabled --> | ||
| 52 | + <div class="box box-warning"> | ||
| 53 | + <div class="box-body"> | ||
| 54 | + <div class="form-group"> | ||
| 55 | + <label> 活动名称 </label> | ||
| 56 | + <div class="input-group"> | ||
| 57 | + <span class="input-group-addon"><i class="fa fa-font"></i> | ||
| 58 | + </span> <input type="text" value="${tActivity.name }" name="name" | ||
| 59 | + id="name" class="form-control"> | ||
| 60 | + <input type="text" id="activity_id" name="activity_id" value="${tActivity.id}" hidden=""> | ||
| 61 | + </div> | ||
| 62 | + </div> | ||
| 63 | + <div class="form-group"> | ||
| 64 | + <label> 直播时间 </label> | ||
| 65 | + <div class="row"> | ||
| 66 | + <div class="col-lg-6"> | ||
| 67 | + <div class="input-group"> | ||
| 68 | + <span class="input-group-addon"> 开始时间 </span> <input | ||
| 69 | + type="text" class="form-control form_datetime" | ||
| 70 | + value="<fmt:formatDate value="${tActivity.start_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 71 | + name="start_time" id="start_time" | ||
| 72 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask="" /> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <div class="col-lg-6"> | ||
| 76 | + <div class="input-group"> | ||
| 77 | + <span class="input-group-addon"> 结束时间</span> <input | ||
| 78 | + type="text" class="form-control form_datetime" | ||
| 79 | + value="<fmt:formatDate value="${tActivity.end_time}" pattern="yyyy-MM-dd HH:mm"/>" | ||
| 80 | + name="end_time" id="end_time" | ||
| 81 | + data-inputmask="'alias': 'yyyy-MM-dd HH:mm'" data-mask=""> | ||
| 82 | + </div> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + </div> | ||
| 86 | + <div class="form-group"> | ||
| 87 | + | ||
| 88 | + <label>封面海报 </label> | ||
| 89 | + <div class="input-group"> | ||
| 90 | + <span class="input-group-addon"><i | ||
| 91 | + class="fa fa-file-word-o"></i> </span> <input id="input-22" type="file" name="input-22" accept="image/*" class="file-loading"> | ||
| 92 | + | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + <div class="form-group"> | ||
| 96 | + <label> 播出直播间 </label> | ||
| 97 | + <div class="box box-warning"> | ||
| 98 | + <div class="box-body"> | ||
| 99 | + <div class="form-group"> | ||
| 100 | + | ||
| 101 | + <select class="form-control" name="t_default_video_id" | ||
| 102 | + id="t_default_video_id"> | ||
| 103 | + | ||
| 104 | + <c:forEach var="item" items="${tRooms}" | ||
| 105 | + varStatus="stat"> | ||
| 106 | + <option id="t_room_id_${item.id}" ${item.id==tLive.t_room_id ? 'selected="selected"':''} value="${item.id}">${item.name}</option> | ||
| 107 | + </c:forEach> | ||
| 108 | + </select> | ||
| 109 | + </div> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + | ||
| 114 | + <div class="form-group"> | ||
| 115 | + | ||
| 116 | + <label>活动简述 </label> | ||
| 117 | + | ||
| 118 | + <div class="input-group"> | ||
| 119 | + <span class="input-group-addon"><i | ||
| 120 | + class="fa fa-file-word-o"></i> </span> <script id="editor" type="text/plain" style="width:1024px;height:500px;"></script> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + <div class="box-footer"> | ||
| 124 | + <button type="submit" id="t_activity_save_btn" | ||
| 125 | + name="t_activity_save_btn" class="btn btn-success"> | ||
| 126 | + <i class="fa fa-save "></i> 保存 | ||
| 127 | + </button> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + </div> | ||
| 132 | + </div> | ||
| 133 | + </form> | ||
| 134 | + </div> | ||
| 135 | + </section> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 139 | +</div> | ||
| 140 | + <!-- 信号选择结束 --> | ||
| 141 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 142 | + | ||
| 143 | + <script type="text/javascript"> | ||
| 144 | + | ||
| 145 | + | ||
| 146 | + $(function () { | ||
| 147 | + //Money Euro | ||
| 148 | + $("[data-mask]").inputmask(); | ||
| 149 | + }); | ||
| 150 | + | ||
| 151 | + $(function () { | ||
| 152 | + $("#datemask").inputmask("dd/mm/yyyy", {"placeholder": "dd/mm/yyyy"}); | ||
| 153 | + //Datemask2 mm/dd/yyyy | ||
| 154 | + $("#datemask2").inputmask("mm/dd/yyyy", {"placeholder": "mm/dd/yyyy"}); | ||
| 155 | + //Money Euro | ||
| 156 | + $("[data-mask]").inputmask(); | ||
| 157 | + | ||
| 158 | + //Date range picker | ||
| 159 | + $('#reservation').daterangepicker(); | ||
| 160 | + //Date range picker with time picker | ||
| 161 | + $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'}); | ||
| 162 | + //Date range as a button | ||
| 163 | + $('#daterange-btn').daterangepicker( | ||
| 164 | + { | ||
| 165 | + ranges: { | ||
| 166 | + 'Today': [moment(), moment()], | ||
| 167 | + 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], | ||
| 168 | + 'Last 7 Days': [moment().subtract('days', 6), moment()], | ||
| 169 | + 'Last 30 Days': [moment().subtract('days', 29), moment()], | ||
| 170 | + 'This Month': [moment().startOf('month'), moment().endOf('month')], | ||
| 171 | + 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] | ||
| 172 | + }, | ||
| 173 | + startDate: moment().subtract('days', 29), | ||
| 174 | + endDate: moment() | ||
| 175 | + }, | ||
| 176 | + function (start, end) { | ||
| 177 | + $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | ||
| 178 | + } | ||
| 179 | + ); | ||
| 180 | + }); | ||
| 181 | + </script> | ||
| 182 | + | ||
| 183 | + | ||
| 184 | + <!-- Le javascript | ||
| 185 | + ================================================== --> | ||
| 186 | + <script | ||
| 187 | + src="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script> | ||
| 188 | + | ||
| 189 | + <script type="text/javascript"> | ||
| 190 | + $(".form_datetime").datetimepicker({ | ||
| 191 | + //format: "dd MM yyyy - hh:ii", | ||
| 192 | + format: "yyyy-mm-dd hh:ii", | ||
| 193 | + autoclose: true, | ||
| 194 | + todayBtn: true, | ||
| 195 | + pickerPosition: "bottom-right" | ||
| 196 | + }); | ||
| 197 | +</script> | ||
| 198 | + | ||
| 199 | +<script type="text/javascript"> | ||
| 200 | + | ||
| 201 | + //实例化编辑器 | ||
| 202 | + //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例 | ||
| 203 | + var ue = UE.getEditor('editor',{ | ||
| 204 | + autoHeightEnabled: true, | ||
| 205 | + autoFloatEnabled: true | ||
| 206 | + }); | ||
| 207 | + | ||
| 208 | + | ||
| 209 | + function isFocus(e){ | ||
| 210 | + alert(UE.getEditor('editor').isFocus()); | ||
| 211 | + UE.dom.domUtils.preventDefault(e) | ||
| 212 | + } | ||
| 213 | + function setblur(e){ | ||
| 214 | + UE.getEditor('editor').blur(); | ||
| 215 | + UE.dom.domUtils.preventDefault(e) | ||
| 216 | + } | ||
| 217 | + function insertHtml() { | ||
| 218 | + var value = prompt('插入html代码', ''); | ||
| 219 | + UE.getEditor('editor').execCommand('insertHtml', value) | ||
| 220 | + } | ||
| 221 | + function createEditor() { | ||
| 222 | + enableBtn(); | ||
| 223 | + UE.getEditor('editor'); | ||
| 224 | + } | ||
| 225 | + function getAllHtml() { | ||
| 226 | + alert(UE.getEditor('editor').getAllHtml()) | ||
| 227 | + } | ||
| 228 | + function getContent() { | ||
| 229 | + var arr = []; | ||
| 230 | + arr.push("使用editor.getContent()方法可以获得编辑器的内容"); | ||
| 231 | + arr.push("内容为:"); | ||
| 232 | + arr.push(UE.getEditor('editor').getContent()); | ||
| 233 | + alert(arr.join("\n")); | ||
| 234 | + } | ||
| 235 | + function getPlainTxt() { | ||
| 236 | + var arr = []; | ||
| 237 | + arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容"); | ||
| 238 | + arr.push("内容为:"); | ||
| 239 | + arr.push(UE.getEditor('editor').getPlainTxt()); | ||
| 240 | + alert(arr.join('\n')) | ||
| 241 | + } | ||
| 242 | + function setContent(isAppendTo) { | ||
| 243 | + var arr = []; | ||
| 244 | + arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容"); | ||
| 245 | + UE.getEditor('editor').setContent('欢迎使用ueditor', isAppendTo); | ||
| 246 | + alert(arr.join("\n")); | ||
| 247 | + } | ||
| 248 | + function setDisabled() { | ||
| 249 | + UE.getEditor('editor').setDisabled('fullscreen'); | ||
| 250 | + disableBtn("enable"); | ||
| 251 | + } | ||
| 252 | + | ||
| 253 | + function setEnabled() { | ||
| 254 | + UE.getEditor('editor').setEnabled(); | ||
| 255 | + enableBtn(); | ||
| 256 | + } | ||
| 257 | + | ||
| 258 | + function getText() { | ||
| 259 | + //当你点击按钮时编辑区域已经失去了焦点,如果直接用getText将不会得到内容,所以要在选回来,然后取得内容 | ||
| 260 | + var range = UE.getEditor('editor').selection.getRange(); | ||
| 261 | + range.select(); | ||
| 262 | + var txt = UE.getEditor('editor').selection.getText(); | ||
| 263 | + alert(txt) | ||
| 264 | + } | ||
| 265 | + | ||
| 266 | + function getContentTxt() { | ||
| 267 | + var arr = []; | ||
| 268 | + arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容"); | ||
| 269 | + arr.push("编辑器的纯文本内容为:"); | ||
| 270 | + arr.push(UE.getEditor('editor').getContentTxt()); | ||
| 271 | + alert(arr.join("\n")); | ||
| 272 | + } | ||
| 273 | + function hasContent() { | ||
| 274 | + var arr = []; | ||
| 275 | + arr.push("使用editor.hasContents()方法判断编辑器里是否有内容"); | ||
| 276 | + arr.push("判断结果为:"); | ||
| 277 | + arr.push(UE.getEditor('editor').hasContents()); | ||
| 278 | + alert(arr.join("\n")); | ||
| 279 | + } | ||
| 280 | + function setFocus() { | ||
| 281 | + UE.getEditor('editor').focus(); | ||
| 282 | + } | ||
| 283 | + function deleteEditor() { | ||
| 284 | + disableBtn(); | ||
| 285 | + UE.getEditor('editor').destroy(); | ||
| 286 | + } | ||
| 287 | + function disableBtn(str) { | ||
| 288 | + var div = document.getElementById('btns'); | ||
| 289 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 290 | + for (var i = 0, btn; btn = btns[i++];) { | ||
| 291 | + if (btn.id == str) { | ||
| 292 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 293 | + } else { | ||
| 294 | + btn.setAttribute("disabled", "true"); | ||
| 295 | + } | ||
| 296 | + } | ||
| 297 | + } | ||
| 298 | + function enableBtn() { | ||
| 299 | + var div = document.getElementById('btns'); | ||
| 300 | + var btns = UE.dom.domUtils.getElementsByTagName(div, "button"); | ||
| 301 | + for (var i = 0, btn; btn = btns[i++];) { | ||
| 302 | + UE.dom.domUtils.removeAttributes(btn, ["disabled"]); | ||
| 303 | + } | ||
| 304 | + } | ||
| 305 | + | ||
| 306 | + function getLocalData () { | ||
| 307 | + alert(UE.getEditor('editor').execCommand( "getlocaldata" )); | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + function clearLocalData () { | ||
| 311 | + UE.getEditor('editor').execCommand( "clearlocaldata" ); | ||
| 312 | + alert("已清空草稿箱") | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + $(document).on('ready', function() { | ||
| 316 | + $("#input-22").fileinput({ | ||
| 317 | + previewFileType : "image", | ||
| 318 | + browseClass : "btn btn-success", | ||
| 319 | + browseLabel : "Pick Image", | ||
| 320 | + browseIcon : "<i class=\"glyphicon glyphicon-picture\"></i> ", | ||
| 321 | + removeClass : "btn btn-danger", | ||
| 322 | + removeLabel : "Delete", | ||
| 323 | + removeIcon : "<i class=\"glyphicon glyphicon-trash\"></i> ", | ||
| 324 | + uploadClass : "btn btn-info", | ||
| 325 | + uploadLabel : "Upload", | ||
| 326 | + uploadIcon : "<i class=\"glyphicon glyphicon-upload\"></i> " | ||
| 327 | + }); | ||
| 328 | + | ||
| 329 | + $(function() { | ||
| 330 | + $('#create_form').ajaxForm({ | ||
| 331 | + type : 'post', | ||
| 332 | + url : '../live/save', | ||
| 333 | + enctype : 'multipart/form-data', | ||
| 334 | + beforeSubmit : function() { | ||
| 335 | + return true; | ||
| 336 | + }, | ||
| 337 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 338 | + alert("错误"); | ||
| 339 | + }, | ||
| 340 | + success : function(result) { | ||
| 341 | + location.href = '../live/list/1'; | ||
| 342 | + } | ||
| 343 | + }); | ||
| 344 | + }); | ||
| 345 | + }); | ||
| 346 | + | ||
| 347 | + /* $(function() { | ||
| 348 | + $('#create_form').ajaxForm({ | ||
| 349 | + type : 'post', | ||
| 350 | + url : '../live/save', | ||
| 351 | + enctype : 'multipart/form-data', | ||
| 352 | + beforeSubmit : function() { | ||
| 353 | + var cms_column_ref_id=$("#input-22").val(); | ||
| 354 | + if(cms_column_ref_id==''){ | ||
| 355 | + alert("请输入栏目名称,点击获取,然后选择!"); | ||
| 356 | + return false; | ||
| 357 | + } | ||
| 358 | + }, | ||
| 359 | + error : function(XMLHttpRequest, textStatus, errorThrown) { | ||
| 360 | + alert("错误"); | ||
| 361 | + }, | ||
| 362 | + success : function(result) { | ||
| 363 | + location.href = '../live/list/1'; | ||
| 364 | + } | ||
| 365 | + }); | ||
| 366 | + }); | ||
| 367 | + */ | ||
| 368 | + | ||
| 369 | +</script> | ||
| 370 | +</body> | ||
| 371 | +</html> |
src/main/webapp/pages/live/live_management.jsp
| 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 | -</head> | ||
| 13 | -<!-- | ||
| 14 | -<body class="skin-blue fixed ">--> | ||
| 15 | -<body class="skin-blue sidebar-mini"> | ||
| 16 | - <div class="wrapper"> | ||
| 17 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 18 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 19 | - <div class="content-wrapper"> | ||
| 20 | - <!-- Content Header (Page header) --> | ||
| 21 | - <section class="content-header"> | ||
| 22 | - <h1> | ||
| 23 | - 活动管理<small><a href="../../live/preload"><i | ||
| 24 | - class="fa fa-plus"></i>新增活动</a> </small> | ||
| 25 | - <small class="label label-warning" style="display: none" | ||
| 26 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 27 | - </h1> | ||
| 28 | - | ||
| 29 | - <ol class="breadcrumb"> | ||
| 30 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 31 | - <li class="active">活动管理</li> | ||
| 32 | - </ol> | ||
| 33 | - </section> | ||
| 34 | - <!-- Main content --> | ||
| 35 | - <section class="content"> | ||
| 36 | - <div class="row"> | ||
| 37 | - <div class="col-xs-12"> | ||
| 38 | - <div class="box box-warning"> | ||
| 39 | - <div class="box-header with-border"> | ||
| 40 | - <h3 class="box-title"></h3> | ||
| 41 | - <div class="box-tools"> | ||
| 42 | - <div class="input-group"> | ||
| 43 | - <form action="../search/1" method="post"> | ||
| 44 | - <div class="input-group"> | ||
| 45 | - <input type="text" name="search_text" id="search_text" | ||
| 46 | - class="form-control input-sm" style="width: 150px;" | ||
| 47 | - placeholder="Search" /> | ||
| 48 | - <button id="t_activity_search_btn" type="submit" | ||
| 49 | - class="btn btn-sm btn-default"> | ||
| 50 | - <i class="fa fa-search"></i>搜索 | ||
| 51 | - </button> | ||
| 52 | - </div> | ||
| 53 | - </form> | ||
| 54 | - </div> | ||
| 55 | - </div> | ||
| 56 | - </div> | ||
| 57 | - <!-- /.box-header --> | ||
| 58 | - <div class="box-body"> | ||
| 59 | - <table class="table table-bordered"> | ||
| 60 | - <tr> | ||
| 61 | - <th>活动名称</th> | ||
| 62 | - <th>开始时间</th> | ||
| 63 | - <th>结束时间</th> | ||
| 64 | - <th>状态</th> | ||
| 65 | - <th>修改</th> | ||
| 66 | - <th>删除</th> | ||
| 67 | - </tr> | ||
| 68 | - <c:forEach var="item" items="${tLive.recordList}" | ||
| 69 | - varStatus="stat"> | ||
| 70 | - <tr> | ||
| 71 | - <td><a href="${BASE}/live/preview/${item.id}">${item.title}</a> | ||
| 72 | - </td> | ||
| 73 | - <td><fmt:formatDate value="${item.start_time}" | ||
| 74 | - pattern="yyyy-MM-dd HH:mm" /></td> | ||
| 75 | - <td>${item.end_time}</td> | ||
| 76 | - <td> | ||
| 77 | - <c:if test="${item.t_status_id==0}"> | ||
| 78 | - <span class="badge bg-green">未开始</span> | ||
| 79 | - </c:if> <c:if test="${item.t_status_id==1}"> | ||
| 80 | - <span class="badge bg-red">直播中</span> | ||
| 81 | - </c:if> <c:if test="${item.t_status_id==2}"> | ||
| 82 | - <span class="badge">直播结束</span> | ||
| 83 | - </c:if> <c:if test="${item.t_status_id==3}"> | ||
| 84 | - <span class="badge">回放同步中</span> | ||
| 85 | - </c:if> <c:if test="${item.t_status_id==4}"> | ||
| 86 | - <span class="badge">同步完成</span> | ||
| 87 | - </c:if> | ||
| 88 | - </td> | ||
| 89 | - <td> | ||
| 90 | - <button class="btn btn-default btn-sm" | ||
| 91 | - onclick="t_live_edit(${item.id});"> | ||
| 92 | - <i class="fa fa-edit"></i> | ||
| 93 | - </button> | ||
| 94 | - </td> | ||
| 95 | - <td> | ||
| 96 | - <button class="btn btn-danger btn-sm" | ||
| 97 | - onclick="t_live_delete(${item.id});"> | ||
| 98 | - <i class="fa fa-close"></i> | ||
| 99 | - </button> | ||
| 100 | - </td> | ||
| 101 | - </tr> | ||
| 102 | - </c:forEach> | ||
| 103 | - </table> | ||
| 104 | - </div> | ||
| 105 | - <!-- /.box-body --> | ||
| 106 | - <div class="box-footer clearfix"> | ||
| 107 | - <center> | ||
| 108 | - <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 109 | - </center> | ||
| 110 | - </div> | ||
| 111 | - </div> | ||
| 112 | - </div> | ||
| 113 | - </div> | ||
| 114 | - </div> | ||
| 115 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 116 | - </div> | ||
| 117 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 118 | -</body> | ||
| 119 | -</html> | 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 | +</head> | ||
| 13 | +<!-- | ||
| 14 | +<body class="skin-blue fixed ">--> | ||
| 15 | +<body class="skin-blue sidebar-mini"> | ||
| 16 | + <div class="wrapper"> | ||
| 17 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 18 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 19 | + <div class="content-wrapper"> | ||
| 20 | + <!-- Content Header (Page header) --> | ||
| 21 | + <section class="content-header"> | ||
| 22 | + <h1> | ||
| 23 | + 活动管理<small><a href="../../live/preload"><i | ||
| 24 | + class="fa fa-plus"></i>新增活动</a> </small> | ||
| 25 | + <small class="label label-warning" style="display: none" | ||
| 26 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 27 | + </h1> | ||
| 28 | + | ||
| 29 | + <ol class="breadcrumb"> | ||
| 30 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 31 | + <li class="active">活动管理</li> | ||
| 32 | + </ol> | ||
| 33 | + </section> | ||
| 34 | + <!-- Main content --> | ||
| 35 | + <section class="content"> | ||
| 36 | + <div class="row"> | ||
| 37 | + <div class="col-xs-12"> | ||
| 38 | + <div class="box box-warning"> | ||
| 39 | + <div class="box-header with-border"> | ||
| 40 | + <h3 class="box-title"></h3> | ||
| 41 | + <div class="box-tools"> | ||
| 42 | + <div class="input-group"> | ||
| 43 | + <form action="../search/1" method="post"> | ||
| 44 | + <div class="input-group"> | ||
| 45 | + <input type="text" name="search_text" id="search_text" | ||
| 46 | + class="form-control input-sm" style="width: 150px;" | ||
| 47 | + placeholder="Search" /> | ||
| 48 | + <button id="t_activity_search_btn" type="submit" | ||
| 49 | + class="btn btn-sm btn-default"> | ||
| 50 | + <i class="fa fa-search"></i>搜索 | ||
| 51 | + </button> | ||
| 52 | + </div> | ||
| 53 | + </form> | ||
| 54 | + </div> | ||
| 55 | + </div> | ||
| 56 | + </div> | ||
| 57 | + <!-- /.box-header --> | ||
| 58 | + <div class="box-body"> | ||
| 59 | + <table class="table table-bordered"> | ||
| 60 | + <tr> | ||
| 61 | + <th>活动名称</th> | ||
| 62 | + <th>开始时间</th> | ||
| 63 | + <th>结束时间</th> | ||
| 64 | + <th>状态</th> | ||
| 65 | + <th>修改</th> | ||
| 66 | + <th>删除</th> | ||
| 67 | + </tr> | ||
| 68 | + <c:forEach var="item" items="${tLive.recordList}" | ||
| 69 | + varStatus="stat"> | ||
| 70 | + <tr> | ||
| 71 | + <td><a href="${BASE}/live/preview/${item.id}">${item.title}</a> | ||
| 72 | + </td> | ||
| 73 | + <td><fmt:formatDate value="${item.start_time}" | ||
| 74 | + pattern="yyyy-MM-dd HH:mm" /></td> | ||
| 75 | + <td>${item.end_time}</td> | ||
| 76 | + <td> | ||
| 77 | + <c:if test="${item.t_status_id==0}"> | ||
| 78 | + <span class="badge bg-green">未开始</span> | ||
| 79 | + </c:if> <c:if test="${item.t_status_id==1}"> | ||
| 80 | + <span class="badge bg-red">直播中</span> | ||
| 81 | + </c:if> <c:if test="${item.t_status_id==2}"> | ||
| 82 | + <span class="badge">直播结束</span> | ||
| 83 | + </c:if> <c:if test="${item.t_status_id==3}"> | ||
| 84 | + <span class="badge">回放同步中</span> | ||
| 85 | + </c:if> <c:if test="${item.t_status_id==4}"> | ||
| 86 | + <span class="badge">同步完成</span> | ||
| 87 | + </c:if> | ||
| 88 | + </td> | ||
| 89 | + <td> | ||
| 90 | + <button class="btn btn-default btn-sm" | ||
| 91 | + onclick="t_live_edit(${item.id});"> | ||
| 92 | + <i class="fa fa-edit"></i> | ||
| 93 | + </button> | ||
| 94 | + </td> | ||
| 95 | + <td> | ||
| 96 | + <button class="btn btn-danger btn-sm" | ||
| 97 | + onclick="t_live_delete(${item.id});"> | ||
| 98 | + <i class="fa fa-close"></i> | ||
| 99 | + </button> | ||
| 100 | + </td> | ||
| 101 | + </tr> | ||
| 102 | + </c:forEach> | ||
| 103 | + </table> | ||
| 104 | + </div> | ||
| 105 | + <!-- /.box-body --> | ||
| 106 | + <div class="box-footer clearfix"> | ||
| 107 | + <center> | ||
| 108 | + <tag:pager id="product_pager" pager="${tLive}" /> | ||
| 109 | + </center> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 116 | + </div> | ||
| 117 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 118 | +</body> | ||
| 119 | +</html> |
src/main/webapp/pages/live/video_management.jsp
| 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 | -</head> | ||
| 13 | -<body class="skin-blue fixed "> | ||
| 14 | - <div class="wrapper"> | ||
| 15 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | - <div class="content-wrapper"> | ||
| 18 | - <!-- Content Header (Page header) --> | ||
| 19 | - <section class="content-header"> | ||
| 20 | - <h1> | ||
| 21 | - 直播录制管理 <small class="label label-warning" style="display: none" | ||
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | - </h1> | ||
| 24 | - | ||
| 25 | - <ol class="breadcrumb"> | ||
| 26 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 27 | - <li class="active">活动管理</li> | ||
| 28 | - </ol> | ||
| 29 | - </section> | ||
| 30 | - <!-- Main content --> | ||
| 31 | - <section class="content"> | ||
| 32 | - <div class="row"> | ||
| 33 | - <div class="col-xs-12"> | ||
| 34 | - <div class="box box-warning"> | ||
| 35 | - <div class="box-header with-border"></div> | ||
| 36 | - <div class="box-body"> | ||
| 37 | - <table class="table table-bordered"> | ||
| 38 | - <tr> | ||
| 39 | - <th width="30%">名称</th> | ||
| 40 | - <th width="30%">relation_id</th> | ||
| 41 | - <th width="30%">审核状态</th> | ||
| 42 | - <th width="10%">操作</th> | ||
| 43 | - </tr> | ||
| 44 | - <c:forEach var="item" items="${videos.recordList}" | ||
| 45 | - varStatus="stat"> | ||
| 46 | - <tr> | ||
| 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> | ||
| 57 | - <td> | ||
| 58 | - <button class="btn btn-danger btn-sm" | ||
| 59 | - onclick="t_live_underLine(${item.id});">下线</button> | ||
| 60 | - </td> | ||
| 61 | - </tr> | ||
| 62 | - </c:forEach> | ||
| 63 | - </table> | ||
| 64 | - </div> | ||
| 65 | - <!-- /.box-body --> | ||
| 66 | - <div class="box-footer clearfix"> | ||
| 67 | - <center> | ||
| 68 | - <tag:pager id="product_pager" pager="${videos}" /> | ||
| 69 | - </center> | ||
| 70 | - </div> | ||
| 71 | - </div> | ||
| 72 | - </div> | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 76 | - </div> | ||
| 77 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 78 | -</body> | ||
| 79 | -</html> | 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 | +</head> | ||
| 13 | +<body class="skin-blue fixed "> | ||
| 14 | + <div class="wrapper"> | ||
| 15 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | + <div class="content-wrapper"> | ||
| 18 | + <!-- Content Header (Page header) --> | ||
| 19 | + <section class="content-header"> | ||
| 20 | + <h1> | ||
| 21 | + 直播录制管理 <small class="label label-warning" style="display: none" | ||
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | + </h1> | ||
| 24 | + | ||
| 25 | + <ol class="breadcrumb"> | ||
| 26 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 27 | + <li class="active">活动管理</li> | ||
| 28 | + </ol> | ||
| 29 | + </section> | ||
| 30 | + <!-- Main content --> | ||
| 31 | + <section class="content"> | ||
| 32 | + <div class="row"> | ||
| 33 | + <div class="col-xs-12"> | ||
| 34 | + <div class="box box-warning"> | ||
| 35 | + <div class="box-header with-border"></div> | ||
| 36 | + <div class="box-body"> | ||
| 37 | + <table class="table table-bordered"> | ||
| 38 | + <tr> | ||
| 39 | + <th width="30%">名称</th> | ||
| 40 | + <th width="30%">relation_id</th> | ||
| 41 | + <th width="30%">审核状态</th> | ||
| 42 | + <th width="10%">操作</th> | ||
| 43 | + </tr> | ||
| 44 | + <c:forEach var="item" items="${videos.recordList}" | ||
| 45 | + varStatus="stat"> | ||
| 46 | + <tr> | ||
| 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> | ||
| 57 | + <td> | ||
| 58 | + <button class="btn btn-danger btn-sm" | ||
| 59 | + onclick="t_live_underLine(${item.id});">下线</button> | ||
| 60 | + </td> | ||
| 61 | + </tr> | ||
| 62 | + </c:forEach> | ||
| 63 | + </table> | ||
| 64 | + </div> | ||
| 65 | + <!-- /.box-body --> | ||
| 66 | + <div class="box-footer clearfix"> | ||
| 67 | + <center> | ||
| 68 | + <tag:pager id="product_pager" pager="${videos}" /> | ||
| 69 | + </center> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 74 | + </div> | ||
| 75 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 76 | + </div> | ||
| 77 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 78 | +</body> | ||
| 79 | +</html> |
src/main/webapp/pages/user/user_list.jsp
| 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 | -</head> | ||
| 13 | -<body class="skin-blue sidebar-mini"> | ||
| 14 | - <div class="wrapper"> | ||
| 15 | - <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | - <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | - <div class="content-wrapper"> | ||
| 18 | - <!-- Content Header (Page header) --> | ||
| 19 | - <section class="content-header"> | ||
| 20 | - <h1> | ||
| 21 | - 用户管理 <small class="label label-warning" style="display: none" | ||
| 22 | - id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | - </h1> | ||
| 24 | - <ol class="breadcrumb"> | ||
| 25 | - <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 26 | - <li><a>用户管理</a></li> | ||
| 27 | - </ol> | ||
| 28 | - </section> | ||
| 29 | - <!-- Main content --> | ||
| 30 | - <section class="content"> | ||
| 31 | - <div class="row"> | ||
| 32 | - <div class="col-xs-12"> | ||
| 33 | - <div class="box box-success"> | ||
| 34 | - <div class="box-header with-border"> | ||
| 35 | - <!-- <h3 class="box-title"></h3> --> | ||
| 36 | - <div class="box-tools"> | ||
| 37 | - <div class="input-group"></div> | ||
| 38 | - </div> | ||
| 39 | - </div> | ||
| 40 | - <!-- /.box-header --> | ||
| 41 | - <div class="box-body"> | ||
| 42 | - <table class="table table-bordered"> | ||
| 43 | - <tr> | ||
| 44 | - <th>用户名</th> | ||
| 45 | - <th>用户权限</th> | ||
| 46 | - <th>创建日期</th> | ||
| 47 | - <th>举报次数</th> | ||
| 48 | - <th>举报原因</th> | ||
| 49 | - <th>播放列表</th> | ||
| 50 | - </tr> | ||
| 51 | - <c:forEach var="item" items="${userPage.recordList}" | ||
| 52 | - varStatus="stat"> | ||
| 53 | - <tr> | ||
| 54 | - <td>${item.name}</td> | ||
| 55 | - <td>${item.is_admin}</td> | ||
| 56 | - <td>${item.create_time}</td> | ||
| 57 | - <td> | ||
| 58 | - <c:if test="${item.reported_count<=5}"><span class="badge">${item.reported_count}</span></c:if> | ||
| 59 | - <c:if test="${item.reported_count>5}"><span class="badge bg-red">${item.reported_count}</span></c:if> | ||
| 60 | - </td> | ||
| 61 | - <td> | ||
| 62 | - <c:forEach items="${fn:split(item.reported_reason,',')}" var="tags"> | ||
| 63 | - ${tags} | ||
| 64 | - </c:forEach> | ||
| 65 | - </td> | ||
| 66 | - <td><a href="${BASE}/user/live/${item.id}/1">查看</a></td> | ||
| 67 | - </tr> | ||
| 68 | - </c:forEach> | ||
| 69 | - </table> | ||
| 70 | - </div> | ||
| 71 | - <div class="box-footer clearfix "> | ||
| 72 | - <center> | ||
| 73 | - <tag:pager id="product_pager" pager="${userPage}" /> | ||
| 74 | - </center> | ||
| 75 | - </div> | ||
| 76 | - </div> | ||
| 77 | - </div> | ||
| 78 | - </div> | ||
| 79 | - </section> | ||
| 80 | - </div> | ||
| 81 | - <%@ include file="/pages/common/bottom.jsp"%> | ||
| 82 | - <%@ include file="/pages/common/js.jsp"%> | ||
| 83 | - </div> | ||
| 84 | -</body> | ||
| 85 | -</html> | 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 | +</head> | ||
| 13 | +<body class="skin-blue sidebar-mini"> | ||
| 14 | + <div class="wrapper"> | ||
| 15 | + <%@ include file="/pages/common/top.jsp"%> | ||
| 16 | + <%@ include file="/pages/common/left.jsp"%> | ||
| 17 | + <div class="content-wrapper"> | ||
| 18 | + <!-- Content Header (Page header) --> | ||
| 19 | + <section class="content-header"> | ||
| 20 | + <h1> | ||
| 21 | + 用户管理 <small class="label label-warning" style="display: none" | ||
| 22 | + id="info_tab_span"><i class="fa fa-bell-o"></i></small> | ||
| 23 | + </h1> | ||
| 24 | + <ol class="breadcrumb"> | ||
| 25 | + <li><a><i class="fa fa-dashboard"></i> 首页</a></li> | ||
| 26 | + <li><a>用户管理</a></li> | ||
| 27 | + </ol> | ||
| 28 | + </section> | ||
| 29 | + <!-- Main content --> | ||
| 30 | + <section class="content"> | ||
| 31 | + <div class="row"> | ||
| 32 | + <div class="col-xs-12"> | ||
| 33 | + <div class="box box-success"> | ||
| 34 | + <div class="box-header with-border"> | ||
| 35 | + <!-- <h3 class="box-title"></h3> --> | ||
| 36 | + <div class="box-tools"> | ||
| 37 | + <div class="input-group"></div> | ||
| 38 | + </div> | ||
| 39 | + </div> | ||
| 40 | + <!-- /.box-header --> | ||
| 41 | + <div class="box-body"> | ||
| 42 | + <table class="table table-bordered"> | ||
| 43 | + <tr> | ||
| 44 | + <th>用户名</th> | ||
| 45 | + <th>用户权限</th> | ||
| 46 | + <th>创建日期</th> | ||
| 47 | + <th>举报次数</th> | ||
| 48 | + <th>举报原因</th> | ||
| 49 | + <th>播放列表</th> | ||
| 50 | + </tr> | ||
| 51 | + <c:forEach var="item" items="${userPage.recordList}" | ||
| 52 | + varStatus="stat"> | ||
| 53 | + <tr> | ||
| 54 | + <td>${item.name}</td> | ||
| 55 | + <td>${item.is_admin}</td> | ||
| 56 | + <td>${item.create_time}</td> | ||
| 57 | + <td> | ||
| 58 | + <c:if test="${item.reported_count<=5}"><span class="badge">${item.reported_count}</span></c:if> | ||
| 59 | + <c:if test="${item.reported_count>5}"><span class="badge bg-red">${item.reported_count}</span></c:if> | ||
| 60 | + </td> | ||
| 61 | + <td> | ||
| 62 | + <c:forEach items="${fn:split(item.reported_reason,',')}" var="tags"> | ||
| 63 | + ${tags} | ||
| 64 | + </c:forEach> | ||
| 65 | + </td> | ||
| 66 | + <td><a href="${BASE}/user/live/${item.id}/1">查看</a></td> | ||
| 67 | + </tr> | ||
| 68 | + </c:forEach> | ||
| 69 | + </table> | ||
| 70 | + </div> | ||
| 71 | + <div class="box-footer clearfix "> | ||
| 72 | + <center> | ||
| 73 | + <tag:pager id="product_pager" pager="${userPage}" /> | ||
| 74 | + </center> | ||
| 75 | + </div> | ||
| 76 | + </div> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + </section> | ||
| 80 | + </div> | ||
| 81 | + <%@ include file="/pages/common/bottom.jsp"%> | ||
| 82 | + <%@ include file="/pages/common/js.jsp"%> | ||
| 83 | + </div> | ||
| 84 | +</body> | ||
| 85 | +</html> |