Commit c5e3a947b1a8dd6aae22dec5b791afeee69db8cd
Merge branch 'dev'
Showing
5 changed files
with
42 additions
and
10 deletions
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| 1 | package com.cnlive.shenhe.api; | 1 | package com.cnlive.shenhe.api; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSONArray; | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 5 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| @@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 24 | 25 | ||
| 25 | import java.util.Date; | 26 | import java.util.Date; |
| 26 | import java.util.List; | 27 | import java.util.List; |
| 28 | +import java.util.Map; | ||
| 27 | 29 | ||
| 28 | import javax.servlet.http.HttpSession; | 30 | import javax.servlet.http.HttpSession; |
| 29 | 31 | ||
| @@ -137,6 +139,21 @@ public class ContentControllerApi { | @@ -137,6 +139,21 @@ public class ContentControllerApi { | ||
| 137 | List<ShyContent> contentList = contentService.findshyContent(shyContent); | 139 | List<ShyContent> contentList = contentService.findshyContent(shyContent); |
| 138 | //获取审核类型 | 140 | //获取审核类型 |
| 139 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"),"moment"); | 141 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"),"moment"); |
| 142 | + | ||
| 143 | + //获取生活圈内容的类型 1:图片 2:视频 3:分享 | ||
| 144 | + Integer contentType = json.getInteger("contentType"); | ||
| 145 | + String contentImageUrl="";//内容图片地址 | ||
| 146 | + if(contentType!=null&&contentType==1){ | ||
| 147 | + JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl"));//朋友圈分享的内容的url | ||
| 148 | + for(int i=0;i<contentImageUrlList.size();i++){ | ||
| 149 | + JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i); | ||
| 150 | + contentImageUrl+=contentImageUrlMap.getString("imageUrl")+","; | ||
| 151 | + } | ||
| 152 | + contentImageUrl=contentImageUrl.substring(0, contentImageUrl.length()-1);//去掉最后一个逗号 | ||
| 153 | + }else{ | ||
| 154 | + contentImageUrl=json.getString("contentImageUrl"); | ||
| 155 | + } | ||
| 156 | + | ||
| 140 | //存在则更新 | 157 | //存在则更新 |
| 141 | if (contentList.size() > 0) { | 158 | if (contentList.size() > 0) { |
| 142 | ShyContent shyContent1 = contentList.get(0); | 159 | ShyContent shyContent1 = contentList.get(0); |
| @@ -152,6 +169,7 @@ public class ContentControllerApi { | @@ -152,6 +169,7 @@ public class ContentControllerApi { | ||
| 152 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); | 169 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); |
| 153 | shyContent1.setCallback(json.getString("callbackUrl"));//回调地址 | 170 | shyContent1.setCallback(json.getString("callbackUrl"));//回调地址 |
| 154 | shyContent1.setContent_url(json.getString("pageUrl"));//朋友圈分享的url | 171 | shyContent1.setContent_url(json.getString("pageUrl"));//朋友圈分享的url |
| 172 | + shyContent1.setContent_pc_url(contentImageUrl);//朋友圈分享的内容的url,以逗号分隔 | ||
| 155 | shyContent1.setSp_id(json.getInteger("spId"));//spid | 173 | shyContent1.setSp_id(json.getInteger("spId"));//spid |
| 156 | shyContent1.setAuthor(json.getString("userId"));//用户id | 174 | shyContent1.setAuthor(json.getString("userId"));//用户id |
| 157 | shyContent1.setSource(json.getString("nickName"));//用户昵称 | 175 | shyContent1.setSource(json.getString("nickName"));//用户昵称 |
| @@ -183,6 +201,7 @@ public class ContentControllerApi { | @@ -183,6 +201,7 @@ public class ContentControllerApi { | ||
| 183 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); | 201 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); |
| 184 | shyContent.setCallback(json.getString("callbackUrl"));//回调地址 | 202 | shyContent.setCallback(json.getString("callbackUrl"));//回调地址 |
| 185 | shyContent.setContent_url(json.getString("pageUrl"));//朋友圈分享的url | 203 | shyContent.setContent_url(json.getString("pageUrl"));//朋友圈分享的url |
| 204 | + shyContent.setContent_pc_url(contentImageUrl);//朋友圈分享的内容的url,以逗号分隔 | ||
| 186 | shyContent.setSp_id(json.getInteger("spId"));//spid | 205 | shyContent.setSp_id(json.getInteger("spId"));//spid |
| 187 | shyContent.setAuthor(json.getString("userId"));//用户id | 206 | shyContent.setAuthor(json.getString("userId"));//用户id |
| 188 | shyContent.setSource(json.getString("nickName"));//用户昵称 | 207 | shyContent.setSource(json.getString("nickName"));//用户昵称 |
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
| @@ -91,16 +91,16 @@ public class LiveControllerApi { | @@ -91,16 +91,16 @@ public class LiveControllerApi { | ||
| 91 | shyLive.setActivity_end_time(timestamp_end); | 91 | shyLive.setActivity_end_time(timestamp_end); |
| 92 | shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是 | 92 | shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是 |
| 93 | }else if(activityStatus==1){//启动直播 | 93 | }else if(activityStatus==1){//启动直播 |
| 94 | - shyLive.setActivity_start_time(CommonUtils.getCurrentTime()); | 94 | + shyLive.setActivity_start_time(timestamp_start); |
| 95 | shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是 | 95 | shyLive.setIs_hot(2);//是否是热点: 1:不是 ,2: 是 |
| 96 | }else if(activityStatus==2){//停止直播 | 96 | }else if(activityStatus==2){//停止直播 |
| 97 | - shyLive.setActivity_end_time(CommonUtils.getCurrentTime()); | 97 | + shyLive.setActivity_end_time(timestamp_end); |
| 98 | shyLive.setPlayback_url(playbackUrl);//回放地址 | 98 | shyLive.setPlayback_url(playbackUrl);//回放地址 |
| 99 | shyLive.setShenhe_state(2);//状态 0:未认领 1.已领未审,2:已审 | 99 | shyLive.setShenhe_state(2);//状态 0:未认领 1.已领未审,2:已审 |
| 100 | shyLive.setUpdater("自动通过");;//直播完成后自动通过 | 100 | shyLive.setUpdater("自动通过");;//直播完成后自动通过 |
| 101 | shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是 | 101 | shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是 |
| 102 | }else if(activityStatus==4){//审核强制下线 | 102 | }else if(activityStatus==4){//审核强制下线 |
| 103 | - shyLive.setActivity_end_time(CommonUtils.getCurrentTime()); | 103 | + shyLive.setActivity_end_time(timestamp_end); |
| 104 | shyLive.setPlayback_url(playbackUrl);//回放地址 | 104 | shyLive.setPlayback_url(playbackUrl);//回放地址 |
| 105 | shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是 | 105 | shyLive.setIs_hot(1);//是否是热点: 1:不是 ,2: 是 |
| 106 | } | 106 | } |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| @@ -148,6 +148,14 @@ public class ContentController { | @@ -148,6 +148,14 @@ public class ContentController { | ||
| 148 | updater =sitesService.getUpdater(updater,auditor_id); | 148 | updater =sitesService.getUpdater(updater,auditor_id); |
| 149 | content.setUpdater(updater); | 149 | content.setUpdater(updater); |
| 150 | } | 150 | } |
| 151 | + //朋友圈内容切割内容图片或者视频地址 | ||
| 152 | + if(content.getContent_tag().equals("moment")){ | ||
| 153 | + String[] contentImageUrlList=null; | ||
| 154 | + if(content.getContent_pc_url()!=null){ | ||
| 155 | + contentImageUrlList=content.getContent_pc_url().split(","); | ||
| 156 | + } | ||
| 157 | + model.addAttribute("contentImageUrlList", contentImageUrlList); | ||
| 158 | + } | ||
| 151 | model.addAttribute("content", content); | 159 | model.addAttribute("content", content); |
| 152 | return "page/contentDetail.html"; | 160 | return "page/contentDetail.html"; |
| 153 | } | 161 | } |
src/main/java/com/cnlive/shenhe/job/ContentJob.java
| @@ -58,7 +58,7 @@ public class ContentJob { | @@ -58,7 +58,7 @@ public class ContentJob { | ||
| 58 | /** | 58 | /** |
| 59 | * 定时发送数美检测视频 | 59 | * 定时发送数美检测视频 |
| 60 | */ | 60 | */ |
| 61 | - @Scheduled(cron="0 0/1 10-23 * * ? ")//每天10点到23点执行,每分钟一次 | 61 | + @Scheduled(cron="0 0/1 * * * ? ")//每分钟一次 |
| 62 | public void videofilter() { | 62 | public void videofilter() { |
| 63 | ShyContent shyContent = new ShyContent(); | 63 | ShyContent shyContent = new ShyContent(); |
| 64 | shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);//审核类型为机审 | 64 | shyContent.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);//审核类型为机审 |
src/main/resources/templates/page/contentDetail.html
| @@ -86,17 +86,22 @@ | @@ -86,17 +86,22 @@ | ||
| 86 | </div> | 86 | </div> |
| 87 | </div> | 87 | </div> |
| 88 | <div class="form-group"> | 88 | <div class="form-group"> |
| 89 | + <label for="activity_id" class="control-label col-sm-2">图文标题:</label> | ||
| 90 | + <div class="col-sm-10"> | ||
| 91 | + <h5 th:text="${content.title}"> | ||
| 92 | + 769:video:comets:604_902dce9848ac482eb433f15c2cb0c401#3025</h5> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + <div class="form-group" th:if="${content.content_tag=='content'}"> | ||
| 89 | <label for="program_id" class="control-label col-sm-2">pc地址:</label> | 96 | <label for="program_id" class="control-label col-sm-2">pc地址:</label> |
| 90 | -<!-- <button type="button" class="btn btn-primary pull-right" onclick="content(1);"></button> --> | ||
| 91 | <div class="col-sm-10"> | 97 | <div class="col-sm-10"> |
| 92 | <a th:href="@{${content.content_pc_url}}" th:text="${content.content_pc_url}" target="blank"></a> | 98 | <a th:href="@{${content.content_pc_url}}" th:text="${content.content_pc_url}" target="blank"></a> |
| 93 | </div> | 99 | </div> |
| 94 | </div> | 100 | </div> |
| 95 | - <div class="form-group"> | ||
| 96 | - <label for="activity_id" class="control-label col-sm-2">图文标题:</label> | ||
| 97 | - <div class="col-sm-10"> | ||
| 98 | - <h5 th:text="${content.title}"> | ||
| 99 | - 769:video:comets:604_902dce9848ac482eb433f15c2cb0c401#3025</h5> | 101 | + <div class="form-group" th:if="${content.content_tag=='moment'}"> |
| 102 | + <label for="program_id" class="control-label col-sm-2">图片/视频地址:</label> | ||
| 103 | + <div class="col-sm-10" th:each="contentImageUrl:${contentImageUrlList}"> | ||
| 104 | + <a th:href="@{${contentImageUrl}}" th:text="${contentImageUrl}" target="blank"></a> | ||
| 100 | </div> | 105 | </div> |
| 101 | </div> | 106 | </div> |
| 102 | <div class="form-group"> | 107 | <div class="form-group"> |