Commit 61d1ddab5980e0809c698fbb4eb8b94ef489e3b9
1 parent
1e8a9459
修复类型转换
Showing
5 changed files
with
48 additions
and
56 deletions
src/main/java/com/cnlive/shenhe/api/AvsampleCallBackControllerApi.java
| @@ -70,10 +70,8 @@ public class AvsampleCallBackControllerApi { | @@ -70,10 +70,8 @@ public class AvsampleCallBackControllerApi { | ||
| 70 | } | 70 | } |
| 71 | return result; | 71 | return result; |
| 72 | } | 72 | } |
| 73 | - | ||
| 74 | - @GetMapping("/getGame") | ||
| 75 | - public String getGame() { | ||
| 76 | - return "html/game.html"; | ||
| 77 | - } | ||
| 78 | - | 73 | + //@GetMapping("/getGame") |
| 74 | + //public String getGame() { | ||
| 75 | + // return "html/game.html"; | ||
| 76 | + //} | ||
| 79 | } | 77 | } |
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -12,9 +12,11 @@ import org.slf4j.Logger; | @@ -12,9 +12,11 @@ import org.slf4j.Logger; | ||
| 12 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Controller; | 14 | import org.springframework.stereotype.Controller; |
| 15 | -import org.springframework.ui.Model; | ||
| 16 | import org.springframework.util.StringUtils; | 15 | import org.springframework.util.StringUtils; |
| 17 | -import org.springframework.web.bind.annotation.*; | 16 | +import org.springframework.web.bind.annotation.PostMapping; |
| 17 | +import org.springframework.web.bind.annotation.RequestBody; | ||
| 18 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 19 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 18 | 20 | ||
| 19 | import java.util.Date; | 21 | import java.util.Date; |
| 20 | import java.util.List; | 22 | import java.util.List; |
| @@ -268,15 +270,12 @@ public class ContentControllerApi { | @@ -268,15 +270,12 @@ public class ContentControllerApi { | ||
| 268 | return new ResponseBean(ErrorEnum.ERROR); | 270 | return new ResponseBean(ErrorEnum.ERROR); |
| 269 | } | 271 | } |
| 270 | } | 272 | } |
| 271 | - | ||
| 272 | - @GetMapping("/detail/{id}.html") | ||
| 273 | - public Object getContentDetail(Model model, @PathVariable Integer id) { | ||
| 274 | - System.out.println("数美送审页面开始进入"); | ||
| 275 | - ShyContent content = contentService.selectByPrimaryKey(id); | ||
| 276 | - model.addAttribute("contentText", content.getContent_text()); | ||
| 277 | - model.addAttribute("contentTitle", content.getTitle()); | ||
| 278 | - return "html/contentPage.html"; | ||
| 279 | - } | ||
| 280 | - | ||
| 281 | - | 273 | + //@GetMapping("/detail/{id}.html") |
| 274 | + //public Object getContentDetail(Model model, @PathVariable Integer id) { | ||
| 275 | + // System.out.println("数美送审页面开始进入"); | ||
| 276 | + // ShyContent content = contentService.selectByPrimaryKey(id); | ||
| 277 | + // model.addAttribute("contentText", content.getContent_text()); | ||
| 278 | + // model.addAttribute("contentTitle", content.getTitle()); | ||
| 279 | + // return "html/contentPage.html"; | ||
| 280 | + //} | ||
| 282 | } | 281 | } |
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
| @@ -61,9 +61,9 @@ public class LiveApplyControllerApi { | @@ -61,9 +61,9 @@ public class LiveApplyControllerApi { | ||
| 61 | //直播主题 | 61 | //直播主题 |
| 62 | String theme = json.getString("theme"); | 62 | String theme = json.getString("theme"); |
| 63 | //商务模式:0免费 1收费 | 63 | //商务模式:0免费 1收费 |
| 64 | - Integer businessModel = Integer.parseInt(json.getString("businessModel")); | 64 | + Integer businessModel = json.getInteger("businessModel"); |
| 65 | //内容属性:1商业类活动 0非商业活动 | 65 | //内容属性:1商业类活动 0非商业活动 |
| 66 | - Integer contentProperty = Integer.parseInt(json.getString("contentProperty")); | 66 | + Integer contentProperty = json.getInteger("contentProperty"); |
| 67 | //内容简述 | 67 | //内容简述 |
| 68 | String simpleContent = json.getString("simpleContent"); | 68 | String simpleContent = json.getString("simpleContent"); |
| 69 | //直播类型 | 69 | //直播类型 |
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
| 1 | package com.cnlive.shenhe.api; | 1 | package com.cnlive.shenhe.api; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSON; | ||
| 4 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.cnlive.shenhe.entity.ShyLive; | 4 | import com.cnlive.shenhe.entity.ShyLive; |
| 6 | import com.cnlive.shenhe.serviceImpl.LiveServiceImpl; | 5 | import com.cnlive.shenhe.serviceImpl.LiveServiceImpl; |
| 7 | import com.cnlive.shenhe.utils.CommonConst; | 6 | import com.cnlive.shenhe.utils.CommonConst; |
| 8 | import com.cnlive.shenhe.utils.CommonConstStates; | 7 | import com.cnlive.shenhe.utils.CommonConstStates; |
| 9 | import com.cnlive.shenhe.utils.CommonUtils; | 8 | import com.cnlive.shenhe.utils.CommonUtils; |
| 10 | -import org.apache.commons.lang3.StringUtils; | ||
| 11 | import org.slf4j.Logger; | 9 | import org.slf4j.Logger; |
| 12 | import org.slf4j.LoggerFactory; | 10 | import org.slf4j.LoggerFactory; |
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.stereotype.Controller; | 12 | import org.springframework.stereotype.Controller; |
| 15 | -import org.springframework.web.bind.annotation.*; | 13 | +import org.springframework.web.bind.annotation.PostMapping; |
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | +import org.springframework.web.bind.annotation.ResponseBody; | ||
| 16 | 16 | ||
| 17 | import java.sql.Timestamp; | 17 | import java.sql.Timestamp; |
| 18 | import java.util.Date; | 18 | import java.util.Date; |
| @@ -47,7 +47,7 @@ public class LiveControllerApi { | @@ -47,7 +47,7 @@ public class LiveControllerApi { | ||
| 47 | //直播活动名称 | 47 | //直播活动名称 |
| 48 | String activityName = json.getString("activityName"); | 48 | String activityName = json.getString("activityName"); |
| 49 | //直播活动状态 | 49 | //直播活动状态 |
| 50 | - Integer activityStatus = Integer.parseInt(json.getString("activityStatus")); | 50 | + Integer activityStatus = json.getInteger("activityStatus"); |
| 51 | //直播频道id | 51 | //直播频道id |
| 52 | String channelId = json.getString("channelId"); | 52 | String channelId = json.getString("channelId"); |
| 53 | //直播频道id | 53 | //直播频道id |
| @@ -57,13 +57,11 @@ public class LiveControllerApi { | @@ -57,13 +57,11 @@ public class LiveControllerApi { | ||
| 57 | //m3u8直播流 | 57 | //m3u8直播流 |
| 58 | String hlsUrl = json.getString("hlsUrl"); | 58 | String hlsUrl = json.getString("hlsUrl"); |
| 59 | //spid | 59 | //spid |
| 60 | - Integer spId = Integer.parseInt(json.getString("spId")); | 60 | + Integer spId = json.getInteger("spId"); |
| 61 | //回调地址 | 61 | //回调地址 |
| 62 | String callback = json.getString("callback"); | 62 | String callback = json.getString("callback"); |
| 63 | - | ||
| 64 | - | ||
| 65 | //优先级 | 63 | //优先级 |
| 66 | - Integer isHot = Integer.parseInt(json.getString("priority")); | 64 | + Integer isHot = json.getInteger("priority"); |
| 67 | //封面 | 65 | //封面 |
| 68 | String coverImgUrl = json.getString("coverImgUrl"); | 66 | String coverImgUrl = json.getString("coverImgUrl"); |
| 69 | //活动描述 | 67 | //活动描述 |
| @@ -279,30 +277,27 @@ public class LiveControllerApi { | @@ -279,30 +277,27 @@ public class LiveControllerApi { | ||
| 279 | } | 277 | } |
| 280 | return map; | 278 | return map; |
| 281 | } | 279 | } |
| 282 | - | ||
| 283 | - | ||
| 284 | - @RequestMapping(value = "callbackLiveResult", method = RequestMethod.POST) | ||
| 285 | - @ResponseBody | ||
| 286 | - public void getFilterVideoResult(@RequestBody String json) { | ||
| 287 | - logger.info("数美视频过滤回调,json:{}", json); | ||
| 288 | - if (StringUtils.isNotEmpty(json)) { | ||
| 289 | - JSONObject jsonObj = JSON.parseObject(json); | ||
| 290 | - JSONObject resultObj = jsonObj.getJSONObject("result"); | ||
| 291 | - Integer code = resultObj.getInteger("code"); | ||
| 292 | - if (code != null && code == 1100) { | ||
| 293 | - String riskLevel = resultObj.getString("riskLevel"); | ||
| 294 | - if ("PASS".equals(riskLevel)) { | ||
| 295 | - | ||
| 296 | - } | ||
| 297 | - if ("REJECT".equals(riskLevel)) { | ||
| 298 | - JSONObject detail = resultObj.getJSONObject("detail"); | ||
| 299 | - logger.info("数美视频回调--REJECT,detail:{}", detail); | ||
| 300 | - } | ||
| 301 | - if ("REVIEW".equals(riskLevel)) { | ||
| 302 | - } | ||
| 303 | - } else { | ||
| 304 | - } | ||
| 305 | - } | ||
| 306 | - } | ||
| 307 | - | 280 | + //@RequestMapping(value = "callbackLiveResult", method = RequestMethod.POST) |
| 281 | + //@ResponseBody | ||
| 282 | + //public void getFilterVideoResult(@RequestBody String json) { | ||
| 283 | + // logger.info("数美视频过滤回调,json:{}", json); | ||
| 284 | + // if (StringUtils.isNotEmpty(json)) { | ||
| 285 | + // JSONObject jsonObj = JSON.parseObject(json); | ||
| 286 | + // JSONObject resultObj = jsonObj.getJSONObject("result"); | ||
| 287 | + // Integer code = resultObj.getInteger("code"); | ||
| 288 | + // if (code != null && code == 1100) { | ||
| 289 | + // String riskLevel = resultObj.getString("riskLevel"); | ||
| 290 | + // if ("PASS".equals(riskLevel)) { | ||
| 291 | + // | ||
| 292 | + // } | ||
| 293 | + // if ("REJECT".equals(riskLevel)) { | ||
| 294 | + // JSONObject detail = resultObj.getJSONObject("detail"); | ||
| 295 | + // logger.info("数美视频回调--REJECT,detail:{}", detail); | ||
| 296 | + // } | ||
| 297 | + // if ("REVIEW".equals(riskLevel)) { | ||
| 298 | + // } | ||
| 299 | + // } else { | ||
| 300 | + // } | ||
| 301 | + // } | ||
| 302 | + //} | ||
| 308 | } | 303 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| @@ -390,7 +390,7 @@ public class ContentServiceImpl { | @@ -390,7 +390,7 @@ public class ContentServiceImpl { | ||
| 390 | String msg = jsonObject.getString("msg"); | 390 | String msg = jsonObject.getString("msg"); |
| 391 | if (code != 200) { | 391 | if (code != 200) { |
| 392 | // |0待发布 |1已发布 |2已下线 | 392 | // |0待发布 |1已发布 |2已下线 |
| 393 | - boolean flag = callback(shyContent.getContent_id(), msg, CommonConst.AUDIT_REFUSE, shyContent.getAuditor_id(), shyContent.getUpdater()); | 393 | + boolean flag = callback(shyContent.getContent_id(), "易盾机审未通过:"+msg, CommonConst.AUDIT_REFUSE, shyContent.getAuditor_id(), shyContent.getUpdater()); |
| 394 | } | 394 | } |
| 395 | JSONObject result = jsonObject.getJSONObject("result"); | 395 | JSONObject result = jsonObject.getJSONObject("result"); |
| 396 | String dataId = result.getString("dataId"); | 396 | String dataId = result.getString("dataId"); |