Commit 14e8a0fd3faca45a756b2a842a0215a5f16bf78e
1 parent
f50134db
添加点播ips调度action
Showing
2 changed files
with
29 additions
and
14 deletions
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("成功"); |
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 Aug 09 08:49:54 CST 2016 | 2 | +#Wed Aug 10 15:00:33 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 |