Commit b08f7020ccb5f046990c68c94afb7ac74cb70f8e
1 parent
b8a5bf8a
切换金山服务器到正式环境
Showing
4 changed files
with
29 additions
and
22 deletions
src/main/java/com/cnlive/mz/live/action/UserAction.java
| @@ -35,9 +35,8 @@ public class UserAction { | @@ -35,9 +35,8 @@ public class UserAction { | ||
| 35 | return new View("user/user_live_list.jsp").data("userPage", userPage); | 35 | return new View("user/user_live_list.jsp").data("userPage", userPage); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | - @Request.Get("/user/report/{userId}") | ||
| 39 | - public Result getUserByReport(int userId) { | 38 | + @Request.Get("/user/report/{userId}/{type}") |
| 39 | + public Result getUserByReport(int userId,int type) { | ||
| 40 | return new Result(tUserService.addReport(userId)); | 40 | return new Result(tUserService.addReport(userId)); |
| 41 | } | 41 | } |
| 42 | - | ||
| 43 | } | 42 | } |
src/main/java/com/cnlive/mz/live/action/VideoAction.java
| @@ -76,6 +76,7 @@ public class VideoAction { | @@ -76,6 +76,7 @@ public class VideoAction { | ||
| 76 | String md5 = params.getString("md5"); | 76 | String md5 = params.getString("md5"); |
| 77 | String relation_id = params.getString("relation_id"); | 77 | String relation_id = params.getString("relation_id"); |
| 78 | String uuid = ""; | 78 | String uuid = ""; |
| 79 | + boolean success=true; | ||
| 79 | if (video_type.equals("2")) { | 80 | if (video_type.equals("2")) { |
| 80 | // 2:sdk上传录播文件 | 81 | // 2:sdk上传录播文件 |
| 81 | TVideo tVideo = new TVideo(); | 82 | TVideo tVideo = new TVideo(); |
| @@ -107,12 +108,17 @@ public class VideoAction { | @@ -107,12 +108,17 @@ public class VideoAction { | ||
| 107 | tLive.setDirect(Integer.parseInt(direct)); | 108 | tLive.setDirect(Integer.parseInt(direct)); |
| 108 | } | 109 | } |
| 109 | tLive.setLive_url(Constants.KS_HOST_RTMP + tLive.getT_user_id() + "_" + uuid); | 110 | tLive.setLive_url(Constants.KS_HOST_RTMP + tLive.getT_user_id() + "_" + uuid); |
| 110 | - tLiveService.startLive(tLive); | 111 | + success=tLiveService.startLive(tLive); |
| 111 | } | 112 | } |
| 112 | data.put("video_uuid", uuid); | 113 | data.put("video_uuid", uuid); |
| 113 | ApiBean apiBean = new ApiBean(); | 114 | ApiBean apiBean = new ApiBean(); |
| 114 | - apiBean.setCode(100); | ||
| 115 | - apiBean.setMessage("请求成功"); | 115 | + if (success) { |
| 116 | + apiBean.setCode(100); | ||
| 117 | + apiBean.setMessage("请求成功"); | ||
| 118 | + }else{ | ||
| 119 | + apiBean.setCode(201); | ||
| 120 | + apiBean.setMessage("发起直播失败"); | ||
| 121 | + } | ||
| 116 | apiBean.setData(data); | 122 | apiBean.setData(data); |
| 117 | return apiBean; | 123 | return apiBean; |
| 118 | } | 124 | } |
src/main/resources/log4j.properties
| 1 | -log4j.rootLogger=INFO,console,file | ||
| 2 | -log4j.logger.content=INFO,content | ||
| 3 | -log4j.logger.video=INFO,video | ||
| 4 | -log4j.logger.action=INFO,action | 1 | +log4j.rootLogger=INFO,console,file,action,content,video,httpreq |
| 2 | + | ||
| 3 | +#Console | ||
| 4 | +log4j.appender.Threshold=INFO | ||
| 5 | +log4j.appender.console.Target=System.out | ||
| 5 | log4j.appender.console=org.apache.log4j.ConsoleAppender | 6 | log4j.appender.console=org.apache.log4j.ConsoleAppender |
| 6 | -log4j.appender.console.Target=System.out | ||
| 7 | log4j.appender.console.layout=org.apache.log4j.PatternLayout | 7 | log4j.appender.console.layout=org.apache.log4j.PatternLayout |
| 8 | -log4j.appender.console.layout.ConversionPattern=%m%n | 8 | +log4j.appender.console.layout.ConversionPattern=%d %-5p [%c] (%t:%x) %m%n |
| 9 | + | ||
| 9 | 10 | ||
| 10 | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender | 11 | log4j.appender.file=org.apache.log4j.DailyRollingFileAppender |
| 11 | log4j.appender.file.File=${catalina.base}/logs/cnlive_live_web/log | 12 | log4j.appender.file.File=${catalina.base}/logs/cnlive_live_web/log |
| @@ -45,6 +46,16 @@ log4j.appender.video.DatePattern='.'yyyy-MM-dd | @@ -45,6 +46,16 @@ log4j.appender.video.DatePattern='.'yyyy-MM-dd | ||
| 45 | log4j.appender.video.Encoding=UTF-8 | 46 | log4j.appender.video.Encoding=UTF-8 |
| 46 | 47 | ||
| 47 | 48 | ||
| 49 | + | ||
| 50 | +#httpreq | ||
| 51 | +log4j.appender.httpreq=org.apache.log4j.DailyRollingFileAppender | ||
| 52 | +log4j.appender.httpreq.File=${catalina.home}/logs/httpreq.log | ||
| 53 | +log4j.appender.httpreq.layout=org.apache.log4j.PatternLayout | ||
| 54 | +log4j.appender.httpreq.layout.ConversionPattern=[%d{yyyy-MM-dd HH:mm:ss}] %5p [%t] %C{1} - %m%n | ||
| 55 | +log4j.appender.httpreq.DatePattern='.'yyyy-MM-dd | ||
| 56 | +log4j.appender.httpreq.Encoding=UTF-8 | ||
| 57 | + | ||
| 58 | + | ||
| 48 | #log4j.logger.com.ksyun.ks3=DEBUG,stdout | 59 | #log4j.logger.com.ksyun.ks3=DEBUG,stdout |
| 49 | #log4j.logger.org.apache.http=DEBUG,stdout | 60 | #log4j.logger.org.apache.http=DEBUG,stdout |
| 50 | #log4j.logger.org.apache.http.wire=ERROR,stdout | 61 | #log4j.logger.org.apache.http.wire=ERROR,stdout |
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
| 1 | #Generated by Maven Integration for Eclipse | 1 | #Generated by Maven Integration for Eclipse |
| 2 | -#Tue Jun 21 13:17:57 CST 2016 | 2 | +#Thu Jun 23 09:20:00 CST 2016 |
| 3 | version=0.0.1-SNAPSHOT | 3 | version=0.0.1-SNAPSHOT |
| 4 | groupId=com.cnlive.mz.live.web | 4 | groupId=com.cnlive.mz.live.web |
| 5 | m2e.projectName=cnlive_live_web | 5 | m2e.projectName=cnlive_live_web |
| 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web | 6 | m2e.projectLocation=D\:\\1_CNLIVE_JAVA_CODE\\cnlive_live_web |
| 7 | artifactId=cnlive_live_web | 7 | artifactId=cnlive_live_web |
| 8 | -#Generated by Maven Integration for Eclipse | ||
| 9 | -#Mon Jun 20 09:31:18 CST 2016 | ||
| 10 | -#Mon Jun 20 10:10:00 CST 2016 | ||
| 11 | -#Fri Jun 17 09:20:43 CST 2016 | ||
| 12 | -version=0.0.1-SNAPSHOT | ||
| 13 | -groupId=com.cnlive.mz.live.web | ||
| 14 | -m2e.projectName=cnlive_live_web | ||
| 15 | -m2e.projectLocation=C\:\\Users\\Administrator\\git\\cnlive_live_web | ||
| 16 | -artifactId=cnlive_live_web |