Commit 6c9515ae880bb6cbcf28ed5cc72634f16547996a

Authored by 刘基城
1 parent e135a207

修改获取info 接口

src/main/java/com/cnlive/mz/live/action/UgcLiveAction.java
... ... @@ -9,7 +9,9 @@
9 9  
10 10 package com.cnlive.mz.live.action;
11 11  
  12 +import java.util.ArrayList;
12 13 import java.util.HashMap;
  14 +import java.util.List;
13 15 import java.util.Map;
14 16  
15 17 import org.apache.commons.lang.StringUtils;
... ... @@ -33,33 +35,44 @@ public class UgcLiveAction {
33 35 private UgcLiveService ugcLiveService;
34 36  
35 37 /**
36   - * 1.0 获取直播活动信息接口Server.md
  38 + * 获取直播活动信息接口(1.0\1.1)
37 39 *
38 40 * @param params
39 41 * @return
40 42 */
41   - @Request.Get("/live/epg/getLiveActivityPlayInfo4Server")
  43 + @Request.Get("/live/epg/info")
42 44 public ResultBean getLiveActivityPlayInfo4Server(Params params) {
43 45 ResultBean rb = new ResultBean();
44 46 String appId = params.getString("appId");
45 47 String activityId = params.getString("activityId");
46 48 String timestamp = params.getString("timestamp");
47   - if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityId)) {
48   - Map<String, Object> map = new HashMap<String, Object>();
49   - map.put("location", "");
  49 + String platform_id = params.getString("platform_id");
  50 + Map<String, Object> map = new HashMap<String, Object>();
  51 + TLive tLive = ugcLiveService.getTLiveByActivityId(appId, activityId);
  52 + if (tLive == null) {
  53 + log.error("获取直播活动信息,活动对象为空");
  54 + rb.setErrorCode("500");
  55 + rb.setErrorMessage("获取直播活动信息失败,活动对象为空");
50 56 rb.setData(map);
51   - rb.setErrorCode("200");
52   - log.error("参数不正确");
53   - rb.setErrorMessage("启动活动失败");
54 57 return rb;
55 58 } else {
56   - TLive tLive = ugcLiveService.getTLiveByActivityId(appId, activityId);
57   - Map<String, Object> map = new HashMap<String, Object>();
58 59 map.put("activityId", activityId);
  60 + map.put("activityName", tLive.getTitle());
  61 + map.put("activityStatus", tLive.getT_status_id());
  62 + map.put("isHorizontalScreen", tLive.getDirect());
  63 + map.put("channelID", tLive.getRelation_id());
  64 + map.put("createTime", tLive.getCreate_time());
  65 + map.put("startTime", tLive.getStart_time());
  66 + map.put("endTime", tLive.getEnd_time());
  67 + map.put("coverImgUrl", tLive.getPoster());
  68 + map.put("activityCategory", tLive.getCategory());
  69 + map.put("extensions", tLive.getCustom_args());
  70 + map.put("rates", "1,2,3,4");
59 71 map.put("location", tLive.getLive_url());
  72 + map.put("extViews", new ArrayList<Map<String, Object>>());
60 73 rb.setData(map);
61 74 rb.setErrorCode("0");
62   - rb.setErrorMessage("启动活动成功");
  75 + rb.setErrorMessage("请求成功");
63 76 return rb;
64 77 }
65 78 }
... ... @@ -129,23 +142,10 @@ public class UgcLiveAction {
129 142 log.info(params);
130 143 String appId = params.getString("appId");
131 144 String activityid = params.getString("activityId");
132   - if (StringUtils.isEmpty(appId) || StringUtils.isEmpty(activityid)) {
133   - rb.setErrorCode("500");
134   - rb.setErrorMessage("启动活动失败,参数不正确");
135   - return rb;
136   - } else {
137   - TLive tLive = ugcLiveService.getTLiveByActivityId(appId, activityid);
138   - if (tLive == null) {
139   - log.info("tLive为空......");
140   - rb.setErrorCode("500");
141   - rb.setErrorMessage("启动活动失败,活动对象为空");
142   - return rb;
143   - } else {
144   - rb.setErrorCode("0");
145   - rb.setErrorMessage("启动活动成功");
146   - return rb;
147   - }
148   - }
  145 + ugcLiveService.start(appId, activityid);
  146 + rb.setErrorCode("0");
  147 + rb.setErrorMessage("启动活动成功");
  148 + return rb;
149 149 }
150 150  
151 151 /**
... ... @@ -352,8 +352,7 @@ public class UgcLiveAction {
352 352 rb.setErrorMessage("失败");
353 353 return rb;
354 354 }
355   -
356   -
  355 +
357 356 @Request.Get("/live/clientError")
358 357 public ResultBean error404() {
359 358 ResultBean rb = new ResultBean();
... ... @@ -363,5 +362,5 @@ public class UgcLiveAction {
363 362 rb.setErrorCode("404");
364 363 rb.setErrorMessage("失败");
365 364 return rb;
366   - }
  365 + }
367 366 }
368 367 \ No newline at end of file
... ...
target/m2e-wtp/web-resources/META-INF/maven/com.cnlive.mz.live.web/cnlive_live_web/pom.properties
1 1 #Generated by Maven Integration for Eclipse
2   -#Thu Aug 25 14:43:25 CST 2016
  2 +#Thu Aug 25 16:34:25 CST 2016
3 3 version=0.0.1-SNAPSHOT
4 4 groupId=com.cnlive.mz.live.web
5 5 m2e.projectName=cnlive_live_web
... ...