Commit 9f2fd2379dde5d1e13924a3ca677ded4300cef2d

Authored by 陈浩
1 parent 5fd93cc3

评论审核相关接口

src/main/java/com/cnlive/shenhe/controller/CommentsController.java 0 → 100644
  1 +package com.cnlive.shenhe.controller;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.bean.ErrorEnum;
  5 +import com.cnlive.shenhe.bean.ResponseBean;
  6 +import com.cnlive.shenhe.entity.AcpComments;
  7 +import com.cnlive.shenhe.entity.ShySites;
  8 +import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
  9 +import com.cnlive.shenhe.utils.AuditPass;
  10 +import com.cnlive.shenhe.utils.CommonConst;
  11 +import com.cnlive.shenhe.utils.CommonUtils;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Controller;
  14 +import org.springframework.web.bind.annotation.PostMapping;
  15 +import org.springframework.web.bind.annotation.RequestBody;
  16 +import org.springframework.web.bind.annotation.RequestMapping;
  17 +import org.springframework.web.bind.annotation.ResponseBody;
  18 +
  19 +import java.util.Arrays;
  20 +import java.util.HashMap;
  21 +import java.util.List;
  22 +
  23 +/**
  24 + * @Auther: chenhao
  25 + * @Date: 2018/12/4 17:30
  26 + * @Description:评论内容送审接口
  27 + */
  28 +@Controller
  29 +@RequestMapping("/comments")
  30 +public class CommentsController {
  31 + @Autowired
  32 + AuditPass Pass;
  33 + @Autowired
  34 + CommentsServiceImpl commentsService;
  35 +
  36 + /**
  37 + * 评论送审接口
  38 + * @param json
  39 + * @return
  40 + */
  41 + @PostMapping("/import")
  42 + @ResponseBody
  43 + public ResponseBean impotComment(@RequestBody JSONObject json){
  44 + AcpComments acpComments = new AcpComments();
  45 + ShySites shySites = new ShySites();
  46 + acpComments.setState(CommonConst.AUDIT_INTT);
  47 + //判断是否白名单
  48 + shySites.setSpid(json.getInteger("spId"));
  49 + List<ShySites> shySitesList = commentsService.getBusiness(shySites);
  50 + if(!shySitesList.isEmpty()){
  51 + if(!shySitesList.get(0).getWrite_business().isEmpty()){
  52 + String write_business = shySitesList.get(0).getWrite_business();
  53 + String[] business = write_business.split(",");
  54 + List<String> asList = Arrays.asList(business);
  55 + if(asList.contains(CommonConst.BUSINESS_COMMENT+"")){
  56 + acpComments.setState(CommonConst.AUDIT_SUCCESS);
  57 + //封装json数据传参进行回调
  58 + JSONObject json1 = new JSONObject();
  59 + json1.put("activity_id",json.getString("activityId"));
  60 + json1.put("state",CommonConst.AUDIT_SUCCESS);
  61 + json1.put("attr_tags","");
  62 + json1.put("msg","");
  63 + Pass.commentPass(json1);
  64 + }else {
  65 + acpComments.setState(CommonConst.AUDIT_INTT);
  66 + }
  67 + }
  68 + }
  69 + //封装数据入库
  70 + acpComments.setProgram_id(json.getInteger("programId"));
  71 + acpComments.setComment_original_url(json.getString("originalUrl"));
  72 + acpComments.setComment_title(json.getString("commentTitle"));
  73 + acpComments.setComment_user_id(json.getInteger("commentUserId"));
  74 + acpComments.setComment_user_name(json.getString("commentUserName"));
  75 + acpComments.setComment_user_avatar(json.getString("commentUserAvatar"));
  76 + acpComments.setComment_user_ip(json.getString("commentUserIP"));
  77 + acpComments.setComment_content(json.getString("commentContent"));
  78 + acpComments.setComment_time(json.getDate("commentTime"));
  79 + acpComments.setSpid(json.getInteger("spId"));
  80 + acpComments.setApp_id(json.getString("appId"));
  81 + acpComments.setPlatform(json.getString("platform"));
  82 + acpComments.setActivity_id(json.getString("activityId"));
  83 + acpComments.setIs_hot(json.getBoolean("priority"));
  84 + acpComments.setCallback(json.getString("callback"));
  85 + int i = commentsService.impotComments(acpComments);
  86 + if(i>0){
  87 + return new ResponseBean(ErrorEnum.SUCCESS);
  88 + }else {
  89 + return new ResponseBean(ErrorEnum.ERROR);
  90 + }
  91 + }
  92 +
  93 + /**
  94 + * 评论修改状态接口
  95 + * @param json
  96 + * @return
  97 + */
  98 + @RequestMapping("/shenheComment")
  99 + @ResponseBody
  100 + public ResponseBean shenheInfo(@RequestBody JSONObject json){
  101 + Pass.commentPass(json);
  102 + int i = commentsService.updateComment(json);
  103 + if(i==0){
  104 + return new ResponseBean(ErrorEnum.ERROR);
  105 + }else {
  106 + return new ResponseBean(ErrorEnum.SUCCESS);
  107 + }
  108 + }
  109 +
  110 + /**
  111 + * 评论列表页
  112 + * @param activity_id
  113 + * @param content
  114 + * @param is_hot
  115 + * @param start_date
  116 + * @param end_date
  117 + * @param state
  118 + * @param auditor
  119 + * @param page
  120 + * @param pageSize
  121 + * @param orderByClause
  122 + * @return
  123 + */
  124 + @RequestMapping("/table")
  125 + @ResponseBody
  126 + public Object getListComments(String activity_id,String content,Integer is_hot,String start_date,String end_date,Integer state,String auditor,Integer page,Integer pageSize,String orderByClause){
  127 + if(CommonUtils.isNull(page))page=1;
  128 + if(CommonUtils.isNull(pageSize))pageSize=10;
  129 + return commentsService.getListComments(activity_id,content,is_hot,start_date,end_date,state,auditor,page,pageSize,orderByClause);
  130 + }
  131 +
  132 + /**
  133 + * 评论查看接口
  134 + * @param id
  135 + * @return
  136 + */
  137 + @RequestMapping("/Details")
  138 + @ResponseBody
  139 + public Object getDetailsComments(Integer id){
  140 + return commentsService.getDetailsComment(id);
  141 + }
  142 +}
... ...
src/main/java/com/cnlive/shenhe/controller/VideosController.java
... ... @@ -83,7 +83,7 @@ public class VideosController {
83 83 * @param msg 备注信息
84 84 * @return
85 85 */
86   - @RequestMapping("/shenheNotify")
  86 + @RequestMapping("/shenheVideo")
87 87 @ResponseBody
88 88 public ResponseBean shenheInfo(String activity_id,int state,String attr_tags,String msg){
89 89 String code = Pass.auditPass(activity_id, state, attr_tags, msg);
... ... @@ -111,7 +111,7 @@ public class VideosController {
111 111 */
112 112 @RequestMapping("/table")
113 113 @ResponseBody
114   - public Object getListContent(String video_title,String start_date,String end_date,Integer state,Integer page,Integer pageSize,String orderByClause,Integer spid){
  114 + public Object getListVideos(String video_title,String start_date,String end_date,Integer state,Integer page,Integer pageSize,String orderByClause,Integer spid){
115 115 if(CommonUtils.isNull(page))page=1;
116 116 if(CommonUtils.isNull(pageSize))pageSize=10;
117 117 if(CommonUtils.isNotNull(spid)&&spid==0){spid=82;}
... ... @@ -125,7 +125,7 @@ public class VideosController {
125 125 */
126 126 @RequestMapping("/Details")
127 127 @ResponseBody
128   - public Object getDetailsContent(Integer id){
  128 + public Object getDetailsVideo(Integer id){
129 129 return videosService.getDetailsContent(id);
130 130 }
131 131  
... ...
src/main/java/com/cnlive/shenhe/entity/AcpComments.java 0 → 100644
  1 +package com.cnlive.shenhe.entity;
  2 +
  3 +import java.util.Date;
  4 +import javax.persistence.*;
  5 +
  6 +@Table(name = "acp_comments")
  7 +public class AcpComments {
  8 + @Id
  9 + private Integer id;
  10 +
  11 + /**
  12 + * 评论内容
  13 + */
  14 + private String comment_content;
  15 +
  16 + /**
  17 + * 评论用户id
  18 + */
  19 + private Integer comment_user_id;
  20 +
  21 + /**
  22 + * 节目id
  23 + */
  24 + private Integer program_id;
  25 +
  26 + /**
  27 + * 评论的活动id
  28 + */
  29 + private String activity_id;
  30 +
  31 + /**
  32 + * 评论所属的平台
  33 + */
  34 + private String platform;
  35 +
  36 + /**
  37 + * 评论标题
  38 + */
  39 + private String comment_title;
  40 +
  41 + /**
  42 + * 评论时间
  43 + */
  44 + private Date comment_time;
  45 +
  46 + private Integer spid;
  47 +
  48 + /**
  49 + * 应用id
  50 + */
  51 + private String app_id;
  52 +
  53 + /**
  54 + * 原文链接url
  55 + */
  56 + private String comment_original_url;
  57 +
  58 + /**
  59 + * 更新者
  60 + */
  61 + private String updater;
  62 +
  63 + /**
  64 + * 审核员
  65 + */
  66 + private String auditor;
  67 +
  68 + /**
  69 + * 回调函数
  70 + */
  71 + private String callback;
  72 +
  73 + /**
  74 + * 是否是热点 对应的就是优先级 : 0:全部 ,1:不是 ,2: 是
  75 + */
  76 + private Boolean is_hot;
  77 +
  78 + /**
  79 + * 拒绝理由
  80 + */
  81 + private String msg;
  82 +
  83 + /**
  84 + * 状态 0.未审核,1:已审核,2审核失败
  85 + */
  86 + private Integer state;
  87 +
  88 + /**
  89 + * 用户昵称
  90 + */
  91 + private String comment_user_name;
  92 +
  93 + /**
  94 + * 评论用户头像url
  95 + */
  96 + private String comment_user_avatar;
  97 +
  98 + /**
  99 + * 评论用户来源ip
  100 + */
  101 + private String comment_user_ip;
  102 +
  103 + private Date created_at;
  104 +
  105 + private Date updated_at;
  106 +
  107 + /**
  108 + * @return id
  109 + */
  110 + public Integer getId() {
  111 + return id;
  112 + }
  113 +
  114 + /**
  115 + * @param id
  116 + */
  117 + public void setId(Integer id) {
  118 + this.id = id;
  119 + }
  120 +
  121 + /**
  122 + * 获取评论内容
  123 + *
  124 + * @return comment_content - 评论内容
  125 + */
  126 + public String getComment_content() {
  127 + return comment_content;
  128 + }
  129 +
  130 + /**
  131 + * 设置评论内容
  132 + *
  133 + * @param comment_content 评论内容
  134 + */
  135 + public void setComment_content(String comment_content) {
  136 + this.comment_content = comment_content;
  137 + }
  138 +
  139 + /**
  140 + * 获取评论用户id
  141 + *
  142 + * @return comment_user_id - 评论用户id
  143 + */
  144 + public Integer getComment_user_id() {
  145 + return comment_user_id;
  146 + }
  147 +
  148 + /**
  149 + * 设置评论用户id
  150 + *
  151 + * @param comment_user_id 评论用户id
  152 + */
  153 + public void setComment_user_id(Integer comment_user_id) {
  154 + this.comment_user_id = comment_user_id;
  155 + }
  156 +
  157 + /**
  158 + * 获取节目id
  159 + *
  160 + * @return program_id - 节目id
  161 + */
  162 + public Integer getProgram_id() {
  163 + return program_id;
  164 + }
  165 +
  166 + /**
  167 + * 设置节目id
  168 + *
  169 + * @param program_id 节目id
  170 + */
  171 + public void setProgram_id(Integer program_id) {
  172 + this.program_id = program_id;
  173 + }
  174 +
  175 + /**
  176 + * 获取评论的活动id
  177 + *
  178 + * @return activity_id - 评论的活动id
  179 + */
  180 + public String getActivity_id() {
  181 + return activity_id;
  182 + }
  183 +
  184 + /**
  185 + * 设置评论的活动id
  186 + *
  187 + * @param activity_id 评论的活动id
  188 + */
  189 + public void setActivity_id(String activity_id) {
  190 + this.activity_id = activity_id;
  191 + }
  192 +
  193 + /**
  194 + * 获取评论所属的平台
  195 + *
  196 + * @return platform - 评论所属的平台
  197 + */
  198 + public String getPlatform() {
  199 + return platform;
  200 + }
  201 +
  202 + /**
  203 + * 设置评论所属的平台
  204 + *
  205 + * @param platform 评论所属的平台
  206 + */
  207 + public void setPlatform(String platform) {
  208 + this.platform = platform;
  209 + }
  210 +
  211 + /**
  212 + * 获取评论标题
  213 + *
  214 + * @return comment_title - 评论标题
  215 + */
  216 + public String getComment_title() {
  217 + return comment_title;
  218 + }
  219 +
  220 + /**
  221 + * 设置评论标题
  222 + *
  223 + * @param comment_title 评论标题
  224 + */
  225 + public void setComment_title(String comment_title) {
  226 + this.comment_title = comment_title;
  227 + }
  228 +
  229 + /**
  230 + * 获取评论时间
  231 + *
  232 + * @return comment_time - 评论时间
  233 + */
  234 + public Date getComment_time() {
  235 + return comment_time;
  236 + }
  237 +
  238 + /**
  239 + * 设置评论时间
  240 + *
  241 + * @param comment_time 评论时间
  242 + */
  243 + public void setComment_time(Date comment_time) {
  244 + this.comment_time = comment_time;
  245 + }
  246 +
  247 + /**
  248 + * @return spid
  249 + */
  250 + public Integer getSpid() {
  251 + return spid;
  252 + }
  253 +
  254 + /**
  255 + * @param spid
  256 + */
  257 + public void setSpid(Integer spid) {
  258 + this.spid = spid;
  259 + }
  260 +
  261 + /**
  262 + * 获取应用id
  263 + *
  264 + * @return app_id - 应用id
  265 + */
  266 + public String getApp_id() {
  267 + return app_id;
  268 + }
  269 +
  270 + /**
  271 + * 设置应用id
  272 + *
  273 + * @param app_id 应用id
  274 + */
  275 + public void setApp_id(String app_id) {
  276 + this.app_id = app_id;
  277 + }
  278 +
  279 + /**
  280 + * 获取原文链接url
  281 + *
  282 + * @return comment_original_url - 原文链接url
  283 + */
  284 + public String getComment_original_url() {
  285 + return comment_original_url;
  286 + }
  287 +
  288 + /**
  289 + * 设置原文链接url
  290 + *
  291 + * @param comment_original_url 原文链接url
  292 + */
  293 + public void setComment_original_url(String comment_original_url) {
  294 + this.comment_original_url = comment_original_url;
  295 + }
  296 +
  297 + /**
  298 + * 获取更新者
  299 + *
  300 + * @return updater - 更新者
  301 + */
  302 + public String getUpdater() {
  303 + return updater;
  304 + }
  305 +
  306 + /**
  307 + * 设置更新者
  308 + *
  309 + * @param updater 更新者
  310 + */
  311 + public void setUpdater(String updater) {
  312 + this.updater = updater;
  313 + }
  314 +
  315 + /**
  316 + * 获取审核员
  317 + *
  318 + * @return auditor - 审核员
  319 + */
  320 + public String getAuditor() {
  321 + return auditor;
  322 + }
  323 +
  324 + /**
  325 + * 设置审核员
  326 + *
  327 + * @param auditor 审核员
  328 + */
  329 + public void setAuditor(String auditor) {
  330 + this.auditor = auditor;
  331 + }
  332 +
  333 + /**
  334 + * 获取回调函数
  335 + *
  336 + * @return callback - 回调函数
  337 + */
  338 + public String getCallback() {
  339 + return callback;
  340 + }
  341 +
  342 + /**
  343 + * 设置回调函数
  344 + *
  345 + * @param callback 回调函数
  346 + */
  347 + public void setCallback(String callback) {
  348 + this.callback = callback;
  349 + }
  350 +
  351 + /**
  352 + * 获取是否是热点 对应的就是优先级 : 0:全部 ,1:不是 ,2: 是
  353 + *
  354 + * @return is_hot - 是否是热点 对应的就是优先级 : 0:全部 ,1:不是 ,2: 是
  355 + */
  356 + public Boolean getIs_hot() {
  357 + return is_hot;
  358 + }
  359 +
  360 + /**
  361 + * 设置是否是热点 对应的就是优先级 : 0:全部 ,1:不是 ,2: 是
  362 + *
  363 + * @param is_hot 是否是热点 对应的就是优先级 : 0:全部 ,1:不是 ,2: 是
  364 + */
  365 + public void setIs_hot(Boolean is_hot) {
  366 + this.is_hot = is_hot;
  367 + }
  368 +
  369 + /**
  370 + * 获取拒绝理由
  371 + *
  372 + * @return msg - 拒绝理由
  373 + */
  374 + public String getMsg() {
  375 + return msg;
  376 + }
  377 +
  378 + /**
  379 + * 设置拒绝理由
  380 + *
  381 + * @param msg 拒绝理由
  382 + */
  383 + public void setMsg(String msg) {
  384 + this.msg = msg;
  385 + }
  386 +
  387 + /**
  388 + * 获取状态 0.未审核,1:已审核,2审核失败
  389 + *
  390 + * @return state - 状态 0.未审核,1:已审核,2审核失败
  391 + */
  392 + public Integer getState() {
  393 + return state;
  394 + }
  395 +
  396 + /**
  397 + * 设置状态 0.未审核,1:已审核,2审核失败
  398 + *
  399 + * @param state 状态 0.未审核,1:已审核,2审核失败
  400 + */
  401 + public void setState(Integer state) {
  402 + this.state = state;
  403 + }
  404 +
  405 + /**
  406 + * 获取用户昵称
  407 + *
  408 + * @return comment_user_name - 用户昵称
  409 + */
  410 + public String getComment_user_name() {
  411 + return comment_user_name;
  412 + }
  413 +
  414 + /**
  415 + * 设置用户昵称
  416 + *
  417 + * @param comment_user_name 用户昵称
  418 + */
  419 + public void setComment_user_name(String comment_user_name) {
  420 + this.comment_user_name = comment_user_name;
  421 + }
  422 +
  423 + /**
  424 + * 获取评论用户头像url
  425 + *
  426 + * @return comment_user_avatar - 评论用户头像url
  427 + */
  428 + public String getComment_user_avatar() {
  429 + return comment_user_avatar;
  430 + }
  431 +
  432 + /**
  433 + * 设置评论用户头像url
  434 + *
  435 + * @param comment_user_avatar 评论用户头像url
  436 + */
  437 + public void setComment_user_avatar(String comment_user_avatar) {
  438 + this.comment_user_avatar = comment_user_avatar;
  439 + }
  440 +
  441 + /**
  442 + * 获取评论用户来源ip
  443 + *
  444 + * @return comment_user_ip - 评论用户来源ip
  445 + */
  446 + public String getComment_user_ip() {
  447 + return comment_user_ip;
  448 + }
  449 +
  450 + /**
  451 + * 设置评论用户来源ip
  452 + *
  453 + * @param comment_user_ip 评论用户来源ip
  454 + */
  455 + public void setComment_user_ip(String comment_user_ip) {
  456 + this.comment_user_ip = comment_user_ip;
  457 + }
  458 +
  459 + /**
  460 + * @return created_at
  461 + */
  462 + public Date getCreated_at() {
  463 + return created_at;
  464 + }
  465 +
  466 + /**
  467 + * @param created_at
  468 + */
  469 + public void setCreated_at(Date created_at) {
  470 + this.created_at = created_at;
  471 + }
  472 +
  473 + /**
  474 + * @return updated_at
  475 + */
  476 + public Date getUpdated_at() {
  477 + return updated_at;
  478 + }
  479 +
  480 + /**
  481 + * @param updated_at
  482 + */
  483 + public void setUpdated_at(Date updated_at) {
  484 + this.updated_at = updated_at;
  485 + }
  486 +}
0 487 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/mapper/AcpCommentsMapper.java 0 → 100644
  1 +package com.cnlive.shenhe.mapper;
  2 +
  3 +import com.cnlive.shenhe.entity.AcpComments;
  4 +import tk.mybatis.mapper.common.Mapper;
  5 +
  6 +public interface AcpCommentsMapper extends Mapper<AcpComments> {
  7 +}
0 8 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java 0 → 100644
  1 +package com.cnlive.shenhe.serviceImpl;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.cnlive.shenhe.entity.AcpComments;
  5 +import com.cnlive.shenhe.entity.ShySites;
  6 +import com.cnlive.shenhe.entity.ShyVideos;
  7 +import com.cnlive.shenhe.mapper.AcpCommentsMapper;
  8 +import com.cnlive.shenhe.mapper.ShySitesMapper;
  9 +import com.cnlive.shenhe.utils.CommonUtils;
  10 +import com.github.pagehelper.PageHelper;
  11 +import com.github.pagehelper.PageInfo;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +import tk.mybatis.mapper.entity.Example;
  15 +
  16 +import java.util.List;
  17 +
  18 +/**
  19 + * @Auther: chenhao
  20 + * @Date: 2018/12/4 17:30
  21 + * @Description:
  22 + */
  23 +@Service
  24 +public class CommentsServiceImpl {
  25 + @Autowired
  26 + AcpCommentsMapper acpCommentsMapper;
  27 + @Autowired
  28 + ShySitesMapper shySitesMapper;
  29 +
  30 +
  31 + public List<ShySites> getBusiness (ShySites shySites ) {
  32 + List<ShySites> sitesList = shySitesMapper.select(shySites);
  33 + return sitesList;
  34 + }
  35 + public int impotComments(AcpComments acpComments){
  36 + int result = acpCommentsMapper.insert(acpComments);
  37 + return result;
  38 + }
  39 + public int updateComment(JSONObject json){
  40 + AcpComments acpComments = new AcpComments();
  41 + acpComments.setActivity_id(json.getString("activity_id"));
  42 + Integer id = acpCommentsMapper.select(acpComments).get(0).getId();
  43 + acpComments.setId(id);
  44 + acpComments.setState(json.getInteger("state"));
  45 + acpComments.setMsg(json.getString("msg"));
  46 + int result = acpCommentsMapper.updateByPrimaryKey(acpComments);
  47 + return result;
  48 + }
  49 + public PageInfo<AcpComments> getListComments(String activity_id,String content,Integer is_hot,String start_date,String end_date,Integer state,String auditor,Integer page,Integer pageSize,String orderByClause){
  50 + Example example = new Example(AcpComments.class);
  51 + Example.Criteria criteria = example.createCriteria();
  52 + if (CommonUtils.isNotEmpty(orderByClause)) {
  53 + example.setOrderByClause(orderByClause);
  54 + }
  55 + if (CommonUtils.isNotEmpty(start_date)&&CommonUtils.isNotEmpty(end_date)) {
  56 + criteria.andGreaterThanOrEqualTo("comment_time",start_date);
  57 + criteria.andLessThanOrEqualTo("comment_time",end_date);
  58 + }
  59 + if (CommonUtils.isNotEmpty(content)){
  60 + criteria.andLike("comment_content", "%" + content + "%");
  61 + }
  62 + if (CommonUtils.isNotNull(is_hot)){
  63 + criteria.andEqualTo("is_hot", is_hot );
  64 + }
  65 + if (CommonUtils.isNotEmpty(activity_id)){
  66 + criteria.andEqualTo("activity_id", activity_id);
  67 + }
  68 + //默认按上传时间倒序排序
  69 + example.setOrderByClause("comment_time desc");
  70 + PageHelper.startPage(page, pageSize, true);
  71 + List<AcpComments> commentsList = acpCommentsMapper.selectByExample(example);
  72 + PageInfo<AcpComments> pageInfo = new PageInfo<>(commentsList);
  73 + return pageInfo;
  74 + }
  75 +
  76 + public Object getDetailsComment(Integer id){
  77 + AcpComments comment = acpCommentsMapper.selectByPrimaryKey(id);
  78 + return comment;
  79 + }
  80 +}
  81 +
  82 +
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -41,7 +41,7 @@ public class VideosServiceImpl {
41 41 shyVideos.setState(state);
42 42 shyVideos.setVideo_tags(attr_tags);
43 43 shyVideos.setMsg(msg);
44   - return shyVideosMapper.updateByPrimaryKeySelective(shyVideos);
  44 + return shyVideosMapper.updateByPrimaryKey(shyVideos);
45 45 }
46 46  
47 47 public PageInfo<ShyVideos> getListContent(String video_title, String start_date,String end_date,Integer state, Integer page, Integer pageSize, String orderByClause, Integer spid){
... ...
src/main/java/com/cnlive/shenhe/utils/AuditPass.java
1 1 package com.cnlive.shenhe.utils;
2 2  
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import org.apache.http.entity.StringEntity;
3 5 import org.springframework.beans.factory.annotation.Value;
4 6 import org.springframework.stereotype.Component;
5 7  
... ... @@ -17,11 +19,22 @@ import java.util.Map;
17 19 public class AuditPass {
18 20  
19 21 @Value("${url}")
20   - private String url;
  22 + private String url;//点播url
21 23 @Value("${platformKey}")
22   - private String platformKey;
  24 + private String platformKey;//点播platformKey
23 25 @Value("${platformValue}")
24   - private String platformValue;
  26 + private String platformValue;//点播platformValue
  27 + @Value("${commenturl}")
  28 + private String commentUrl;
  29 +
  30 + /**
  31 + * 点播视频回调
  32 + * @param activity_id
  33 + * @param state
  34 + * @param attr_tags
  35 + * @param msg
  36 + * @return
  37 + */
25 38 public String auditPass(String activity_id,int state,String attr_tags,String msg){
26 39 String token = null;
27 40 try {
... ... @@ -43,4 +56,10 @@ public class AuditPass {
43 56 String code = post.get("code");
44 57 return code;
45 58 }
  59 +
  60 + public void commentPass(JSONObject json){
  61 + HttpUtil httpUtil = HttpUtil.init();
  62 + httpUtil.setStringParam(json.toJSONString());
  63 + httpUtil.post(commentUrl);
  64 + }
46 65 }
... ...
src/main/resources/application.properties
... ... @@ -15,7 +15,10 @@ mybatis.type-aliases-package=com.cnlive.shenhe.entity
15 15 sync_users_api=http://api.cnlive.com/open/api2/inner2/shenhe/getuser
16 16 sync_users_app_key=314a9dd4-a9b7-4c12-bbbe-1150a36491ae
17 17  
18   -
  18 +#点播云需要的常量
19 19 url=http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify
20 20 platformKey =AUDIT
21   -platformValue=10011438
22 21 \ No newline at end of file
  22 +platformValue=10011438
  23 +
  24 +#评论回调地址
  25 +commenturl=http://comment.cnlive.com/services/commentForHd/auditCallBack
23 26 \ No newline at end of file
... ...
src/main/resources/mapper/AcpCommentsMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.cnlive.shenhe.mapper.AcpCommentsMapper">
  4 + <resultMap id="BaseResultMap" type="com.cnlive.shenhe.entity.AcpComments">
  5 + <!--
  6 + WARNING - @mbg.generated
  7 + -->
  8 + <id column="id" jdbcType="INTEGER" property="id" />
  9 + <result column="comment_content" jdbcType="VARCHAR" property="comment_content" />
  10 + <result column="comment_user_id" jdbcType="INTEGER" property="comment_user_id" />
  11 + <result column="program_id" jdbcType="INTEGER" property="program_id" />
  12 + <result column="activity_id" jdbcType="VARCHAR" property="activity_id" />
  13 + <result column="platform" jdbcType="VARCHAR" property="platform" />
  14 + <result column="comment_title" jdbcType="VARCHAR" property="comment_title" />
  15 + <result column="comment_time" jdbcType="TIMESTAMP" property="comment_time" />
  16 + <result column="spid" jdbcType="INTEGER" property="spid" />
  17 + <result column="app_id" jdbcType="VARCHAR" property="app_id" />
  18 + <result column="comment_original_url" jdbcType="VARCHAR" property="comment_original_url" />
  19 + <result column="updater" jdbcType="VARCHAR" property="updater" />
  20 + <result column="auditor" jdbcType="VARCHAR" property="auditor" />
  21 + <result column="callback" jdbcType="VARCHAR" property="callback" />
  22 + <result column="is_hot" jdbcType="BIT" property="is_hot" />
  23 + <result column="msg" jdbcType="VARCHAR" property="msg" />
  24 + <result column="state" jdbcType="INTEGER" property="state" />
  25 + <result column="comment_user_name" jdbcType="VARCHAR" property="comment_user_name" />
  26 + <result column="comment_user_avatar" jdbcType="VARCHAR" property="comment_user_avatar" />
  27 + <result column="comment_user_ip" jdbcType="CHAR" property="comment_user_ip" />
  28 + <result column="created_at" jdbcType="TIMESTAMP" property="created_at" />
  29 + <result column="updated_at" jdbcType="TIMESTAMP" property="updated_at" />
  30 + </resultMap>
  31 +</mapper>
0 32 \ No newline at end of file
... ...