Commit 50e076dc3191aa2b4cb26d14d773f12a5e654ca7
1 parent
32a5b6f9
优化代码、删去无引用的注入、删去注释的代码、将下划线统一换成驼峰命名
Showing
47 changed files
with
367 additions
and
654 deletions
src/main/java/com/cnlive/shenhe/api/AudioControllerApi.java
| @@ -41,7 +41,7 @@ public class AudioControllerApi { | @@ -41,7 +41,7 @@ public class AudioControllerApi { | ||
| 41 | @Autowired | 41 | @Autowired |
| 42 | YiDunServiceImpl yiDunServiceImpl; | 42 | YiDunServiceImpl yiDunServiceImpl; |
| 43 | @Autowired | 43 | @Autowired |
| 44 | - AuditPass Pass; | 44 | + AuditPass pass; |
| 45 | 45 | ||
| 46 | /** | 46 | /** |
| 47 | * 音频入库 | 47 | * 音频入库 |
| @@ -143,7 +143,7 @@ public class AudioControllerApi { | @@ -143,7 +143,7 @@ public class AudioControllerApi { | ||
| 143 | newshyAudio.setState(1); | 143 | newshyAudio.setState(1); |
| 144 | newshyAudio.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); | 144 | newshyAudio.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE); |
| 145 | newshyAudio.setReceive(CommonConst.RECEIVE_AUDIT); | 145 | newshyAudio.setReceive(CommonConst.RECEIVE_AUDIT); |
| 146 | - Pass.audioPass(shyAudio.getAudioId(), 3, shyAudio.getAttr_tags(), "易盾点播音频审核通过了", shyAudio.getCallback()); | 146 | + pass.audioPass(shyAudio.getAudioId(), 3, shyAudio.getAttr_tags(), "易盾点播音频审核通过了", shyAudio.getCallback()); |
| 147 | } else { | 147 | } else { |
| 148 | String labelMsg = ""; | 148 | String labelMsg = ""; |
| 149 | if (action != 0 && asrStatus == 3) { | 149 | if (action != 0 && asrStatus == 3) { |
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
| @@ -34,6 +34,7 @@ public class ChannelControllerApi { | @@ -34,6 +34,7 @@ public class ChannelControllerApi { | ||
| 34 | * @Date: 2019/08/17 11:17 | 34 | * @Date: 2019/08/17 11:17 |
| 35 | * @Description: 频道送审接口 | 35 | * @Description: 频道送审接口 |
| 36 | */ | 36 | */ |
| 37 | + @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming") | ||
| 37 | @PostMapping("/import") | 38 | @PostMapping("/import") |
| 38 | @ResponseBody | 39 | @ResponseBody |
| 39 | public ResponseBean impotChannel(String param) { | 40 | public ResponseBean impotChannel(String param) { |
| @@ -62,8 +63,8 @@ public class ChannelControllerApi { | @@ -62,8 +63,8 @@ public class ChannelControllerApi { | ||
| 62 | shyChannel1.setOffline(CommonConstStates.ZHENGCHANG); | 63 | shyChannel1.setOffline(CommonConstStates.ZHENGCHANG); |
| 63 | shyChannel1.setUpdated_at(CommonUtils.getCurrentTime()); | 64 | shyChannel1.setUpdated_at(CommonUtils.getCurrentTime()); |
| 64 | channelService.getShenheType(shyChannel1); | 65 | channelService.getShenheType(shyChannel1); |
| 65 | - boolean YorN = channelService.updateshyChannel(shyChannel1); | ||
| 66 | - if (YorN) { | 66 | + boolean yorN = channelService.updateshyChannel(shyChannel1); |
| 67 | + if (yorN) { | ||
| 67 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); | 68 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); |
| 68 | } | 69 | } |
| 69 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(更新)"); | 70 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(更新)"); |
| @@ -79,8 +80,8 @@ public class ChannelControllerApi { | @@ -79,8 +80,8 @@ public class ChannelControllerApi { | ||
| 79 | shyChannel.setCreated_at(CommonUtils.getCurrentTime()); | 80 | shyChannel.setCreated_at(CommonUtils.getCurrentTime()); |
| 80 | shyChannel.setUpdated_at(CommonUtils.getCurrentTime()); | 81 | shyChannel.setUpdated_at(CommonUtils.getCurrentTime()); |
| 81 | channelService.getShenheType(shyChannel); | 82 | channelService.getShenheType(shyChannel); |
| 82 | - boolean YorN = channelService.impotChannel(shyChannel); | ||
| 83 | - if (YorN) { | 83 | + boolean yorN = channelService.impotChannel(shyChannel); |
| 84 | + if (yorN) { | ||
| 84 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); | 85 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功"); |
| 85 | } | 86 | } |
| 86 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(新增)"); | 87 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(新增)"); |
src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
| @@ -5,8 +5,6 @@ import com.cnlive.shenhe.bean.ErrorEnum; | @@ -5,8 +5,6 @@ import com.cnlive.shenhe.bean.ErrorEnum; | ||
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.entity.ShyComments; | 6 | import com.cnlive.shenhe.entity.ShyComments; |
| 7 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | 7 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 8 | -import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; | ||
| 9 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 10 | import com.cnlive.shenhe.utils.CommonConst; | 8 | import com.cnlive.shenhe.utils.CommonConst; |
| 11 | import com.cnlive.shenhe.utils.CommonUtils; | 9 | import com.cnlive.shenhe.utils.CommonUtils; |
| 12 | import org.slf4j.Logger; | 10 | import org.slf4j.Logger; |
| @@ -28,11 +26,7 @@ import java.util.List; | @@ -28,11 +26,7 @@ import java.util.List; | ||
| 28 | public class CommentsControllerApi { | 26 | public class CommentsControllerApi { |
| 29 | private static Logger logger = LoggerFactory.getLogger(CommentsControllerApi.class); | 27 | private static Logger logger = LoggerFactory.getLogger(CommentsControllerApi.class); |
| 30 | @Autowired | 28 | @Autowired |
| 31 | - AuditPass Pass; | ||
| 32 | - @Autowired | ||
| 33 | CommentsServiceImpl commentsService; | 29 | CommentsServiceImpl commentsService; |
| 34 | - @Autowired | ||
| 35 | - TopicServiceImpl topicService; | ||
| 36 | 30 | ||
| 37 | /** | 31 | /** |
| 38 | * @Auther: chenhao | 32 | * @Auther: chenhao |
| @@ -54,7 +48,7 @@ public class CommentsControllerApi { | @@ -54,7 +48,7 @@ public class CommentsControllerApi { | ||
| 54 | Integer commentUserId = json.getInteger("commentUserId"); | 48 | Integer commentUserId = json.getInteger("commentUserId"); |
| 55 | String commentUserName = json.getString("commentUserName"); | 49 | String commentUserName = json.getString("commentUserName"); |
| 56 | String commentUserAvatar = json.getString("commentUserAvatar"); | 50 | String commentUserAvatar = json.getString("commentUserAvatar"); |
| 57 | - String commentUserIP = json.getString("commentUserIP"); | 51 | + String commentUserIp = json.getString("commentUserIP"); |
| 58 | String commentContent = json.getString("commentContent"); | 52 | String commentContent = json.getString("commentContent"); |
| 59 | String appId = json.getString("appId"); | 53 | String appId = json.getString("appId"); |
| 60 | String platform = json.getString("platform"); | 54 | String platform = json.getString("platform"); |
| @@ -72,11 +66,11 @@ public class CommentsControllerApi { | @@ -72,11 +66,11 @@ public class CommentsControllerApi { | ||
| 72 | shyComments.setActivity_id(json.getString("activityId")); | 66 | shyComments.setActivity_id(json.getString("activityId")); |
| 73 | List<ShyComments> commentsList = commentsService.findshyComments(shyComments); | 67 | List<ShyComments> commentsList = commentsService.findshyComments(shyComments); |
| 74 | 68 | ||
| 75 | - Integer sp_id = null; | 69 | + Integer spId = null; |
| 76 | try { | 70 | try { |
| 77 | - sp_id = json.getInteger("spId"); | 71 | + spId = json.getInteger("spId"); |
| 78 | } catch (Exception e) { | 72 | } catch (Exception e) { |
| 79 | - sp_id = null; | 73 | + spId = null; |
| 80 | } | 74 | } |
| 81 | //存在则更新 | 75 | //存在则更新 |
| 82 | if (commentsList.size() > 0) { | 76 | if (commentsList.size() > 0) { |
| @@ -88,20 +82,19 @@ public class CommentsControllerApi { | @@ -88,20 +82,19 @@ public class CommentsControllerApi { | ||
| 88 | shyComments1.setComment_user_id(commentUserId); | 82 | shyComments1.setComment_user_id(commentUserId); |
| 89 | shyComments1.setComment_user_name(commentUserName); | 83 | shyComments1.setComment_user_name(commentUserName); |
| 90 | shyComments1.setComment_user_avatar(commentUserAvatar); | 84 | shyComments1.setComment_user_avatar(commentUserAvatar); |
| 91 | - shyComments1.setComment_user_ip(commentUserIP); | 85 | + shyComments1.setComment_user_ip(commentUserIp); |
| 92 | shyComments1.setComment_content(commentContent); | 86 | shyComments1.setComment_content(commentContent); |
| 93 | shyComments1.setType(type); | 87 | shyComments1.setType(type); |
| 94 | shyComments1.setLevel(level); | 88 | shyComments1.setLevel(level); |
| 95 | - | ||
| 96 | shyComments1.setComment_time(timestamp); | 89 | shyComments1.setComment_time(timestamp); |
| 97 | - shyComments1.setSpid(sp_id); | 90 | + shyComments1.setSpid(spId); |
| 98 | shyComments1.setApp_id(appId); | 91 | shyComments1.setApp_id(appId); |
| 99 | shyComments1.setPlatform(platform); | 92 | shyComments1.setPlatform(platform); |
| 100 | shyComments1.setActivity_id(activityId); | 93 | shyComments1.setActivity_id(activityId); |
| 101 | shyComments1.setIs_hot(priority); | 94 | shyComments1.setIs_hot(priority); |
| 102 | shyComments1.setCallback(callback); | 95 | shyComments1.setCallback(callback); |
| 103 | - boolean YorN = commentsService.updateshyComments1(shyComments1); | ||
| 104 | - if (YorN == true) { | 96 | + boolean yorN = commentsService.updateshyComments1(shyComments1); |
| 97 | + if (yorN) { | ||
| 105 | return new ResponseBean(ErrorEnum.SUCCESS); | 98 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 106 | } else { | 99 | } else { |
| 107 | return new ResponseBean(ErrorEnum.ERROR); | 100 | return new ResponseBean(ErrorEnum.ERROR); |
| @@ -115,19 +108,19 @@ public class CommentsControllerApi { | @@ -115,19 +108,19 @@ public class CommentsControllerApi { | ||
| 115 | shyComments.setComment_user_id(commentUserId); | 108 | shyComments.setComment_user_id(commentUserId); |
| 116 | shyComments.setComment_user_name(commentUserName); | 109 | shyComments.setComment_user_name(commentUserName); |
| 117 | shyComments.setComment_user_avatar(commentUserAvatar); | 110 | shyComments.setComment_user_avatar(commentUserAvatar); |
| 118 | - shyComments.setComment_user_ip(commentUserIP); | 111 | + shyComments.setComment_user_ip(commentUserIp); |
| 119 | shyComments.setComment_content(commentContent); | 112 | shyComments.setComment_content(commentContent); |
| 120 | shyComments.setComment_time(timestamp); | 113 | shyComments.setComment_time(timestamp); |
| 121 | shyComments.setType(type); | 114 | shyComments.setType(type); |
| 122 | shyComments.setLevel(level); | 115 | shyComments.setLevel(level); |
| 123 | - shyComments.setSpid(sp_id); | 116 | + shyComments.setSpid(spId); |
| 124 | shyComments.setApp_id(appId); | 117 | shyComments.setApp_id(appId); |
| 125 | shyComments.setPlatform(platform); | 118 | shyComments.setPlatform(platform); |
| 126 | shyComments.setIs_hot(priority); | 119 | shyComments.setIs_hot(priority); |
| 127 | shyComments.setCallback(callback); | 120 | shyComments.setCallback(callback); |
| 128 | commentsService.getShenheType(shyComments); | 121 | commentsService.getShenheType(shyComments); |
| 129 | - boolean YorN = commentsService.impotComments(shyComments); | ||
| 130 | - if (YorN == true) { | 122 | + boolean yorN = commentsService.impotComments(shyComments); |
| 123 | + if (yorN) { | ||
| 131 | return new ResponseBean(ErrorEnum.SUCCESS); | 124 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 132 | } else { | 125 | } else { |
| 133 | return new ResponseBean(ErrorEnum.ERROR); | 126 | return new ResponseBean(ErrorEnum.ERROR); |
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -76,7 +76,6 @@ public class ContentControllerApi { | @@ -76,7 +76,6 @@ public class ContentControllerApi { | ||
| 76 | if (CommonUtils.isNotEmpty(contentTime)) { | 76 | if (CommonUtils.isNotEmpty(contentTime)) { |
| 77 | Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); | 77 | Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); |
| 78 | shyContent1.setContent_time(timestamp); | 78 | shyContent1.setContent_time(timestamp); |
| 79 | - | ||
| 80 | } | 79 | } |
| 81 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); | 80 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); |
| 82 | //回调地址 | 81 | //回调地址 |
| @@ -93,8 +92,8 @@ public class ContentControllerApi { | @@ -93,8 +92,8 @@ public class ContentControllerApi { | ||
| 93 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); | 92 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 94 | //最后一次更新时间 | 93 | //最后一次更新时间 |
| 95 | shyContent1.setLast_update(CommonUtils.getCurrentTime()); | 94 | shyContent1.setLast_update(CommonUtils.getCurrentTime()); |
| 96 | - boolean YorN = contentService.updateshyContent(shyContent1); | ||
| 97 | - if (YorN == true) { | 95 | + boolean yorN = contentService.updateshyContent(shyContent1); |
| 96 | + if (yorN) { | ||
| 98 | logger.info("图文同步接口更新成功:{}", contentId); | 97 | logger.info("图文同步接口更新成功:{}", contentId); |
| 99 | return new ResponseBean(ErrorEnum.SUCCESS); | 98 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 100 | } else { | 99 | } else { |
| @@ -130,15 +129,8 @@ public class ContentControllerApi { | @@ -130,15 +129,8 @@ public class ContentControllerApi { | ||
| 130 | shyContent.setContent_text(json.getString("content_text")); | 129 | shyContent.setContent_text(json.getString("content_text")); |
| 131 | //创建时间 | 130 | //创建时间 |
| 132 | shyContent.setContent_time(new Date()); | 131 | shyContent.setContent_time(new Date()); |
| 133 | - //String contentTime = json.getString("contentTime"); | ||
| 134 | - //if (CommonUtils.isNotEmpty(contentTime)) { | ||
| 135 | - // Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); | ||
| 136 | - // shyContent.setContent_time(timestamp); | ||
| 137 | - // | ||
| 138 | - //} | ||
| 139 | String contentTag = json.getString("content_tag"); | 132 | String contentTag = json.getString("content_tag"); |
| 140 | shyContent.setContent_tag(StringUtils.isEmpty(contentTag) ? "content" : contentTag); | 133 | shyContent.setContent_tag(StringUtils.isEmpty(contentTag) ? "content" : contentTag); |
| 141 | - | ||
| 142 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); | 134 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); |
| 143 | //回调地址 | 135 | //回调地址 |
| 144 | shyContent.setCallback(json.getString("callback")); | 136 | shyContent.setCallback(json.getString("callback")); |
| @@ -152,8 +144,8 @@ public class ContentControllerApi { | @@ -152,8 +144,8 @@ public class ContentControllerApi { | ||
| 152 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); | 144 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 153 | //最后一次更新时间 | 145 | //最后一次更新时间 |
| 154 | shyContent.setLast_update(CommonUtils.getCurrentTime()); | 146 | shyContent.setLast_update(CommonUtils.getCurrentTime()); |
| 155 | - boolean YorN = contentService.impotContent(shyContent); | ||
| 156 | - if (YorN == true) { | 147 | + boolean yorN = contentService.impotContent(shyContent); |
| 148 | + if (yorN) { | ||
| 157 | logger.info("图文同步接口保存操作成功:{}", json.getString("contentId")); | 149 | logger.info("图文同步接口保存操作成功:{}", json.getString("contentId")); |
| 158 | return new ResponseBean(ErrorEnum.SUCCESS); | 150 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 159 | } else { | 151 | } else { |
| @@ -181,7 +173,6 @@ public class ContentControllerApi { | @@ -181,7 +173,6 @@ public class ContentControllerApi { | ||
| 181 | List<ShyContent> contentList = contentService.findshyContent(shyContent); | 173 | List<ShyContent> contentList = contentService.findshyContent(shyContent); |
| 182 | //获取审核类型 | 174 | //获取审核类型 |
| 183 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment"); | 175 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment"); |
| 184 | - | ||
| 185 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 | 176 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 |
| 186 | Integer contentType = json.getInteger("contentType"); | 177 | Integer contentType = json.getInteger("contentType"); |
| 187 | //内容图片地址 | 178 | //内容图片地址 |
| @@ -211,10 +202,6 @@ public class ContentControllerApi { | @@ -211,10 +202,6 @@ public class ContentControllerApi { | ||
| 211 | //朋友圈内容创建时间 | 202 | //朋友圈内容创建时间 |
| 212 | String contentTime = json.getString("createTime"); | 203 | String contentTime = json.getString("createTime"); |
| 213 | shyContent1.setContent_time(new Date(Long.valueOf(contentTime))); | 204 | shyContent1.setContent_time(new Date(Long.valueOf(contentTime))); |
| 214 | - //if (CommonUtils.isNotEmpty(contentTime)) { | ||
| 215 | - // //Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); | ||
| 216 | - // | ||
| 217 | - //} | ||
| 218 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); | 205 | shyContent1.setCreate_date(CommonUtils.getCurrentTime()); |
| 219 | //回调地址 | 206 | //回调地址 |
| 220 | shyContent1.setCallback(json.getString("callbackUrl")); | 207 | shyContent1.setCallback(json.getString("callbackUrl")); |
| @@ -236,10 +223,8 @@ public class ContentControllerApi { | @@ -236,10 +223,8 @@ public class ContentControllerApi { | ||
| 236 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); | 223 | shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 237 | //最后一次更新时间 | 224 | //最后一次更新时间 |
| 238 | shyContent1.setLast_update(CommonUtils.getCurrentTime()); | 225 | shyContent1.setLast_update(CommonUtils.getCurrentTime()); |
| 239 | - | ||
| 240 | - | ||
| 241 | - boolean YorN = contentService.updateshyContent(shyContent1); | ||
| 242 | - if (YorN == true) { | 226 | + boolean yorN = contentService.updateshyContent(shyContent1); |
| 227 | + if (yorN) { | ||
| 243 | return new ResponseBean(ErrorEnum.SUCCESS); | 228 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 244 | } else { | 229 | } else { |
| 245 | return new ResponseBean(ErrorEnum.ERROR); | 230 | return new ResponseBean(ErrorEnum.ERROR); |
| @@ -257,10 +242,6 @@ public class ContentControllerApi { | @@ -257,10 +242,6 @@ public class ContentControllerApi { | ||
| 257 | //创建时间 | 242 | //创建时间 |
| 258 | String contentTime = json.getString("createTime"); | 243 | String contentTime = json.getString("createTime"); |
| 259 | shyContent.setContent_time(new Date(Long.valueOf(contentTime))); | 244 | shyContent.setContent_time(new Date(Long.valueOf(contentTime))); |
| 260 | -// if (CommonUtils.isNotEmpty(contentTime)) { | ||
| 261 | -// Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); | ||
| 262 | -// | ||
| 263 | -// } | ||
| 264 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); | 245 | shyContent.setCreate_date(CommonUtils.getCurrentTime()); |
| 265 | //回调地址 | 246 | //回调地址 |
| 266 | shyContent.setCallback(json.getString("callbackUrl")); | 247 | shyContent.setCallback(json.getString("callbackUrl")); |
| @@ -280,8 +261,8 @@ public class ContentControllerApi { | @@ -280,8 +261,8 @@ public class ContentControllerApi { | ||
| 280 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); | 261 | shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE); |
| 281 | //最后一次更新时间 | 262 | //最后一次更新时间 |
| 282 | shyContent.setLast_update(CommonUtils.getCurrentTime()); | 263 | shyContent.setLast_update(CommonUtils.getCurrentTime()); |
| 283 | - boolean YorN = contentService.impotContent(shyContent); | ||
| 284 | - if (YorN == true) { | 264 | + boolean yorN = contentService.impotContent(shyContent); |
| 265 | + if (yorN) { | ||
| 285 | return new ResponseBean(ErrorEnum.SUCCESS); | 266 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 286 | } else { | 267 | } else { |
| 287 | return new ResponseBean(ErrorEnum.ERROR); | 268 | return new ResponseBean(ErrorEnum.ERROR); |
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
| @@ -35,7 +35,7 @@ public class LiveApplyControllerApi { | @@ -35,7 +35,7 @@ public class LiveApplyControllerApi { | ||
| 35 | JSONObject map = new JSONObject(); | 35 | JSONObject map = new JSONObject(); |
| 36 | JSONObject result = new JSONObject(); | 36 | JSONObject result = new JSONObject(); |
| 37 | //初始化一个请求数据库返回结果 | 37 | //初始化一个请求数据库返回结果 |
| 38 | - boolean YorN = true; | 38 | + boolean yorN = true; |
| 39 | 39 | ||
| 40 | logger.info("直播申请入库,param=====" + param); | 40 | logger.info("直播申请入库,param=====" + param); |
| 41 | JSONObject json = JSONObject.parseObject(param); | 41 | JSONObject json = JSONObject.parseObject(param); |
| @@ -67,7 +67,7 @@ public class LiveApplyControllerApi { | @@ -67,7 +67,7 @@ public class LiveApplyControllerApi { | ||
| 67 | //内容简述 | 67 | //内容简述 |
| 68 | String simpleContent = json.getString("simpleContent"); | 68 | String simpleContent = json.getString("simpleContent"); |
| 69 | //直播类型 | 69 | //直播类型 |
| 70 | - String live_type = json.getString("liveType"); | 70 | + String liveType = json.getString("liveType"); |
| 71 | //要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标 | 71 | //要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标 |
| 72 | String keys = json.getString("keys").equals("") ? "无" : json.getString("keys"); | 72 | String keys = json.getString("keys").equals("") ? "无" : json.getString("keys"); |
| 73 | //直播地点 | 73 | //直播地点 |
| @@ -82,15 +82,15 @@ public class LiveApplyControllerApi { | @@ -82,15 +82,15 @@ public class LiveApplyControllerApi { | ||
| 82 | String platforms = json.getString("platforms"); | 82 | String platforms = json.getString("platforms"); |
| 83 | //预计开始时间 | 83 | //预计开始时间 |
| 84 | String startTime = json.getString("preStartTime"); | 84 | String startTime = json.getString("preStartTime"); |
| 85 | - Date timestamp_start = null; | 85 | + Date timestampStart = null; |
| 86 | if (CommonUtils.isNotEmpty(startTime)) { | 86 | if (CommonUtils.isNotEmpty(startTime)) { |
| 87 | - timestamp_start = new Timestamp(Long.valueOf(startTime)); | 87 | + timestampStart = new Timestamp(Long.valueOf(startTime)); |
| 88 | } | 88 | } |
| 89 | //预计结束时间 | 89 | //预计结束时间 |
| 90 | String endTime = json.getString("preEndTime"); | 90 | String endTime = json.getString("preEndTime"); |
| 91 | - Date timestamp_end = null; | 91 | + Date timestampEnd = null; |
| 92 | if (CommonUtils.isNotEmpty(endTime)) { | 92 | if (CommonUtils.isNotEmpty(endTime)) { |
| 93 | - timestamp_end = new Timestamp(Long.valueOf(endTime)); | 93 | + timestampEnd = new Timestamp(Long.valueOf(endTime)); |
| 94 | } | 94 | } |
| 95 | ShyLiveapply shyliveApply1 = new ShyLiveapply(); | 95 | ShyLiveapply shyliveApply1 = new ShyLiveapply(); |
| 96 | //得到直播活动id去查询是否已有 | 96 | //得到直播活动id去查询是否已有 |
| @@ -112,11 +112,11 @@ public class LiveApplyControllerApi { | @@ -112,11 +112,11 @@ public class LiveApplyControllerApi { | ||
| 112 | //直播主题 | 112 | //直播主题 |
| 113 | shyliveApply.setTheme(theme); | 113 | shyliveApply.setTheme(theme); |
| 114 | //直播类型 | 114 | //直播类型 |
| 115 | - shyliveApply.setLive_type(live_type); | 115 | + shyliveApply.setLive_type(liveType); |
| 116 | //预计开始时间 | 116 | //预计开始时间 |
| 117 | - shyliveApply.setPre_start_time(timestamp_start); | 117 | + shyliveApply.setPre_start_time(timestampStart); |
| 118 | //预计结束时间 | 118 | //预计结束时间 |
| 119 | - shyliveApply.setPre_end_time(timestamp_end); | 119 | + shyliveApply.setPre_end_time(timestampEnd); |
| 120 | //商务模式:0免费 1收费 | 120 | //商务模式:0免费 1收费 |
| 121 | shyliveApply.setBusiness_model(businessModel); | 121 | shyliveApply.setBusiness_model(businessModel); |
| 122 | //内容属性:1商业类活动 0非商业活动 | 122 | //内容属性:1商业类活动 0非商业活动 |
| @@ -147,7 +147,7 @@ public class LiveApplyControllerApi { | @@ -147,7 +147,7 @@ public class LiveApplyControllerApi { | ||
| 147 | 147 | ||
| 148 | //获取审核类型 | 148 | //获取审核类型 |
| 149 | liveApplyServiceImpl.getShenheType(shyliveApply); | 149 | liveApplyServiceImpl.getShenheType(shyliveApply); |
| 150 | - YorN = liveApplyServiceImpl.updateshyLiveApply(shyliveApply); | 150 | + yorN = liveApplyServiceImpl.updateshyLiveApply(shyliveApply); |
| 151 | } else { | 151 | } else { |
| 152 | //查了,没有,直接插入数据库 | 152 | //查了,没有,直接插入数据库 |
| 153 | //设置频道id | 153 | //设置频道id |
| @@ -163,11 +163,11 @@ public class LiveApplyControllerApi { | @@ -163,11 +163,11 @@ public class LiveApplyControllerApi { | ||
| 163 | //直播主题 | 163 | //直播主题 |
| 164 | shyliveApply1.setTheme(theme); | 164 | shyliveApply1.setTheme(theme); |
| 165 | //直播类型 | 165 | //直播类型 |
| 166 | - shyliveApply1.setLive_type(live_type); | 166 | + shyliveApply1.setLive_type(liveType); |
| 167 | //预计开始时间 | 167 | //预计开始时间 |
| 168 | - shyliveApply1.setPre_start_time(timestamp_start); | 168 | + shyliveApply1.setPre_start_time(timestampStart); |
| 169 | //预计结束时间 | 169 | //预计结束时间 |
| 170 | - shyliveApply1.setPre_end_time(timestamp_end); | 170 | + shyliveApply1.setPre_end_time(timestampEnd); |
| 171 | //商务模式:0免费 1收费 | 171 | //商务模式:0免费 1收费 |
| 172 | shyliveApply1.setBusiness_model(businessModel); | 172 | shyliveApply1.setBusiness_model(businessModel); |
| 173 | //内容属性:1商业类活动 0非商业活动 | 173 | //内容属性:1商业类活动 0非商业活动 |
| @@ -202,10 +202,10 @@ public class LiveApplyControllerApi { | @@ -202,10 +202,10 @@ public class LiveApplyControllerApi { | ||
| 202 | //更新时间 | 202 | //更新时间 |
| 203 | shyliveApply1.setUpdated_at(CommonUtils.getCurrentTime()); | 203 | shyliveApply1.setUpdated_at(CommonUtils.getCurrentTime()); |
| 204 | 204 | ||
| 205 | - YorN = liveApplyServiceImpl.impotLiveApply(shyliveApply1); | 205 | + yorN = liveApplyServiceImpl.impotLiveApply(shyliveApply1); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | - if (YorN == true) { | 208 | + if (yorN) { |
| 209 | result.put("errorCode", "0"); | 209 | result.put("errorCode", "0"); |
| 210 | result.put("errorMessage", "直播申请审核请求收到成功"); | 210 | result.put("errorMessage", "直播申请审核请求收到成功"); |
| 211 | map.put("statusCode", "200"); | 211 | map.put("statusCode", "200"); |
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
| @@ -37,7 +37,7 @@ public class LiveControllerApi { | @@ -37,7 +37,7 @@ public class LiveControllerApi { | ||
| 37 | JSONObject map = new JSONObject(); | 37 | JSONObject map = new JSONObject(); |
| 38 | JSONObject result = new JSONObject(); | 38 | JSONObject result = new JSONObject(); |
| 39 | //初始化一个请求数据库返回结果 | 39 | //初始化一个请求数据库返回结果 |
| 40 | - boolean YorN = true; | 40 | + boolean yorN = true; |
| 41 | 41 | ||
| 42 | logger.info("直播入库,param=====" + param); | 42 | logger.info("直播入库,param=====" + param); |
| 43 | JSONObject json = JSONObject.parseObject(param); | 43 | JSONObject json = JSONObject.parseObject(param); |
| @@ -51,7 +51,7 @@ public class LiveControllerApi { | @@ -51,7 +51,7 @@ public class LiveControllerApi { | ||
| 51 | //直播频道id | 51 | //直播频道id |
| 52 | String channelId = json.getString("channelId"); | 52 | String channelId = json.getString("channelId"); |
| 53 | //直播频道id | 53 | //直播频道id |
| 54 | - String live_type = json.getString("liveType"); | 54 | + String liveType = json.getString("liveType"); |
| 55 | //rtmp直播流 | 55 | //rtmp直播流 |
| 56 | String mp4Url = json.getString("mp4Url"); | 56 | String mp4Url = json.getString("mp4Url"); |
| 57 | //m3u8直播流 | 57 | //m3u8直播流 |
| @@ -60,8 +60,10 @@ public class LiveControllerApi { | @@ -60,8 +60,10 @@ public class LiveControllerApi { | ||
| 60 | Integer spId = Integer.parseInt(json.getString("spId")); | 60 | Integer spId = Integer.parseInt(json.getString("spId")); |
| 61 | //回调地址 | 61 | //回调地址 |
| 62 | String callback = json.getString("callback"); | 62 | String callback = json.getString("callback"); |
| 63 | + | ||
| 64 | + | ||
| 63 | //优先级 | 65 | //优先级 |
| 64 | - Integer is_hot = Integer.parseInt(json.getString("priority")); | 66 | + Integer isHot = Integer.parseInt(json.getString("priority")); |
| 65 | //封面 | 67 | //封面 |
| 66 | String coverImgUrl = json.getString("coverImgUrl"); | 68 | String coverImgUrl = json.getString("coverImgUrl"); |
| 67 | //活动描述 | 69 | //活动描述 |
| @@ -70,28 +72,30 @@ public class LiveControllerApi { | @@ -70,28 +72,30 @@ public class LiveControllerApi { | ||
| 70 | String playbackUrl = json.getString("playbackUrl"); | 72 | String playbackUrl = json.getString("playbackUrl"); |
| 71 | //开始时间 | 73 | //开始时间 |
| 72 | String startTime = json.getString("startTime"); | 74 | String startTime = json.getString("startTime"); |
| 73 | - Date timestamp_start = null; | 75 | + |
| 76 | + Date timestampStart = null; | ||
| 74 | if (CommonUtils.isNotEmpty(startTime)) { | 77 | if (CommonUtils.isNotEmpty(startTime)) { |
| 75 | - timestamp_start = new Timestamp(Long.valueOf(startTime)); | 78 | + timestampStart = new Timestamp(Long.valueOf(startTime)); |
| 76 | } | 79 | } |
| 77 | //结束时间 | 80 | //结束时间 |
| 78 | String endTime = json.getString("endTime"); | 81 | String endTime = json.getString("endTime"); |
| 79 | - Date timestamp_end = null; | 82 | + Date timestampEnd = null; |
| 80 | if (CommonUtils.isNotEmpty(endTime)) { | 83 | if (CommonUtils.isNotEmpty(endTime)) { |
| 81 | - timestamp_end = new Timestamp(Long.valueOf(endTime)); | 84 | + timestampEnd = new Timestamp(Long.valueOf(endTime)); |
| 82 | } | 85 | } |
| 83 | 86 | ||
| 84 | //预计开始时间 | 87 | //预计开始时间 |
| 85 | - String pre_startTime = json.getString("preStartTime"); | ||
| 86 | - Date pre_timestamp_start = null; | ||
| 87 | - if (CommonUtils.isNotEmpty(pre_startTime)) { | ||
| 88 | - pre_timestamp_start = new Timestamp(Long.valueOf(pre_startTime)); | 88 | + String preStartTime = json.getString("preStartTime"); |
| 89 | + | ||
| 90 | + Date preTimestampStart = null; | ||
| 91 | + if (CommonUtils.isNotEmpty(preStartTime)) { | ||
| 92 | + preTimestampStart = new Timestamp(Long.valueOf(preStartTime)); | ||
| 89 | } | 93 | } |
| 90 | //预计结束时间 | 94 | //预计结束时间 |
| 91 | - String pre_endTime = json.getString("preEndTime"); | ||
| 92 | - Date pre_timestamp_end = null; | ||
| 93 | - if (CommonUtils.isNotEmpty(pre_endTime)) { | ||
| 94 | - pre_timestamp_end = new Timestamp(Long.valueOf(pre_endTime)); | 95 | + String preEndTime = json.getString("preEndTime"); |
| 96 | + Date preTimestampEnd = null; | ||
| 97 | + if (CommonUtils.isNotEmpty(preEndTime)) { | ||
| 98 | + preTimestampEnd = new Timestamp(Long.valueOf(preEndTime)); | ||
| 95 | } | 99 | } |
| 96 | 100 | ||
| 97 | ShyLive shylive1 = new ShyLive(); | 101 | ShyLive shylive1 = new ShyLive(); |
| @@ -109,8 +113,8 @@ public class LiveControllerApi { | @@ -109,8 +113,8 @@ public class LiveControllerApi { | ||
| 109 | shyLive.setActivity_name(activityName); | 113 | shyLive.setActivity_name(activityName); |
| 110 | //设置直播活动状态 | 114 | //设置直播活动状态 |
| 111 | shyLive.setActivity_status(activityStatus); | 115 | shyLive.setActivity_status(activityStatus); |
| 112 | - shyLive.setPre_start_time(pre_timestamp_start); | ||
| 113 | - shyLive.setPre_end_time(pre_timestamp_end); | 116 | + shyLive.setPre_start_time(preTimestampStart); |
| 117 | + shyLive.setPre_end_time(preTimestampEnd); | ||
| 114 | 118 | ||
| 115 | //直播活动状态,1:直播中,2:直播完成,3:待直播,0:直播撤销(手动),4:直播下线(强制) | 119 | //直播活动状态,1:直播中,2:直播完成,3:待直播,0:直播撤销(手动),4:直播下线(强制) |
| 116 | //发布直播 | 120 | //发布直播 |
| @@ -121,14 +125,14 @@ public class LiveControllerApi { | @@ -121,14 +125,14 @@ public class LiveControllerApi { | ||
| 121 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); | 125 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); |
| 122 | //启动直播 | 126 | //启动直播 |
| 123 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) { | 127 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) { |
| 124 | - shyLive.setActivity_start_time(timestamp_start); | 128 | + shyLive.setActivity_start_time(timestampStart); |
| 125 | shyLive.setActivity_end_time(null); | 129 | shyLive.setActivity_end_time(null); |
| 126 | //是否是热点: 1:不是 ,2: 是 | 130 | //是否是热点: 1:不是 ,2: 是 |
| 127 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); | 131 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); |
| 128 | //停止直播 | 132 | //停止直播 |
| 129 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_JIESHU)) { | 133 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_JIESHU)) { |
| 130 | - shyLive.setActivity_start_time(timestamp_start); | ||
| 131 | - shyLive.setActivity_end_time(timestamp_end); | 134 | + shyLive.setActivity_start_time(timestampStart); |
| 135 | + shyLive.setActivity_end_time(timestampEnd); | ||
| 132 | //回放地址 | 136 | //回放地址 |
| 133 | shyLive.setPlayback_url(playbackUrl); | 137 | shyLive.setPlayback_url(playbackUrl); |
| 134 | //状态 0:未认领 1.已领未审,2:已审 | 138 | //状态 0:未认领 1.已领未审,2:已审 |
| @@ -139,8 +143,8 @@ public class LiveControllerApi { | @@ -139,8 +143,8 @@ public class LiveControllerApi { | ||
| 139 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); | 143 | shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); |
| 140 | //审核强制下线 | 144 | //审核强制下线 |
| 141 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_XIAXIAN)) { | 145 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_XIAXIAN)) { |
| 142 | - shyLive.setActivity_start_time(timestamp_start); | ||
| 143 | - shyLive.setActivity_end_time(timestamp_end); | 146 | + shyLive.setActivity_start_time(timestampStart); |
| 147 | + shyLive.setActivity_end_time(timestampEnd); | ||
| 144 | //回放地址 | 148 | //回放地址 |
| 145 | shyLive.setPlayback_url(playbackUrl); | 149 | shyLive.setPlayback_url(playbackUrl); |
| 146 | //是否是热点: 1:不是 ,2: 是 | 150 | //是否是热点: 1:不是 ,2: 是 |
| @@ -148,7 +152,7 @@ public class LiveControllerApi { | @@ -148,7 +152,7 @@ public class LiveControllerApi { | ||
| 148 | } | 152 | } |
| 149 | //直播活动简介 | 153 | //直播活动简介 |
| 150 | shyLive.setActivity_intro(activityIntro); | 154 | shyLive.setActivity_intro(activityIntro); |
| 151 | - shyLive.setLive_type(live_type); | 155 | + shyLive.setLive_type(liveType); |
| 152 | //m3u8直播流 | 156 | //m3u8直播流 |
| 153 | shyLive.setM3u8_url(hlsUrl); | 157 | shyLive.setM3u8_url(hlsUrl); |
| 154 | //rtmp直播流 | 158 | //rtmp直播流 |
| @@ -173,7 +177,7 @@ public class LiveControllerApi { | @@ -173,7 +177,7 @@ public class LiveControllerApi { | ||
| 173 | //更新时间 | 177 | //更新时间 |
| 174 | shyLive.setUpdated_at(CommonUtils.getCurrentTime()); | 178 | shyLive.setUpdated_at(CommonUtils.getCurrentTime()); |
| 175 | 179 | ||
| 176 | - YorN = liveService.updateshyLive(shyLive); | 180 | + yorN = liveService.updateshyLive(shyLive); |
| 177 | } else { | 181 | } else { |
| 178 | //查了,没有,直接插入数据库 | 182 | //查了,没有,直接插入数据库 |
| 179 | //设置直播活动id | 183 | //设置直播活动id |
| @@ -190,20 +194,20 @@ public class LiveControllerApi { | @@ -190,20 +194,20 @@ public class LiveControllerApi { | ||
| 190 | shylive1.setShenhe_state(CommonConst.RECEIVE_BEFORE); | 194 | shylive1.setShenhe_state(CommonConst.RECEIVE_BEFORE); |
| 191 | //是否是热点: 1:不是 ,2: 是 | 195 | //是否是热点: 1:不是 ,2: 是 |
| 192 | shylive1.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); | 196 | shylive1.setIs_hot(CommonConstStates.SHIFOU_REDIANYES); |
| 193 | - shylive1.setPre_start_time(pre_timestamp_start); | ||
| 194 | - shylive1.setPre_end_time(pre_timestamp_end); | 197 | + shylive1.setPre_start_time(preTimestampStart); |
| 198 | + shylive1.setPre_end_time(preTimestampEnd); | ||
| 195 | //发布直播 | 199 | //发布直播 |
| 196 | if (activityStatus.equals(CommonConstStates.ZHIBO_DENGDAI)) { | 200 | if (activityStatus.equals(CommonConstStates.ZHIBO_DENGDAI)) { |
| 197 | shylive1.setActivity_start_time(null); | 201 | shylive1.setActivity_start_time(null); |
| 198 | shylive1.setActivity_end_time(null); | 202 | shylive1.setActivity_end_time(null); |
| 199 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) { | 203 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) { |
| 200 | //启动直播 | 204 | //启动直播 |
| 201 | - shylive1.setActivity_start_time(timestamp_start); | 205 | + shylive1.setActivity_start_time(timestampStart); |
| 202 | shylive1.setActivity_end_time(null); | 206 | shylive1.setActivity_end_time(null); |
| 203 | //停止直播 | 207 | //停止直播 |
| 204 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_JIESHU)) { | 208 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_JIESHU)) { |
| 205 | - shylive1.setActivity_start_time(timestamp_start); | ||
| 206 | - shylive1.setActivity_end_time(timestamp_end); | 209 | + shylive1.setActivity_start_time(timestampStart); |
| 210 | + shylive1.setActivity_end_time(timestampEnd); | ||
| 207 | //回放地址 | 211 | //回放地址 |
| 208 | shylive1.setPlayback_url(playbackUrl); | 212 | shylive1.setPlayback_url(playbackUrl); |
| 209 | //状态 0:未认领 1.已领未审,2:已审 | 213 | //状态 0:未认领 1.已领未审,2:已审 |
| @@ -214,8 +218,8 @@ public class LiveControllerApi { | @@ -214,8 +218,8 @@ public class LiveControllerApi { | ||
| 214 | shylive1.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); | 218 | shylive1.setIs_hot(CommonConstStates.SHIFOU_REDIANNO); |
| 215 | //审核强制下线 | 219 | //审核强制下线 |
| 216 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_XIAXIAN)) { | 220 | } else if (activityStatus.equals(CommonConstStates.ZHIBO_XIAXIAN)) { |
| 217 | - shylive1.setActivity_start_time(timestamp_start); | ||
| 218 | - shylive1.setActivity_end_time(timestamp_end); | 221 | + shylive1.setActivity_start_time(timestampStart); |
| 222 | + shylive1.setActivity_end_time(timestampEnd); | ||
| 219 | //回放地址 | 223 | //回放地址 |
| 220 | shylive1.setPlayback_url(playbackUrl); | 224 | shylive1.setPlayback_url(playbackUrl); |
| 221 | //状态 0:未认领 1.已领未审,2:已审 | 225 | //状态 0:未认领 1.已领未审,2:已审 |
| @@ -225,7 +229,7 @@ public class LiveControllerApi { | @@ -225,7 +229,7 @@ public class LiveControllerApi { | ||
| 225 | } | 229 | } |
| 226 | //直播活动简介 | 230 | //直播活动简介 |
| 227 | shylive1.setActivity_intro(activityIntro); | 231 | shylive1.setActivity_intro(activityIntro); |
| 228 | - shylive1.setLive_type(live_type); | 232 | + shylive1.setLive_type(liveType); |
| 229 | //m3u8直播流 | 233 | //m3u8直播流 |
| 230 | shylive1.setM3u8_url(hlsUrl); | 234 | shylive1.setM3u8_url(hlsUrl); |
| 231 | //rtmp直播流 | 235 | //rtmp直播流 |
| @@ -252,10 +256,10 @@ public class LiveControllerApi { | @@ -252,10 +256,10 @@ public class LiveControllerApi { | ||
| 252 | shylive1.setCreated_at(CommonUtils.getCurrentTime()); | 256 | shylive1.setCreated_at(CommonUtils.getCurrentTime()); |
| 253 | //更新时间 | 257 | //更新时间 |
| 254 | shylive1.setUpdated_at(CommonUtils.getCurrentTime()); | 258 | shylive1.setUpdated_at(CommonUtils.getCurrentTime()); |
| 255 | - YorN = liveService.impotVideo(shylive1); | 259 | + yorN = liveService.impotVideo(shylive1); |
| 256 | } | 260 | } |
| 257 | 261 | ||
| 258 | - if (YorN == true) { | 262 | + if (yorN) { |
| 259 | result.put("errorCode", "0"); | 263 | result.put("errorCode", "0"); |
| 260 | result.put("errorMessage", "直播审核请求收到成功"); | 264 | result.put("errorMessage", "直播审核请求收到成功"); |
| 261 | map.put("statusCode", "200"); | 265 | map.put("statusCode", "200"); |
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
| @@ -4,22 +4,15 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,22 +4,15 @@ import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.entity.ShyTopic; | 6 | import com.cnlive.shenhe.entity.ShyTopic; |
| 7 | -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | ||
| 8 | import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; | 7 | import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; |
| 9 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 10 | import com.cnlive.shenhe.utils.CommonConst; | 8 | import com.cnlive.shenhe.utils.CommonConst; |
| 11 | import com.cnlive.shenhe.utils.CommonUtils; | 9 | import com.cnlive.shenhe.utils.CommonUtils; |
| 12 | import com.cnlive.shenhe.utils.TransitServiceUtils; | 10 | import com.cnlive.shenhe.utils.TransitServiceUtils; |
| 13 | - | ||
| 14 | import org.slf4j.Logger; | 11 | import org.slf4j.Logger; |
| 15 | import org.slf4j.LoggerFactory; | 12 | import org.slf4j.LoggerFactory; |
| 16 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | import org.springframework.stereotype.Controller; | 14 | import org.springframework.stereotype.Controller; |
| 18 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 19 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 20 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 21 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 22 | -import org.springframework.web.bind.annotation.ResponseBody; | 15 | +import org.springframework.web.bind.annotation.*; |
| 23 | 16 | ||
| 24 | import java.util.HashMap; | 17 | import java.util.HashMap; |
| 25 | import java.util.List; | 18 | import java.util.List; |
| @@ -31,16 +24,12 @@ import java.util.Map; | @@ -31,16 +24,12 @@ import java.util.Map; | ||
| 31 | @Controller | 24 | @Controller |
| 32 | @RequestMapping("/api/topic") | 25 | @RequestMapping("/api/topic") |
| 33 | public class TopicControllerApi { | 26 | public class TopicControllerApi { |
| 27 | + | ||
| 34 | private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class); | 28 | private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class); |
| 35 | @Autowired | 29 | @Autowired |
| 36 | - AuditPass Pass; | ||
| 37 | - @Autowired | ||
| 38 | - CommentsServiceImpl commentsService; | ||
| 39 | - @Autowired | ||
| 40 | TopicServiceImpl topicService; | 30 | TopicServiceImpl topicService; |
| 41 | - | ||
| 42 | @Autowired | 31 | @Autowired |
| 43 | - TransitServiceUtils t; | 32 | + TransitServiceUtils transitServiceUtils; |
| 44 | 33 | ||
| 45 | /** | 34 | /** |
| 46 | * @author liwei | 35 | * @author liwei |
| @@ -52,11 +41,9 @@ public class TopicControllerApi { | @@ -52,11 +41,9 @@ public class TopicControllerApi { | ||
| 52 | public ResponseBean impotTopic(@RequestBody String param) { | 41 | public ResponseBean impotTopic(@RequestBody String param) { |
| 53 | logger.info("话题入库,param=====" + param); | 42 | logger.info("话题入库,param=====" + param); |
| 54 | JSONObject json = JSONObject.parseObject(param); | 43 | JSONObject json = JSONObject.parseObject(param); |
| 55 | - JSONObject result = new JSONObject(); | ||
| 56 | - | ||
| 57 | //获取所有参数 | 44 | //获取所有参数 |
| 58 | //话题id | 45 | //话题id |
| 59 | - String topic_id = json.getString("topicId"); | 46 | + String topicId = json.getString("topicId"); |
| 60 | Integer spId = null; | 47 | Integer spId = null; |
| 61 | try { | 48 | try { |
| 62 | spId = json.getInteger("spId"); | 49 | spId = json.getInteger("spId"); |
| @@ -68,18 +55,18 @@ public class TopicControllerApi { | @@ -68,18 +55,18 @@ public class TopicControllerApi { | ||
| 68 | //话题图片 | 55 | //话题图片 |
| 69 | String topicPic = json.getString("topicPic"); | 56 | String topicPic = json.getString("topicPic"); |
| 70 | //话题内容 | 57 | //话题内容 |
| 71 | - String topic_text = json.getString("topicMsg"); | 58 | + String topicText = json.getString("topicMsg"); |
| 72 | //话题创建时间 | 59 | //话题创建时间 |
| 73 | - String topic_time = json.getString("createTime"); | 60 | + String topicTime = json.getString("createTime"); |
| 74 | 61 | ||
| 75 | //话题标签 | 62 | //话题标签 |
| 76 | - String topic_tag = json.getString("topicTag"); | 63 | + String topicTag = json.getString("topicTag"); |
| 77 | //话题url | 64 | //话题url |
| 78 | - String topic_url = json.getString("topicUrl"); | 65 | + String topicUrl = json.getString("topicUrl"); |
| 79 | 66 | ||
| 80 | //判断是否存在 | 67 | //判断是否存在 |
| 81 | ShyTopic shyTopic = new ShyTopic(); | 68 | ShyTopic shyTopic = new ShyTopic(); |
| 82 | - shyTopic.setTopic_id(topic_id); | 69 | + shyTopic.setTopic_id(topicId); |
| 83 | List<ShyTopic> topicList = topicService.findshyTopic(shyTopic); | 70 | List<ShyTopic> topicList = topicService.findshyTopic(shyTopic); |
| 84 | 71 | ||
| 85 | //获取审核类型 | 72 | //获取审核类型 |
| @@ -94,13 +81,13 @@ public class TopicControllerApi { | @@ -94,13 +81,13 @@ public class TopicControllerApi { | ||
| 94 | //审核类型 | 81 | //审核类型 |
| 95 | shyTopic1.setShenhe_type(shenheType); | 82 | shyTopic1.setShenhe_type(shenheType); |
| 96 | //话题内容 | 83 | //话题内容 |
| 97 | - shyTopic1.setTopic_text(topic_text); | 84 | + shyTopic1.setTopic_text(topicText); |
| 98 | //话题标签 | 85 | //话题标签 |
| 99 | - shyTopic1.setTopic_tag(topic_tag); | 86 | + shyTopic1.setTopic_tag(topicTag); |
| 100 | //话题url | 87 | //话题url |
| 101 | - shyTopic1.setTopic_url(topic_url); | 88 | + shyTopic1.setTopic_url(topicUrl); |
| 102 | //话题创建时间 | 89 | //话题创建时间 |
| 103 | - shyTopic1.setTopic_time(topic_time); | 90 | + shyTopic1.setTopic_time(topicTime); |
| 104 | //spid | 91 | //spid |
| 105 | shyTopic1.setSp_id(spId); | 92 | shyTopic1.setSp_id(spId); |
| 106 | //当前话题的审核状态 | 93 | //当前话题的审核状态 |
| @@ -108,11 +95,11 @@ public class TopicControllerApi { | @@ -108,11 +95,11 @@ public class TopicControllerApi { | ||
| 108 | //最后一次更新时间 | 95 | //最后一次更新时间 |
| 109 | shyTopic1.setUpdate_date(CommonUtils.getCurrentTime()); | 96 | shyTopic1.setUpdate_date(CommonUtils.getCurrentTime()); |
| 110 | 97 | ||
| 111 | - boolean YorN = topicService.updateshyTopic(shyTopic1); | ||
| 112 | - if (YorN == true) { | ||
| 113 | - return new ResponseBean(ErrorEnum.SUCCESS, new JSONObject().put("topic_id", topic_id)); | 98 | + boolean yorN = topicService.updateshyTopic(shyTopic1); |
| 99 | + if (yorN) { | ||
| 100 | + return new ResponseBean(ErrorEnum.SUCCESS, new JSONObject().put("topic_id", topicId)); | ||
| 114 | } else { | 101 | } else { |
| 115 | - return new ResponseBean(ErrorEnum.ERROR, new JSONObject().put("topic_id", topic_id)); | 102 | + return new ResponseBean(ErrorEnum.ERROR, new JSONObject().put("topic_id", topicId)); |
| 116 | } | 103 | } |
| 117 | } | 104 | } |
| 118 | //如果不存在直接插入 | 105 | //如果不存在直接插入 |
| @@ -123,13 +110,13 @@ public class TopicControllerApi { | @@ -123,13 +110,13 @@ public class TopicControllerApi { | ||
| 123 | //审核类型 | 110 | //审核类型 |
| 124 | shyTopic.setShenhe_type(shenheType); | 111 | shyTopic.setShenhe_type(shenheType); |
| 125 | //话题内容 | 112 | //话题内容 |
| 126 | - shyTopic.setTopic_text(topic_text); | 113 | + shyTopic.setTopic_text(topicText); |
| 127 | //话题标签 | 114 | //话题标签 |
| 128 | - shyTopic.setTopic_tag(topic_tag); | 115 | + shyTopic.setTopic_tag(topicTag); |
| 129 | //话题url | 116 | //话题url |
| 130 | - shyTopic.setTopic_url(topic_url); | 117 | + shyTopic.setTopic_url(topicUrl); |
| 131 | //话题创建时间 | 118 | //话题创建时间 |
| 132 | - shyTopic.setTopic_time(topic_time); | 119 | + shyTopic.setTopic_time(topicTime); |
| 133 | //spid | 120 | //spid |
| 134 | shyTopic.setSp_id(spId); | 121 | shyTopic.setSp_id(spId); |
| 135 | //当前话题的审核状态 | 122 | //当前话题的审核状态 |
| @@ -138,24 +125,24 @@ public class TopicControllerApi { | @@ -138,24 +125,24 @@ public class TopicControllerApi { | ||
| 138 | shyTopic.setUpdate_date(CommonUtils.getCurrentTime()); | 125 | shyTopic.setUpdate_date(CommonUtils.getCurrentTime()); |
| 139 | //送审时间 | 126 | //送审时间 |
| 140 | shyTopic.setCreate_date(CommonUtils.getCurrentTime()); | 127 | shyTopic.setCreate_date(CommonUtils.getCurrentTime()); |
| 141 | - boolean YorN = topicService.impotshyTopic(shyTopic); | ||
| 142 | - if (YorN == true) { | ||
| 143 | - return new ResponseBean(ErrorEnum.SUCCESS, new JSONObject().put("topic_id", topic_id)); | 128 | + boolean yorN = topicService.impotshyTopic(shyTopic); |
| 129 | + if (yorN) { | ||
| 130 | + return new ResponseBean(ErrorEnum.SUCCESS, new JSONObject().put("topic_id", topicId)); | ||
| 144 | } else { | 131 | } else { |
| 145 | - return new ResponseBean(ErrorEnum.ERROR, new JSONObject().put("topic_id", topic_id)); | 132 | + return new ResponseBean(ErrorEnum.ERROR, new JSONObject().put("topic_id", topicId)); |
| 146 | } | 133 | } |
| 147 | } | 134 | } |
| 148 | 135 | ||
| 149 | @GetMapping("/send") | 136 | @GetMapping("/send") |
| 150 | @ResponseBody | 137 | @ResponseBody |
| 151 | public String send() { | 138 | public String send() { |
| 152 | - System.out.println("1111"); | 139 | + logger.info("1111"); |
| 153 | JSONObject params = new JSONObject(); | 140 | JSONObject params = new JSONObject(); |
| 154 | params.put("video_id", "11111"); | 141 | params.put("video_id", "11111"); |
| 155 | params.put("state", "22222"); | 142 | params.put("state", "22222"); |
| 156 | params.put("attr_tags", "33333"); | 143 | params.put("attr_tags", "33333"); |
| 157 | params.put("msg", "4444"); | 144 | params.put("msg", "4444"); |
| 158 | - t.send("cms", "/api/callback", false, params); | 145 | + transitServiceUtils.send("cms", "/api/callback", false, params); |
| 159 | return "1111"; | 146 | return "1111"; |
| 160 | } | 147 | } |
| 161 | 148 | ||
| @@ -169,27 +156,28 @@ public class TopicControllerApi { | @@ -169,27 +156,28 @@ public class TopicControllerApi { | ||
| 169 | String errorMessage = json.getString("errorMessage"); | 156 | String errorMessage = json.getString("errorMessage"); |
| 170 | //获取接收方消息 | 157 | //获取接收方消息 |
| 171 | JSONObject dataObject = json.getJSONObject("data"); | 158 | JSONObject dataObject = json.getJSONObject("data"); |
| 172 | - String topic_id = dataObject.getString("topic_id"); | 159 | + String topicId = dataObject.getString("topic_id"); |
| 173 | //获取当前话题实体 | 160 | //获取当前话题实体 |
| 174 | ShyTopic topic = new ShyTopic(); | 161 | ShyTopic topic = new ShyTopic(); |
| 175 | - topic.setTopic_id(topic_id); | 162 | + topic.setTopic_id(topicId); |
| 176 | topic = topicService.getShyTopic(topic); | 163 | topic = topicService.getShyTopic(topic); |
| 177 | 164 | ||
| 178 | - if (errorCode.equals("0")) { | ||
| 179 | - logger.info("话题id为:" + topic_id + ",cms系统已通知"); | 165 | + String numcode = "0"; |
| 166 | + if (numcode.equals(errorCode)) { | ||
| 167 | + logger.info("话题id为:" + topicId + ",cms系统已通知"); | ||
| 180 | if (topic != null) { | 168 | if (topic != null) { |
| 181 | topic.setShenhe_msg(topic.getShenhe_msg() + ",cms系统已通知"); | 169 | topic.setShenhe_msg(topic.getShenhe_msg() + ",cms系统已通知"); |
| 182 | } | 170 | } |
| 183 | } else {//中转服务器失败 | 171 | } else {//中转服务器失败 |
| 184 | - logger.info("话题id为:" + topic_id + ",中转服务器调用cms失败,失败消息:" + errorMessage); | 172 | + logger.info("话题id为:" + topicId + ",中转服务器调用cms失败,失败消息:" + errorMessage); |
| 185 | topic.setShenhe_msg(topic.getShenhe_msg() + ",中转服务器调用cms失败,失败消息:" + errorMessage); | 173 | topic.setShenhe_msg(topic.getShenhe_msg() + ",中转服务器调用cms失败,失败消息:" + errorMessage); |
| 186 | topic.setShenhe_status(CommonConst.AUDIT_INTT); | 174 | topic.setShenhe_status(CommonConst.AUDIT_INTT); |
| 187 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | 175 | topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); |
| 188 | topic.setAuditor_id(null); | 176 | topic.setAuditor_id(null); |
| 189 | } | 177 | } |
| 190 | boolean rs = topicService.updateshyTopic(topic); | 178 | boolean rs = topicService.updateshyTopic(topic); |
| 191 | - Map<String, Object> ee = new HashMap<>(); | ||
| 192 | - ee.put("topic_id", topic_id); | 179 | + Map<String, Object> ee = new HashMap<>(16); |
| 180 | + ee.put("topic_id", topicId); | ||
| 193 | if (rs) { | 181 | if (rs) { |
| 194 | return new ResponseBean(ErrorEnum.SUCCESS, ee); | 182 | return new ResponseBean(ErrorEnum.SUCCESS, ee); |
| 195 | } | 183 | } |
src/main/java/com/cnlive/shenhe/api/YiDunControllerApi.java
| @@ -49,7 +49,7 @@ public class YiDunControllerApi { | @@ -49,7 +49,7 @@ public class YiDunControllerApi { | ||
| 49 | @PostMapping("/submitYiDunUrl") | 49 | @PostMapping("/submitYiDunUrl") |
| 50 | @ResponseBody | 50 | @ResponseBody |
| 51 | public void submitYiDunUrl(String url) { | 51 | public void submitYiDunUrl(String url) { |
| 52 | - Map<String, String> params = new HashMap<String, String>(); | 52 | + Map<String, String> params = new HashMap<String, String>(16); |
| 53 | 53 | ||
| 54 | // 1.设置公共参数 | 54 | // 1.设置公共参数 |
| 55 | params.put("secretId", SECRETID); | 55 | params.put("secretId", SECRETID); |
src/main/java/com/cnlive/shenhe/config/SessionFilter.java
| 1 | package com.cnlive.shenhe.config; | 1 | package com.cnlive.shenhe.config; |
| 2 | 2 | ||
| 3 | +import com.cnlive.shenhe.bean.SessionUser; | ||
| 4 | +import org.slf4j.Logger; | ||
| 3 | import org.slf4j.LoggerFactory; | 5 | import org.slf4j.LoggerFactory; |
| 4 | import org.springframework.web.context.request.RequestContextHolder; | 6 | import org.springframework.web.context.request.RequestContextHolder; |
| 5 | import org.springframework.web.context.request.ServletRequestAttributes; | 7 | import org.springframework.web.context.request.ServletRequestAttributes; |
| 6 | 8 | ||
| 7 | -import com.cnlive.shenhe.bean.SessionUser; | ||
| 8 | - | ||
| 9 | import javax.servlet.*; | 9 | import javax.servlet.*; |
| 10 | import javax.servlet.http.HttpServletRequest; | 10 | import javax.servlet.http.HttpServletRequest; |
| 11 | import javax.servlet.http.HttpServletResponse; | 11 | import javax.servlet.http.HttpServletResponse; |
| @@ -23,7 +23,7 @@ import java.util.regex.Pattern; | @@ -23,7 +23,7 @@ import java.util.regex.Pattern; | ||
| 23 | * 过滤器 | 23 | * 过滤器 |
| 24 | */ | 24 | */ |
| 25 | public class SessionFilter implements Filter { | 25 | public class SessionFilter implements Filter { |
| 26 | - private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SessionFilter.class); | 26 | + private static final Logger logger = LoggerFactory.getLogger(SessionFilter.class); |
| 27 | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); | 27 | HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
| 28 | HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); | 28 | HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); |
| 29 | /** | 29 | /** |
| @@ -59,7 +59,7 @@ public class SessionFilter implements Filter { | @@ -59,7 +59,7 @@ public class SessionFilter implements Filter { | ||
| 59 | // session不存在 准备跳转失败 | 59 | // session不存在 准备跳转失败 |
| 60 | RequestDispatcher dispatcher = request.getRequestDispatcher("/users/login"); | 60 | RequestDispatcher dispatcher = request.getRequestDispatcher("/users/login"); |
| 61 | dispatcher.forward(request, response); | 61 | dispatcher.forward(request, response); |
| 62 | -// chain.doFilter(httpRequest, httpResponse); | 62 | + //chain.doFilter(httpRequest, httpResponse); |
| 63 | return; | 63 | return; |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
src/main/java/com/cnlive/shenhe/controller/AudioController.java
| @@ -63,7 +63,7 @@ public class AudioController extends BaseController { | @@ -63,7 +63,7 @@ public class AudioController extends BaseController { | ||
| 63 | String ks_domain; | 63 | String ks_domain; |
| 64 | 64 | ||
| 65 | @Autowired | 65 | @Autowired |
| 66 | - AuditPass Pass; | 66 | + AuditPass pass; |
| 67 | 67 | ||
| 68 | /** | 68 | /** |
| 69 | * 音频数据分页获取 | 69 | * 音频数据分页获取 |
| @@ -105,10 +105,11 @@ public class AudioController extends BaseController { | @@ -105,10 +105,11 @@ public class AudioController extends BaseController { | ||
| 105 | //已审+已拒绝 | 105 | //已审+已拒绝 |
| 106 | if (!CommonConst.AUDIT_INTT.equals(shyAudio.getState())) { | 106 | if (!CommonConst.AUDIT_INTT.equals(shyAudio.getState())) { |
| 107 | String updater = CommonUtils.isEmpty(shyAudio.getUploader()) ? "白名单" : shyAudio.getUploader(); | 107 | String updater = CommonUtils.isEmpty(shyAudio.getUploader()) ? "白名单" : shyAudio.getUploader(); |
| 108 | - String auditor_id = shyAudio.getAuditor_id(); | ||
| 109 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 108 | + |
| 109 | + String auditorId = shyAudio.getAuditor_id(); | ||
| 110 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 110 | ShyUsers user = new ShyUsers(); | 111 | ShyUsers user = new ShyUsers(); |
| 111 | - user.setUser_id(auditor_id); | 112 | + user.setUser_id(auditorId); |
| 112 | user = usersService.select(user); | 113 | user = usersService.select(user); |
| 113 | if (CommonUtils.isNotNull(user)) { | 114 | if (CommonUtils.isNotNull(user)) { |
| 114 | String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); | 115 | String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail(); |
| @@ -332,10 +333,10 @@ public class AudioController extends BaseController { | @@ -332,10 +333,10 @@ public class AudioController extends BaseController { | ||
| 332 | //审核员需要做处理 | 333 | //审核员需要做处理 |
| 333 | if (!shyAudioList.get(i).getState().equals(CommonConst.AUDIT_INTT)) { | 334 | if (!shyAudioList.get(i).getState().equals(CommonConst.AUDIT_INTT)) { |
| 334 | updater = CommonUtils.isEmpty(shyAudioList.get(i).getUploader()) || "null".equals(shyAudioList.get(i).getUploader()) ? "白名单" : shyAudioList.get(i).getUploader(); | 335 | updater = CommonUtils.isEmpty(shyAudioList.get(i).getUploader()) || "null".equals(shyAudioList.get(i).getUploader()) ? "白名单" : shyAudioList.get(i).getUploader(); |
| 335 | - String auditor_id = shyAudioList.get(i).getAuditor_id(); | ||
| 336 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 336 | + String auditorId = shyAudioList.get(i).getAuditor_id(); |
| 337 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 337 | ShyUsers user = new ShyUsers(); | 338 | ShyUsers user = new ShyUsers(); |
| 338 | - user.setUser_id(auditor_id); | 339 | + user.setUser_id(auditorId); |
| 339 | user = usersService.select(user); | 340 | user = usersService.select(user); |
| 340 | if (CommonUtils.isNotNull(user)) { | 341 | if (CommonUtils.isNotNull(user)) { |
| 341 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 342 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| @@ -437,7 +438,7 @@ public class AudioController extends BaseController { | @@ -437,7 +438,7 @@ public class AudioController extends BaseController { | ||
| 437 | String userId = sessionUser.getUserId(); | 438 | String userId = sessionUser.getUserId(); |
| 438 | JSONObject result; | 439 | JSONObject result; |
| 439 | try { | 440 | try { |
| 440 | - result = Pass.audioPass(activity_id, state, attr_tags, msg, callback); | 441 | + result = pass.audioPass(activity_id, state, attr_tags, msg, callback); |
| 441 | } catch (Exception e) { | 442 | } catch (Exception e) { |
| 442 | e.printStackTrace(); | 443 | e.printStackTrace(); |
| 443 | System.out.println("音频审核失败"); | 444 | System.out.println("音频审核失败"); |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| @@ -40,7 +40,7 @@ public class ChannelController extends BaseController { | @@ -40,7 +40,7 @@ public class ChannelController extends BaseController { | ||
| 40 | @Value("${spring.localhost.url}") | 40 | @Value("${spring.localhost.url}") |
| 41 | private String localhost_url;//本机地址 | 41 | private String localhost_url;//本机地址 |
| 42 | @Autowired | 42 | @Autowired |
| 43 | - AuditPass Pass; | 43 | + AuditPass pass; |
| 44 | @Autowired | 44 | @Autowired |
| 45 | ChannelServiceImpl channelService; | 45 | ChannelServiceImpl channelService; |
| 46 | 46 | ||
| @@ -99,10 +99,10 @@ public class ChannelController extends BaseController { | @@ -99,10 +99,10 @@ public class ChannelController extends BaseController { | ||
| 99 | for (ShyChannel channel : list) { | 99 | for (ShyChannel channel : list) { |
| 100 | if (!channel.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { | 100 | if (!channel.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { |
| 101 | String updater = CommonUtils.isEmpty(channel.getUpdater()) || "null".equals(channel.getUpdater()) ? "白名单" : channel.getUpdater(); | 101 | String updater = CommonUtils.isEmpty(channel.getUpdater()) || "null".equals(channel.getUpdater()) ? "白名单" : channel.getUpdater(); |
| 102 | - String auditor_id = channel.getAuditor(); | ||
| 103 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 102 | + String auditorId = channel.getAuditor(); |
| 103 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 104 | ShyUsers user = new ShyUsers(); | 104 | ShyUsers user = new ShyUsers(); |
| 105 | - user.setUser_id(auditor_id); | 105 | + user.setUser_id(auditorId); |
| 106 | user = usersService.select(user); | 106 | user = usersService.select(user); |
| 107 | if (CommonUtils.isNotNull(user)) { | 107 | if (CommonUtils.isNotNull(user)) { |
| 108 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 108 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| @@ -211,7 +211,7 @@ public class ChannelController extends BaseController { | @@ -211,7 +211,7 @@ public class ChannelController extends BaseController { | ||
| 211 | json.put("attr_tags", ""); | 211 | json.put("attr_tags", ""); |
| 212 | json.put("msg", msg); | 212 | json.put("msg", msg); |
| 213 | try { | 213 | try { |
| 214 | - result = Pass.commentPass(json, channel.getCallback()); | 214 | + result = pass.commentPass(json, channel.getCallback()); |
| 215 | } catch (Exception e) { | 215 | } catch (Exception e) { |
| 216 | logger.error("评论回调失败,activity_id:{}", channel.getChannel_id()); | 216 | logger.error("评论回调失败,activity_id:{}", channel.getChannel_id()); |
| 217 | showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; | 217 | showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败"; |
| @@ -254,7 +254,7 @@ public class ChannelController extends BaseController { | @@ -254,7 +254,7 @@ public class ChannelController extends BaseController { | ||
| 254 | @GetMapping("/channelNotice") | 254 | @GetMapping("/channelNotice") |
| 255 | @ResponseBody | 255 | @ResponseBody |
| 256 | public Map<String, Object> channelNotice() { | 256 | public Map<String, Object> channelNotice() { |
| 257 | - Map<String, Object> map = new HashMap<>(); | 257 | + Map<String, Object> map = new HashMap<>(16); |
| 258 | ShyChannel shyChannel = new ShyChannel(); | 258 | ShyChannel shyChannel = new ShyChannel(); |
| 259 | shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 | 259 | shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 |
| 260 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); | 260 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -41,7 +41,7 @@ import java.util.List; | @@ -41,7 +41,7 @@ import java.util.List; | ||
| 41 | public class CommentsController extends BaseController { | 41 | public class CommentsController extends BaseController { |
| 42 | private static Logger logger = LoggerFactory.getLogger(CommentsController.class); | 42 | private static Logger logger = LoggerFactory.getLogger(CommentsController.class); |
| 43 | @Autowired | 43 | @Autowired |
| 44 | - AuditPass Pass; | 44 | + AuditPass pass; |
| 45 | @Autowired | 45 | @Autowired |
| 46 | CommentsServiceImpl commentsService; | 46 | CommentsServiceImpl commentsService; |
| 47 | 47 | ||
| @@ -92,10 +92,10 @@ public class CommentsController extends BaseController { | @@ -92,10 +92,10 @@ public class CommentsController extends BaseController { | ||
| 92 | for (ShyComments comment : list) { | 92 | for (ShyComments comment : list) { |
| 93 | if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { | 93 | if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { |
| 94 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); | 94 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); |
| 95 | - String auditor_id = comment.getAuditor_id(); | ||
| 96 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 95 | + String auditorId = comment.getAuditor_id(); |
| 96 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 97 | ShyUsers user = new ShyUsers(); | 97 | ShyUsers user = new ShyUsers(); |
| 98 | - user.setUser_id(auditor_id); | 98 | + user.setUser_id(auditorId); |
| 99 | user = usersService.select(user); | 99 | user = usersService.select(user); |
| 100 | if (CommonUtils.isNotNull(user)) { | 100 | if (CommonUtils.isNotNull(user)) { |
| 101 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 101 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| @@ -253,7 +253,7 @@ public class CommentsController extends BaseController { | @@ -253,7 +253,7 @@ public class CommentsController extends BaseController { | ||
| 253 | json.put("attr_tags", ""); | 253 | json.put("attr_tags", ""); |
| 254 | json.put("msg", msg); | 254 | json.put("msg", msg); |
| 255 | try { | 255 | try { |
| 256 | - result = Pass.commentPass(json, comments.getCallback()); | 256 | + result = pass.commentPass(json, comments.getCallback()); |
| 257 | } catch (Exception e) { | 257 | } catch (Exception e) { |
| 258 | logger.error("评论回调失败,activity_id:{}", comments.getActivity_id()); | 258 | logger.error("评论回调失败,activity_id:{}", comments.getActivity_id()); |
| 259 | showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; | 259 | showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败"; |
| @@ -373,17 +373,17 @@ public class CommentsController extends BaseController { | @@ -373,17 +373,17 @@ public class CommentsController extends BaseController { | ||
| 373 | 373 | ||
| 374 | 374 | ||
| 375 | /*状态需要处理成用户可读*/ | 375 | /*状态需要处理成用户可读*/ |
| 376 | - String common_type = "";//评论类型,topic:话题 | 376 | + String commonType = "";//评论类型,topic:话题 |
| 377 | String type = list.get(i).getType(); | 377 | String type = list.get(i).getType(); |
| 378 | if (type != null) { | 378 | if (type != null) { |
| 379 | if (type.equals(CommonConst.CATEGORY_TOPIC)) { | 379 | if (type.equals(CommonConst.CATEGORY_TOPIC)) { |
| 380 | - common_type = "话题"; | 380 | + commonType = "话题"; |
| 381 | } | 381 | } |
| 382 | } else { | 382 | } else { |
| 383 | - common_type = "其他"; | 383 | + commonType = "其他"; |
| 384 | } | 384 | } |
| 385 | cell = row.createCell(6);//列 | 385 | cell = row.createCell(6);//列 |
| 386 | - cell.setCellValue(common_type); | 386 | + cell.setCellValue(commonType); |
| 387 | cell = row.createCell(7);//列 | 387 | cell = row.createCell(7);//列 |
| 388 | Integer level = list.get(i).getLevel(); | 388 | Integer level = list.get(i).getLevel(); |
| 389 | if (level != null) { | 389 | if (level != null) { |
| @@ -391,9 +391,9 @@ public class CommentsController extends BaseController { | @@ -391,9 +391,9 @@ public class CommentsController extends BaseController { | ||
| 391 | } | 391 | } |
| 392 | /*状态需要处理成用户可读*/ | 392 | /*状态需要处理成用户可读*/ |
| 393 | String platform = "";//评论所属的平台 | 393 | String platform = "";//评论所属的平台 |
| 394 | - if (list.get(i).getPlatform().equals("a")) { | 394 | + if ("a".equals(list.get(i).getPlatform())) { |
| 395 | platform = "安卓"; | 395 | platform = "安卓"; |
| 396 | - } else if (list.get(i).getPlatform().equals("i")) { | 396 | + } else if ("i".equals(list.get(i).getPlatform())) { |
| 397 | platform = "ios"; | 397 | platform = "ios"; |
| 398 | } else { | 398 | } else { |
| 399 | platform = "未知"; | 399 | platform = "未知"; |
| @@ -406,25 +406,26 @@ public class CommentsController extends BaseController { | @@ -406,25 +406,26 @@ public class CommentsController extends BaseController { | ||
| 406 | cell.setCellValue(list.get(i).getCreated_at() == null ? "" : CommonUtils.formatDate(list.get(i).getCreated_at(), "yyyy-MM-dd HH:mm:ss")); | 406 | cell.setCellValue(list.get(i).getCreated_at() == null ? "" : CommonUtils.formatDate(list.get(i).getCreated_at(), "yyyy-MM-dd HH:mm:ss")); |
| 407 | 407 | ||
| 408 | /*状态需要处理成用户可读*/ | 408 | /*状态需要处理成用户可读*/ |
| 409 | - String shenhe_Status = "";//状态 0.未审核,1:已审核,2审核失败 | 409 | + //状态 0.未审核,1:已审核,2审核失败 |
| 410 | + String shenheStatus = ""; | ||
| 410 | if (list.get(i).getState() == 1) { | 411 | if (list.get(i).getState() == 1) { |
| 411 | - shenhe_Status = "已审核"; | 412 | + shenheStatus = "已审核"; |
| 412 | } else if (list.get(i).getState() == 2) { | 413 | } else if (list.get(i).getState() == 2) { |
| 413 | - shenhe_Status = "已拒绝"; | 414 | + shenheStatus = "已拒绝"; |
| 414 | } else { | 415 | } else { |
| 415 | - shenhe_Status = "未审核"; | 416 | + shenheStatus = "未审核"; |
| 416 | } | 417 | } |
| 417 | cell = row.createCell(10);//列 | 418 | cell = row.createCell(10);//列 |
| 418 | - cell.setCellValue(shenhe_Status); | 419 | + cell.setCellValue(shenheStatus); |
| 419 | 420 | ||
| 420 | /* 审核员需要做处理*/ | 421 | /* 审核员需要做处理*/ |
| 421 | String updater = "";//审核员名字 | 422 | String updater = "";//审核员名字 |
| 422 | if (!list.get(i).getState().equals(CommonConst.AUDIT_INTT)) { | 423 | if (!list.get(i).getState().equals(CommonConst.AUDIT_INTT)) { |
| 423 | updater = CommonUtils.isEmpty(list.get(i).getUpdater()) || "null".equals(list.get(i).getUpdater()) ? "自动通过" : list.get(i).getUpdater(); | 424 | updater = CommonUtils.isEmpty(list.get(i).getUpdater()) || "null".equals(list.get(i).getUpdater()) ? "自动通过" : list.get(i).getUpdater(); |
| 424 | - String auditor_id = list.get(i).getAuditor_id(); | ||
| 425 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 425 | + String auditorId = list.get(i).getAuditor_id(); |
| 426 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 426 | ShyUsers user = new ShyUsers(); | 427 | ShyUsers user = new ShyUsers(); |
| 427 | - user.setUser_id(auditor_id); | 428 | + user.setUser_id(auditorId); |
| 428 | user = usersService.select(user); | 429 | user = usersService.select(user); |
| 429 | if (CommonUtils.isNotNull(user)) { | 430 | if (CommonUtils.isNotNull(user)) { |
| 430 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 431 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| @@ -95,9 +95,9 @@ public class ContentController extends BaseController { | @@ -95,9 +95,9 @@ public class ContentController extends BaseController { | ||
| 95 | if (!list.isEmpty()) { | 95 | if (!list.isEmpty()) { |
| 96 | for (ShyContent content : list) { | 96 | for (ShyContent content : list) { |
| 97 | if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { | 97 | if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { |
| 98 | - String auditor_id = content.getAuditor_id(); | 98 | + String auditorId = content.getAuditor_id(); |
| 99 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); | 99 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); |
| 100 | - updater = sitesService.getUpdater(updater, auditor_id); | 100 | + updater = sitesService.getUpdater(updater, auditorId); |
| 101 | content.setUpdater(updater); | 101 | content.setUpdater(updater); |
| 102 | } | 102 | } |
| 103 | //显示spid简称 | 103 | //显示spid简称 |
| @@ -122,13 +122,13 @@ public class ContentController extends BaseController { | @@ -122,13 +122,13 @@ public class ContentController extends BaseController { | ||
| 122 | public String getDetailsComments(@PathVariable Integer id, Model model) { | 122 | public String getDetailsComments(@PathVariable Integer id, Model model) { |
| 123 | ShyContent content = contentService.getDetailsContent(id); | 123 | ShyContent content = contentService.getDetailsContent(id); |
| 124 | if (!content.getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { | 124 | if (!content.getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { |
| 125 | - String auditor_id = content.getAuditor_id(); | 125 | + String auditorId = content.getAuditor_id(); |
| 126 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); | 126 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); |
| 127 | - updater = sitesService.getUpdater(updater, auditor_id); | 127 | + updater = sitesService.getUpdater(updater, auditorId); |
| 128 | content.setUpdater(updater); | 128 | content.setUpdater(updater); |
| 129 | } | 129 | } |
| 130 | //朋友圈内容切割内容图片或者视频地址 | 130 | //朋友圈内容切割内容图片或者视频地址 |
| 131 | - if (content.getContent_tag().equals("moment")) { | 131 | + if ("moment".equals(content.getContent_tag())) { |
| 132 | String[] contentImageUrlList = null; | 132 | String[] contentImageUrlList = null; |
| 133 | if (content.getContent_pc_url() != null) { | 133 | if (content.getContent_pc_url() != null) { |
| 134 | contentImageUrlList = content.getContent_pc_url().split(","); | 134 | contentImageUrlList = content.getContent_pc_url().split(","); |
| @@ -304,9 +304,9 @@ public class ContentController extends BaseController { | @@ -304,9 +304,9 @@ public class ContentController extends BaseController { | ||
| 304 | /*状态需要处理成用户可读*/ | 304 | /*状态需要处理成用户可读*/ |
| 305 | //图文标签 content:图文发布,moment:朋友圈 | 305 | //图文标签 content:图文发布,moment:朋友圈 |
| 306 | String contentTag = ""; | 306 | String contentTag = ""; |
| 307 | - if (contentList.get(i).getContent_tag().equals("content")) { | 307 | + if ("content".equals(contentList.get(i).getContent_tag())) { |
| 308 | contentTag = "图文发布"; | 308 | contentTag = "图文发布"; |
| 309 | - } else if (contentList.get(i).getContent_tag().equals("moment")) { | 309 | + } else if ("moment".equals(contentList.get(i).getContent_tag())) { |
| 310 | contentTag = "朋友圈"; | 310 | contentTag = "朋友圈"; |
| 311 | } | 311 | } |
| 312 | cell = row.createCell(4); | 312 | cell = row.createCell(4); |
| @@ -365,10 +365,12 @@ public class ContentController extends BaseController { | @@ -365,10 +365,12 @@ public class ContentController extends BaseController { | ||
| 365 | String updater = ""; | 365 | String updater = ""; |
| 366 | if (!contentList.get(i).getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { | 366 | if (!contentList.get(i).getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) { |
| 367 | updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater()) ? "自动通过" : contentList.get(i).getUpdater(); | 367 | updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater()) ? "自动通过" : contentList.get(i).getUpdater(); |
| 368 | - String auditor_id = contentList.get(i).getAuditor_id(); | ||
| 369 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 368 | + |
| 369 | + | ||
| 370 | + String auditorId = contentList.get(i).getAuditor_id(); | ||
| 371 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 370 | ShyUsers user = new ShyUsers(); | 372 | ShyUsers user = new ShyUsers(); |
| 371 | - user.setUser_id(auditor_id); | 373 | + user.setUser_id(auditorId); |
| 372 | user = usersService.select(user); | 374 | user = usersService.select(user); |
| 373 | if (CommonUtils.isNotNull(user)) { | 375 | if (CommonUtils.isNotNull(user)) { |
| 374 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 376 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
src/main/java/com/cnlive/shenhe/controller/EmailController.java
| @@ -9,7 +9,6 @@ import com.cnlive.shenhe.dto.EmailDTO; | @@ -9,7 +9,6 @@ import com.cnlive.shenhe.dto.EmailDTO; | ||
| 9 | import com.cnlive.shenhe.entity.ShyEmail; | 9 | import com.cnlive.shenhe.entity.ShyEmail; |
| 10 | import com.cnlive.shenhe.entity.ShyUsers; | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | import com.cnlive.shenhe.serviceImpl.EmailServiceImpl; | 11 | import com.cnlive.shenhe.serviceImpl.EmailServiceImpl; |
| 12 | -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | ||
| 13 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | 12 | import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 14 | import com.cnlive.shenhe.utils.CommonConst; | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 15 | import com.cnlive.shenhe.utils.CommonUtils; | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| @@ -40,9 +39,6 @@ public class EmailController extends BaseController { | @@ -40,9 +39,6 @@ public class EmailController extends BaseController { | ||
| 40 | @Autowired | 39 | @Autowired |
| 41 | EmailServiceImpl emailServiceImpl; | 40 | EmailServiceImpl emailServiceImpl; |
| 42 | @Autowired | 41 | @Autowired |
| 43 | - SitesServiceImpl sitesService; | ||
| 44 | - | ||
| 45 | - @Autowired | ||
| 46 | UsersServiceImpl usersService; | 42 | UsersServiceImpl usersService; |
| 47 | 43 | ||
| 48 | 44 | ||
| @@ -55,7 +51,11 @@ public class EmailController extends BaseController { | @@ -55,7 +51,11 @@ public class EmailController extends BaseController { | ||
| 55 | } | 51 | } |
| 56 | PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO); | 52 | PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO); |
| 57 | List<ShyEmail> list = emailPage.getList(); | 53 | List<ShyEmail> list = emailPage.getList(); |
| 58 | - JSONObject email_message = CommonConst.EMAIL_MESSAGE; | 54 | + |
| 55 | + | ||
| 56 | + | ||
| 57 | + | ||
| 58 | + JSONObject emailMessage = CommonConst.EMAIL_MESSAGE; | ||
| 59 | if (!list.isEmpty()) { | 59 | if (!list.isEmpty()) { |
| 60 | for (ShyEmail shyEmail : list) { | 60 | for (ShyEmail shyEmail : list) { |
| 61 | //获取更新人的名称 | 61 | //获取更新人的名称 |
| @@ -65,28 +65,30 @@ public class EmailController extends BaseController { | @@ -65,28 +65,30 @@ public class EmailController extends BaseController { | ||
| 65 | user.setUser_id(shyEmail.getUpdater()); | 65 | user.setUser_id(shyEmail.getUpdater()); |
| 66 | user = usersService.select(user); | 66 | user = usersService.select(user); |
| 67 | if (CommonUtils.isNotNull(user)) { | 67 | if (CommonUtils.isNotNull(user)) { |
| 68 | - String email_add = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | ||
| 69 | - String userName = CommonUtils.isEmpty(user.getUsername()) ? email_add : user.getUsername(); | 68 | + String emailAdd = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 69 | + String userName = CommonUtils.isEmpty(user.getUsername()) ? emailAdd : user.getUsername(); | ||
| 70 | updater = userName; | 70 | updater = userName; |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | shyEmail.setUpdater(updater); | 73 | shyEmail.setUpdater(updater); |
| 74 | 74 | ||
| 75 | //获取邮件消息类型名称 | 75 | //获取邮件消息类型名称 |
| 76 | - String email_type_name = shyEmail.getNotice_type(); | ||
| 77 | - if (CommonUtils.isNotEmpty(email_type_name)) { | ||
| 78 | - for (String bkey : email_message.keySet()) { | ||
| 79 | - email_type_name = email_type_name.replace(bkey, email_message.getString(bkey)); | 76 | + |
| 77 | + | ||
| 78 | + String emailTypeName = shyEmail.getNotice_type(); | ||
| 79 | + if (CommonUtils.isNotEmpty(emailTypeName)) { | ||
| 80 | + for (String bkey : emailMessage.keySet()) { | ||
| 81 | + emailTypeName = emailTypeName.replace(bkey, emailMessage.getString(bkey)); | ||
| 80 | } | 82 | } |
| 81 | } else { | 83 | } else { |
| 82 | - email_type_name = "无"; | 84 | + emailTypeName = "无"; |
| 83 | } | 85 | } |
| 84 | - shyEmail.setEmail_type_name(email_type_name); | 86 | + shyEmail.setEmail_type_name(emailTypeName); |
| 85 | } | 87 | } |
| 86 | } | 88 | } |
| 87 | model.addAttribute("emailPage", emailPage); | 89 | model.addAttribute("emailPage", emailPage); |
| 88 | model.addAttribute("pageSize", emailDTO.getPageSize()); | 90 | model.addAttribute("pageSize", emailDTO.getPageSize()); |
| 89 | - model.addAttribute("email_message", email_message); | 91 | + model.addAttribute("email_message", emailMessage); |
| 90 | return "page/email.html"; | 92 | return "page/email.html"; |
| 91 | } | 93 | } |
| 92 | 94 |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| @@ -45,9 +45,7 @@ import java.util.Map; | @@ -45,9 +45,7 @@ import java.util.Map; | ||
| 45 | public class LiveApplyController extends BaseController { | 45 | public class LiveApplyController extends BaseController { |
| 46 | private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class); | 46 | private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class); |
| 47 | @Autowired | 47 | @Autowired |
| 48 | - AuditPass Pass; | ||
| 49 | - @Autowired | ||
| 50 | - VideosServiceImpl videosService; | 48 | + AuditPass pass; |
| 51 | @Autowired | 49 | @Autowired |
| 52 | UsersServiceImpl usersService; | 50 | UsersServiceImpl usersService; |
| 53 | @Autowired | 51 | @Autowired |
| @@ -84,7 +82,7 @@ public class LiveApplyController extends BaseController { | @@ -84,7 +82,7 @@ public class LiveApplyController extends BaseController { | ||
| 84 | ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId)); | 82 | ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId)); |
| 85 | JSONObject result = null; | 83 | JSONObject result = null; |
| 86 | try { | 84 | try { |
| 87 | - result = Pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback()); | 85 | + result = pass.liveApplyPass(shyLiveapply.getActivity_id(), state + 2, msg, msg, shyLiveapply.getCallback()); |
| 88 | } catch (Exception e) { | 86 | } catch (Exception e) { |
| 89 | logger.error("直播视频审核失败,id==" + shyLiveApplyId, e); | 87 | logger.error("直播视频审核失败,id==" + shyLiveApplyId, e); |
| 90 | showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 88 | showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; |
| @@ -149,10 +147,13 @@ public class LiveApplyController extends BaseController { | @@ -149,10 +147,13 @@ public class LiveApplyController extends BaseController { | ||
| 149 | for (ShyLiveapply liveApply : list) { | 147 | for (ShyLiveapply liveApply : list) { |
| 150 | if (!liveApply.getShenhe_state().equals(CommonConst.AUDIT_INTT)) { | 148 | if (!liveApply.getShenhe_state().equals(CommonConst.AUDIT_INTT)) { |
| 151 | String updater = CommonUtils.isEmpty(liveApply.getUpdater()) || "null".equals(liveApply.getUpdater()) ? "白名单" : liveApply.getUpdater(); | 149 | String updater = CommonUtils.isEmpty(liveApply.getUpdater()) || "null".equals(liveApply.getUpdater()) ? "白名单" : liveApply.getUpdater(); |
| 152 | - String auditor_id = liveApply.getAuditor(); | ||
| 153 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 150 | + |
| 151 | + | ||
| 152 | + | ||
| 153 | + String auditorId = liveApply.getAuditor(); | ||
| 154 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 154 | ShyUsers user = new ShyUsers(); | 155 | ShyUsers user = new ShyUsers(); |
| 155 | - user.setUser_id(auditor_id); | 156 | + user.setUser_id(auditorId); |
| 156 | user = usersService.select(user); | 157 | user = usersService.select(user); |
| 157 | if (CommonUtils.isNotNull(user)) { | 158 | if (CommonUtils.isNotNull(user)) { |
| 158 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 159 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| @@ -272,7 +273,7 @@ public class LiveApplyController extends BaseController { | @@ -272,7 +273,7 @@ public class LiveApplyController extends BaseController { | ||
| 272 | ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 273 | ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 273 | JSONObject result = null; | 274 | JSONObject result = null; |
| 274 | try { | 275 | try { |
| 275 | - result = Pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); | 276 | + result = pass.liveApplyPass(shyLiveapply.getActivity_id(), 4, msg, msg, shyLiveapply.getCallback()); |
| 276 | } catch (Exception e) { | 277 | } catch (Exception e) { |
| 277 | logger.error("直播视频审核失败,id==" + shyLiveId, e); | 278 | logger.error("直播视频审核失败,id==" + shyLiveId, e); |
| 278 | showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; | 279 | showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败"; |
| @@ -446,7 +447,7 @@ public class LiveApplyController extends BaseController { | @@ -446,7 +447,7 @@ public class LiveApplyController extends BaseController { | ||
| 446 | @GetMapping("/liveApplyNotice") | 447 | @GetMapping("/liveApplyNotice") |
| 447 | @ResponseBody | 448 | @ResponseBody |
| 448 | public Map<String, Object> channelNotice() { | 449 | public Map<String, Object> channelNotice() { |
| 449 | - Map<String, Object> map = new HashMap<>(); | 450 | + Map<String, Object> map = new HashMap<>(16); |
| 450 | ShyLiveapply shyLiveapply = new ShyLiveapply(); | 451 | ShyLiveapply shyLiveapply = new ShyLiveapply(); |
| 451 | shyLiveapply.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 | 452 | shyLiveapply.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 |
| 452 | shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT); | 453 | shyLiveapply.setShenhe_state(CommonConst.AUDIT_INTT); |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| @@ -49,7 +49,7 @@ import java.util.Map; | @@ -49,7 +49,7 @@ import java.util.Map; | ||
| 49 | public class LiveController extends BaseController { | 49 | public class LiveController extends BaseController { |
| 50 | private static Logger logger = LoggerFactory.getLogger(LiveController.class); | 50 | private static Logger logger = LoggerFactory.getLogger(LiveController.class); |
| 51 | @Autowired | 51 | @Autowired |
| 52 | - AuditPass Pass; | 52 | + AuditPass pass; |
| 53 | @Autowired | 53 | @Autowired |
| 54 | VideosServiceImpl videosService; | 54 | VideosServiceImpl videosService; |
| 55 | @Autowired | 55 | @Autowired |
| @@ -82,11 +82,9 @@ public class LiveController extends BaseController { | @@ -82,11 +82,9 @@ public class LiveController extends BaseController { | ||
| 82 | public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { | 82 | public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) { |
| 83 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 83 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 84 | String userId = sessionUser.getUserId(); | 84 | String userId = sessionUser.getUserId(); |
| 85 | -// ShyVideos shyVideos = videosService.selectByPrimaryKey(id); | ||
| 86 | -// if (shyVideos.getReceive() && CommonUtils.isNotEmpty(shyVideos.getReceive_user_id()) && userId.equals(shyVideos.getReceive_user_id())) { | ||
| 87 | JSONObject result = null; | 85 | JSONObject result = null; |
| 88 | try { | 86 | try { |
| 89 | - result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | 87 | + result = pass.auditPass(activity_id, state, attr_tags, msg, callback); |
| 90 | } catch (Exception e) { | 88 | } catch (Exception e) { |
| 91 | e.printStackTrace(); | 89 | e.printStackTrace(); |
| 92 | System.out.println("视频审核失败"); | 90 | System.out.println("视频审核失败"); |
| @@ -107,9 +105,6 @@ public class LiveController extends BaseController { | @@ -107,9 +105,6 @@ public class LiveController extends BaseController { | ||
| 107 | return new ResponseBean(ErrorEnum.ERROR); | 105 | return new ResponseBean(ErrorEnum.ERROR); |
| 108 | } | 106 | } |
| 109 | return new ResponseBean(ErrorEnum.SUCCESS); | 107 | return new ResponseBean(ErrorEnum.SUCCESS); |
| 110 | -// } | ||
| 111 | -// logger.error("领取逻辑不符,不能审核,Video_id:{}", shyVideos.getVideo_id()); | ||
| 112 | -// return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "领取逻辑不符,不能审核"); | ||
| 113 | } | 108 | } |
| 114 | 109 | ||
| 115 | /** | 110 | /** |
| @@ -283,7 +278,7 @@ public class LiveController extends BaseController { | @@ -283,7 +278,7 @@ public class LiveController extends BaseController { | ||
| 283 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 278 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 284 | JSONObject result = null; | 279 | JSONObject result = null; |
| 285 | try { | 280 | try { |
| 286 | - result = Pass.livePass(shyLive.getActivity_id(), 6, msg, msg, shyLive.getCallback()); | 281 | + result = pass.livePass(shyLive.getActivity_id(), 6, msg, msg, shyLive.getCallback()); |
| 287 | } catch (Exception e) { | 282 | } catch (Exception e) { |
| 288 | logger.error("直播视频审核失败,id==" + shyLiveId, e); | 283 | logger.error("直播视频审核失败,id==" + shyLiveId, e); |
| 289 | showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 284 | showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; |
| @@ -332,7 +327,7 @@ public class LiveController extends BaseController { | @@ -332,7 +327,7 @@ public class LiveController extends BaseController { | ||
| 332 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); | 327 | ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId)); |
| 333 | JSONObject result = null; | 328 | JSONObject result = null; |
| 334 | try { | 329 | try { |
| 335 | - result = Pass.syncLive(shyLive.getActivity_id()); | 330 | + result = pass.syncLive(shyLive.getActivity_id()); |
| 336 | } catch (Exception e) { | 331 | } catch (Exception e) { |
| 337 | logger.error("直播云信息同步失败,id==" + shyLiveId, e); | 332 | logger.error("直播云信息同步失败,id==" + shyLiveId, e); |
| 338 | showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; | 333 | showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败"; |
| @@ -433,23 +428,23 @@ public class LiveController extends BaseController { | @@ -433,23 +428,23 @@ public class LiveController extends BaseController { | ||
| 433 | cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getPre_start_time(), "HH:mm")); | 428 | cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getPre_start_time(), "HH:mm")); |
| 434 | } | 429 | } |
| 435 | /*预计结束时间需要处理成用户可读*/ | 430 | /*预计结束时间需要处理成用户可读*/ |
| 436 | - String pre_endTime = ""; | ||
| 437 | - | ||
| 438 | - if (CommonUtils.isNull(liveList.get(i).getPre_end_time())) {//结束时间为空 | ||
| 439 | - pre_endTime = "待定"; | 431 | + String preEndTime = ""; |
| 432 | + //结束时间为空 | ||
| 433 | + if (CommonUtils.isNull(liveList.get(i).getPre_end_time())) { | ||
| 434 | + preEndTime = "待定"; | ||
| 440 | } else { | 435 | } else { |
| 441 | long start = liveList.get(i).getPre_start_time().getTime() + 8 * 60 * 60 * 1000; | 436 | long start = liveList.get(i).getPre_start_time().getTime() + 8 * 60 * 60 * 1000; |
| 442 | long end = liveList.get(i).getPre_end_time().getTime() + 8 * 60 * 60 * 1000; | 437 | long end = liveList.get(i).getPre_end_time().getTime() + 8 * 60 * 60 * 1000; |
| 443 | long count = end / (24 * 3600 * 1000) - start / (24 * 3600 * 1000); | 438 | long count = end / (24 * 3600 * 1000) - start / (24 * 3600 * 1000); |
| 444 | logger.info(String.valueOf(count)); | 439 | logger.info(String.valueOf(count)); |
| 445 | if (count == 0) { | 440 | if (count == 0) { |
| 446 | - pre_endTime = CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm"); | 441 | + preEndTime = CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm"); |
| 447 | } else if (count > 0) { | 442 | } else if (count > 0) { |
| 448 | - pre_endTime = "跨" + count + "天 " + CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm"); | 443 | + preEndTime = "跨" + count + "天 " + CommonUtils.formatDate(liveList.get(i).getPre_end_time(), "HH:mm"); |
| 449 | } | 444 | } |
| 450 | } | 445 | } |
| 451 | cell = row.createCell(3);//列 | 446 | cell = row.createCell(3);//列 |
| 452 | - cell.setCellValue(pre_endTime); | 447 | + cell.setCellValue(preEndTime); |
| 453 | cell = row.createCell(4);//列 | 448 | cell = row.createCell(4);//列 |
| 454 | cell.setCellValue(liveList.get(i).getActivity_name()); | 449 | cell.setCellValue(liveList.get(i).getActivity_name()); |
| 455 | cell = row.createCell(5);//列 | 450 | cell = row.createCell(5);//列 |
| @@ -461,10 +456,10 @@ public class LiveController extends BaseController { | @@ -461,10 +456,10 @@ public class LiveController extends BaseController { | ||
| 461 | String updater = "";//审核员名字 | 456 | String updater = "";//审核员名字 |
| 462 | if (!liveList.get(i).getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | 457 | if (!liveList.get(i).getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { |
| 463 | updater = CommonUtils.isEmpty(liveList.get(i).getUpdater()) || "null".equals(liveList.get(i).getUpdater()) ? "自动通过" : liveList.get(i).getUpdater(); | 458 | updater = CommonUtils.isEmpty(liveList.get(i).getUpdater()) || "null".equals(liveList.get(i).getUpdater()) ? "自动通过" : liveList.get(i).getUpdater(); |
| 464 | - String auditor_id = liveList.get(i).getAuditor(); | ||
| 465 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 459 | + String auditorId = liveList.get(i).getAuditor(); |
| 460 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 466 | ShyUsers user = new ShyUsers(); | 461 | ShyUsers user = new ShyUsers(); |
| 467 | - user.setUser_id(auditor_id); | 462 | + user.setUser_id(auditorId); |
| 468 | user = usersService.select(user); | 463 | user = usersService.select(user); |
| 469 | if (CommonUtils.isNotNull(user)) { | 464 | if (CommonUtils.isNotNull(user)) { |
| 470 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 465 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| @@ -483,24 +478,24 @@ public class LiveController extends BaseController { | @@ -483,24 +478,24 @@ public class LiveController extends BaseController { | ||
| 483 | cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "HH:mm")); | 478 | cell.setCellValue(CommonUtils.formatDate(liveList.get(i).getActivity_start_time(), "HH:mm")); |
| 484 | } | 479 | } |
| 485 | /*实际结束时间需要处理成用户可读*/ | 480 | /*实际结束时间需要处理成用户可读*/ |
| 486 | - String Activity_endTime = ""; | 481 | + String activityEndTime = ""; |
| 487 | if (liveList.get(i).getActivity_start_time() != null && liveList.get(i).getActivity_end_time() != null) { | 482 | if (liveList.get(i).getActivity_start_time() != null && liveList.get(i).getActivity_end_time() != null) { |
| 488 | - long Activity_start = liveList.get(i).getActivity_start_time().getTime() + 8 * 60 * 60 * 1000; | ||
| 489 | - long Activity_end = liveList.get(i).getActivity_end_time().getTime() + 8 * 60 * 60 * 1000; | ||
| 490 | - long Activity_count = Activity_end / (24 * 3600 * 1000) - Activity_start / (24 * 3600 * 1000); | ||
| 491 | - logger.info(String.valueOf(Activity_count)); | ||
| 492 | - if (Activity_count == 0) { | ||
| 493 | - Activity_endTime = CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | ||
| 494 | - } else if (Activity_count > 0) { | ||
| 495 | - Activity_endTime = "跨" + Activity_count + "天 " + CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | 483 | + long activityStart = liveList.get(i).getActivity_start_time().getTime() + 8 * 60 * 60 * 1000; |
| 484 | + long activityEnd = liveList.get(i).getActivity_end_time().getTime() + 8 * 60 * 60 * 1000; | ||
| 485 | + long activityCount = activityEnd / (24 * 3600 * 1000) - activityStart / (24 * 3600 * 1000); | ||
| 486 | + logger.info(String.valueOf(activityCount)); | ||
| 487 | + if (activityCount == 0) { | ||
| 488 | + activityEndTime = CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | ||
| 489 | + } else if (activityCount > 0) { | ||
| 490 | + activityEndTime = "跨" + activityCount + "天 " + CommonUtils.formatDate(liveList.get(i).getActivity_end_time(), "HH:mm"); | ||
| 496 | } | 491 | } |
| 497 | 492 | ||
| 498 | cell = row.createCell(10);//列 | 493 | cell = row.createCell(10);//列 |
| 499 | - cell.setCellValue(Activity_endTime); | 494 | + cell.setCellValue(activityEndTime); |
| 500 | cell = row.createCell(11);//时长 | 495 | cell = row.createCell(11);//时长 |
| 501 | /*时长需要处理成用户可读,单位:分钟*/ | 496 | /*时长需要处理成用户可读,单位:分钟*/ |
| 502 | - long time_length = (Activity_end - Activity_start) / (60 * 1000); | ||
| 503 | - cell.setCellValue(time_length); | 497 | + long timeLength = (activityEnd - activityStart) / (60 * 1000); |
| 498 | + cell.setCellValue(timeLength); | ||
| 504 | 499 | ||
| 505 | cell = row.createCell(12);//列 | 500 | cell = row.createCell(12);//列 |
| 506 | cell.setCellValue(""); | 501 | cell.setCellValue(""); |
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
| @@ -9,7 +9,6 @@ import com.cnlive.shenhe.entity.ShyNotspeak; | @@ -9,7 +9,6 @@ import com.cnlive.shenhe.entity.ShyNotspeak; | ||
| 9 | import com.cnlive.shenhe.entity.ShySites; | 9 | import com.cnlive.shenhe.entity.ShySites; |
| 10 | import com.cnlive.shenhe.entity.ShyUsers; | 10 | import com.cnlive.shenhe.entity.ShyUsers; |
| 11 | import com.cnlive.shenhe.serviceImpl.*; | 11 | import com.cnlive.shenhe.serviceImpl.*; |
| 12 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 13 | import com.cnlive.shenhe.utils.CommonUtils; | 12 | import com.cnlive.shenhe.utils.CommonUtils; |
| 14 | import com.github.pagehelper.PageInfo; | 13 | import com.github.pagehelper.PageInfo; |
| 15 | import org.slf4j.Logger; | 14 | import org.slf4j.Logger; |
| @@ -34,19 +33,11 @@ import java.util.List; | @@ -34,19 +33,11 @@ import java.util.List; | ||
| 34 | public class NotSpeakController extends BaseController { | 33 | public class NotSpeakController extends BaseController { |
| 35 | private static Logger logger = LoggerFactory.getLogger(NotSpeakController.class); | 34 | private static Logger logger = LoggerFactory.getLogger(NotSpeakController.class); |
| 36 | @Autowired | 35 | @Autowired |
| 37 | - AuditPass Pass; | ||
| 38 | - @Autowired | ||
| 39 | - CommentsServiceImpl commentsService; | ||
| 40 | - @Autowired | ||
| 41 | NotspeakServiceImpl notSpeakService; | 36 | NotspeakServiceImpl notSpeakService; |
| 42 | - | ||
| 43 | @Autowired | 37 | @Autowired |
| 44 | UsersServiceImpl usersService; | 38 | UsersServiceImpl usersService; |
| 45 | - | ||
| 46 | @Autowired | 39 | @Autowired |
| 47 | SitesServiceImpl sitesService; | 40 | SitesServiceImpl sitesService; |
| 48 | - @Autowired | ||
| 49 | - ContentServiceImpl contentService; | ||
| 50 | 41 | ||
| 51 | /** | 42 | /** |
| 52 | * 禁言列表页 | 43 | * 禁言列表页 |
| @@ -69,10 +60,10 @@ public class NotSpeakController extends BaseController { | @@ -69,10 +60,10 @@ public class NotSpeakController extends BaseController { | ||
| 69 | if (!list.isEmpty()) { | 60 | if (!list.isEmpty()) { |
| 70 | for (ShyNotspeak notspeak : list) { | 61 | for (ShyNotspeak notspeak : list) { |
| 71 | String updater = CommonUtils.isEmpty(notspeak.getUpdater()) || "null".equals(notspeak.getUpdater()) ? "无" : notspeak.getUpdater(); | 62 | String updater = CommonUtils.isEmpty(notspeak.getUpdater()) || "null".equals(notspeak.getUpdater()) ? "无" : notspeak.getUpdater(); |
| 72 | - String auditor_id = notspeak.getAuditor(); | ||
| 73 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 63 | + String auditorId = notspeak.getAuditor(); |
| 64 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 74 | ShyUsers user = new ShyUsers(); | 65 | ShyUsers user = new ShyUsers(); |
| 75 | - user.setUser_id(auditor_id); | 66 | + user.setUser_id(auditorId); |
| 76 | user = usersService.select(user); | 67 | user = usersService.select(user); |
| 77 | if (CommonUtils.isNotNull(user)) { | 68 | if (CommonUtils.isNotNull(user)) { |
| 78 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 69 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
| 1 | package com.cnlive.shenhe.controller; | 1 | package com.cnlive.shenhe.controller; |
| 2 | 2 | ||
| 3 | - | ||
| 4 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 5 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 6 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| @@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 20 | 19 | ||
| 21 | import java.util.List; | 20 | import java.util.List; |
| 22 | 21 | ||
| 23 | - | ||
| 24 | /** | 22 | /** |
| 25 | * @author Administrator | 23 | * @author Administrator |
| 26 | * @author yanzhaowang | 24 | * @author yanzhaowang |
| @@ -38,8 +36,8 @@ public class ShyActivityController extends BaseController { | @@ -38,8 +36,8 @@ public class ShyActivityController extends BaseController { | ||
| 38 | @PostMapping("/add") | 36 | @PostMapping("/add") |
| 39 | @ResponseBody | 37 | @ResponseBody |
| 40 | public ResponseBean insterShyActivity(ShyActivity shyActivity) { | 38 | public ResponseBean insterShyActivity(ShyActivity shyActivity) { |
| 41 | - int i = shyActivityImpl.insertShyActivity(shyActivity); | ||
| 42 | - if (i > 0) { | 39 | + int result = shyActivityImpl.insertShyActivity(shyActivity); |
| 40 | + if (result > 0) { | ||
| 43 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); | 41 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功"); |
| 44 | } | 42 | } |
| 45 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "添加失败,请重试"); | 43 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "添加失败,请重试"); |
| @@ -48,8 +46,8 @@ public class ShyActivityController extends BaseController { | @@ -48,8 +46,8 @@ public class ShyActivityController extends BaseController { | ||
| 48 | @PostMapping("/delete") | 46 | @PostMapping("/delete") |
| 49 | @ResponseBody | 47 | @ResponseBody |
| 50 | public ResponseBean deleteShyActivity(Integer id) { | 48 | public ResponseBean deleteShyActivity(Integer id) { |
| 51 | - int i = shyActivityImpl.deleteShyActivity(id); | ||
| 52 | - if (i > 0) { | 49 | + int result = shyActivityImpl.deleteShyActivity(id); |
| 50 | + if (result > 0) { | ||
| 53 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前活动成功"); | 51 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前活动成功"); |
| 54 | } | 52 | } |
| 55 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "删除失败,请重试"); | 53 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "删除失败,请重试"); |
| @@ -60,8 +58,8 @@ public class ShyActivityController extends BaseController { | @@ -60,8 +58,8 @@ public class ShyActivityController extends BaseController { | ||
| 60 | @ResponseBody | 58 | @ResponseBody |
| 61 | public ResponseBean updateShyActivity(ShyActivity shyActivity) { | 59 | public ResponseBean updateShyActivity(ShyActivity shyActivity) { |
| 62 | 60 | ||
| 63 | - int i = shyActivityImpl.updateShyActivity(shyActivity); | ||
| 64 | - if (i > 0) { | 61 | + int result = shyActivityImpl.updateShyActivity(shyActivity); |
| 62 | + if (result > 0) { | ||
| 65 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前活动成功"); | 63 | return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前活动成功"); |
| 66 | } | 64 | } |
| 67 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "修改失败,请重试"); | 65 | return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "修改失败,请重试"); |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| @@ -64,15 +64,16 @@ public class SitesController extends BaseController { | @@ -64,15 +64,16 @@ public class SitesController extends BaseController { | ||
| 64 | JSONObject business = CommonConst.BUSINESS; | 64 | JSONObject business = CommonConst.BUSINESS; |
| 65 | if (!list.isEmpty()) { | 65 | if (!list.isEmpty()) { |
| 66 | for (ShySites site : list) { | 66 | for (ShySites site : list) { |
| 67 | - String write_business_name = site.getWrite_business(); | ||
| 68 | - if (CommonUtils.isNotEmpty(write_business_name)) { | 67 | + |
| 68 | + String writeBusinessName = site.getWrite_business(); | ||
| 69 | + if (CommonUtils.isNotEmpty(writeBusinessName)) { | ||
| 69 | for (String bkey : business.keySet()) { | 70 | for (String bkey : business.keySet()) { |
| 70 | - write_business_name = write_business_name.replace(bkey, business.getString(bkey)); | 71 | + writeBusinessName = writeBusinessName.replace(bkey, business.getString(bkey)); |
| 71 | } | 72 | } |
| 72 | } else { | 73 | } else { |
| 73 | - write_business_name = "无"; | 74 | + writeBusinessName = "无"; |
| 74 | } | 75 | } |
| 75 | - site.setWrite_business_name(write_business_name); | 76 | + site.setWrite_business_name(writeBusinessName); |
| 76 | } | 77 | } |
| 77 | } | 78 | } |
| 78 | model.addAttribute("sitePage", sitePage); | 79 | model.addAttribute("sitePage", sitePage); |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| @@ -7,11 +7,8 @@ import com.cnlive.shenhe.bean.SessionUser; | @@ -7,11 +7,8 @@ import com.cnlive.shenhe.bean.SessionUser; | ||
| 7 | import com.cnlive.shenhe.dto.TopicDTO; | 7 | import com.cnlive.shenhe.dto.TopicDTO; |
| 8 | import com.cnlive.shenhe.entity.ShySites; | 8 | import com.cnlive.shenhe.entity.ShySites; |
| 9 | import com.cnlive.shenhe.entity.ShyTopic; | 9 | import com.cnlive.shenhe.entity.ShyTopic; |
| 10 | -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | ||
| 11 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 12 | import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; | 11 | import com.cnlive.shenhe.serviceImpl.TopicServiceImpl; |
| 13 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 14 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 15 | import com.cnlive.shenhe.utils.CommonConst; | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| 16 | import com.cnlive.shenhe.utils.CommonUtils; | 13 | import com.cnlive.shenhe.utils.CommonUtils; |
| 17 | import com.github.pagehelper.PageInfo; | 14 | import com.github.pagehelper.PageInfo; |
| @@ -38,19 +35,13 @@ import java.util.Map; | @@ -38,19 +35,13 @@ import java.util.Map; | ||
| 38 | @Controller | 35 | @Controller |
| 39 | @RequestMapping("/topic") | 36 | @RequestMapping("/topic") |
| 40 | public class TopicController extends BaseController { | 37 | public class TopicController extends BaseController { |
| 38 | + | ||
| 41 | private static Logger logger = LoggerFactory.getLogger(TopicController.class); | 39 | private static Logger logger = LoggerFactory.getLogger(TopicController.class); |
| 42 | @Autowired | 40 | @Autowired |
| 43 | - AuditPass Pass; | ||
| 44 | - @Autowired | ||
| 45 | - CommentsServiceImpl commentsService; | ||
| 46 | - @Autowired | ||
| 47 | TopicServiceImpl topicService; | 41 | TopicServiceImpl topicService; |
| 48 | @Autowired | 42 | @Autowired |
| 49 | SitesServiceImpl sitesService; | 43 | SitesServiceImpl sitesService; |
| 50 | 44 | ||
| 51 | - @Autowired | ||
| 52 | - UsersServiceImpl usersService; | ||
| 53 | - | ||
| 54 | @Value("${spring.localhost.url}") | 45 | @Value("${spring.localhost.url}") |
| 55 | private String localhost_url; | 46 | private String localhost_url; |
| 56 | 47 | ||
| @@ -102,9 +93,9 @@ public class TopicController extends BaseController { | @@ -102,9 +93,9 @@ public class TopicController extends BaseController { | ||
| 102 | if (!list.isEmpty()) { | 93 | if (!list.isEmpty()) { |
| 103 | for (ShyTopic topic : list) { | 94 | for (ShyTopic topic : list) { |
| 104 | if (!topic.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { | 95 | if (!topic.getShenhe_status().equals(CommonConst.AUDIT_INTT)) { |
| 105 | - String auditor_id = topic.getAuditor_id(); | 96 | + String auditorId = topic.getAuditor_id(); |
| 106 | String updater = CommonUtils.isEmpty(topic.getUpdater()) || "null".equals(topic.getUpdater()) ? "白名单" : topic.getUpdater(); | 97 | String updater = CommonUtils.isEmpty(topic.getUpdater()) || "null".equals(topic.getUpdater()) ? "白名单" : topic.getUpdater(); |
| 107 | - updater = sitesService.getUpdater(updater, auditor_id); | 98 | + updater = sitesService.getUpdater(updater, auditorId); |
| 108 | topic.setUpdater(updater); | 99 | topic.setUpdater(updater); |
| 109 | } | 100 | } |
| 110 | //显示spid简称 | 101 | //显示spid简称 |
| @@ -178,7 +169,7 @@ public class TopicController extends BaseController { | @@ -178,7 +169,7 @@ public class TopicController extends BaseController { | ||
| 178 | @GetMapping("/topicNotice") | 169 | @GetMapping("/topicNotice") |
| 179 | @ResponseBody | 170 | @ResponseBody |
| 180 | public Map<String, Object> channelNotice() { | 171 | public Map<String, Object> channelNotice() { |
| 181 | - Map<String, Object> map = new HashMap<>(); | 172 | + Map<String, Object> map = new HashMap<>(16); |
| 182 | 173 | ||
| 183 | ShyTopic shyTopic = new ShyTopic(); | 174 | ShyTopic shyTopic = new ShyTopic(); |
| 184 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); | 175 | shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); |
| @@ -195,211 +186,4 @@ public class TopicController extends BaseController { | @@ -195,211 +186,4 @@ public class TopicController extends BaseController { | ||
| 195 | } | 186 | } |
| 196 | return null; | 187 | return null; |
| 197 | } | 188 | } |
| 198 | - | ||
| 199 | - | ||
| 200 | - /** | ||
| 201 | - * 根据条件导出excel | ||
| 202 | - */ | ||
| 203 | -// @GetMapping("excel") | ||
| 204 | -// public void getExcel( String title,String contentId, String content_tag, | ||
| 205 | -// String start_date, String end_date, Integer receive_status, String sp_desc, | ||
| 206 | -// Integer page, Integer pageSize, String orderByClause, HttpSession session,HttpServletResponse response) { | ||
| 207 | -// SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | ||
| 208 | -// Integer spid = sessionUser.getSpid(); | ||
| 209 | -// String userId = sessionUser.getUserId(); | ||
| 210 | -// if (CommonUtils.isNotEmpty(sp_desc) && spid == 0) { | ||
| 211 | -// ShySites shySite=sitesService.findspidBySpdesc(sp_desc); | ||
| 212 | -// if(CommonUtils.isNotNull(shySite)){ | ||
| 213 | -// spid = shySite.getSpid(); | ||
| 214 | -// } | ||
| 215 | -// }else if (CommonUtils.isEmpty(sp_desc) && spid == 0) { | ||
| 216 | -// spid = null; | ||
| 217 | -// } | ||
| 218 | -// Date sDate = null; | ||
| 219 | -// Date eDate = null; | ||
| 220 | -// | ||
| 221 | -// if (CommonUtils.isNotEmpty(start_date)) { | ||
| 222 | -// try { | ||
| 223 | -// sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd"); | ||
| 224 | -// } catch (Exception e) { | ||
| 225 | -// } | ||
| 226 | -// } | ||
| 227 | -// if (CommonUtils.isNotEmpty(end_date)) { | ||
| 228 | -// try { | ||
| 229 | -// eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd"); | ||
| 230 | -// } catch (Exception e) { | ||
| 231 | -// } | ||
| 232 | -// } | ||
| 233 | -// List<ShyContent> contentList = contentService.findByCondition(title,content_tag,contentId, sDate, eDate, receive_status, page, pageSize, orderByClause, spid); | ||
| 234 | -// | ||
| 235 | -// String fileName = "图文数据"; | ||
| 236 | -// | ||
| 237 | -// XSSFWorkbook wb = new XSSFWorkbook(); | ||
| 238 | -// ServletOutputStream out = null; | ||
| 239 | -// BufferedInputStream bis = null; | ||
| 240 | -// BufferedOutputStream bos = null; | ||
| 241 | -// try { | ||
| 242 | -// XSSFSheet sheetlist = wb.createSheet(fileName); | ||
| 243 | -// XSSFRow row = sheetlist.createRow(0);//行 | ||
| 244 | -// XSSFCell cell = row.createCell(0);//列 | ||
| 245 | -// cell.setCellValue("id"); | ||
| 246 | -// cell = row.createCell(1);//列 | ||
| 247 | -// cell.setCellValue("sp昵称"); | ||
| 248 | -// cell = row.createCell(2);//列 | ||
| 249 | -// cell.setCellValue("图文id"); | ||
| 250 | -// cell = row.createCell(3);//列 | ||
| 251 | -// cell.setCellValue("内容标题"); | ||
| 252 | -// cell = row.createCell(4);//列 | ||
| 253 | -// cell.setCellValue("图文标签"); | ||
| 254 | -// cell = row.createCell(5);//列 | ||
| 255 | -// cell.setCellValue("审核类型"); | ||
| 256 | -// cell = row.createCell(6);//列 | ||
| 257 | -// cell.setCellValue("内容状态"); | ||
| 258 | -// cell = row.createCell(7);//列 | ||
| 259 | -// cell.setCellValue("图文创建时间"); | ||
| 260 | -// cell = row.createCell(8);//列 | ||
| 261 | -// cell.setCellValue("图文送审时间"); | ||
| 262 | -// cell = row.createCell(9);//列 | ||
| 263 | -// cell.setCellValue("领取状态"); | ||
| 264 | -// cell = row.createCell(10);//列 | ||
| 265 | -// cell.setCellValue("审核人"); | ||
| 266 | -// cell = row.createCell(11);//列 | ||
| 267 | -// cell.setCellValue("审核意见"); | ||
| 268 | -// cell = row.createCell(12);//列 | ||
| 269 | -// cell.setCellValue("来源(昵称)"); | ||
| 270 | -// cell = row.createCell(13);//列 | ||
| 271 | -// cell.setCellValue("作者(sid)"); | ||
| 272 | -// cell = row.createCell(14);//列 | ||
| 273 | -// cell.setCellValue("图文url"); | ||
| 274 | -// | ||
| 275 | -// for (int i = 0; i < contentList.size(); i++) { | ||
| 276 | -// row = sheetlist.createRow((short) (i + 1));//行 | ||
| 277 | -// cell = row.createCell(0);//列 | ||
| 278 | -// cell.setCellValue(contentList.get(i).getId()); | ||
| 279 | -// cell = row.createCell(1);//列 | ||
| 280 | -// cell.setCellValue(sitesService.findspidDescByspid(contentList.get(i).getSp_id()).getName()); | ||
| 281 | -// cell = row.createCell(2);//列 | ||
| 282 | -// cell.setCellValue(contentList.get(i).getContent_id()); | ||
| 283 | -// cell = row.createCell(3);//列 | ||
| 284 | -// cell.setCellValue(contentList.get(i).getTitle()); | ||
| 285 | -// /*状态需要处理成用户可读*/ | ||
| 286 | -// String contentTag = "";//图文标签 content:图文发布,moment:朋友圈 | ||
| 287 | -// if (contentList.get(i).getContent_tag().equals("content") ) { | ||
| 288 | -// contentTag = "图文发布"; | ||
| 289 | -// } else if (contentList.get(i).getContent_tag().equals("moment")) { | ||
| 290 | -// contentTag = "朋友圈"; | ||
| 291 | -// } | ||
| 292 | -// cell = row.createCell(4);//列 | ||
| 293 | -// cell.setCellValue(contentTag); | ||
| 294 | -// | ||
| 295 | -// /*状态需要处理成用户可读*/ | ||
| 296 | -// String shenheType = "";//审核类型,1:免审,2:机审,3:人工审 | ||
| 297 | -// if (contentList.get(i).getShenhe_type() == 1) { | ||
| 298 | -// shenheType = "免审"; | ||
| 299 | -// } else if (contentList.get(i).getShenhe_type() == 2) { | ||
| 300 | -// shenheType = "机审"; | ||
| 301 | -// } else { | ||
| 302 | -// shenheType = "人工审"; | ||
| 303 | -// } | ||
| 304 | -// cell = row.createCell(5);//列 | ||
| 305 | -// cell.setCellValue(shenheType); | ||
| 306 | -// | ||
| 307 | -// /*状态需要处理成用户可读*/ | ||
| 308 | -// String contentStatus = "";//内容状态:0:待发布,1:已发布,2:已下线,3:已删除 | ||
| 309 | -// if (contentList.get(i).getContent_status() == 0) { | ||
| 310 | -// contentStatus = "待发布"; | ||
| 311 | -// } else if (contentList.get(i).getContent_status() == 1) { | ||
| 312 | -// contentStatus = "已发布"; | ||
| 313 | -// } else if(contentList.get(i).getContent_status() == 2){ | ||
| 314 | -// contentStatus = "已下线"; | ||
| 315 | -// }else if(contentList.get(i).getContent_status() == 3){ | ||
| 316 | -// contentStatus = "已删除"; | ||
| 317 | -// } | ||
| 318 | -// | ||
| 319 | -// cell = row.createCell(6);//列 | ||
| 320 | -// cell.setCellValue(contentStatus); | ||
| 321 | -// cell = row.createCell(7);//列 | ||
| 322 | -// cell.setCellValue(contentList.get(i).getContent_time()==null?"":CommonUtils.formatDate(contentList.get(i).getContent_time(), "yyyy-MM-dd HH:mm:ss")); | ||
| 323 | -// cell = row.createCell(8);//列 | ||
| 324 | -// cell.setCellValue(contentList.get(i).getCreate_date()==null?"":CommonUtils.formatDate(contentList.get(i).getCreate_date(), "yyyy-MM-dd HH:mm:ss")); | ||
| 325 | -// | ||
| 326 | -// /*状态需要处理成用户可读*/ | ||
| 327 | -// String receiveStatus = "";//领取状态。0:未领取;1:已领取,2:已审核 | ||
| 328 | -// if (contentList.get(i).getReceive_status() == 1) { | ||
| 329 | -// receiveStatus = "已领取"; | ||
| 330 | -// } else if (contentList.get(i).getReceive_status() == 2) { | ||
| 331 | -// receiveStatus = "已审核"; | ||
| 332 | -// } else { | ||
| 333 | -// receiveStatus = "未领取"; | ||
| 334 | -// } | ||
| 335 | -// | ||
| 336 | -// cell = row.createCell(9);//列 | ||
| 337 | -// cell.setCellValue(receiveStatus); | ||
| 338 | -// | ||
| 339 | -// /* 审核员需要做处理*/ | ||
| 340 | -// String updater = "";//审核员名字 | ||
| 341 | -// if (contentList.get(i).getReceive_status() != CommonConst.RECEIVE_BEFORE) { | ||
| 342 | -// updater = CommonUtils.isEmpty(contentList.get(i).getUpdater()) || "null".equals(contentList.get(i).getUpdater())? "自动通过":contentList.get(i).getUpdater(); | ||
| 343 | -// String auditor_id = contentList.get(i).getAuditor_id(); | ||
| 344 | -// if (CommonUtils.isNotEmpty(auditor_id)) { | ||
| 345 | -// ShyUsers user = new ShyUsers(); | ||
| 346 | -// user.setUser_id(auditor_id); | ||
| 347 | -// user = usersService.select(user); | ||
| 348 | -// if (CommonUtils.isNotNull(user)) { | ||
| 349 | -// String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | ||
| 350 | -// String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | ||
| 351 | -// updater = userName ; | ||
| 352 | -// } | ||
| 353 | -// } | ||
| 354 | -// } | ||
| 355 | -// cell = row.createCell(10);//列 | ||
| 356 | -// cell.setCellValue(updater); | ||
| 357 | -// | ||
| 358 | -// | ||
| 359 | -// | ||
| 360 | -// cell = row.createCell(11);//列 | ||
| 361 | -// cell.setCellValue(contentList.get(i).getShenhe_msg()); | ||
| 362 | -// cell = row.createCell(12);//列 | ||
| 363 | -// cell.setCellValue(contentList.get(i).getSource()); | ||
| 364 | -// cell = row.createCell(13);//列 | ||
| 365 | -// cell.setCellValue(contentList.get(i).getAuthor()); | ||
| 366 | -// cell = row.createCell(14);//列 | ||
| 367 | -// cell.setCellValue(contentList.get(i).getContent_url()); | ||
| 368 | -// } | ||
| 369 | -// | ||
| 370 | -// ByteArrayOutputStream os = new ByteArrayOutputStream(); | ||
| 371 | -// wb.write(os); | ||
| 372 | -// byte[] content = os.toByteArray(); | ||
| 373 | -// InputStream is = new ByteArrayInputStream(content); | ||
| 374 | -// response.setContentType("application/vnd.ms-excel;charset=utf-8"); | ||
| 375 | -// response.setHeader("Content-Disposition", "attachment;filename=" + new String((fileName + ".xlsx").getBytes(), "iso-8859-1")); | ||
| 376 | -// out = response.getOutputStream(); | ||
| 377 | -// bis = new BufferedInputStream(is); | ||
| 378 | -// bos = new BufferedOutputStream(out); | ||
| 379 | -// byte[] buff = new byte[2048]; | ||
| 380 | -// int bytesRead; | ||
| 381 | -// while (-1 != (bytesRead = bis.read(buff, 0, buff.length))) { | ||
| 382 | -// bos.write(buff, 0, bytesRead); | ||
| 383 | -// } | ||
| 384 | -// } catch (final Exception e) { | ||
| 385 | -// e.printStackTrace(); | ||
| 386 | -// try { | ||
| 387 | -// if (bis != null) | ||
| 388 | -// bis.close(); | ||
| 389 | -// if (bos != null) | ||
| 390 | -// bos.close(); | ||
| 391 | -// } catch (Exception e1) { | ||
| 392 | -// e1.printStackTrace(); | ||
| 393 | -// } | ||
| 394 | -// } finally { | ||
| 395 | -// try { | ||
| 396 | -// if (bis != null) | ||
| 397 | -// bis.close(); | ||
| 398 | -// if (bos != null) | ||
| 399 | -// bos.close(); | ||
| 400 | -// } catch (Exception e2) { | ||
| 401 | -// e2.printStackTrace(); | ||
| 402 | -// } | ||
| 403 | -// } | ||
| 404 | -// } | ||
| 405 | } | 189 | } |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| @@ -138,22 +138,25 @@ public class UsersController extends BaseController { | @@ -138,22 +138,25 @@ public class UsersController extends BaseController { | ||
| 138 | ShyUsers shyUser = new ShyUsers(); | 138 | ShyUsers shyUser = new ShyUsers(); |
| 139 | shyUser.setUser_id(sessionUser.getUserId()); | 139 | shyUser.setUser_id(sessionUser.getUserId()); |
| 140 | shyUser = usersService.select(shyUser); | 140 | shyUser = usersService.select(shyUser); |
| 141 | - boolean isShow_chinnal = false;//是否显示频道消息框 | ||
| 142 | - boolean isShow_liveApply = false;//是否显示直播申请消息框 | ||
| 143 | - boolean isShow_topic = false;//是否显示话题审核消息框 | 141 | + //是否显示频道消息框 |
| 142 | + boolean isShowChinnal = false; | ||
| 143 | + //是否显示直播申请消息框 | ||
| 144 | + boolean isShowLiveApply = false; | ||
| 145 | + //是否显示话题审核消息框 | ||
| 146 | + boolean isShowTopic = false; | ||
| 144 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_CHANNAL.toString())) { | 147 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_CHANNAL.toString())) { |
| 145 | - isShow_chinnal = true; | 148 | + isShowChinnal = true; |
| 146 | } | 149 | } |
| 147 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_LIVEAPPLY.toString())) { | 150 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_LIVEAPPLY.toString())) { |
| 148 | - isShow_liveApply = true; | 151 | + isShowLiveApply = true; |
| 149 | } | 152 | } |
| 150 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_TOPIC.toString())) { | 153 | if (CommonUtils.isNotEmpty(shyUser.getNotice_show()) && shyUser.getNotice_show().contains(CommonConst.NOTICE_TOPIC.toString())) { |
| 151 | - isShow_topic = true; | 154 | + isShowTopic = true; |
| 152 | } | 155 | } |
| 153 | - Map<String, Object> map = new HashMap<>(); | ||
| 154 | - map.put("isShow_chinnal", isShow_chinnal); | ||
| 155 | - map.put("isShow_liveApply", isShow_liveApply); | ||
| 156 | - map.put("isShow_topic", isShow_topic); | 156 | + Map<String, Object> map = new HashMap<>(16); |
| 157 | + map.put("isShowChinnal", isShowChinnal); | ||
| 158 | + map.put("isShowLiveApply", isShowLiveApply); | ||
| 159 | + map.put("isShowTopic", isShowTopic); | ||
| 157 | return map; | 160 | return map; |
| 158 | } | 161 | } |
| 159 | 162 | ||
| @@ -161,10 +164,6 @@ public class UsersController extends BaseController { | @@ -161,10 +164,6 @@ public class UsersController extends BaseController { | ||
| 161 | @PostMapping(value = "/write") | 164 | @PostMapping(value = "/write") |
| 162 | public String write(Model model, Integer userId, String[] write_notice, HttpSession session, String redirect_url) { | 165 | public String write(Model model, Integer userId, String[] write_notice, HttpSession session, String redirect_url) { |
| 163 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 166 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 164 | -// Integer spid = sessionUser.getSpid(); | ||
| 165 | -// if (spid != 0) { | ||
| 166 | -// return "page/error.html"; | ||
| 167 | -// } | ||
| 168 | ShyUsers user = usersService.get(userId); | 167 | ShyUsers user = usersService.get(userId); |
| 169 | String write = ""; | 168 | String write = ""; |
| 170 | if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) { | 169 | if (CommonUtils.isNotNull(write_notice) && write_notice.length > 0) { |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| @@ -71,15 +71,15 @@ public class UsersFreeController extends BaseController { | @@ -71,15 +71,15 @@ public class UsersFreeController extends BaseController { | ||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | //获取栏目名称 | 73 | //获取栏目名称 |
| 74 | - String category_name = users.getCategory(); | ||
| 75 | - if (CommonUtils.isNotEmpty(category_name)) { | 74 | + String categoryName = users.getCategory(); |
| 75 | + if (CommonUtils.isNotEmpty(categoryName)) { | ||
| 76 | for (String bkey : category.keySet()) { | 76 | for (String bkey : category.keySet()) { |
| 77 | - category_name = category_name.replace(bkey, category.getString(bkey)); | 77 | + categoryName = categoryName.replace(bkey, category.getString(bkey)); |
| 78 | } | 78 | } |
| 79 | } else { | 79 | } else { |
| 80 | - category_name = "无"; | 80 | + categoryName = "无"; |
| 81 | } | 81 | } |
| 82 | - users.setCategory_name(category_name); | 82 | + users.setCategory_name(categoryName); |
| 83 | 83 | ||
| 84 | } | 84 | } |
| 85 | } | 85 | } |
src/main/java/com/cnlive/shenhe/controller/VideosController.java
| @@ -48,7 +48,7 @@ import java.util.Map; | @@ -48,7 +48,7 @@ import java.util.Map; | ||
| 48 | public class VideosController extends BaseController { | 48 | public class VideosController extends BaseController { |
| 49 | private static Logger logger = LoggerFactory.getLogger(VideosController.class); | 49 | private static Logger logger = LoggerFactory.getLogger(VideosController.class); |
| 50 | @Autowired | 50 | @Autowired |
| 51 | - AuditPass Pass; | 51 | + AuditPass pass; |
| 52 | @Autowired | 52 | @Autowired |
| 53 | VideosServiceImpl videosService; | 53 | VideosServiceImpl videosService; |
| 54 | @Autowired | 54 | @Autowired |
| @@ -84,7 +84,7 @@ public class VideosController extends BaseController { | @@ -84,7 +84,7 @@ public class VideosController extends BaseController { | ||
| 84 | String userId = sessionUser.getUserId(); | 84 | String userId = sessionUser.getUserId(); |
| 85 | JSONObject result; | 85 | JSONObject result; |
| 86 | try { | 86 | try { |
| 87 | - result = Pass.auditPass(activity_id, state, attr_tags, msg, callback); | 87 | + result = pass.auditPass(activity_id, state, attr_tags, msg, callback); |
| 88 | } catch (Exception e) { | 88 | } catch (Exception e) { |
| 89 | e.printStackTrace(); | 89 | e.printStackTrace(); |
| 90 | logger.error("视频审核失败", e); | 90 | logger.error("视频审核失败", e); |
| @@ -414,10 +414,10 @@ public class VideosController extends BaseController { | @@ -414,10 +414,10 @@ public class VideosController extends BaseController { | ||
| 414 | /* 审核员需要做处理*/ | 414 | /* 审核员需要做处理*/ |
| 415 | if (!shyVideosList.get(i).getState().equals(CommonConst.AUDIT_INTT)) { | 415 | if (!shyVideosList.get(i).getState().equals(CommonConst.AUDIT_INTT)) { |
| 416 | updater = CommonUtils.isEmpty(shyVideosList.get(i).getUpdater()) || "null".equals(shyVideosList.get(i).getUpdater()) ? "白名单" : shyVideosList.get(i).getUpdater(); | 416 | updater = CommonUtils.isEmpty(shyVideosList.get(i).getUpdater()) || "null".equals(shyVideosList.get(i).getUpdater()) ? "白名单" : shyVideosList.get(i).getUpdater(); |
| 417 | - String auditor_id = shyVideosList.get(i).getAuditor_id(); | ||
| 418 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 417 | + String auditorId = shyVideosList.get(i).getAuditor_id(); |
| 418 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 419 | ShyUsers user = new ShyUsers(); | 419 | ShyUsers user = new ShyUsers(); |
| 420 | - user.setUser_id(auditor_id); | 420 | + user.setUser_id(auditorId); |
| 421 | user = usersService.select(user); | 421 | user = usersService.select(user); |
| 422 | if (CommonUtils.isNotNull(user)) { | 422 | if (CommonUtils.isNotNull(user)) { |
| 423 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 423 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
src/main/java/com/cnlive/shenhe/job/AudioJob.java
| @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | ||
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyAudio; | 3 | import com.cnlive.shenhe.entity.ShyAudio; |
| 4 | import com.cnlive.shenhe.serviceImpl.AudioServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.AudioServiceImpl; |
| 5 | -import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl; | ||
| 6 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 7 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| @@ -23,8 +22,6 @@ public class AudioJob { | @@ -23,8 +22,6 @@ public class AudioJob { | ||
| 23 | 22 | ||
| 24 | @Autowired | 23 | @Autowired |
| 25 | AudioServiceImpl audioService; | 24 | AudioServiceImpl audioService; |
| 26 | - @Autowired | ||
| 27 | - YiDunServiceImpl yiDunServiceImpl; | ||
| 28 | 25 | ||
| 29 | /** | 26 | /** |
| 30 | * 白名单sp音频通过 | 27 | * 白名单sp音频通过 |
src/main/java/com/cnlive/shenhe/job/ChannelJob.java
| @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | ||
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyChannel; | 3 | import com.cnlive.shenhe.entity.ShyChannel; |
| 4 | import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl; |
| 5 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 6 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 7 | import com.cnlive.shenhe.utils.InfoUtil; | 6 | import com.cnlive.shenhe.utils.InfoUtil; |
| 8 | import org.slf4j.Logger; | 7 | import org.slf4j.Logger; |
| @@ -19,13 +18,11 @@ import java.util.List; | @@ -19,13 +18,11 @@ import java.util.List; | ||
| 19 | */ | 18 | */ |
| 20 | @Component | 19 | @Component |
| 21 | public class ChannelJob { | 20 | public class ChannelJob { |
| 21 | + | ||
| 22 | private static Logger logger = LoggerFactory.getLogger(ChannelJob.class); | 22 | private static Logger logger = LoggerFactory.getLogger(ChannelJob.class); |
| 23 | @Value("${spring.localhost.url}") | 23 | @Value("${spring.localhost.url}") |
| 24 | //本机地址 | 24 | //本机地址 |
| 25 | private String localhost_url; | 25 | private String localhost_url; |
| 26 | - | ||
| 27 | - @Autowired | ||
| 28 | - AuditPass Pass; | ||
| 29 | @Autowired | 26 | @Autowired |
| 30 | InfoUtil infoUtil; | 27 | InfoUtil infoUtil; |
| 31 | @Autowired | 28 | @Autowired |
| @@ -33,7 +30,6 @@ public class ChannelJob { | @@ -33,7 +30,6 @@ public class ChannelJob { | ||
| 33 | 30 | ||
| 34 | @Scheduled(fixedRate = 60 * 1000) | 31 | @Scheduled(fixedRate = 60 * 1000) |
| 35 | public void updateChannel() { | 32 | public void updateChannel() { |
| 36 | - | ||
| 37 | //遍历免审的spid去更改状态值 | 33 | //遍历免审的spid去更改状态值 |
| 38 | ShyChannel shyChannel = new ShyChannel(); | 34 | ShyChannel shyChannel = new ShyChannel(); |
| 39 | // 审核类型为免审 | 35 | // 审核类型为免审 |
| @@ -53,7 +49,8 @@ public class ChannelJob { | @@ -53,7 +49,8 @@ public class ChannelJob { | ||
| 53 | // @Scheduled(fixedRate = 60 * 1000) | 49 | // @Scheduled(fixedRate = 60 * 1000) |
| 54 | public void channelNotice() { | 50 | public void channelNotice() { |
| 55 | ShyChannel shyChannel = new ShyChannel(); | 51 | ShyChannel shyChannel = new ShyChannel(); |
| 56 | - shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审 | 52 | + // 审核类型为人工审 |
| 53 | + shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | ||
| 57 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); | 54 | shyChannel.setShenhe_status(CommonConst.AUDIT_INTT); |
| 58 | List<ShyChannel> channelList = channelService.findshyChannel(shyChannel); | 55 | List<ShyChannel> channelList = channelService.findshyChannel(shyChannel); |
| 59 | if (channelList.size() > 0) { | 56 | if (channelList.size() > 0) { |
src/main/java/com/cnlive/shenhe/job/CommentsJob.java
| @@ -16,6 +16,7 @@ import java.util.List; | @@ -16,6 +16,7 @@ import java.util.List; | ||
| 16 | */ | 16 | */ |
| 17 | @Component | 17 | @Component |
| 18 | public class CommentsJob { | 18 | public class CommentsJob { |
| 19 | + | ||
| 19 | private static Logger logger = LoggerFactory.getLogger(CommentsJob.class); | 20 | private static Logger logger = LoggerFactory.getLogger(CommentsJob.class); |
| 20 | @Autowired | 21 | @Autowired |
| 21 | CommentsServiceImpl commentsService; | 22 | CommentsServiceImpl commentsService; |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| @@ -30,12 +30,9 @@ import java.util.Map; | @@ -30,12 +30,9 @@ import java.util.Map; | ||
| 30 | */ | 30 | */ |
| 31 | @Component | 31 | @Component |
| 32 | public class LiveApplyJob { | 32 | public class LiveApplyJob { |
| 33 | + | ||
| 33 | private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class); | 34 | private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class); |
| 34 | - /** | ||
| 35 | - * //本机地址 | ||
| 36 | - */ | ||
| 37 | - @Value("${spring.localhost.url}") | ||
| 38 | - private String localhost_url; | 35 | + |
| 39 | /** | 36 | /** |
| 40 | * //开发者对应的id,与app_key相对应 | 37 | * //开发者对应的id,与app_key相对应 |
| 41 | */ | 38 | */ |
src/main/java/com/cnlive/shenhe/job/NotSpeakJob.java
| @@ -16,6 +16,7 @@ import java.util.List; | @@ -16,6 +16,7 @@ import java.util.List; | ||
| 16 | */ | 16 | */ |
| 17 | @Component | 17 | @Component |
| 18 | public class NotSpeakJob { | 18 | public class NotSpeakJob { |
| 19 | + | ||
| 19 | private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class); | 20 | private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class); |
| 20 | @Autowired | 21 | @Autowired |
| 21 | NotspeakServiceImpl notSpeakService; | 22 | NotspeakServiceImpl notSpeakService; |
src/main/java/com/cnlive/shenhe/job/TopicJob.java
| @@ -21,7 +21,6 @@ import java.util.List; | @@ -21,7 +21,6 @@ import java.util.List; | ||
| 21 | public class TopicJob { | 21 | public class TopicJob { |
| 22 | 22 | ||
| 23 | private static Logger logger = LoggerFactory.getLogger(TopicJob.class); | 23 | private static Logger logger = LoggerFactory.getLogger(TopicJob.class); |
| 24 | - | ||
| 25 | @Autowired | 24 | @Autowired |
| 26 | TopicServiceImpl topicService; | 25 | TopicServiceImpl topicService; |
| 27 | @Autowired | 26 | @Autowired |
src/main/java/com/cnlive/shenhe/job/VideosJob.java
| @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | ||
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyVideos; | 3 | import com.cnlive.shenhe.entity.ShyVideos; |
| 4 | import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; |
| 5 | -import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl; | ||
| 6 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 7 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| @@ -19,13 +18,9 @@ import java.util.List; | @@ -19,13 +18,9 @@ import java.util.List; | ||
| 19 | public class VideosJob { | 18 | public class VideosJob { |
| 20 | 19 | ||
| 21 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); | 20 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); |
| 22 | - | ||
| 23 | @Autowired | 21 | @Autowired |
| 24 | VideosServiceImpl videosService; | 22 | VideosServiceImpl videosService; |
| 25 | 23 | ||
| 26 | - @Autowired | ||
| 27 | - YiDunServiceImpl yiDunServiceImpl; | ||
| 28 | - | ||
| 29 | /** | 24 | /** |
| 30 | * 白名单sp视频通过 | 25 | * 白名单sp视频通过 |
| 31 | * 免审、未审核 | 26 | * 免审、未审核 |
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
| @@ -46,7 +46,6 @@ public class YiDunUrlResultJob { | @@ -46,7 +46,6 @@ public class YiDunUrlResultJob { | ||
| 46 | */ | 46 | */ |
| 47 | private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results"; | 47 | private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results"; |
| 48 | 48 | ||
| 49 | - | ||
| 50 | @Autowired | 49 | @Autowired |
| 51 | YiDunServiceImpl yiDunServiceImpl; | 50 | YiDunServiceImpl yiDunServiceImpl; |
| 52 | @Autowired | 51 | @Autowired |
src/main/java/com/cnlive/shenhe/jsoup/GetData.java
| @@ -43,14 +43,17 @@ public class GetData { | @@ -43,14 +43,17 @@ public class GetData { | ||
| 43 | private static List<String> getJobList(Document dom) { | 43 | private static List<String> getJobList(Document dom) { |
| 44 | String URL = "http://www.chinanews.com"; | 44 | String URL = "http://www.chinanews.com"; |
| 45 | ArrayList<String> list = new ArrayList<>(); | 45 | ArrayList<String> list = new ArrayList<>(); |
| 46 | - Elements select = dom.select(".content_list ul li");//获取到整个列表数据 | 46 | + //获取到整个列表数据 |
| 47 | + Elements select = dom.select(".content_list ul li"); | ||
| 47 | for (Element element : select) { | 48 | for (Element element : select) { |
| 48 | /* 处理个别li标签是空格问题,直接跳过不处理*/ | 49 | /* 处理个别li标签是空格问题,直接跳过不处理*/ |
| 49 | if (element.attr("id") != "" && !element.attr("id").equals("")) { | 50 | if (element.attr("id") != "" && !element.attr("id").equals("")) { |
| 50 | continue; | 51 | continue; |
| 51 | } | 52 | } |
| 52 | - Elements elementa = element.select(".dd_bt a");//得到带连接的a标签 | ||
| 53 | - String href = elementa.attr("href");//从a标签里面获取到他的相对路径 | 53 | + //得到带连接的a标签 |
| 54 | + Elements elementa = element.select(".dd_bt a"); | ||
| 55 | + //从a标签里面获取到他的相对路径 | ||
| 56 | + String href = elementa.attr("href"); | ||
| 54 | href = URL + href; | 57 | href = URL + href; |
| 55 | // String jobName = select1.text(); | 58 | // String jobName = select1.text(); |
| 56 | // Elements select2 = element.select(".t2 a"); | 59 | // Elements select2 = element.select(".t2 a"); |
src/main/java/com/cnlive/shenhe/jsoup/newCrawl.java
| @@ -16,11 +16,16 @@ public class newCrawl { | @@ -16,11 +16,16 @@ public class newCrawl { | ||
| 16 | //String url = "http://www.chinanews.com/sh/2019/06-21/8871343.shtml"; | 16 | //String url = "http://www.chinanews.com/sh/2019/06-21/8871343.shtml"; |
| 17 | //Document doc = Jsoup.connect(url).get(); | 17 | //Document doc = Jsoup.connect(url).get(); |
| 18 | Document doc = Jsoup.parse(new URL(url), 4000); | 18 | Document doc = Jsoup.parse(new URL(url), 4000); |
| 19 | - String title = newCl.getnewTitle(doc);//获取新闻标题 | ||
| 20 | - String time = newCl.getTime(doc);//获取新闻发布时间 | ||
| 21 | - String text = newCl.getNewtext(doc);//获取新闻内容 | ||
| 22 | - String imgurl = newCl.getImgurl(doc);//获取标题图片链接 | ||
| 23 | - String source = newCl.getSource(doc);//获取来源 | 19 | + //获取新闻标题 |
| 20 | + String title = newCl.getnewTitle(doc); | ||
| 21 | + //获取新闻发布时间 | ||
| 22 | + String time = newCl.getTime(doc); | ||
| 23 | + //获取新闻内容 | ||
| 24 | + String text = newCl.getNewtext(doc); | ||
| 25 | + //获取标题图片链接 | ||
| 26 | + String imgurl = newCl.getImgurl(doc); | ||
| 27 | + //获取来源 | ||
| 28 | + String source = newCl.getSource(doc); | ||
| 24 | System.out.println("新闻Url:" + url); | 29 | System.out.println("新闻Url:" + url); |
| 25 | System.out.println("新闻标题:" + title); | 30 | System.out.println("新闻标题:" + title); |
| 26 | System.out.println("新闻标题图片url:" + imgurl); | 31 | System.out.println("新闻标题图片url:" + imgurl); |
| @@ -61,7 +66,8 @@ public class newCrawl { | @@ -61,7 +66,8 @@ public class newCrawl { | ||
| 61 | String time = null; | 66 | String time = null; |
| 62 | Elements element = doc.select(".left-t"); | 67 | Elements element = doc.select(".left-t"); |
| 63 | String text = element.text(); | 68 | String text = element.text(); |
| 64 | - String s1 = text.replaceAll(" ", "");//完全清除,空格 | 69 | + //完全清除,空格 |
| 70 | + String s1 = text.replaceAll(" ", ""); | ||
| 65 | time = s1.substring(0, 17); | 71 | time = s1.substring(0, 17); |
| 66 | return time; | 72 | return time; |
| 67 | } | 73 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/AudioServiceImpl.java
| @@ -37,7 +37,7 @@ public class AudioServiceImpl { | @@ -37,7 +37,7 @@ public class AudioServiceImpl { | ||
| 37 | AudioServiceImpl audioService; | 37 | AudioServiceImpl audioService; |
| 38 | 38 | ||
| 39 | @Autowired | 39 | @Autowired |
| 40 | - AuditPass Pass; | 40 | + AuditPass pass; |
| 41 | 41 | ||
| 42 | @Autowired | 42 | @Autowired |
| 43 | ShyUsersMapper shyUsersMapper; | 43 | ShyUsersMapper shyUsersMapper; |
| @@ -53,12 +53,12 @@ public class AudioServiceImpl { | @@ -53,12 +53,12 @@ public class AudioServiceImpl { | ||
| 53 | return shyAudioMapper.getAudioMsg(audioId); | 53 | return shyAudioMapper.getAudioMsg(audioId); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | - public int importAudioMsg(ShyAudio ShyAudio) { | ||
| 57 | - return shyAudioMapper.insertSelective(ShyAudio); | 56 | + public int importAudioMsg(ShyAudio shyAudio) { |
| 57 | + return shyAudioMapper.insertSelective(shyAudio); | ||
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | - public int updateAudioMsg(ShyAudio ShyAudio) { | ||
| 61 | - return shyAudioMapper.updateByPrimaryKeySelective(ShyAudio); | 60 | + public int updateAudioMsg(ShyAudio shyAudio) { |
| 61 | + return shyAudioMapper.updateByPrimaryKeySelective(shyAudio); | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | public ShyAudio selectByPrimaryKey(Integer id) { | 64 | public ShyAudio selectByPrimaryKey(Integer id) { |
| @@ -79,7 +79,7 @@ public class AudioServiceImpl { | @@ -79,7 +79,7 @@ public class AudioServiceImpl { | ||
| 79 | */ | 79 | */ |
| 80 | public int updateAudioAndShenhe(ShyAudio shyAudio, int audioState) { | 80 | public int updateAudioAndShenhe(ShyAudio shyAudio, int audioState) { |
| 81 | //修改点播云音频状态 | 81 | //修改点播云音频状态 |
| 82 | - JSONObject result = Pass.audioPass(shyAudio.getAudioId(), audioState, shyAudio.getAttr_tags(), shyAudio.getMsg(), shyAudio.getCallback()); | 82 | + JSONObject result = pass.audioPass(shyAudio.getAudioId(), audioState, shyAudio.getAttr_tags(), shyAudio.getMsg(), shyAudio.getCallback()); |
| 83 | Integer code = result.getInteger("code"); | 83 | Integer code = result.getInteger("code"); |
| 84 | Integer shenheState = CommonConst.AUDIT_REFUSE; | 84 | Integer shenheState = CommonConst.AUDIT_REFUSE; |
| 85 | if (0 == code) { | 85 | if (0 == code) { |
| @@ -160,7 +160,7 @@ public class AudioServiceImpl { | @@ -160,7 +160,7 @@ public class AudioServiceImpl { | ||
| 160 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(shyAudioId)); | 160 | ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(shyAudioId)); |
| 161 | JSONObject result; | 161 | JSONObject result; |
| 162 | try { | 162 | try { |
| 163 | - result = Pass.audioPass(shyAudio.getAudioId(), 4, msg, msg, shyAudio.getCallback()); | 163 | + result = pass.audioPass(shyAudio.getAudioId(), 4, msg, msg, shyAudio.getCallback()); |
| 164 | } catch (Exception e) { | 164 | } catch (Exception e) { |
| 165 | logger.error("音频审核失败,id==" + shyAudioId, e); | 165 | logger.error("音频审核失败,id==" + shyAudioId, e); |
| 166 | showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 拒绝请求失败"; | 166 | showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 拒绝请求失败"; |
| @@ -271,10 +271,10 @@ public class AudioServiceImpl { | @@ -271,10 +271,10 @@ public class AudioServiceImpl { | ||
| 271 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id); | 271 | ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id); |
| 272 | if (!shyAudio.getState().equals(CommonConst.AUDIT_INTT)) { | 272 | if (!shyAudio.getState().equals(CommonConst.AUDIT_INTT)) { |
| 273 | String updater = CommonUtils.isEmpty(shyAudio.getUploader()) || "null".equals(shyAudio.getUploader()) ? "白名单" : shyAudio.getUploader(); | 273 | String updater = CommonUtils.isEmpty(shyAudio.getUploader()) || "null".equals(shyAudio.getUploader()) ? "白名单" : shyAudio.getUploader(); |
| 274 | - String auditor_id = shyAudio.getAuditor_id(); | ||
| 275 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 274 | + String auditorId = shyAudio.getAuditor_id(); |
| 275 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 276 | ShyUsers user = new ShyUsers(); | 276 | ShyUsers user = new ShyUsers(); |
| 277 | - user.setUser_id(auditor_id); | 277 | + user.setUser_id(auditorId); |
| 278 | user = shyUsersMapper.selectOne(user); | 278 | user = shyUsersMapper.selectOne(user); |
| 279 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 279 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 280 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 280 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
src/main/java/com/cnlive/shenhe/serviceImpl/ChannelServiceImpl.java
| @@ -35,7 +35,7 @@ public class ChannelServiceImpl { | @@ -35,7 +35,7 @@ public class ChannelServiceImpl { | ||
| 35 | @Autowired | 35 | @Autowired |
| 36 | ShyUsersMapper shyUsersMapper; | 36 | ShyUsersMapper shyUsersMapper; |
| 37 | @Autowired | 37 | @Autowired |
| 38 | - AuditPass Pass; | 38 | + AuditPass pass; |
| 39 | 39 | ||
| 40 | @Autowired | 40 | @Autowired |
| 41 | SitesServiceImpl sitesService; | 41 | SitesServiceImpl sitesService; |
| @@ -141,7 +141,7 @@ public class ChannelServiceImpl { | @@ -141,7 +141,7 @@ public class ChannelServiceImpl { | ||
| 141 | json.put("msg", msg); | 141 | json.put("msg", msg); |
| 142 | JSONObject result; | 142 | JSONObject result; |
| 143 | try { | 143 | try { |
| 144 | - result = Pass.channelPass(json, channel.getCallback()); | 144 | + result = pass.channelPass(json, channel.getCallback()); |
| 145 | } catch (Exception e) { | 145 | } catch (Exception e) { |
| 146 | logger.error("频道回调失败,id:{},channel_id:{}", channel.getId(), channel.getChannel_id()); | 146 | logger.error("频道回调失败,id:{},channel_id:{}", channel.getId(), channel.getChannel_id()); |
| 147 | success = false; | 147 | success = false; |
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| @@ -38,7 +38,7 @@ public class CommentsServiceImpl { | @@ -38,7 +38,7 @@ public class CommentsServiceImpl { | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | ShyUsersMapper shyUsersMapper; | 39 | ShyUsersMapper shyUsersMapper; |
| 40 | @Autowired | 40 | @Autowired |
| 41 | - AuditPass Pass; | 41 | + AuditPass pass; |
| 42 | 42 | ||
| 43 | @Autowired | 43 | @Autowired |
| 44 | SitesServiceImpl sitesService; | 44 | SitesServiceImpl sitesService; |
| @@ -192,10 +192,10 @@ public class CommentsServiceImpl { | @@ -192,10 +192,10 @@ public class CommentsServiceImpl { | ||
| 192 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); | 192 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); |
| 193 | if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { | 193 | if (!comment.getState().equals(CommonConst.AUDIT_INTT)) { |
| 194 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); | 194 | String updater = CommonUtils.isEmpty(comment.getUpdater()) || "null".equals(comment.getUpdater()) ? "白名单" : comment.getUpdater(); |
| 195 | - String auditor_id = comment.getAuditor_id(); | ||
| 196 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 195 | + String auditorId = comment.getAuditor_id(); |
| 196 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 197 | ShyUsers user = new ShyUsers(); | 197 | ShyUsers user = new ShyUsers(); |
| 198 | - user.setUser_id(auditor_id); | 198 | + user.setUser_id(auditorId); |
| 199 | user = shyUsersMapper.selectOne(user); | 199 | user = shyUsersMapper.selectOne(user); |
| 200 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 200 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 201 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 201 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| @@ -219,7 +219,7 @@ public class CommentsServiceImpl { | @@ -219,7 +219,7 @@ public class CommentsServiceImpl { | ||
| 219 | json.put("msg", msg); | 219 | json.put("msg", msg); |
| 220 | JSONObject result = new JSONObject(); | 220 | JSONObject result = new JSONObject(); |
| 221 | try { | 221 | try { |
| 222 | - result = Pass.commentPass(json, comment.getCallback()); | 222 | + result = pass.commentPass(json, comment.getCallback()); |
| 223 | } catch (Exception e) { | 223 | } catch (Exception e) { |
| 224 | logger.error("评论回调失败,activity_id:{}", comment.getActivity_id()); | 224 | logger.error("评论回调失败,activity_id:{}", comment.getActivity_id()); |
| 225 | success = false; | 225 | success = false; |
| @@ -242,7 +242,8 @@ public class CommentsServiceImpl { | @@ -242,7 +242,8 @@ public class CommentsServiceImpl { | ||
| 242 | comment.setUpdater(updater); | 242 | comment.setUpdater(updater); |
| 243 | } else { | 243 | } else { |
| 244 | comment.setAuditor_id(userId); | 244 | comment.setAuditor_id(userId); |
| 245 | - comment.setReceive(1);//已领取 | 245 | + //已领取 |
| 246 | + comment.setReceive(1); | ||
| 246 | comment.setReceive_user_id(userId); | 247 | comment.setReceive_user_id(userId); |
| 247 | } | 248 | } |
| 248 | int i = shyCommentsMapper.updateByPrimaryKeySelective(comment); | 249 | int i = shyCommentsMapper.updateByPrimaryKeySelective(comment); |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| @@ -38,7 +38,7 @@ public class ContentServiceImpl { | @@ -38,7 +38,7 @@ public class ContentServiceImpl { | ||
| 38 | @Autowired | 38 | @Autowired |
| 39 | ShyUsersMapper shyUsersMapper; | 39 | ShyUsersMapper shyUsersMapper; |
| 40 | @Autowired | 40 | @Autowired |
| 41 | - AuditPass Pass; | 41 | + AuditPass pass; |
| 42 | @Autowired | 42 | @Autowired |
| 43 | SitesServiceImpl sitesService; | 43 | SitesServiceImpl sitesService; |
| 44 | @Autowired | 44 | @Autowired |
| @@ -192,10 +192,10 @@ public class ContentServiceImpl { | @@ -192,10 +192,10 @@ public class ContentServiceImpl { | ||
| 192 | ShyContent content = shyContentMapper.selectByPrimaryKey(id); | 192 | ShyContent content = shyContentMapper.selectByPrimaryKey(id); |
| 193 | if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { | 193 | if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) { |
| 194 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); | 194 | String updater = CommonUtils.isEmpty(content.getUpdater()) || "null".equals(content.getUpdater()) ? "白名单" : content.getUpdater(); |
| 195 | - String auditor_id = content.getAuditor_id(); | ||
| 196 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 195 | + String auditorId = content.getAuditor_id(); |
| 196 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 197 | ShyUsers user = new ShyUsers(); | 197 | ShyUsers user = new ShyUsers(); |
| 198 | - user.setUser_id(auditor_id); | 198 | + user.setUser_id(auditorId); |
| 199 | user = shyUsersMapper.selectOne(user); | 199 | user = shyUsersMapper.selectOne(user); |
| 200 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 200 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 201 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 201 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| @@ -216,14 +216,14 @@ public class ContentServiceImpl { | @@ -216,14 +216,14 @@ public class ContentServiceImpl { | ||
| 216 | ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId)); | 216 | ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId)); |
| 217 | JSONObject result = new JSONObject(); | 217 | JSONObject result = new JSONObject(); |
| 218 | try { | 218 | try { |
| 219 | - if (CommonUtils.isNotEmpty(content.getContent_tag()) && content.getContent_tag().equals("content")) { | ||
| 220 | - result = Pass.contentPass(content.getContent_id(), state + "", msg, content.getCallback()); | ||
| 221 | - } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && content.getContent_tag().equals("moment")) { | ||
| 222 | - result = Pass.momentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | ||
| 223 | - } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && content.getContent_tag().equals("cms_photoalbum")) { | ||
| 224 | - result = Pass.cmsCommonContentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | ||
| 225 | - } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && content.getContent_tag().equals("edu_works")) { | ||
| 226 | - result = Pass.cmsCommonContentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | 219 | + if (CommonUtils.isNotEmpty(content.getContent_tag()) && "content".equals(content.getContent_tag())) { |
| 220 | + result = pass.contentPass(content.getContent_id(), state + "", msg, content.getCallback()); | ||
| 221 | + } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && "moment".equals(content.getContent_tag())) { | ||
| 222 | + result = pass.momentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | ||
| 223 | + } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && "cms_photoalbum".equals(content.getContent_tag())) { | ||
| 224 | + result = pass.cmsCommonContentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | ||
| 225 | + } else if (CommonUtils.isNotEmpty(content.getContent_tag()) && "edu_works".equals(content.getContent_tag())) { | ||
| 226 | + result = pass.cmsCommonContentPass(content.getContent_id(), state, msg, content.getCallback(), content.getAuthor()); | ||
| 227 | } | 227 | } |
| 228 | } catch (Exception e) { | 228 | } catch (Exception e) { |
| 229 | logger.error("图文审核回调失败,图文id:{}", content.getId()); | 229 | logger.error("图文审核回调失败,图文id:{}", content.getId()); |
| @@ -245,7 +245,7 @@ public class ContentServiceImpl { | @@ -245,7 +245,7 @@ public class ContentServiceImpl { | ||
| 245 | 245 | ||
| 246 | //如果当前图文是朋友圈的视频,通知点播云 | 246 | //如果当前图文是朋友圈的视频,通知点播云 |
| 247 | if (CommonUtils.isNotEmpty(content.getContent_tag()) | 247 | if (CommonUtils.isNotEmpty(content.getContent_tag()) |
| 248 | - && content.getContent_tag().equals("moment") | 248 | + && "moment".equals(content.getContent_tag()) |
| 249 | && CommonUtils.isNotEmpty(content.getVideo_id()) | 249 | && CommonUtils.isNotEmpty(content.getVideo_id()) |
| 250 | && state.equals(CommonConst.AUDIT_REFUSE)) { | 250 | && state.equals(CommonConst.AUDIT_REFUSE)) { |
| 251 | ShyVideos shyVideos1 = new ShyVideos(); | 251 | ShyVideos shyVideos1 = new ShyVideos(); |
src/main/java/com/cnlive/shenhe/serviceImpl/EmailServiceImpl.java
| @@ -46,9 +46,8 @@ public class EmailServiceImpl { | @@ -46,9 +46,8 @@ public class EmailServiceImpl { | ||
| 46 | } | 46 | } |
| 47 | criteria.andEqualTo("is_delete", false); | 47 | criteria.andEqualTo("is_delete", false); |
| 48 | PageHelper.startPage(emailDTO.getPage(), emailDTO.getPageSize(), true); | 48 | PageHelper.startPage(emailDTO.getPage(), emailDTO.getPageSize(), true); |
| 49 | - | ||
| 50 | - List<ShyEmail> ShyEmailList = shyEmailMapper.selectByExample(example); | ||
| 51 | - PageInfo<ShyEmail> pageInfo = new PageInfo<ShyEmail>(ShyEmailList); | 49 | + List<ShyEmail> shyEmailList = shyEmailMapper.selectByExample(example); |
| 50 | + PageInfo<ShyEmail> pageInfo = new PageInfo<ShyEmail>(shyEmailList); | ||
| 52 | return pageInfo; | 51 | return pageInfo; |
| 53 | } | 52 | } |
| 54 | 53 |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
| @@ -7,7 +7,6 @@ import com.cnlive.shenhe.bean.ResponseBean; | @@ -7,7 +7,6 @@ import com.cnlive.shenhe.bean.ResponseBean; | ||
| 7 | import com.cnlive.shenhe.dto.LiveApplyDTO; | 7 | import com.cnlive.shenhe.dto.LiveApplyDTO; |
| 8 | import com.cnlive.shenhe.entity.ShyLiveapply; | 8 | import com.cnlive.shenhe.entity.ShyLiveapply; |
| 9 | import com.cnlive.shenhe.entity.ShyUsers; | 9 | import com.cnlive.shenhe.entity.ShyUsers; |
| 10 | -import com.cnlive.shenhe.mapper.ShyLiveMapper; | ||
| 11 | import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; | 10 | import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; |
| 12 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 11 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 13 | import com.cnlive.shenhe.utils.CommonConst; | 12 | import com.cnlive.shenhe.utils.CommonConst; |
| @@ -32,14 +31,12 @@ import java.util.List; | @@ -32,14 +31,12 @@ import java.util.List; | ||
| 32 | */ | 31 | */ |
| 33 | @Service | 32 | @Service |
| 34 | public class LiveApplyServiceImpl { | 33 | public class LiveApplyServiceImpl { |
| 34 | + | ||
| 35 | private static Logger logger = LoggerFactory.getLogger(LiveApplyServiceImpl.class); | 35 | private static Logger logger = LoggerFactory.getLogger(LiveApplyServiceImpl.class); |
| 36 | @Autowired | 36 | @Autowired |
| 37 | - ShyLiveMapper shyLiveMapper; | ||
| 38 | - @Autowired | ||
| 39 | ShyLiveapplyMapper shyLiveApplyMapper; | 37 | ShyLiveapplyMapper shyLiveApplyMapper; |
| 40 | @Autowired | 38 | @Autowired |
| 41 | ShyUsersMapper shyUsersMapper; | 39 | ShyUsersMapper shyUsersMapper; |
| 42 | - | ||
| 43 | @Autowired | 40 | @Autowired |
| 44 | SitesServiceImpl sitesService; | 41 | SitesServiceImpl sitesService; |
| 45 | 42 | ||
| @@ -152,10 +149,10 @@ public class LiveApplyServiceImpl { | @@ -152,10 +149,10 @@ public class LiveApplyServiceImpl { | ||
| 152 | ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id); | 149 | ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id); |
| 153 | if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | 150 | if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { |
| 154 | String updater = CommonUtils.isEmpty(shyLiveapply.getUpdater()) || "null".equals(shyLiveapply.getUpdater()) ? "自动通过" : shyLiveapply.getUpdater(); | 151 | String updater = CommonUtils.isEmpty(shyLiveapply.getUpdater()) || "null".equals(shyLiveapply.getUpdater()) ? "自动通过" : shyLiveapply.getUpdater(); |
| 155 | - String auditor_id = shyLiveapply.getAuditor(); | ||
| 156 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 152 | + String auditorId = shyLiveapply.getAuditor(); |
| 153 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 157 | ShyUsers user = new ShyUsers(); | 154 | ShyUsers user = new ShyUsers(); |
| 158 | - user.setUser_id(auditor_id); | 155 | + user.setUser_id(auditorId); |
| 159 | user = shyUsersMapper.selectOne(user); | 156 | user = shyUsersMapper.selectOne(user); |
| 160 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 157 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 161 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 158 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
| @@ -30,6 +30,7 @@ import java.util.List; | @@ -30,6 +30,7 @@ import java.util.List; | ||
| 30 | */ | 30 | */ |
| 31 | @Service | 31 | @Service |
| 32 | public class LiveServiceImpl { | 32 | public class LiveServiceImpl { |
| 33 | + | ||
| 33 | private static Logger logger = LoggerFactory.getLogger(LiveServiceImpl.class); | 34 | private static Logger logger = LoggerFactory.getLogger(LiveServiceImpl.class); |
| 34 | @Autowired | 35 | @Autowired |
| 35 | ShyLiveMapper shyLiveMapper; | 36 | ShyLiveMapper shyLiveMapper; |
| @@ -136,10 +137,12 @@ public class LiveServiceImpl { | @@ -136,10 +137,12 @@ public class LiveServiceImpl { | ||
| 136 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); | 137 | ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id); |
| 137 | if (!shyLive.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { | 138 | if (!shyLive.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) { |
| 138 | String updater = CommonUtils.isEmpty(shyLive.getUpdater()) || "null".equals(shyLive.getUpdater()) ? "自动通过" : shyLive.getUpdater(); | 139 | String updater = CommonUtils.isEmpty(shyLive.getUpdater()) || "null".equals(shyLive.getUpdater()) ? "自动通过" : shyLive.getUpdater(); |
| 139 | - String auditor_id = shyLive.getAuditor(); | ||
| 140 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 140 | + |
| 141 | + String auditorId = shyLive.getAuditor(); | ||
| 142 | + | ||
| 143 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 141 | ShyUsers user = new ShyUsers(); | 144 | ShyUsers user = new ShyUsers(); |
| 142 | - user.setUser_id(auditor_id); | 145 | + user.setUser_id(auditorId); |
| 143 | user = shyUsersMapper.selectOne(user); | 146 | user = shyUsersMapper.selectOne(user); |
| 144 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 147 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 145 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 148 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
src/main/java/com/cnlive/shenhe/serviceImpl/NotspeakServiceImpl.java
| @@ -9,12 +9,9 @@ import com.cnlive.shenhe.entity.ShyComments; | @@ -9,12 +9,9 @@ import com.cnlive.shenhe.entity.ShyComments; | ||
| 9 | import com.cnlive.shenhe.entity.ShyNotspeak; | 9 | import com.cnlive.shenhe.entity.ShyNotspeak; |
| 10 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; | 10 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; |
| 11 | import com.cnlive.shenhe.mapper.ShyNotspeakMapper; | 11 | import com.cnlive.shenhe.mapper.ShyNotspeakMapper; |
| 12 | -import com.cnlive.shenhe.mapper.ShySitesMapper; | ||
| 13 | -import com.cnlive.shenhe.mapper.ShyUsersMapper; | ||
| 14 | import com.cnlive.shenhe.utils.AuditPass; | 12 | import com.cnlive.shenhe.utils.AuditPass; |
| 15 | import com.cnlive.shenhe.utils.CommonConst; | 13 | import com.cnlive.shenhe.utils.CommonConst; |
| 16 | import com.cnlive.shenhe.utils.CommonUtils; | 14 | import com.cnlive.shenhe.utils.CommonUtils; |
| 17 | -import com.cnlive.shenhe.utils.TransitServiceUtils; | ||
| 18 | import com.github.pagehelper.PageHelper; | 15 | import com.github.pagehelper.PageHelper; |
| 19 | import com.github.pagehelper.PageInfo; | 16 | import com.github.pagehelper.PageInfo; |
| 20 | import org.apache.ibatis.session.RowBounds; | 17 | import org.apache.ibatis.session.RowBounds; |
| @@ -28,7 +25,7 @@ import tk.mybatis.mapper.entity.Example; | @@ -28,7 +25,7 @@ import tk.mybatis.mapper.entity.Example; | ||
| 28 | import java.util.List; | 25 | import java.util.List; |
| 29 | 26 | ||
| 30 | /** | 27 | /** |
| 31 | - * @Auther: liwei | 28 | + * @author Administrator |
| 32 | * @Date: 2019/1/2 11:30 | 29 | * @Date: 2019/1/2 11:30 |
| 33 | * @Description: | 30 | * @Description: |
| 34 | */ | 31 | */ |
| @@ -41,19 +38,7 @@ public class NotspeakServiceImpl { | @@ -41,19 +38,7 @@ public class NotspeakServiceImpl { | ||
| 41 | @Autowired | 38 | @Autowired |
| 42 | ShyNotspeakMapper shyNotspeakMapper; | 39 | ShyNotspeakMapper shyNotspeakMapper; |
| 43 | @Autowired | 40 | @Autowired |
| 44 | - ShySitesMapper shySitesMapper; | ||
| 45 | - @Autowired | ||
| 46 | - ShyUsersMapper shyUsersMapper; | ||
| 47 | - @Autowired | ||
| 48 | - TransitServiceUtils transitServiceUtils; | ||
| 49 | - @Autowired | ||
| 50 | - SitesServiceImpl sitesService; | ||
| 51 | - @Autowired | ||
| 52 | - VideosServiceImpl videosService; | ||
| 53 | - @Autowired | ||
| 54 | - VideofilterServiceImpl videofilterServiceImpl; | ||
| 55 | - @Autowired | ||
| 56 | - AuditPass Pass; | 41 | + AuditPass pass; |
| 57 | 42 | ||
| 58 | @Value("${spring.localhost.url}") | 43 | @Value("${spring.localhost.url}") |
| 59 | String localhost_url; | 44 | String localhost_url; |
| @@ -102,7 +87,7 @@ public class NotspeakServiceImpl { | @@ -102,7 +87,7 @@ public class NotspeakServiceImpl { | ||
| 102 | json.put("minute", time); | 87 | json.put("minute", time); |
| 103 | JSONObject result = new JSONObject(); | 88 | JSONObject result = new JSONObject(); |
| 104 | try { | 89 | try { |
| 105 | - result = Pass.commentSpeak(json, speak_comment); | 90 | + result = pass.commentSpeak(json, speak_comment); |
| 106 | } catch (Exception e) { | 91 | } catch (Exception e) { |
| 107 | logger.error("评论禁言失败,comments_id:{}", comment.getId()); | 92 | logger.error("评论禁言失败,comments_id:{}", comment.getId()); |
| 108 | success = new ResponseBean(500, "评论禁言调用互动云服务器失败!"); | 93 | success = new ResponseBean(500, "评论禁言调用互动云服务器失败!"); |
| @@ -123,7 +108,8 @@ public class NotspeakServiceImpl { | @@ -123,7 +108,8 @@ public class NotspeakServiceImpl { | ||
| 123 | comment.setState(CommonConst.AUDIT_REFUSE); | 108 | comment.setState(CommonConst.AUDIT_REFUSE); |
| 124 | comment.setMsg("评论禁言操作"); | 109 | comment.setMsg("评论禁言操作"); |
| 125 | comment.setAuditor_id(userId); | 110 | comment.setAuditor_id(userId); |
| 126 | - comment.setReceive(1);//已领取 | 111 | + //已领取 |
| 112 | + comment.setReceive(1); | ||
| 127 | comment.setReceive_user_id(userId); | 113 | comment.setReceive_user_id(userId); |
| 128 | int i = shyCommentsMapper.updateByPrimaryKeySelective(comment); | 114 | int i = shyCommentsMapper.updateByPrimaryKeySelective(comment); |
| 129 | if (i != 1) { | 115 | if (i != 1) { |
| @@ -131,7 +117,7 @@ public class NotspeakServiceImpl { | @@ -131,7 +117,7 @@ public class NotspeakServiceImpl { | ||
| 131 | return success; | 117 | return success; |
| 132 | } | 118 | } |
| 133 | boolean res = writeNotSpeakByComment(commentId, time, userId); | 119 | boolean res = writeNotSpeakByComment(commentId, time, userId); |
| 134 | - if (res == false) { | 120 | + if (res) { |
| 135 | success = new ResponseBean(500, "评论禁言修改禁言表失败!"); | 121 | success = new ResponseBean(500, "评论禁言修改禁言表失败!"); |
| 136 | return success; | 122 | return success; |
| 137 | } | 123 | } |
| @@ -161,7 +147,7 @@ public class NotspeakServiceImpl { | @@ -161,7 +147,7 @@ public class NotspeakServiceImpl { | ||
| 161 | json.put("minute", time); | 147 | json.put("minute", time); |
| 162 | JSONObject result = new JSONObject(); | 148 | JSONObject result = new JSONObject(); |
| 163 | try { | 149 | try { |
| 164 | - result = Pass.commentSpeak(json, speak_comment); | 150 | + result = pass.commentSpeak(json, speak_comment); |
| 165 | } catch (Exception e) { | 151 | } catch (Exception e) { |
| 166 | logger.error("评论禁言失败,shyNotspeak_id:{}", shyNotspeak.getId()); | 152 | logger.error("评论禁言失败,shyNotspeak_id:{}", shyNotspeak.getId()); |
| 167 | success = new ResponseBean(500, "评论禁言调用互动云服务器失败!"); | 153 | success = new ResponseBean(500, "评论禁言调用互动云服务器失败!"); |
| @@ -198,7 +184,7 @@ public class NotspeakServiceImpl { | @@ -198,7 +184,7 @@ public class NotspeakServiceImpl { | ||
| 198 | shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime()); | 184 | shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime()); |
| 199 | shyNotspeak.setMsg(shyNotspeak.getMsg() + "\n" + msg); | 185 | shyNotspeak.setMsg(shyNotspeak.getMsg() + "\n" + msg); |
| 200 | boolean res = updateshyNotspeak(shyNotspeak); | 186 | boolean res = updateshyNotspeak(shyNotspeak); |
| 201 | - if (res == false) { | 187 | + if (res) { |
| 202 | success = new ResponseBean(500, "评论禁言修改禁言表失败!"); | 188 | success = new ResponseBean(500, "评论禁言修改禁言表失败!"); |
| 203 | return success; | 189 | return success; |
| 204 | } | 190 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
| @@ -28,7 +28,7 @@ public class ShyActivityImpl { | @@ -28,7 +28,7 @@ public class ShyActivityImpl { | ||
| 28 | private static Logger logger = LoggerFactory.getLogger(ShyActivityImpl.class); | 28 | private static Logger logger = LoggerFactory.getLogger(ShyActivityImpl.class); |
| 29 | 29 | ||
| 30 | @Autowired | 30 | @Autowired |
| 31 | - private ShyActivityMapper ShyActivityMapper; | 31 | + private ShyActivityMapper shyActivityMapper; |
| 32 | 32 | ||
| 33 | /** | 33 | /** |
| 34 | * 添加活动 | 34 | * 添加活动 |
| @@ -41,7 +41,7 @@ public class ShyActivityImpl { | @@ -41,7 +41,7 @@ public class ShyActivityImpl { | ||
| 41 | shyActivity.setCreate_time(date); | 41 | shyActivity.setCreate_time(date); |
| 42 | shyActivity.setUpdate_time(date); | 42 | shyActivity.setUpdate_time(date); |
| 43 | shyActivity.setExempt_from_trial(0); | 43 | shyActivity.setExempt_from_trial(0); |
| 44 | - int i = ShyActivityMapper.insertSelective(shyActivity); | 44 | + int i = shyActivityMapper.insertSelective(shyActivity); |
| 45 | return i; | 45 | return i; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| @@ -53,7 +53,7 @@ public class ShyActivityImpl { | @@ -53,7 +53,7 @@ public class ShyActivityImpl { | ||
| 53 | */ | 53 | */ |
| 54 | public int deleteShyActivity(Integer id) { | 54 | public int deleteShyActivity(Integer id) { |
| 55 | 55 | ||
| 56 | - int i = ShyActivityMapper.deleteByPrimaryKey(id); | 56 | + int i = shyActivityMapper.deleteByPrimaryKey(id); |
| 57 | return i; | 57 | return i; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -67,7 +67,7 @@ public class ShyActivityImpl { | @@ -67,7 +67,7 @@ public class ShyActivityImpl { | ||
| 67 | Date date = new Date(); | 67 | Date date = new Date(); |
| 68 | shyActivity.setCreate_time(date); | 68 | shyActivity.setCreate_time(date); |
| 69 | shyActivity.setUpdate_time(date); | 69 | shyActivity.setUpdate_time(date); |
| 70 | - int i = ShyActivityMapper.updateByPrimaryKeySelective(shyActivity); | 70 | + int i = shyActivityMapper.updateByPrimaryKeySelective(shyActivity); |
| 71 | return i; | 71 | return i; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| @@ -95,7 +95,7 @@ public class ShyActivityImpl { | @@ -95,7 +95,7 @@ public class ShyActivityImpl { | ||
| 95 | criteria.andLike("activity", "%" + shyActivityDTO.getActivity() + "%"); | 95 | criteria.andLike("activity", "%" + shyActivityDTO.getActivity() + "%"); |
| 96 | } | 96 | } |
| 97 | PageHelper.startPage(shyActivityDTO.getPageNum(), shyActivityDTO.getPageSize(), true); | 97 | PageHelper.startPage(shyActivityDTO.getPageNum(), shyActivityDTO.getPageSize(), true); |
| 98 | - List<ShyActivity> shyActivities = ShyActivityMapper.selectByExample(example); | 98 | + List<ShyActivity> shyActivities = shyActivityMapper.selectByExample(example); |
| 99 | PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities); | 99 | PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities); |
| 100 | return shyActivityPageInfo; | 100 | return shyActivityPageInfo; |
| 101 | } | 101 | } |
| @@ -105,11 +105,11 @@ public class ShyActivityImpl { | @@ -105,11 +105,11 @@ public class ShyActivityImpl { | ||
| 105 | * 根据条件查询活动 | 105 | * 根据条件查询活动 |
| 106 | * | 106 | * |
| 107 | * @param | 107 | * @param |
| 108 | - * @param exempt_from_trial | 108 | + * @param exemptFromTrial |
| 109 | * @return | 109 | * @return |
| 110 | */ | 110 | */ |
| 111 | - public List<Integer> selectByExample(Integer exempt_from_trial) { | ||
| 112 | - List<Integer> shyActivities = ShyActivityMapper.selectAllByExempt_from_trial(exempt_from_trial); | 111 | + public List<Integer> selectByExample(Integer exemptFromTrial) { |
| 112 | + List<Integer> shyActivities = shyActivityMapper.selectAllByExempt_from_trial(exemptFromTrial); | ||
| 113 | return shyActivities; | 113 | return shyActivities; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| @@ -120,7 +120,7 @@ public class ShyActivityImpl { | @@ -120,7 +120,7 @@ public class ShyActivityImpl { | ||
| 120 | * @return | 120 | * @return |
| 121 | */ | 121 | */ |
| 122 | public List<ShyActivity> selectAll() { | 122 | public List<ShyActivity> selectAll() { |
| 123 | - List<ShyActivity> shyActivities = ShyActivityMapper.selectAll(); | 123 | + List<ShyActivity> shyActivities = shyActivityMapper.selectAll(); |
| 124 | return shyActivities; | 124 | return shyActivities; |
| 125 | } | 125 | } |
| 126 | 126 |
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
| @@ -26,6 +26,7 @@ import java.util.List; | @@ -26,6 +26,7 @@ import java.util.List; | ||
| 26 | */ | 26 | */ |
| 27 | @Service | 27 | @Service |
| 28 | public class SitesServiceImpl { | 28 | public class SitesServiceImpl { |
| 29 | + | ||
| 29 | private static Logger logger = LoggerFactory.getLogger(SitesServiceImpl.class); | 30 | private static Logger logger = LoggerFactory.getLogger(SitesServiceImpl.class); |
| 30 | @Autowired | 31 | @Autowired |
| 31 | ShySitesMapper shySitesMapper; | 32 | ShySitesMapper shySitesMapper; |
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java
| @@ -7,9 +7,7 @@ import com.cnlive.shenhe.entity.ShyComments; | @@ -7,9 +7,7 @@ import com.cnlive.shenhe.entity.ShyComments; | ||
| 7 | import com.cnlive.shenhe.entity.ShyContent; | 7 | import com.cnlive.shenhe.entity.ShyContent; |
| 8 | import com.cnlive.shenhe.entity.ShyTopic; | 8 | import com.cnlive.shenhe.entity.ShyTopic; |
| 9 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; | 9 | import com.cnlive.shenhe.mapper.ShyCommentsMapper; |
| 10 | -import com.cnlive.shenhe.mapper.ShySitesMapper; | ||
| 11 | import com.cnlive.shenhe.mapper.ShyTopicMapper; | 10 | import com.cnlive.shenhe.mapper.ShyTopicMapper; |
| 12 | -import com.cnlive.shenhe.mapper.ShyUsersMapper; | ||
| 13 | import com.cnlive.shenhe.utils.CommonConst; | 11 | import com.cnlive.shenhe.utils.CommonConst; |
| 14 | import com.cnlive.shenhe.utils.CommonUtils; | 12 | import com.cnlive.shenhe.utils.CommonUtils; |
| 15 | import com.cnlive.shenhe.utils.TransitServiceUtils; | 13 | import com.cnlive.shenhe.utils.TransitServiceUtils; |
| @@ -40,17 +38,9 @@ public class TopicServiceImpl { | @@ -40,17 +38,9 @@ public class TopicServiceImpl { | ||
| 40 | @Autowired | 38 | @Autowired |
| 41 | ShyTopicMapper shyTopicMapper; | 39 | ShyTopicMapper shyTopicMapper; |
| 42 | @Autowired | 40 | @Autowired |
| 43 | - ShySitesMapper shySitesMapper; | ||
| 44 | - @Autowired | ||
| 45 | - ShyUsersMapper shyUsersMapper; | ||
| 46 | - @Autowired | ||
| 47 | TransitServiceUtils transitServiceUtils; | 41 | TransitServiceUtils transitServiceUtils; |
| 48 | @Autowired | 42 | @Autowired |
| 49 | SitesServiceImpl sitesService; | 43 | SitesServiceImpl sitesService; |
| 50 | - @Autowired | ||
| 51 | - VideosServiceImpl videosService; | ||
| 52 | - @Autowired | ||
| 53 | - VideofilterServiceImpl videofilterServiceImpl; | ||
| 54 | 44 | ||
| 55 | @Value("${spring.localhost.url}") | 45 | @Value("${spring.localhost.url}") |
| 56 | String localhost_url; | 46 | String localhost_url; |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersServiceImpl.java
| @@ -48,20 +48,20 @@ public class UsersServiceImpl { | @@ -48,20 +48,20 @@ public class UsersServiceImpl { | ||
| 48 | criteria.andEqualTo("sp_id", usersDTO.getSp_id()); | 48 | criteria.andEqualTo("sp_id", usersDTO.getSp_id()); |
| 49 | } | 49 | } |
| 50 | PageHelper.startPage(usersDTO.getPage(), usersDTO.getPageSize(), true); | 50 | PageHelper.startPage(usersDTO.getPage(), usersDTO.getPageSize(), true); |
| 51 | - List<ShyUsers> ShyUsersList = shyUsersMapper.selectByExample(example); | ||
| 52 | - PageInfo<ShyUsers> pageInfo = new PageInfo<ShyUsers>(ShyUsersList); | 51 | + List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example); |
| 52 | + PageInfo<ShyUsers> pageInfo = new PageInfo<ShyUsers>(shyUsersList); | ||
| 53 | return pageInfo; | 53 | return pageInfo; |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | - public String findspidByName(String shen_auditor_id) { | 56 | + public String findspidByName(String shenAuditorId) { |
| 57 | Example example = new Example(ShyUsers.class); | 57 | Example example = new Example(ShyUsers.class); |
| 58 | Example.Criteria criteria = example.createCriteria(); | 58 | Example.Criteria criteria = example.createCriteria(); |
| 59 | - criteria.andEqualTo("username", shen_auditor_id); | 59 | + criteria.andEqualTo("username", shenAuditorId); |
| 60 | List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example); | 60 | List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example); |
| 61 | if (CommonUtils.isNotNull(shyUsersList) && shyUsersList.size() > 0) { | 61 | if (CommonUtils.isNotNull(shyUsersList) && shyUsersList.size() > 0) { |
| 62 | ShyUsers shyUsers = shyUsersList.get(0); | 62 | ShyUsers shyUsers = shyUsersList.get(0); |
| 63 | - String user_id = shyUsers.getUser_id(); | ||
| 64 | - return user_id; | 63 | + String userId = shyUsers.getUser_id(); |
| 64 | + return userId; | ||
| 65 | } | 65 | } |
| 66 | return null; | 66 | return null; |
| 67 | } | 67 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersfreeServiceImpl.java
| @@ -29,7 +29,7 @@ public class UsersfreeServiceImpl { | @@ -29,7 +29,7 @@ public class UsersfreeServiceImpl { | ||
| 29 | @Autowired | 29 | @Autowired |
| 30 | ShyUsersfreeMapper shyUsersfreeMapper; | 30 | ShyUsersfreeMapper shyUsersfreeMapper; |
| 31 | @Autowired | 31 | @Autowired |
| 32 | - AuditPass Pass; | 32 | + AuditPass pass; |
| 33 | 33 | ||
| 34 | public ShyUsersfree get(Integer id) { | 34 | public ShyUsersfree get(Integer id) { |
| 35 | return shyUsersfreeMapper.selectByPrimaryKey(id); | 35 | return shyUsersfreeMapper.selectByPrimaryKey(id); |
| @@ -61,8 +61,8 @@ public class UsersfreeServiceImpl { | @@ -61,8 +61,8 @@ public class UsersfreeServiceImpl { | ||
| 61 | criteria.andLike("mobile", "%" + usersFreeDTO.getMobile() + "%"); | 61 | criteria.andLike("mobile", "%" + usersFreeDTO.getMobile() + "%"); |
| 62 | } | 62 | } |
| 63 | PageHelper.startPage(usersFreeDTO.getPage(), usersFreeDTO.getPageSize(), true); | 63 | PageHelper.startPage(usersFreeDTO.getPage(), usersFreeDTO.getPageSize(), true); |
| 64 | - List<ShyUsersfree> ShyUsersList = shyUsersfreeMapper.selectByExample(example); | ||
| 65 | - PageInfo<ShyUsersfree> pageInfo = new PageInfo<ShyUsersfree>(ShyUsersList); | 64 | + List<ShyUsersfree> shyUsersList = shyUsersfreeMapper.selectByExample(example); |
| 65 | + PageInfo<ShyUsersfree> pageInfo = new PageInfo<ShyUsersfree>(shyUsersList); | ||
| 66 | return pageInfo; | 66 | return pageInfo; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| @@ -77,7 +77,6 @@ public class UsersfreeServiceImpl { | @@ -77,7 +77,6 @@ public class UsersfreeServiceImpl { | ||
| 77 | public ShyUsersfree selectUser(Integer sp_id, String category, String user_id) { | 77 | public ShyUsersfree selectUser(Integer sp_id, String category, String user_id) { |
| 78 | ShyUsersfree shyUserfree = new ShyUsersfree(); | 78 | ShyUsersfree shyUserfree = new ShyUsersfree(); |
| 79 | shyUserfree.setSp_id(sp_id); | 79 | shyUserfree.setSp_id(sp_id); |
| 80 | -// shyUserfree.setCategory(category); | ||
| 81 | shyUserfree.setUser_id(user_id); | 80 | shyUserfree.setUser_id(user_id); |
| 82 | shyUserfree.setIs_enable(true); | 81 | shyUserfree.setIs_enable(true); |
| 83 | shyUserfree.setIs_delete(false); | 82 | shyUserfree.setIs_delete(false); |
| @@ -91,7 +90,7 @@ public class UsersfreeServiceImpl { | @@ -91,7 +90,7 @@ public class UsersfreeServiceImpl { | ||
| 91 | public boolean update(String userId, String userMobile, String write, Integer spId, String updater) { | 90 | public boolean update(String userId, String userMobile, String write, Integer spId, String updater) { |
| 92 | JSONObject result = new JSONObject(); | 91 | JSONObject result = new JSONObject(); |
| 93 | try { | 92 | try { |
| 94 | - result = Pass.queryUser(userId, userMobile); | 93 | + result = pass.queryUser(userId, userMobile); |
| 95 | } catch (Exception e) { | 94 | } catch (Exception e) { |
| 96 | logger.error("用户白名单获取失败,userId:{},userMobile:{}", userId, userMobile); | 95 | logger.error("用户白名单获取失败,userId:{},userMobile:{}", userId, userMobile); |
| 97 | return false; | 96 | return false; |
| @@ -108,7 +107,7 @@ public class UsersfreeServiceImpl { | @@ -108,7 +107,7 @@ public class UsersfreeServiceImpl { | ||
| 108 | JSONObject jsonData = result.getJSONObject("data"); | 107 | JSONObject jsonData = result.getJSONObject("data"); |
| 109 | String mobile = jsonData.getString("mobile"); | 108 | String mobile = jsonData.getString("mobile"); |
| 110 | String user_id = jsonData.getString("uid"); | 109 | String user_id = jsonData.getString("uid"); |
| 111 | - String user_name = jsonData.getString("nickName"); | 110 | + String userName = jsonData.getString("nickName"); |
| 112 | String email = jsonData.getString("email"); | 111 | String email = jsonData.getString("email"); |
| 113 | 112 | ||
| 114 | ShyUsersfree shyUserfree = new ShyUsersfree(); | 113 | ShyUsersfree shyUserfree = new ShyUsersfree(); |
| @@ -118,7 +117,7 @@ public class UsersfreeServiceImpl { | @@ -118,7 +117,7 @@ public class UsersfreeServiceImpl { | ||
| 118 | if (shyUserfree1 != null) { | 117 | if (shyUserfree1 != null) { |
| 119 | shyUserfree1.setMobile(mobile); | 118 | shyUserfree1.setMobile(mobile); |
| 120 | shyUserfree1.setCategory(write); | 119 | shyUserfree1.setCategory(write); |
| 121 | - shyUserfree1.setUser_name(user_name); | 120 | + shyUserfree1.setUser_name(userName); |
| 122 | shyUserfree1.setEmail(email); | 121 | shyUserfree1.setEmail(email); |
| 123 | shyUserfree1.setSp_id(spId); | 122 | shyUserfree1.setSp_id(spId); |
| 124 | shyUserfree1.setUpdated_at(CommonUtils.getCurrentTime()); | 123 | shyUserfree1.setUpdated_at(CommonUtils.getCurrentTime()); |
| @@ -132,7 +131,7 @@ public class UsersfreeServiceImpl { | @@ -132,7 +131,7 @@ public class UsersfreeServiceImpl { | ||
| 132 | } else { | 131 | } else { |
| 133 | shyUserfree.setMobile(mobile); | 132 | shyUserfree.setMobile(mobile); |
| 134 | shyUserfree.setCategory(write); | 133 | shyUserfree.setCategory(write); |
| 135 | - shyUserfree.setUser_name(user_name); | 134 | + shyUserfree.setUser_name(userName); |
| 136 | shyUserfree.setEmail(email); | 135 | shyUserfree.setEmail(email); |
| 137 | shyUserfree.setSp_id(spId); | 136 | shyUserfree.setSp_id(spId); |
| 138 | shyUserfree.setCreated_at(CommonUtils.getCurrentTime()); | 137 | shyUserfree.setCreated_at(CommonUtils.getCurrentTime()); |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| @@ -64,7 +64,7 @@ public class VideosServiceImpl { | @@ -64,7 +64,7 @@ public class VideosServiceImpl { | ||
| 64 | String ks_domain; | 64 | String ks_domain; |
| 65 | 65 | ||
| 66 | @Autowired | 66 | @Autowired |
| 67 | - AuditPass Pass; | 67 | + AuditPass pass; |
| 68 | 68 | ||
| 69 | public boolean impotVideo(ShyVideos shyVideos) { | 69 | public boolean impotVideo(ShyVideos shyVideos) { |
| 70 | int result = shyVideosMapper.insertSelective(shyVideos); | 70 | int result = shyVideosMapper.insertSelective(shyVideos); |
| @@ -209,10 +209,10 @@ public class VideosServiceImpl { | @@ -209,10 +209,10 @@ public class VideosServiceImpl { | ||
| 209 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); | 209 | ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id); |
| 210 | if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { | 210 | if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) { |
| 211 | String updater = CommonUtils.isEmpty(shyVideos.getUpdater()) || "null".equals(shyVideos.getUpdater()) ? "白名单" : shyVideos.getUpdater(); | 211 | String updater = CommonUtils.isEmpty(shyVideos.getUpdater()) || "null".equals(shyVideos.getUpdater()) ? "白名单" : shyVideos.getUpdater(); |
| 212 | - String auditor_id = shyVideos.getAuditor_id(); | ||
| 213 | - if (CommonUtils.isNotEmpty(auditor_id)) { | 212 | + String auditorId = shyVideos.getAuditor_id(); |
| 213 | + if (CommonUtils.isNotEmpty(auditorId)) { | ||
| 214 | ShyUsers user = new ShyUsers(); | 214 | ShyUsers user = new ShyUsers(); |
| 215 | - user.setUser_id(auditor_id); | 215 | + user.setUser_id(auditorId); |
| 216 | user = shyUsersMapper.selectOne(user); | 216 | user = shyUsersMapper.selectOne(user); |
| 217 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); | 217 | String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail(); |
| 218 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); | 218 | String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername(); |
| @@ -405,7 +405,7 @@ public class VideosServiceImpl { | @@ -405,7 +405,7 @@ public class VideosServiceImpl { | ||
| 405 | */ | 405 | */ |
| 406 | public int updateDianboAndShenhe(ShyVideos video, int dianboState) { | 406 | public int updateDianboAndShenhe(ShyVideos video, int dianboState) { |
| 407 | //修改点播云的视频状态 | 407 | //修改点播云的视频状态 |
| 408 | - JSONObject result = Pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback()); | 408 | + JSONObject result = pass.auditPass(video.getVideo_id(), dianboState, video.getMsg(), video.getMsg(), video.getCallback()); |
| 409 | logger.error("点播回调result:{}", result); | 409 | logger.error("点播回调result:{}", result); |
| 410 | Integer code = result.getInteger("code"); | 410 | Integer code = result.getInteger("code"); |
| 411 | String errorCode = result.getString("errorCode"); | 411 | String errorCode = result.getString("errorCode"); |
| @@ -525,7 +525,7 @@ public class VideosServiceImpl { | @@ -525,7 +525,7 @@ public class VideosServiceImpl { | ||
| 525 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); | 525 | ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId)); |
| 526 | JSONObject result = null; | 526 | JSONObject result = null; |
| 527 | try { | 527 | try { |
| 528 | - result = Pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); | 528 | + result = pass.auditPass(shyVideos.getVideo_id(), 4, msg, msg, shyVideos.getCallback()); |
| 529 | } catch (Exception e) { | 529 | } catch (Exception e) { |
| 530 | logger.error("视频审核失败,id==" + shyVideoId, e); | 530 | logger.error("视频审核失败,id==" + shyVideoId, e); |
| 531 | showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; | 531 | showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败"; |