Commit 9d888a990dbd2818fa24edf00dec5f0e7047f978
1 parent
6581fca2
修改话题接口回调
Showing
1 changed file
with
15 additions
and
12 deletions
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
| @@ -21,7 +21,9 @@ import org.springframework.web.bind.annotation.RequestBody; | @@ -21,7 +21,9 @@ import org.springframework.web.bind.annotation.RequestBody; | ||
| 21 | import org.springframework.web.bind.annotation.RequestMapping; | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 22 | import org.springframework.web.bind.annotation.ResponseBody; | 22 | import org.springframework.web.bind.annotation.ResponseBody; |
| 23 | 23 | ||
| 24 | +import java.util.HashMap; | ||
| 24 | import java.util.List; | 25 | import java.util.List; |
| 26 | +import java.util.Map; | ||
| 25 | 27 | ||
| 26 | @Controller | 28 | @Controller |
| 27 | @RequestMapping("/api/topic") | 29 | @RequestMapping("/api/topic") |
| @@ -130,32 +132,33 @@ public class TopicControllerApi { | @@ -130,32 +132,33 @@ public class TopicControllerApi { | ||
| 130 | //获取中转服务器消息 | 132 | //获取中转服务器消息 |
| 131 | String errorCode = json.getString("errorCode"); | 133 | String errorCode = json.getString("errorCode"); |
| 132 | String errorMessage=json.getString("errorMessage"); | 134 | String errorMessage=json.getString("errorMessage"); |
| 133 | - String date=json.getString("date"); | ||
| 134 | - //获取接收方消息 | ||
| 135 | - JSONObject dateObject = JSONObject.parseObject(date); | ||
| 136 | - String topic_id=dateObject.getString("topic_id"); | 135 | + //获取接收方消息 |
| 136 | + JSONObject dataObject = json.getJSONObject("data"); | ||
| 137 | + String topic_id=dataObject.getString("topic_id"); | ||
| 137 | //获取当前话题实体 | 138 | //获取当前话题实体 |
| 138 | - ShyTopic shyTopic=new ShyTopic(); | ||
| 139 | - shyTopic.setTopic_id(topic_id); | ||
| 140 | - ShyTopic topic = topicService.getShyTopic(shyTopic); | 139 | + ShyTopic topic=new ShyTopic(); |
| 140 | + topic.setTopic_id(topic_id); | ||
| 141 | + topic = topicService.getShyTopic(topic); | ||
| 141 | 142 | ||
| 142 | if(errorCode.equals("0")){ | 143 | if(errorCode.equals("0")){ |
| 143 | - logger.info("cms系统已通知"); | 144 | + logger.info("话题id为:"+topic_id+",cms系统已通知"); |
| 144 | if(topic!=null){ | 145 | if(topic!=null){ |
| 145 | topic.setShenhe_msg(topic.getShenhe_msg()+",cms系统已通知"); | 146 | topic.setShenhe_msg(topic.getShenhe_msg()+",cms系统已通知"); |
| 146 | } | 147 | } |
| 147 | }else{//中转服务器失败 | 148 | }else{//中转服务器失败 |
| 148 | - logger.info("中转服务器调用cms失败,失败消息:"+errorMessage); | 149 | + logger.info("话题id为:"+topic_id+",中转服务器调用cms失败,失败消息:"+errorMessage); |
| 149 | topic.setShenhe_msg(topic.getShenhe_msg()+",中转服务器调用cms失败,失败消息:"+errorMessage); | 150 | topic.setShenhe_msg(topic.getShenhe_msg()+",中转服务器调用cms失败,失败消息:"+errorMessage); |
| 150 | topic.setShenhe_status(CommonConst.AUDIT_INTT); | 151 | topic.setShenhe_status(CommonConst.AUDIT_INTT); |
| 151 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 152 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 152 | } | 153 | } |
| 153 | - boolean rs = topicService.updateshyTopic(shyTopic); | 154 | + boolean rs = topicService.updateshyTopic(topic); |
| 155 | + Map<String,Object> ee=new HashMap<>(); | ||
| 156 | + ee.put("topic_id", topic_id); | ||
| 154 | if(rs){ | 157 | if(rs){ |
| 155 | - return new ResponseBean(ErrorEnum.SUCCESS,new JSONObject().put("topic_id", topic_id)); | 158 | + return new ResponseBean(ErrorEnum.SUCCESS,ee); |
| 156 | } | 159 | } |
| 157 | 160 | ||
| 158 | - return new ResponseBean(300,"话题送审回调成功,入库失败",new JSONObject().put("topic_id", topic_id)); | 161 | + return new ResponseBean(300,"话题送审回调成功,入库失败",ee); |
| 159 | } | 162 | } |
| 160 | 163 | ||
| 161 | 164 |