Commit 50e076dc3191aa2b4cb26d14d773f12a5e654ca7

Authored by 王言钊
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 41 @Autowired
42 42 YiDunServiceImpl yiDunServiceImpl;
43 43 @Autowired
44   - AuditPass Pass;
  44 + AuditPass pass;
45 45  
46 46 /**
47 47 * 音频入库
... ... @@ -143,7 +143,7 @@ public class AudioControllerApi {
143 143 newshyAudio.setState(1);
144 144 newshyAudio.setShenhe_type(CommonConst.AUDIT_TYPE_MACHANE);
145 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 147 } else {
148 148 String labelMsg = "";
149 149 if (action != 0 && asrStatus == 3) {
... ...
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
... ... @@ -34,6 +34,7 @@ public class ChannelControllerApi {
34 34 * @Date: 2019/08/17 11:17
35 35 * @Description: 频道送审接口
36 36 */
  37 + @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
37 38 @PostMapping("/import")
38 39 @ResponseBody
39 40 public ResponseBean impotChannel(String param) {
... ... @@ -62,8 +63,8 @@ public class ChannelControllerApi {
62 63 shyChannel1.setOffline(CommonConstStates.ZHENGCHANG);
63 64 shyChannel1.setUpdated_at(CommonUtils.getCurrentTime());
64 65 channelService.getShenheType(shyChannel1);
65   - boolean YorN = channelService.updateshyChannel(shyChannel1);
66   - if (YorN) {
  66 + boolean yorN = channelService.updateshyChannel(shyChannel1);
  67 + if (yorN) {
67 68 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功");
68 69 }
69 70 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "审核请求收到失败(更新)");
... ... @@ -79,8 +80,8 @@ public class ChannelControllerApi {
79 80 shyChannel.setCreated_at(CommonUtils.getCurrentTime());
80 81 shyChannel.setUpdated_at(CommonUtils.getCurrentTime());
81 82 channelService.getShenheType(shyChannel);
82   - boolean YorN = channelService.impotChannel(shyChannel);
83   - if (YorN) {
  83 + boolean yorN = channelService.impotChannel(shyChannel);
  84 + if (yorN) {
84 85 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "审核请求收到成功");
85 86 }
86 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 5 import com.cnlive.shenhe.bean.ResponseBean;
6 6 import com.cnlive.shenhe.entity.ShyComments;
7 7 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
8   -import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
9   -import com.cnlive.shenhe.utils.AuditPass;
10 8 import com.cnlive.shenhe.utils.CommonConst;
11 9 import com.cnlive.shenhe.utils.CommonUtils;
12 10 import org.slf4j.Logger;
... ... @@ -28,11 +26,7 @@ import java.util.List;
28 26 public class CommentsControllerApi {
29 27 private static Logger logger = LoggerFactory.getLogger(CommentsControllerApi.class);
30 28 @Autowired
31   - AuditPass Pass;
32   - @Autowired
33 29 CommentsServiceImpl commentsService;
34   - @Autowired
35   - TopicServiceImpl topicService;
36 30  
37 31 /**
38 32 * @Auther: chenhao
... ... @@ -54,7 +48,7 @@ public class CommentsControllerApi {
54 48 Integer commentUserId = json.getInteger("commentUserId");
55 49 String commentUserName = json.getString("commentUserName");
56 50 String commentUserAvatar = json.getString("commentUserAvatar");
57   - String commentUserIP = json.getString("commentUserIP");
  51 + String commentUserIp = json.getString("commentUserIP");
58 52 String commentContent = json.getString("commentContent");
59 53 String appId = json.getString("appId");
60 54 String platform = json.getString("platform");
... ... @@ -72,11 +66,11 @@ public class CommentsControllerApi {
72 66 shyComments.setActivity_id(json.getString("activityId"));
73 67 List<ShyComments> commentsList = commentsService.findshyComments(shyComments);
74 68  
75   - Integer sp_id = null;
  69 + Integer spId = null;
76 70 try {
77   - sp_id = json.getInteger("spId");
  71 + spId = json.getInteger("spId");
78 72 } catch (Exception e) {
79   - sp_id = null;
  73 + spId = null;
80 74 }
81 75 //存在则更新
82 76 if (commentsList.size() > 0) {
... ... @@ -88,20 +82,19 @@ public class CommentsControllerApi {
88 82 shyComments1.setComment_user_id(commentUserId);
89 83 shyComments1.setComment_user_name(commentUserName);
90 84 shyComments1.setComment_user_avatar(commentUserAvatar);
91   - shyComments1.setComment_user_ip(commentUserIP);
  85 + shyComments1.setComment_user_ip(commentUserIp);
92 86 shyComments1.setComment_content(commentContent);
93 87 shyComments1.setType(type);
94 88 shyComments1.setLevel(level);
95   -
96 89 shyComments1.setComment_time(timestamp);
97   - shyComments1.setSpid(sp_id);
  90 + shyComments1.setSpid(spId);
98 91 shyComments1.setApp_id(appId);
99 92 shyComments1.setPlatform(platform);
100 93 shyComments1.setActivity_id(activityId);
101 94 shyComments1.setIs_hot(priority);
102 95 shyComments1.setCallback(callback);
103   - boolean YorN = commentsService.updateshyComments1(shyComments1);
104   - if (YorN == true) {
  96 + boolean yorN = commentsService.updateshyComments1(shyComments1);
  97 + if (yorN) {
105 98 return new ResponseBean(ErrorEnum.SUCCESS);
106 99 } else {
107 100 return new ResponseBean(ErrorEnum.ERROR);
... ... @@ -115,19 +108,19 @@ public class CommentsControllerApi {
115 108 shyComments.setComment_user_id(commentUserId);
116 109 shyComments.setComment_user_name(commentUserName);
117 110 shyComments.setComment_user_avatar(commentUserAvatar);
118   - shyComments.setComment_user_ip(commentUserIP);
  111 + shyComments.setComment_user_ip(commentUserIp);
119 112 shyComments.setComment_content(commentContent);
120 113 shyComments.setComment_time(timestamp);
121 114 shyComments.setType(type);
122 115 shyComments.setLevel(level);
123   - shyComments.setSpid(sp_id);
  116 + shyComments.setSpid(spId);
124 117 shyComments.setApp_id(appId);
125 118 shyComments.setPlatform(platform);
126 119 shyComments.setIs_hot(priority);
127 120 shyComments.setCallback(callback);
128 121 commentsService.getShenheType(shyComments);
129   - boolean YorN = commentsService.impotComments(shyComments);
130   - if (YorN == true) {
  122 + boolean yorN = commentsService.impotComments(shyComments);
  123 + if (yorN) {
131 124 return new ResponseBean(ErrorEnum.SUCCESS);
132 125 } else {
133 126 return new ResponseBean(ErrorEnum.ERROR);
... ...
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
... ... @@ -76,7 +76,6 @@ public class ContentControllerApi {
76 76 if (CommonUtils.isNotEmpty(contentTime)) {
77 77 Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss");
78 78 shyContent1.setContent_time(timestamp);
79   -
80 79 }
81 80 shyContent1.setCreate_date(CommonUtils.getCurrentTime());
82 81 //回调地址
... ... @@ -93,8 +92,8 @@ public class ContentControllerApi {
93 92 shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);
94 93 //最后一次更新时间
95 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 97 logger.info("图文同步接口更新成功:{}", contentId);
99 98 return new ResponseBean(ErrorEnum.SUCCESS);
100 99 } else {
... ... @@ -130,15 +129,8 @@ public class ContentControllerApi {
130 129 shyContent.setContent_text(json.getString("content_text"));
131 130 //创建时间
132 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 132 String contentTag = json.getString("content_tag");
140 133 shyContent.setContent_tag(StringUtils.isEmpty(contentTag) ? "content" : contentTag);
141   -
142 134 shyContent.setCreate_date(CommonUtils.getCurrentTime());
143 135 //回调地址
144 136 shyContent.setCallback(json.getString("callback"));
... ... @@ -152,8 +144,8 @@ public class ContentControllerApi {
152 144 shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);
153 145 //最后一次更新时间
154 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 149 logger.info("图文同步接口保存操作成功:{}", json.getString("contentId"));
158 150 return new ResponseBean(ErrorEnum.SUCCESS);
159 151 } else {
... ... @@ -181,7 +173,6 @@ public class ContentControllerApi {
181 173 List<ShyContent> contentList = contentService.findshyContent(shyContent);
182 174 //获取审核类型
183 175 Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment");
184   -
185 176 //获取生活圈内容的类型 1:图片 2:视频 3:分享
186 177 Integer contentType = json.getInteger("contentType");
187 178 //内容图片地址
... ... @@ -211,10 +202,6 @@ public class ContentControllerApi {
211 202 //朋友圈内容创建时间
212 203 String contentTime = json.getString("createTime");
213 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 205 shyContent1.setCreate_date(CommonUtils.getCurrentTime());
219 206 //回调地址
220 207 shyContent1.setCallback(json.getString("callbackUrl"));
... ... @@ -236,10 +223,8 @@ public class ContentControllerApi {
236 223 shyContent1.setReceive_status(CommonConst.RECEIVE_BEFORE);
237 224 //最后一次更新时间
238 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 228 return new ResponseBean(ErrorEnum.SUCCESS);
244 229 } else {
245 230 return new ResponseBean(ErrorEnum.ERROR);
... ... @@ -257,10 +242,6 @@ public class ContentControllerApi {
257 242 //创建时间
258 243 String contentTime = json.getString("createTime");
259 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 245 shyContent.setCreate_date(CommonUtils.getCurrentTime());
265 246 //回调地址
266 247 shyContent.setCallback(json.getString("callbackUrl"));
... ... @@ -280,8 +261,8 @@ public class ContentControllerApi {
280 261 shyContent.setReceive_status(CommonConst.RECEIVE_BEFORE);
281 262 //最后一次更新时间
282 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 266 return new ResponseBean(ErrorEnum.SUCCESS);
286 267 } else {
287 268 return new ResponseBean(ErrorEnum.ERROR);
... ...
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
... ... @@ -35,7 +35,7 @@ public class LiveApplyControllerApi {
35 35 JSONObject map = new JSONObject();
36 36 JSONObject result = new JSONObject();
37 37 //初始化一个请求数据库返回结果
38   - boolean YorN = true;
  38 + boolean yorN = true;
39 39  
40 40 logger.info("直播申请入库,param=====" + param);
41 41 JSONObject json = JSONObject.parseObject(param);
... ... @@ -67,7 +67,7 @@ public class LiveApplyControllerApi {
67 67 //内容简述
68 68 String simpleContent = json.getString("simpleContent");
69 69 //直播类型
70   - String live_type = json.getString("liveType");
  70 + String liveType = json.getString("liveType");
71 71 //要点报备:0品牌植入 1广告植入 2商品推销 3网家家独家麦标
72 72 String keys = json.getString("keys").equals("") ? "无" : json.getString("keys");
73 73 //直播地点
... ... @@ -82,15 +82,15 @@ public class LiveApplyControllerApi {
82 82 String platforms = json.getString("platforms");
83 83 //预计开始时间
84 84 String startTime = json.getString("preStartTime");
85   - Date timestamp_start = null;
  85 + Date timestampStart = null;
86 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 90 String endTime = json.getString("preEndTime");
91   - Date timestamp_end = null;
  91 + Date timestampEnd = null;
92 92 if (CommonUtils.isNotEmpty(endTime)) {
93   - timestamp_end = new Timestamp(Long.valueOf(endTime));
  93 + timestampEnd = new Timestamp(Long.valueOf(endTime));
94 94 }
95 95 ShyLiveapply shyliveApply1 = new ShyLiveapply();
96 96 //得到直播活动id去查询是否已有
... ... @@ -112,11 +112,11 @@ public class LiveApplyControllerApi {
112 112 //直播主题
113 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 120 //商务模式:0免费 1收费
121 121 shyliveApply.setBusiness_model(businessModel);
122 122 //内容属性:1商业类活动 0非商业活动
... ... @@ -147,7 +147,7 @@ public class LiveApplyControllerApi {
147 147  
148 148 //获取审核类型
149 149 liveApplyServiceImpl.getShenheType(shyliveApply);
150   - YorN = liveApplyServiceImpl.updateshyLiveApply(shyliveApply);
  150 + yorN = liveApplyServiceImpl.updateshyLiveApply(shyliveApply);
151 151 } else {
152 152 //查了,没有,直接插入数据库
153 153 //设置频道id
... ... @@ -163,11 +163,11 @@ public class LiveApplyControllerApi {
163 163 //直播主题
164 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 171 //商务模式:0免费 1收费
172 172 shyliveApply1.setBusiness_model(businessModel);
173 173 //内容属性:1商业类活动 0非商业活动
... ... @@ -202,10 +202,10 @@ public class LiveApplyControllerApi {
202 202 //更新时间
203 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 209 result.put("errorCode", "0");
210 210 result.put("errorMessage", "直播申请审核请求收到成功");
211 211 map.put("statusCode", "200");
... ...
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
... ... @@ -37,7 +37,7 @@ public class LiveControllerApi {
37 37 JSONObject map = new JSONObject();
38 38 JSONObject result = new JSONObject();
39 39 //初始化一个请求数据库返回结果
40   - boolean YorN = true;
  40 + boolean yorN = true;
41 41  
42 42 logger.info("直播入库,param=====" + param);
43 43 JSONObject json = JSONObject.parseObject(param);
... ... @@ -51,7 +51,7 @@ public class LiveControllerApi {
51 51 //直播频道id
52 52 String channelId = json.getString("channelId");
53 53 //直播频道id
54   - String live_type = json.getString("liveType");
  54 + String liveType = json.getString("liveType");
55 55 //rtmp直播流
56 56 String mp4Url = json.getString("mp4Url");
57 57 //m3u8直播流
... ... @@ -60,8 +60,10 @@ public class LiveControllerApi {
60 60 Integer spId = Integer.parseInt(json.getString("spId"));
61 61 //回调地址
62 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 68 String coverImgUrl = json.getString("coverImgUrl");
67 69 //活动描述
... ... @@ -70,28 +72,30 @@ public class LiveControllerApi {
70 72 String playbackUrl = json.getString("playbackUrl");
71 73 //开始时间
72 74 String startTime = json.getString("startTime");
73   - Date timestamp_start = null;
  75 +
  76 + Date timestampStart = null;
74 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 81 String endTime = json.getString("endTime");
79   - Date timestamp_end = null;
  82 + Date timestampEnd = null;
80 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 101 ShyLive shylive1 = new ShyLive();
... ... @@ -109,8 +113,8 @@ public class LiveControllerApi {
109 113 shyLive.setActivity_name(activityName);
110 114 //设置直播活动状态
111 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 119 //直播活动状态,1:直播中,2:直播完成,3:待直播,0:直播撤销(手动),4:直播下线(强制)
116 120 //发布直播
... ... @@ -121,14 +125,14 @@ public class LiveControllerApi {
121 125 shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES);
122 126 //启动直播
123 127 } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) {
124   - shyLive.setActivity_start_time(timestamp_start);
  128 + shyLive.setActivity_start_time(timestampStart);
125 129 shyLive.setActivity_end_time(null);
126 130 //是否是热点: 1:不是 ,2: 是
127 131 shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANYES);
128 132 //停止直播
129 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 137 shyLive.setPlayback_url(playbackUrl);
134 138 //状态 0:未认领 1.已领未审,2:已审
... ... @@ -139,8 +143,8 @@ public class LiveControllerApi {
139 143 shyLive.setIs_hot(CommonConstStates.SHIFOU_REDIANNO);
140 144 //审核强制下线
141 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 149 shyLive.setPlayback_url(playbackUrl);
146 150 //是否是热点: 1:不是 ,2: 是
... ... @@ -148,7 +152,7 @@ public class LiveControllerApi {
148 152 }
149 153 //直播活动简介
150 154 shyLive.setActivity_intro(activityIntro);
151   - shyLive.setLive_type(live_type);
  155 + shyLive.setLive_type(liveType);
152 156 //m3u8直播流
153 157 shyLive.setM3u8_url(hlsUrl);
154 158 //rtmp直播流
... ... @@ -173,7 +177,7 @@ public class LiveControllerApi {
173 177 //更新时间
174 178 shyLive.setUpdated_at(CommonUtils.getCurrentTime());
175 179  
176   - YorN = liveService.updateshyLive(shyLive);
  180 + yorN = liveService.updateshyLive(shyLive);
177 181 } else {
178 182 //查了,没有,直接插入数据库
179 183 //设置直播活动id
... ... @@ -190,20 +194,20 @@ public class LiveControllerApi {
190 194 shylive1.setShenhe_state(CommonConst.RECEIVE_BEFORE);
191 195 //是否是热点: 1:不是 ,2: 是
192 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 200 if (activityStatus.equals(CommonConstStates.ZHIBO_DENGDAI)) {
197 201 shylive1.setActivity_start_time(null);
198 202 shylive1.setActivity_end_time(null);
199 203 } else if (activityStatus.equals(CommonConstStates.ZHIBO_ZHENGZAI)) {
200 204 //启动直播
201   - shylive1.setActivity_start_time(timestamp_start);
  205 + shylive1.setActivity_start_time(timestampStart);
202 206 shylive1.setActivity_end_time(null);
203 207 //停止直播
204 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 212 shylive1.setPlayback_url(playbackUrl);
209 213 //状态 0:未认领 1.已领未审,2:已审
... ... @@ -214,8 +218,8 @@ public class LiveControllerApi {
214 218 shylive1.setIs_hot(CommonConstStates.SHIFOU_REDIANNO);
215 219 //审核强制下线
216 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 224 shylive1.setPlayback_url(playbackUrl);
221 225 //状态 0:未认领 1.已领未审,2:已审
... ... @@ -225,7 +229,7 @@ public class LiveControllerApi {
225 229 }
226 230 //直播活动简介
227 231 shylive1.setActivity_intro(activityIntro);
228   - shylive1.setLive_type(live_type);
  232 + shylive1.setLive_type(liveType);
229 233 //m3u8直播流
230 234 shylive1.setM3u8_url(hlsUrl);
231 235 //rtmp直播流
... ... @@ -252,10 +256,10 @@ public class LiveControllerApi {
252 256 shylive1.setCreated_at(CommonUtils.getCurrentTime());
253 257 //更新时间
254 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 263 result.put("errorCode", "0");
260 264 result.put("errorMessage", "直播审核请求收到成功");
261 265 map.put("statusCode", "200");
... ...
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
... ... @@ -4,22 +4,15 @@ import com.alibaba.fastjson.JSONObject;
4 4 import com.cnlive.shenhe.bean.ErrorEnum;
5 5 import com.cnlive.shenhe.bean.ResponseBean;
6 6 import com.cnlive.shenhe.entity.ShyTopic;
7   -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
8 7 import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
9   -import com.cnlive.shenhe.utils.AuditPass;
10 8 import com.cnlive.shenhe.utils.CommonConst;
11 9 import com.cnlive.shenhe.utils.CommonUtils;
12 10 import com.cnlive.shenhe.utils.TransitServiceUtils;
13   -
14 11 import org.slf4j.Logger;
15 12 import org.slf4j.LoggerFactory;
16 13 import org.springframework.beans.factory.annotation.Autowired;
17 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 17 import java.util.HashMap;
25 18 import java.util.List;
... ... @@ -31,16 +24,12 @@ import java.util.Map;
31 24 @Controller
32 25 @RequestMapping("/api/topic")
33 26 public class TopicControllerApi {
  27 +
34 28 private static Logger logger = LoggerFactory.getLogger(TopicControllerApi.class);
35 29 @Autowired
36   - AuditPass Pass;
37   - @Autowired
38   - CommentsServiceImpl commentsService;
39   - @Autowired
40 30 TopicServiceImpl topicService;
41   -
42 31 @Autowired
43   - TransitServiceUtils t;
  32 + TransitServiceUtils transitServiceUtils;
44 33  
45 34 /**
46 35 * @author liwei
... ... @@ -52,11 +41,9 @@ public class TopicControllerApi {
52 41 public ResponseBean impotTopic(@RequestBody String param) {
53 42 logger.info("话题入库,param=====" + param);
54 43 JSONObject json = JSONObject.parseObject(param);
55   - JSONObject result = new JSONObject();
56   -
57 44 //获取所有参数
58 45 //话题id
59   - String topic_id = json.getString("topicId");
  46 + String topicId = json.getString("topicId");
60 47 Integer spId = null;
61 48 try {
62 49 spId = json.getInteger("spId");
... ... @@ -68,18 +55,18 @@ public class TopicControllerApi {
68 55 //话题图片
69 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 64 //话题url
78   - String topic_url = json.getString("topicUrl");
  65 + String topicUrl = json.getString("topicUrl");
79 66  
80 67 //判断是否存在
81 68 ShyTopic shyTopic = new ShyTopic();
82   - shyTopic.setTopic_id(topic_id);
  69 + shyTopic.setTopic_id(topicId);
83 70 List<ShyTopic> topicList = topicService.findshyTopic(shyTopic);
84 71  
85 72 //获取审核类型
... ... @@ -94,13 +81,13 @@ public class TopicControllerApi {
94 81 //审核类型
95 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 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 91 //spid
105 92 shyTopic1.setSp_id(spId);
106 93 //当前话题的审核状态
... ... @@ -108,11 +95,11 @@ public class TopicControllerApi {
108 95 //最后一次更新时间
109 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 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 110 //审核类型
124 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 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 120 //spid
134 121 shyTopic.setSp_id(spId);
135 122 //当前话题的审核状态
... ... @@ -138,24 +125,24 @@ public class TopicControllerApi {
138 125 shyTopic.setUpdate_date(CommonUtils.getCurrentTime());
139 126 //送审时间
140 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 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 136 @GetMapping("/send")
150 137 @ResponseBody
151 138 public String send() {
152   - System.out.println("1111");
  139 + logger.info("1111");
153 140 JSONObject params = new JSONObject();
154 141 params.put("video_id", "11111");
155 142 params.put("state", "22222");
156 143 params.put("attr_tags", "33333");
157 144 params.put("msg", "4444");
158   - t.send("cms", "/api/callback", false, params);
  145 + transitServiceUtils.send("cms", "/api/callback", false, params);
159 146 return "1111";
160 147 }
161 148  
... ... @@ -169,27 +156,28 @@ public class TopicControllerApi {
169 156 String errorMessage = json.getString("errorMessage");
170 157 //获取接收方消息
171 158 JSONObject dataObject = json.getJSONObject("data");
172   - String topic_id = dataObject.getString("topic_id");
  159 + String topicId = dataObject.getString("topic_id");
173 160 //获取当前话题实体
174 161 ShyTopic topic = new ShyTopic();
175   - topic.setTopic_id(topic_id);
  162 + topic.setTopic_id(topicId);
176 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 168 if (topic != null) {
181 169 topic.setShenhe_msg(topic.getShenhe_msg() + ",cms系统已通知");
182 170 }
183 171 } else {//中转服务器失败
184   - logger.info("话题id为:" + topic_id + ",中转服务器调用cms失败,失败消息:" + errorMessage);
  172 + logger.info("话题id为:" + topicId + ",中转服务器调用cms失败,失败消息:" + errorMessage);
185 173 topic.setShenhe_msg(topic.getShenhe_msg() + ",中转服务器调用cms失败,失败消息:" + errorMessage);
186 174 topic.setShenhe_status(CommonConst.AUDIT_INTT);
187 175 topic.setShenhe_type(CommonConst.AUDIT_TYPE_USER);
188 176 topic.setAuditor_id(null);
189 177 }
190 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 181 if (rs) {
194 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 49 @PostMapping("/submitYiDunUrl")
50 50 @ResponseBody
51 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 54 // 1.设置公共参数
55 55 params.put("secretId", SECRETID);
... ...
src/main/java/com/cnlive/shenhe/config/SessionFilter.java
1 1 package com.cnlive.shenhe.config;
2 2  
  3 +import com.cnlive.shenhe.bean.SessionUser;
  4 +import org.slf4j.Logger;
3 5 import org.slf4j.LoggerFactory;
4 6 import org.springframework.web.context.request.RequestContextHolder;
5 7 import org.springframework.web.context.request.ServletRequestAttributes;
6 8  
7   -import com.cnlive.shenhe.bean.SessionUser;
8   -
9 9 import javax.servlet.*;
10 10 import javax.servlet.http.HttpServletRequest;
11 11 import javax.servlet.http.HttpServletResponse;
... ... @@ -23,7 +23,7 @@ import java.util.regex.Pattern;
23 23 * 过滤器
24 24 */
25 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 27 HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
28 28 HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
29 29 /**
... ... @@ -59,7 +59,7 @@ public class SessionFilter implements Filter {
59 59 // session不存在 准备跳转失败
60 60 RequestDispatcher dispatcher = request.getRequestDispatcher("/users/login");
61 61 dispatcher.forward(request, response);
62   -// chain.doFilter(httpRequest, httpResponse);
  62 + //chain.doFilter(httpRequest, httpResponse);
63 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 63 String ks_domain;
64 64  
65 65 @Autowired
66   - AuditPass Pass;
  66 + AuditPass pass;
67 67  
68 68 /**
69 69 * 音频数据分页获取
... ... @@ -105,10 +105,11 @@ public class AudioController extends BaseController {
105 105 //已审+已拒绝
106 106 if (!CommonConst.AUDIT_INTT.equals(shyAudio.getState())) {
107 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 111 ShyUsers user = new ShyUsers();
111   - user.setUser_id(auditor_id);
  112 + user.setUser_id(auditorId);
112 113 user = usersService.select(user);
113 114 if (CommonUtils.isNotNull(user)) {
114 115 String email = CommonUtils.isEmpty(user.getEmail()) ? "" : user.getEmail();
... ... @@ -332,10 +333,10 @@ public class AudioController extends BaseController {
332 333 //审核员需要做处理
333 334 if (!shyAudioList.get(i).getState().equals(CommonConst.AUDIT_INTT)) {
334 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 338 ShyUsers user = new ShyUsers();
338   - user.setUser_id(auditor_id);
  339 + user.setUser_id(auditorId);
339 340 user = usersService.select(user);
340 341 if (CommonUtils.isNotNull(user)) {
341 342 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ... @@ -437,7 +438,7 @@ public class AudioController extends BaseController {
437 438 String userId = sessionUser.getUserId();
438 439 JSONObject result;
439 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 442 } catch (Exception e) {
442 443 e.printStackTrace();
443 444 System.out.println("音频审核失败");
... ...
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
... ... @@ -40,7 +40,7 @@ public class ChannelController extends BaseController {
40 40 @Value("${spring.localhost.url}")
41 41 private String localhost_url;//本机地址
42 42 @Autowired
43   - AuditPass Pass;
  43 + AuditPass pass;
44 44 @Autowired
45 45 ChannelServiceImpl channelService;
46 46  
... ... @@ -99,10 +99,10 @@ public class ChannelController extends BaseController {
99 99 for (ShyChannel channel : list) {
100 100 if (!channel.getShenhe_status().equals(CommonConst.AUDIT_INTT)) {
101 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 104 ShyUsers user = new ShyUsers();
105   - user.setUser_id(auditor_id);
  105 + user.setUser_id(auditorId);
106 106 user = usersService.select(user);
107 107 if (CommonUtils.isNotNull(user)) {
108 108 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ... @@ -211,7 +211,7 @@ public class ChannelController extends BaseController {
211 211 json.put("attr_tags", "");
212 212 json.put("msg", msg);
213 213 try {
214   - result = Pass.commentPass(json, channel.getCallback());
  214 + result = pass.commentPass(json, channel.getCallback());
215 215 } catch (Exception e) {
216 216 logger.error("评论回调失败,activity_id:{}", channel.getChannel_id());
217 217 showMsg = showMsg + "," + channel.getChannel_name() + "的评论拒绝请求失败";
... ... @@ -254,7 +254,7 @@ public class ChannelController extends BaseController {
254 254 @GetMapping("/channelNotice")
255 255 @ResponseBody
256 256 public Map<String, Object> channelNotice() {
257   - Map<String, Object> map = new HashMap<>();
  257 + Map<String, Object> map = new HashMap<>(16);
258 258 ShyChannel shyChannel = new ShyChannel();
259 259 shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
260 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 41 public class CommentsController extends BaseController {
42 42 private static Logger logger = LoggerFactory.getLogger(CommentsController.class);
43 43 @Autowired
44   - AuditPass Pass;
  44 + AuditPass pass;
45 45 @Autowired
46 46 CommentsServiceImpl commentsService;
47 47  
... ... @@ -92,10 +92,10 @@ public class CommentsController extends BaseController {
92 92 for (ShyComments comment : list) {
93 93 if (!comment.getState().equals(CommonConst.AUDIT_INTT)) {
94 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 97 ShyUsers user = new ShyUsers();
98   - user.setUser_id(auditor_id);
  98 + user.setUser_id(auditorId);
99 99 user = usersService.select(user);
100 100 if (CommonUtils.isNotNull(user)) {
101 101 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ... @@ -253,7 +253,7 @@ public class CommentsController extends BaseController {
253 253 json.put("attr_tags", "");
254 254 json.put("msg", msg);
255 255 try {
256   - result = Pass.commentPass(json, comments.getCallback());
  256 + result = pass.commentPass(json, comments.getCallback());
257 257 } catch (Exception e) {
258 258 logger.error("评论回调失败,activity_id:{}", comments.getActivity_id());
259 259 showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败";
... ... @@ -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 377 String type = list.get(i).getType();
378 378 if (type != null) {
379 379 if (type.equals(CommonConst.CATEGORY_TOPIC)) {
380   - common_type = "话题";
  380 + commonType = "话题";
381 381 }
382 382 } else {
383   - common_type = "其他";
  383 + commonType = "其他";
384 384 }
385 385 cell = row.createCell(6);//列
386   - cell.setCellValue(common_type);
  386 + cell.setCellValue(commonType);
387 387 cell = row.createCell(7);//列
388 388 Integer level = list.get(i).getLevel();
389 389 if (level != null) {
... ... @@ -391,9 +391,9 @@ public class CommentsController extends BaseController {
391 391 }
392 392 /*状态需要处理成用户可读*/
393 393 String platform = "";//评论所属的平台
394   - if (list.get(i).getPlatform().equals("a")) {
  394 + if ("a".equals(list.get(i).getPlatform())) {
395 395 platform = "安卓";
396   - } else if (list.get(i).getPlatform().equals("i")) {
  396 + } else if ("i".equals(list.get(i).getPlatform())) {
397 397 platform = "ios";
398 398 } else {
399 399 platform = "未知";
... ... @@ -406,25 +406,26 @@ public class CommentsController extends BaseController {
406 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 411 if (list.get(i).getState() == 1) {
411   - shenhe_Status = "已审核";
  412 + shenheStatus = "已审核";
412 413 } else if (list.get(i).getState() == 2) {
413   - shenhe_Status = "已拒绝";
  414 + shenheStatus = "已拒绝";
414 415 } else {
415   - shenhe_Status = "未审核";
  416 + shenheStatus = "未审核";
416 417 }
417 418 cell = row.createCell(10);//列
418   - cell.setCellValue(shenhe_Status);
  419 + cell.setCellValue(shenheStatus);
419 420  
420 421 /* 审核员需要做处理*/
421 422 String updater = "";//审核员名字
422 423 if (!list.get(i).getState().equals(CommonConst.AUDIT_INTT)) {
423 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 427 ShyUsers user = new ShyUsers();
427   - user.setUser_id(auditor_id);
  428 + user.setUser_id(auditorId);
428 429 user = usersService.select(user);
429 430 if (CommonUtils.isNotNull(user)) {
430 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 95 if (!list.isEmpty()) {
96 96 for (ShyContent content : list) {
97 97 if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) {
98   - String auditor_id = content.getAuditor_id();
  98 + String auditorId = content.getAuditor_id();
99 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 101 content.setUpdater(updater);
102 102 }
103 103 //显示spid简称
... ... @@ -122,13 +122,13 @@ public class ContentController extends BaseController {
122 122 public String getDetailsComments(@PathVariable Integer id, Model model) {
123 123 ShyContent content = contentService.getDetailsContent(id);
124 124 if (!content.getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) {
125   - String auditor_id = content.getAuditor_id();
  125 + String auditorId = content.getAuditor_id();
126 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 128 content.setUpdater(updater);
129 129 }
130 130 //朋友圈内容切割内容图片或者视频地址
131   - if (content.getContent_tag().equals("moment")) {
  131 + if ("moment".equals(content.getContent_tag())) {
132 132 String[] contentImageUrlList = null;
133 133 if (content.getContent_pc_url() != null) {
134 134 contentImageUrlList = content.getContent_pc_url().split(",");
... ... @@ -304,9 +304,9 @@ public class ContentController extends BaseController {
304 304 /*状态需要处理成用户可读*/
305 305 //图文标签 content:图文发布,moment:朋友圈
306 306 String contentTag = "";
307   - if (contentList.get(i).getContent_tag().equals("content")) {
  307 + if ("content".equals(contentList.get(i).getContent_tag())) {
308 308 contentTag = "图文发布";
309   - } else if (contentList.get(i).getContent_tag().equals("moment")) {
  309 + } else if ("moment".equals(contentList.get(i).getContent_tag())) {
310 310 contentTag = "朋友圈";
311 311 }
312 312 cell = row.createCell(4);
... ... @@ -365,10 +365,12 @@ public class ContentController extends BaseController {
365 365 String updater = "";
366 366 if (!contentList.get(i).getReceive_status().equals(CommonConst.RECEIVE_BEFORE)) {
367 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 372 ShyUsers user = new ShyUsers();
371   - user.setUser_id(auditor_id);
  373 + user.setUser_id(auditorId);
372 374 user = usersService.select(user);
373 375 if (CommonUtils.isNotNull(user)) {
374 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 9 import com.cnlive.shenhe.entity.ShyEmail;
10 10 import com.cnlive.shenhe.entity.ShyUsers;
11 11 import com.cnlive.shenhe.serviceImpl.EmailServiceImpl;
12   -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
13 12 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
14 13 import com.cnlive.shenhe.utils.CommonConst;
15 14 import com.cnlive.shenhe.utils.CommonUtils;
... ... @@ -40,9 +39,6 @@ public class EmailController extends BaseController {
40 39 @Autowired
41 40 EmailServiceImpl emailServiceImpl;
42 41 @Autowired
43   - SitesServiceImpl sitesService;
44   -
45   - @Autowired
46 42 UsersServiceImpl usersService;
47 43  
48 44  
... ... @@ -55,7 +51,11 @@ public class EmailController extends BaseController {
55 51 }
56 52 PageInfo<ShyEmail> emailPage = emailServiceImpl.getPage(emailDTO);
57 53 List<ShyEmail> list = emailPage.getList();
58   - JSONObject email_message = CommonConst.EMAIL_MESSAGE;
  54 +
  55 +
  56 +
  57 +
  58 + JSONObject emailMessage = CommonConst.EMAIL_MESSAGE;
59 59 if (!list.isEmpty()) {
60 60 for (ShyEmail shyEmail : list) {
61 61 //获取更新人的名称
... ... @@ -65,28 +65,30 @@ public class EmailController extends BaseController {
65 65 user.setUser_id(shyEmail.getUpdater());
66 66 user = usersService.select(user);
67 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 70 updater = userName;
71 71 }
72 72 }
73 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 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 89 model.addAttribute("emailPage", emailPage);
88 90 model.addAttribute("pageSize", emailDTO.getPageSize());
89   - model.addAttribute("email_message", email_message);
  91 + model.addAttribute("email_message", emailMessage);
90 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 45 public class LiveApplyController extends BaseController {
46 46 private static Logger logger = LoggerFactory.getLogger(LiveApplyController.class);
47 47 @Autowired
48   - AuditPass Pass;
49   - @Autowired
50   - VideosServiceImpl videosService;
  48 + AuditPass pass;
51 49 @Autowired
52 50 UsersServiceImpl usersService;
53 51 @Autowired
... ... @@ -84,7 +82,7 @@ public class LiveApplyController extends BaseController {
84 82 ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveApplyId));
85 83 JSONObject result = null;
86 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 86 } catch (Exception e) {
89 87 logger.error("直播视频审核失败,id==" + shyLiveApplyId, e);
90 88 showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
... ... @@ -149,10 +147,13 @@ public class LiveApplyController extends BaseController {
149 147 for (ShyLiveapply liveApply : list) {
150 148 if (!liveApply.getShenhe_state().equals(CommonConst.AUDIT_INTT)) {
151 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 155 ShyUsers user = new ShyUsers();
155   - user.setUser_id(auditor_id);
  156 + user.setUser_id(auditorId);
156 157 user = usersService.select(user);
157 158 if (CommonUtils.isNotNull(user)) {
158 159 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ... @@ -272,7 +273,7 @@ public class LiveApplyController extends BaseController {
272 273 ShyLiveapply shyLiveapply = liveApplyServiceImpl.selectByPrimaryKey(Integer.parseInt(shyLiveId));
273 274 JSONObject result = null;
274 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 277 } catch (Exception e) {
277 278 logger.error("直播视频审核失败,id==" + shyLiveId, e);
278 279 showMsg = showMsg + "," + shyLiveapply.getActivity_id() + " 拒绝请求失败";
... ... @@ -446,7 +447,7 @@ public class LiveApplyController extends BaseController {
446 447 @GetMapping("/liveApplyNotice")
447 448 @ResponseBody
448 449 public Map<String, Object> channelNotice() {
449   - Map<String, Object> map = new HashMap<>();
  450 + Map<String, Object> map = new HashMap<>(16);
450 451 ShyLiveapply shyLiveapply = new ShyLiveapply();
451 452 shyLiveapply.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
452 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 49 public class LiveController extends BaseController {
50 50 private static Logger logger = LoggerFactory.getLogger(LiveController.class);
51 51 @Autowired
52   - AuditPass Pass;
  52 + AuditPass pass;
53 53 @Autowired
54 54 VideosServiceImpl videosService;
55 55 @Autowired
... ... @@ -82,11 +82,9 @@ public class LiveController extends BaseController {
82 82 public ResponseBean shenheInfo(Integer id, String activity_id, Integer state, String attr_tags, String msg, String callback, HttpSession session) {
83 83 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
84 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 85 JSONObject result = null;
88 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 88 } catch (Exception e) {
91 89 e.printStackTrace();
92 90 System.out.println("视频审核失败");
... ... @@ -107,9 +105,6 @@ public class LiveController extends BaseController {
107 105 return new ResponseBean(ErrorEnum.ERROR);
108 106 }
109 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 278 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
284 279 JSONObject result = null;
285 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 282 } catch (Exception e) {
288 283 logger.error("直播视频审核失败,id==" + shyLiveId, e);
289 284 showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败";
... ... @@ -332,7 +327,7 @@ public class LiveController extends BaseController {
332 327 ShyLive shyLive = liveService.selectByPrimaryKey(Integer.parseInt(shyLiveId));
333 328 JSONObject result = null;
334 329 try {
335   - result = Pass.syncLive(shyLive.getActivity_id());
  330 + result = pass.syncLive(shyLive.getActivity_id());
336 331 } catch (Exception e) {
337 332 logger.error("直播云信息同步失败,id==" + shyLiveId, e);
338 333 showMsg = showMsg + "," + shyLive.getActivity_id() + " 拒绝请求失败";
... ... @@ -433,23 +428,23 @@ public class LiveController extends BaseController {
433 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 435 } else {
441 436 long start = liveList.get(i).getPre_start_time().getTime() + 8 * 60 * 60 * 1000;
442 437 long end = liveList.get(i).getPre_end_time().getTime() + 8 * 60 * 60 * 1000;
443 438 long count = end / (24 * 3600 * 1000) - start / (24 * 3600 * 1000);
444 439 logger.info(String.valueOf(count));
445 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 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 446 cell = row.createCell(3);//列
452   - cell.setCellValue(pre_endTime);
  447 + cell.setCellValue(preEndTime);
453 448 cell = row.createCell(4);//列
454 449 cell.setCellValue(liveList.get(i).getActivity_name());
455 450 cell = row.createCell(5);//列
... ... @@ -461,10 +456,10 @@ public class LiveController extends BaseController {
461 456 String updater = "";//审核员名字
462 457 if (!liveList.get(i).getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
463 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 461 ShyUsers user = new ShyUsers();
467   - user.setUser_id(auditor_id);
  462 + user.setUser_id(auditorId);
468 463 user = usersService.select(user);
469 464 if (CommonUtils.isNotNull(user)) {
470 465 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ... @@ -483,24 +478,24 @@ public class LiveController extends BaseController {
483 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 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 493 cell = row.createCell(10);//列
499   - cell.setCellValue(Activity_endTime);
  494 + cell.setCellValue(activityEndTime);
500 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 500 cell = row.createCell(12);//列
506 501 cell.setCellValue("");
... ...
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
... ... @@ -9,7 +9,6 @@ import com.cnlive.shenhe.entity.ShyNotspeak;
9 9 import com.cnlive.shenhe.entity.ShySites;
10 10 import com.cnlive.shenhe.entity.ShyUsers;
11 11 import com.cnlive.shenhe.serviceImpl.*;
12   -import com.cnlive.shenhe.utils.AuditPass;
13 12 import com.cnlive.shenhe.utils.CommonUtils;
14 13 import com.github.pagehelper.PageInfo;
15 14 import org.slf4j.Logger;
... ... @@ -34,19 +33,11 @@ import java.util.List;
34 33 public class NotSpeakController extends BaseController {
35 34 private static Logger logger = LoggerFactory.getLogger(NotSpeakController.class);
36 35 @Autowired
37   - AuditPass Pass;
38   - @Autowired
39   - CommentsServiceImpl commentsService;
40   - @Autowired
41 36 NotspeakServiceImpl notSpeakService;
42   -
43 37 @Autowired
44 38 UsersServiceImpl usersService;
45   -
46 39 @Autowired
47 40 SitesServiceImpl sitesService;
48   - @Autowired
49   - ContentServiceImpl contentService;
50 41  
51 42 /**
52 43 * 禁言列表页
... ... @@ -69,10 +60,10 @@ public class NotSpeakController extends BaseController {
69 60 if (!list.isEmpty()) {
70 61 for (ShyNotspeak notspeak : list) {
71 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 65 ShyUsers user = new ShyUsers();
75   - user.setUser_id(auditor_id);
  66 + user.setUser_id(auditorId);
76 67 user = usersService.select(user);
77 68 if (CommonUtils.isNotNull(user)) {
78 69 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
... ...
src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
1 1 package com.cnlive.shenhe.controller;
2 2  
3   -
4 3 import com.alibaba.fastjson.JSON;
5 4 import com.cnlive.shenhe.bean.ErrorEnum;
6 5 import com.cnlive.shenhe.bean.ResponseBean;
... ... @@ -20,7 +19,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
20 19  
21 20 import java.util.List;
22 21  
23   -
24 22 /**
25 23 * @author Administrator
26 24 * @author yanzhaowang
... ... @@ -38,8 +36,8 @@ public class ShyActivityController extends BaseController {
38 36 @PostMapping("/add")
39 37 @ResponseBody
40 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 41 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前活动添加成功");
44 42 }
45 43 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "添加失败,请重试");
... ... @@ -48,8 +46,8 @@ public class ShyActivityController extends BaseController {
48 46 @PostMapping("/delete")
49 47 @ResponseBody
50 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 51 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前活动成功");
54 52 }
55 53 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "删除失败,请重试");
... ... @@ -60,8 +58,8 @@ public class ShyActivityController extends BaseController {
60 58 @ResponseBody
61 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 63 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前活动成功");
66 64 }
67 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 64 JSONObject business = CommonConst.BUSINESS;
65 65 if (!list.isEmpty()) {
66 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 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 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 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 7 import com.cnlive.shenhe.dto.TopicDTO;
8 8 import com.cnlive.shenhe.entity.ShySites;
9 9 import com.cnlive.shenhe.entity.ShyTopic;
10   -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
11 10 import com.cnlive.shenhe.serviceImpl.SitesServiceImpl;
12 11 import com.cnlive.shenhe.serviceImpl.TopicServiceImpl;
13   -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
14   -import com.cnlive.shenhe.utils.AuditPass;
15 12 import com.cnlive.shenhe.utils.CommonConst;
16 13 import com.cnlive.shenhe.utils.CommonUtils;
17 14 import com.github.pagehelper.PageInfo;
... ... @@ -38,19 +35,13 @@ import java.util.Map;
38 35 @Controller
39 36 @RequestMapping("/topic")
40 37 public class TopicController extends BaseController {
  38 +
41 39 private static Logger logger = LoggerFactory.getLogger(TopicController.class);
42 40 @Autowired
43   - AuditPass Pass;
44   - @Autowired
45   - CommentsServiceImpl commentsService;
46   - @Autowired
47 41 TopicServiceImpl topicService;
48 42 @Autowired
49 43 SitesServiceImpl sitesService;
50 44  
51   - @Autowired
52   - UsersServiceImpl usersService;
53   -
54 45 @Value("${spring.localhost.url}")
55 46 private String localhost_url;
56 47  
... ... @@ -102,9 +93,9 @@ public class TopicController extends BaseController {
102 93 if (!list.isEmpty()) {
103 94 for (ShyTopic topic : list) {
104 95 if (!topic.getShenhe_status().equals(CommonConst.AUDIT_INTT)) {
105   - String auditor_id = topic.getAuditor_id();
  96 + String auditorId = topic.getAuditor_id();
106 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 99 topic.setUpdater(updater);
109 100 }
110 101 //显示spid简称
... ... @@ -178,7 +169,7 @@ public class TopicController extends BaseController {
178 169 @GetMapping("/topicNotice")
179 170 @ResponseBody
180 171 public Map<String, Object> channelNotice() {
181   - Map<String, Object> map = new HashMap<>();
  172 + Map<String, Object> map = new HashMap<>(16);
182 173  
183 174 ShyTopic shyTopic = new ShyTopic();
184 175 shyTopic.setShenhe_status(CommonConst.AUDIT_INTT);
... ... @@ -195,211 +186,4 @@ public class TopicController extends BaseController {
195 186 }
196 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 138 ShyUsers shyUser = new ShyUsers();
139 139 shyUser.setUser_id(sessionUser.getUserId());
140 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 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 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 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 160 return map;
158 161 }
159 162  
... ... @@ -161,10 +164,6 @@ public class UsersController extends BaseController {
161 164 @PostMapping(value = "/write")
162 165 public String write(Model model, Integer userId, String[] write_notice, HttpSession session, String redirect_url) {
163 166 SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
164   -// Integer spid = sessionUser.getSpid();
165   -// if (spid != 0) {
166   -// return "page/error.html";
167   -// }
168 167 ShyUsers user = usersService.get(userId);
169 168 String write = "";
170 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 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 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 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 48 public class VideosController extends BaseController {
49 49 private static Logger logger = LoggerFactory.getLogger(VideosController.class);
50 50 @Autowired
51   - AuditPass Pass;
  51 + AuditPass pass;
52 52 @Autowired
53 53 VideosServiceImpl videosService;
54 54 @Autowired
... ... @@ -84,7 +84,7 @@ public class VideosController extends BaseController {
84 84 String userId = sessionUser.getUserId();
85 85 JSONObject result;
86 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 88 } catch (Exception e) {
89 89 e.printStackTrace();
90 90 logger.error("视频审核失败", e);
... ... @@ -414,10 +414,10 @@ public class VideosController extends BaseController {
414 414 /* 审核员需要做处理*/
415 415 if (!shyVideosList.get(i).getState().equals(CommonConst.AUDIT_INTT)) {
416 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 419 ShyUsers user = new ShyUsers();
420   - user.setUser_id(auditor_id);
  420 + user.setUser_id(auditorId);
421 421 user = usersService.select(user);
422 422 if (CommonUtils.isNotNull(user)) {
423 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 2  
3 3 import com.cnlive.shenhe.entity.ShyAudio;
4 4 import com.cnlive.shenhe.serviceImpl.AudioServiceImpl;
5   -import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl;
6 5 import com.cnlive.shenhe.utils.CommonConst;
7 6 import org.slf4j.Logger;
8 7 import org.slf4j.LoggerFactory;
... ... @@ -23,8 +22,6 @@ public class AudioJob {
23 22  
24 23 @Autowired
25 24 AudioServiceImpl audioService;
26   - @Autowired
27   - YiDunServiceImpl yiDunServiceImpl;
28 25  
29 26 /**
30 27 * 白名单sp音频通过
... ...
src/main/java/com/cnlive/shenhe/job/ChannelJob.java
... ... @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job;
2 2  
3 3 import com.cnlive.shenhe.entity.ShyChannel;
4 4 import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl;
5   -import com.cnlive.shenhe.utils.AuditPass;
6 5 import com.cnlive.shenhe.utils.CommonConst;
7 6 import com.cnlive.shenhe.utils.InfoUtil;
8 7 import org.slf4j.Logger;
... ... @@ -19,13 +18,11 @@ import java.util.List;
19 18 */
20 19 @Component
21 20 public class ChannelJob {
  21 +
22 22 private static Logger logger = LoggerFactory.getLogger(ChannelJob.class);
23 23 @Value("${spring.localhost.url}")
24 24 //本机地址
25 25 private String localhost_url;
26   -
27   - @Autowired
28   - AuditPass Pass;
29 26 @Autowired
30 27 InfoUtil infoUtil;
31 28 @Autowired
... ... @@ -33,7 +30,6 @@ public class ChannelJob {
33 30  
34 31 @Scheduled(fixedRate = 60 * 1000)
35 32 public void updateChannel() {
36   -
37 33 //遍历免审的spid去更改状态值
38 34 ShyChannel shyChannel = new ShyChannel();
39 35 // 审核类型为免审
... ... @@ -53,7 +49,8 @@ public class ChannelJob {
53 49 // @Scheduled(fixedRate = 60 * 1000)
54 50 public void channelNotice() {
55 51 ShyChannel shyChannel = new ShyChannel();
56   - shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);// 审核类型为人工审
  52 + // 审核类型为人工审
  53 + shyChannel.setShenhe_type(CommonConst.AUDIT_TYPE_USER);
57 54 shyChannel.setShenhe_status(CommonConst.AUDIT_INTT);
58 55 List<ShyChannel> channelList = channelService.findshyChannel(shyChannel);
59 56 if (channelList.size() > 0) {
... ...
src/main/java/com/cnlive/shenhe/job/CommentsJob.java
... ... @@ -16,6 +16,7 @@ import java.util.List;
16 16 */
17 17 @Component
18 18 public class CommentsJob {
  19 +
19 20 private static Logger logger = LoggerFactory.getLogger(CommentsJob.class);
20 21 @Autowired
21 22 CommentsServiceImpl commentsService;
... ...
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
... ... @@ -30,12 +30,9 @@ import java.util.Map;
30 30 */
31 31 @Component
32 32 public class LiveApplyJob {
  33 +
33 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 37 * //开发者对应的id,与app_key相对应
41 38 */
... ...
src/main/java/com/cnlive/shenhe/job/NotSpeakJob.java
... ... @@ -16,6 +16,7 @@ import java.util.List;
16 16 */
17 17 @Component
18 18 public class NotSpeakJob {
  19 +
19 20 private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class);
20 21 @Autowired
21 22 NotspeakServiceImpl notSpeakService;
... ...
src/main/java/com/cnlive/shenhe/job/TopicJob.java
... ... @@ -21,7 +21,6 @@ import java.util.List;
21 21 public class TopicJob {
22 22  
23 23 private static Logger logger = LoggerFactory.getLogger(TopicJob.class);
24   -
25 24 @Autowired
26 25 TopicServiceImpl topicService;
27 26 @Autowired
... ...
src/main/java/com/cnlive/shenhe/job/VideosJob.java
... ... @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job;
2 2  
3 3 import com.cnlive.shenhe.entity.ShyVideos;
4 4 import com.cnlive.shenhe.serviceImpl.VideosServiceImpl;
5   -import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl;
6 5 import com.cnlive.shenhe.utils.CommonConst;
7 6 import org.slf4j.Logger;
8 7 import org.slf4j.LoggerFactory;
... ... @@ -19,13 +18,9 @@ import java.util.List;
19 18 public class VideosJob {
20 19  
21 20 private static Logger logger = LoggerFactory.getLogger(VideosJob.class);
22   -
23 21 @Autowired
24 22 VideosServiceImpl videosService;
25 23  
26   - @Autowired
27   - YiDunServiceImpl yiDunServiceImpl;
28   -
29 24 /**
30 25 * 白名单sp视频通过
31 26 * 免审、未审核
... ...
src/main/java/com/cnlive/shenhe/job/YiDunUrlResultJob.java
... ... @@ -46,7 +46,6 @@ public class YiDunUrlResultJob {
46 46 */
47 47 private final static String URL_RESULT = "https://as.dun.163yun.com/v1/crawler/callback/results";
48 48  
49   -
50 49 @Autowired
51 50 YiDunServiceImpl yiDunServiceImpl;
52 51 @Autowired
... ...
src/main/java/com/cnlive/shenhe/jsoup/GetData.java
... ... @@ -43,14 +43,17 @@ public class GetData {
43 43 private static List<String> getJobList(Document dom) {
44 44 String URL = "http://www.chinanews.com";
45 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 48 for (Element element : select) {
48 49 /* 处理个别li标签是空格问题,直接跳过不处理*/
49 50 if (element.attr("id") != "" && !element.attr("id").equals("")) {
50 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 57 href = URL + href;
55 58 // String jobName = select1.text();
56 59 // Elements select2 = element.select(".t2 a");
... ...
src/main/java/com/cnlive/shenhe/jsoup/newCrawl.java
... ... @@ -16,11 +16,16 @@ public class newCrawl {
16 16 //String url = "http://www.chinanews.com/sh/2019/06-21/8871343.shtml";
17 17 //Document doc = Jsoup.connect(url).get();
18 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 29 System.out.println("新闻Url:" + url);
25 30 System.out.println("新闻标题:" + title);
26 31 System.out.println("新闻标题图片url:" + imgurl);
... ... @@ -61,7 +66,8 @@ public class newCrawl {
61 66 String time = null;
62 67 Elements element = doc.select(".left-t");
63 68 String text = element.text();
64   - String s1 = text.replaceAll(" ", "");//完全清除,空格
  69 + //完全清除,空格
  70 + String s1 = text.replaceAll(" ", "");
65 71 time = s1.substring(0, 17);
66 72 return time;
67 73 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/AudioServiceImpl.java
... ... @@ -37,7 +37,7 @@ public class AudioServiceImpl {
37 37 AudioServiceImpl audioService;
38 38  
39 39 @Autowired
40   - AuditPass Pass;
  40 + AuditPass pass;
41 41  
42 42 @Autowired
43 43 ShyUsersMapper shyUsersMapper;
... ... @@ -53,12 +53,12 @@ public class AudioServiceImpl {
53 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 64 public ShyAudio selectByPrimaryKey(Integer id) {
... ... @@ -79,7 +79,7 @@ public class AudioServiceImpl {
79 79 */
80 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 83 Integer code = result.getInteger("code");
84 84 Integer shenheState = CommonConst.AUDIT_REFUSE;
85 85 if (0 == code) {
... ... @@ -160,7 +160,7 @@ public class AudioServiceImpl {
160 160 ShyAudio shyAudio = audioService.selectByPrimaryKey(Integer.parseInt(shyAudioId));
161 161 JSONObject result;
162 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 164 } catch (Exception e) {
165 165 logger.error("音频审核失败,id==" + shyAudioId, e);
166 166 showMsg = showMsg + "," + shyAudio.getAudioTitle() + " 拒绝请求失败";
... ... @@ -271,10 +271,10 @@ public class AudioServiceImpl {
271 271 ShyAudio shyAudio = shyAudioMapper.selectByPrimaryKey(id);
272 272 if (!shyAudio.getState().equals(CommonConst.AUDIT_INTT)) {
273 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 276 ShyUsers user = new ShyUsers();
277   - user.setUser_id(auditor_id);
  277 + user.setUser_id(auditorId);
278 278 user = shyUsersMapper.selectOne(user);
279 279 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
280 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 35 @Autowired
36 36 ShyUsersMapper shyUsersMapper;
37 37 @Autowired
38   - AuditPass Pass;
  38 + AuditPass pass;
39 39  
40 40 @Autowired
41 41 SitesServiceImpl sitesService;
... ... @@ -141,7 +141,7 @@ public class ChannelServiceImpl {
141 141 json.put("msg", msg);
142 142 JSONObject result;
143 143 try {
144   - result = Pass.channelPass(json, channel.getCallback());
  144 + result = pass.channelPass(json, channel.getCallback());
145 145 } catch (Exception e) {
146 146 logger.error("频道回调失败,id:{},channel_id:{}", channel.getId(), channel.getChannel_id());
147 147 success = false;
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
... ... @@ -38,7 +38,7 @@ public class CommentsServiceImpl {
38 38 @Autowired
39 39 ShyUsersMapper shyUsersMapper;
40 40 @Autowired
41   - AuditPass Pass;
  41 + AuditPass pass;
42 42  
43 43 @Autowired
44 44 SitesServiceImpl sitesService;
... ... @@ -192,10 +192,10 @@ public class CommentsServiceImpl {
192 192 ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id);
193 193 if (!comment.getState().equals(CommonConst.AUDIT_INTT)) {
194 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 197 ShyUsers user = new ShyUsers();
198   - user.setUser_id(auditor_id);
  198 + user.setUser_id(auditorId);
199 199 user = shyUsersMapper.selectOne(user);
200 200 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
201 201 String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
... ... @@ -219,7 +219,7 @@ public class CommentsServiceImpl {
219 219 json.put("msg", msg);
220 220 JSONObject result = new JSONObject();
221 221 try {
222   - result = Pass.commentPass(json, comment.getCallback());
  222 + result = pass.commentPass(json, comment.getCallback());
223 223 } catch (Exception e) {
224 224 logger.error("评论回调失败,activity_id:{}", comment.getActivity_id());
225 225 success = false;
... ... @@ -242,7 +242,8 @@ public class CommentsServiceImpl {
242 242 comment.setUpdater(updater);
243 243 } else {
244 244 comment.setAuditor_id(userId);
245   - comment.setReceive(1);//已领取
  245 + //已领取
  246 + comment.setReceive(1);
246 247 comment.setReceive_user_id(userId);
247 248 }
248 249 int i = shyCommentsMapper.updateByPrimaryKeySelective(comment);
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
... ... @@ -38,7 +38,7 @@ public class ContentServiceImpl {
38 38 @Autowired
39 39 ShyUsersMapper shyUsersMapper;
40 40 @Autowired
41   - AuditPass Pass;
  41 + AuditPass pass;
42 42 @Autowired
43 43 SitesServiceImpl sitesService;
44 44 @Autowired
... ... @@ -192,10 +192,10 @@ public class ContentServiceImpl {
192 192 ShyContent content = shyContentMapper.selectByPrimaryKey(id);
193 193 if (content.getReceive_status().equals(CommonConst.RECEIVE_AUDIT)) {
194 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 197 ShyUsers user = new ShyUsers();
198   - user.setUser_id(auditor_id);
  198 + user.setUser_id(auditorId);
199 199 user = shyUsersMapper.selectOne(user);
200 200 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
201 201 String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
... ... @@ -216,14 +216,14 @@ public class ContentServiceImpl {
216 216 ShyContent content = shyContentMapper.selectByPrimaryKey(Integer.parseInt(contentId));
217 217 JSONObject result = new JSONObject();
218 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 228 } catch (Exception e) {
229 229 logger.error("图文审核回调失败,图文id:{}", content.getId());
... ... @@ -245,7 +245,7 @@ public class ContentServiceImpl {
245 245  
246 246 //如果当前图文是朋友圈的视频,通知点播云
247 247 if (CommonUtils.isNotEmpty(content.getContent_tag())
248   - && content.getContent_tag().equals("moment")
  248 + && "moment".equals(content.getContent_tag())
249 249 && CommonUtils.isNotEmpty(content.getVideo_id())
250 250 && state.equals(CommonConst.AUDIT_REFUSE)) {
251 251 ShyVideos shyVideos1 = new ShyVideos();
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/EmailServiceImpl.java
... ... @@ -46,9 +46,8 @@ public class EmailServiceImpl {
46 46 }
47 47 criteria.andEqualTo("is_delete", false);
48 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 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 import com.cnlive.shenhe.dto.LiveApplyDTO;
8 8 import com.cnlive.shenhe.entity.ShyLiveapply;
9 9 import com.cnlive.shenhe.entity.ShyUsers;
10   -import com.cnlive.shenhe.mapper.ShyLiveMapper;
11 10 import com.cnlive.shenhe.mapper.ShyLiveapplyMapper;
12 11 import com.cnlive.shenhe.mapper.ShyUsersMapper;
13 12 import com.cnlive.shenhe.utils.CommonConst;
... ... @@ -32,14 +31,12 @@ import java.util.List;
32 31 */
33 32 @Service
34 33 public class LiveApplyServiceImpl {
  34 +
35 35 private static Logger logger = LoggerFactory.getLogger(LiveApplyServiceImpl.class);
36 36 @Autowired
37   - ShyLiveMapper shyLiveMapper;
38   - @Autowired
39 37 ShyLiveapplyMapper shyLiveApplyMapper;
40 38 @Autowired
41 39 ShyUsersMapper shyUsersMapper;
42   -
43 40 @Autowired
44 41 SitesServiceImpl sitesService;
45 42  
... ... @@ -152,10 +149,10 @@ public class LiveApplyServiceImpl {
152 149 ShyLiveapply shyLiveapply = shyLiveApplyMapper.selectByPrimaryKey(id);
153 150 if (!shyLiveapply.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
154 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 154 ShyUsers user = new ShyUsers();
158   - user.setUser_id(auditor_id);
  155 + user.setUser_id(auditorId);
159 156 user = shyUsersMapper.selectOne(user);
160 157 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
161 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 30 */
31 31 @Service
32 32 public class LiveServiceImpl {
  33 +
33 34 private static Logger logger = LoggerFactory.getLogger(LiveServiceImpl.class);
34 35 @Autowired
35 36 ShyLiveMapper shyLiveMapper;
... ... @@ -136,10 +137,12 @@ public class LiveServiceImpl {
136 137 ShyLive shyLive = shyLiveMapper.selectByPrimaryKey(id);
137 138 if (!shyLive.getShenhe_state().equals(CommonConst.RECEIVE_BEFORE)) {
138 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 144 ShyUsers user = new ShyUsers();
142   - user.setUser_id(auditor_id);
  145 + user.setUser_id(auditorId);
143 146 user = shyUsersMapper.selectOne(user);
144 147 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
145 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 9 import com.cnlive.shenhe.entity.ShyNotspeak;
10 10 import com.cnlive.shenhe.mapper.ShyCommentsMapper;
11 11 import com.cnlive.shenhe.mapper.ShyNotspeakMapper;
12   -import com.cnlive.shenhe.mapper.ShySitesMapper;
13   -import com.cnlive.shenhe.mapper.ShyUsersMapper;
14 12 import com.cnlive.shenhe.utils.AuditPass;
15 13 import com.cnlive.shenhe.utils.CommonConst;
16 14 import com.cnlive.shenhe.utils.CommonUtils;
17   -import com.cnlive.shenhe.utils.TransitServiceUtils;
18 15 import com.github.pagehelper.PageHelper;
19 16 import com.github.pagehelper.PageInfo;
20 17 import org.apache.ibatis.session.RowBounds;
... ... @@ -28,7 +25,7 @@ import tk.mybatis.mapper.entity.Example;
28 25 import java.util.List;
29 26  
30 27 /**
31   - * @Auther: liwei
  28 + * @author Administrator
32 29 * @Date: 2019/1/2 11:30
33 30 * @Description:
34 31 */
... ... @@ -41,19 +38,7 @@ public class NotspeakServiceImpl {
41 38 @Autowired
42 39 ShyNotspeakMapper shyNotspeakMapper;
43 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 43 @Value("${spring.localhost.url}")
59 44 String localhost_url;
... ... @@ -102,7 +87,7 @@ public class NotspeakServiceImpl {
102 87 json.put("minute", time);
103 88 JSONObject result = new JSONObject();
104 89 try {
105   - result = Pass.commentSpeak(json, speak_comment);
  90 + result = pass.commentSpeak(json, speak_comment);
106 91 } catch (Exception e) {
107 92 logger.error("评论禁言失败,comments_id:{}", comment.getId());
108 93 success = new ResponseBean(500, "评论禁言调用互动云服务器失败!");
... ... @@ -123,7 +108,8 @@ public class NotspeakServiceImpl {
123 108 comment.setState(CommonConst.AUDIT_REFUSE);
124 109 comment.setMsg("评论禁言操作");
125 110 comment.setAuditor_id(userId);
126   - comment.setReceive(1);//已领取
  111 + //已领取
  112 + comment.setReceive(1);
127 113 comment.setReceive_user_id(userId);
128 114 int i = shyCommentsMapper.updateByPrimaryKeySelective(comment);
129 115 if (i != 1) {
... ... @@ -131,7 +117,7 @@ public class NotspeakServiceImpl {
131 117 return success;
132 118 }
133 119 boolean res = writeNotSpeakByComment(commentId, time, userId);
134   - if (res == false) {
  120 + if (res) {
135 121 success = new ResponseBean(500, "评论禁言修改禁言表失败!");
136 122 return success;
137 123 }
... ... @@ -161,7 +147,7 @@ public class NotspeakServiceImpl {
161 147 json.put("minute", time);
162 148 JSONObject result = new JSONObject();
163 149 try {
164   - result = Pass.commentSpeak(json, speak_comment);
  150 + result = pass.commentSpeak(json, speak_comment);
165 151 } catch (Exception e) {
166 152 logger.error("评论禁言失败,shyNotspeak_id:{}", shyNotspeak.getId());
167 153 success = new ResponseBean(500, "评论禁言调用互动云服务器失败!");
... ... @@ -198,7 +184,7 @@ public class NotspeakServiceImpl {
198 184 shyNotspeak.setUpdated_at(CommonUtils.getCurrentTime());
199 185 shyNotspeak.setMsg(shyNotspeak.getMsg() + "\n" + msg);
200 186 boolean res = updateshyNotspeak(shyNotspeak);
201   - if (res == false) {
  187 + if (res) {
202 188 success = new ResponseBean(500, "评论禁言修改禁言表失败!");
203 189 return success;
204 190 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
... ... @@ -28,7 +28,7 @@ public class ShyActivityImpl {
28 28 private static Logger logger = LoggerFactory.getLogger(ShyActivityImpl.class);
29 29  
30 30 @Autowired
31   - private ShyActivityMapper ShyActivityMapper;
  31 + private ShyActivityMapper shyActivityMapper;
32 32  
33 33 /**
34 34 * 添加活动
... ... @@ -41,7 +41,7 @@ public class ShyActivityImpl {
41 41 shyActivity.setCreate_time(date);
42 42 shyActivity.setUpdate_time(date);
43 43 shyActivity.setExempt_from_trial(0);
44   - int i = ShyActivityMapper.insertSelective(shyActivity);
  44 + int i = shyActivityMapper.insertSelective(shyActivity);
45 45 return i;
46 46 }
47 47  
... ... @@ -53,7 +53,7 @@ public class ShyActivityImpl {
53 53 */
54 54 public int deleteShyActivity(Integer id) {
55 55  
56   - int i = ShyActivityMapper.deleteByPrimaryKey(id);
  56 + int i = shyActivityMapper.deleteByPrimaryKey(id);
57 57 return i;
58 58 }
59 59  
... ... @@ -67,7 +67,7 @@ public class ShyActivityImpl {
67 67 Date date = new Date();
68 68 shyActivity.setCreate_time(date);
69 69 shyActivity.setUpdate_time(date);
70   - int i = ShyActivityMapper.updateByPrimaryKeySelective(shyActivity);
  70 + int i = shyActivityMapper.updateByPrimaryKeySelective(shyActivity);
71 71 return i;
72 72 }
73 73  
... ... @@ -95,7 +95,7 @@ public class ShyActivityImpl {
95 95 criteria.andLike("activity", "%" + shyActivityDTO.getActivity() + "%");
96 96 }
97 97 PageHelper.startPage(shyActivityDTO.getPageNum(), shyActivityDTO.getPageSize(), true);
98   - List<ShyActivity> shyActivities = ShyActivityMapper.selectByExample(example);
  98 + List<ShyActivity> shyActivities = shyActivityMapper.selectByExample(example);
99 99 PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities);
100 100 return shyActivityPageInfo;
101 101 }
... ... @@ -105,11 +105,11 @@ public class ShyActivityImpl {
105 105 * 根据条件查询活动
106 106 *
107 107 * @param
108   - * @param exempt_from_trial
  108 + * @param exemptFromTrial
109 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 113 return shyActivities;
114 114 }
115 115  
... ... @@ -120,7 +120,7 @@ public class ShyActivityImpl {
120 120 * @return
121 121 */
122 122 public List<ShyActivity> selectAll() {
123   - List<ShyActivity> shyActivities = ShyActivityMapper.selectAll();
  123 + List<ShyActivity> shyActivities = shyActivityMapper.selectAll();
124 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 26 */
27 27 @Service
28 28 public class SitesServiceImpl {
  29 +
29 30 private static Logger logger = LoggerFactory.getLogger(SitesServiceImpl.class);
30 31 @Autowired
31 32 ShySitesMapper shySitesMapper;
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java
... ... @@ -7,9 +7,7 @@ import com.cnlive.shenhe.entity.ShyComments;
7 7 import com.cnlive.shenhe.entity.ShyContent;
8 8 import com.cnlive.shenhe.entity.ShyTopic;
9 9 import com.cnlive.shenhe.mapper.ShyCommentsMapper;
10   -import com.cnlive.shenhe.mapper.ShySitesMapper;
11 10 import com.cnlive.shenhe.mapper.ShyTopicMapper;
12   -import com.cnlive.shenhe.mapper.ShyUsersMapper;
13 11 import com.cnlive.shenhe.utils.CommonConst;
14 12 import com.cnlive.shenhe.utils.CommonUtils;
15 13 import com.cnlive.shenhe.utils.TransitServiceUtils;
... ... @@ -40,17 +38,9 @@ public class TopicServiceImpl {
40 38 @Autowired
41 39 ShyTopicMapper shyTopicMapper;
42 40 @Autowired
43   - ShySitesMapper shySitesMapper;
44   - @Autowired
45   - ShyUsersMapper shyUsersMapper;
46   - @Autowired
47 41 TransitServiceUtils transitServiceUtils;
48 42 @Autowired
49 43 SitesServiceImpl sitesService;
50   - @Autowired
51   - VideosServiceImpl videosService;
52   - @Autowired
53   - VideofilterServiceImpl videofilterServiceImpl;
54 44  
55 45 @Value("${spring.localhost.url}")
56 46 String localhost_url;
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/UsersServiceImpl.java
... ... @@ -48,20 +48,20 @@ public class UsersServiceImpl {
48 48 criteria.andEqualTo("sp_id", usersDTO.getSp_id());
49 49 }
50 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 53 return pageInfo;
54 54 }
55 55  
56   - public String findspidByName(String shen_auditor_id) {
  56 + public String findspidByName(String shenAuditorId) {
57 57 Example example = new Example(ShyUsers.class);
58 58 Example.Criteria criteria = example.createCriteria();
59   - criteria.andEqualTo("username", shen_auditor_id);
  59 + criteria.andEqualTo("username", shenAuditorId);
60 60 List<ShyUsers> shyUsersList = shyUsersMapper.selectByExample(example);
61 61 if (CommonUtils.isNotNull(shyUsersList) && shyUsersList.size() > 0) {
62 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 66 return null;
67 67 }
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/UsersfreeServiceImpl.java
... ... @@ -29,7 +29,7 @@ public class UsersfreeServiceImpl {
29 29 @Autowired
30 30 ShyUsersfreeMapper shyUsersfreeMapper;
31 31 @Autowired
32   - AuditPass Pass;
  32 + AuditPass pass;
33 33  
34 34 public ShyUsersfree get(Integer id) {
35 35 return shyUsersfreeMapper.selectByPrimaryKey(id);
... ... @@ -61,8 +61,8 @@ public class UsersfreeServiceImpl {
61 61 criteria.andLike("mobile", "%" + usersFreeDTO.getMobile() + "%");
62 62 }
63 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 66 return pageInfo;
67 67 }
68 68  
... ... @@ -77,7 +77,6 @@ public class UsersfreeServiceImpl {
77 77 public ShyUsersfree selectUser(Integer sp_id, String category, String user_id) {
78 78 ShyUsersfree shyUserfree = new ShyUsersfree();
79 79 shyUserfree.setSp_id(sp_id);
80   -// shyUserfree.setCategory(category);
81 80 shyUserfree.setUser_id(user_id);
82 81 shyUserfree.setIs_enable(true);
83 82 shyUserfree.setIs_delete(false);
... ... @@ -91,7 +90,7 @@ public class UsersfreeServiceImpl {
91 90 public boolean update(String userId, String userMobile, String write, Integer spId, String updater) {
92 91 JSONObject result = new JSONObject();
93 92 try {
94   - result = Pass.queryUser(userId, userMobile);
  93 + result = pass.queryUser(userId, userMobile);
95 94 } catch (Exception e) {
96 95 logger.error("用户白名单获取失败,userId:{},userMobile:{}", userId, userMobile);
97 96 return false;
... ... @@ -108,7 +107,7 @@ public class UsersfreeServiceImpl {
108 107 JSONObject jsonData = result.getJSONObject("data");
109 108 String mobile = jsonData.getString("mobile");
110 109 String user_id = jsonData.getString("uid");
111   - String user_name = jsonData.getString("nickName");
  110 + String userName = jsonData.getString("nickName");
112 111 String email = jsonData.getString("email");
113 112  
114 113 ShyUsersfree shyUserfree = new ShyUsersfree();
... ... @@ -118,7 +117,7 @@ public class UsersfreeServiceImpl {
118 117 if (shyUserfree1 != null) {
119 118 shyUserfree1.setMobile(mobile);
120 119 shyUserfree1.setCategory(write);
121   - shyUserfree1.setUser_name(user_name);
  120 + shyUserfree1.setUser_name(userName);
122 121 shyUserfree1.setEmail(email);
123 122 shyUserfree1.setSp_id(spId);
124 123 shyUserfree1.setUpdated_at(CommonUtils.getCurrentTime());
... ... @@ -132,7 +131,7 @@ public class UsersfreeServiceImpl {
132 131 } else {
133 132 shyUserfree.setMobile(mobile);
134 133 shyUserfree.setCategory(write);
135   - shyUserfree.setUser_name(user_name);
  134 + shyUserfree.setUser_name(userName);
136 135 shyUserfree.setEmail(email);
137 136 shyUserfree.setSp_id(spId);
138 137 shyUserfree.setCreated_at(CommonUtils.getCurrentTime());
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -64,7 +64,7 @@ public class VideosServiceImpl {
64 64 String ks_domain;
65 65  
66 66 @Autowired
67   - AuditPass Pass;
  67 + AuditPass pass;
68 68  
69 69 public boolean impotVideo(ShyVideos shyVideos) {
70 70 int result = shyVideosMapper.insertSelective(shyVideos);
... ... @@ -209,10 +209,10 @@ public class VideosServiceImpl {
209 209 ShyVideos shyVideos = shyVideosMapper.selectByPrimaryKey(id);
210 210 if (!shyVideos.getState().equals(CommonConst.AUDIT_INTT)) {
211 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 214 ShyUsers user = new ShyUsers();
215   - user.setUser_id(auditor_id);
  215 + user.setUser_id(auditorId);
216 216 user = shyUsersMapper.selectOne(user);
217 217 String email = CommonUtils.isEmpty(user.getEmail()) || "null".equals(user.getEmail()) ? "" : user.getEmail();
218 218 String userName = CommonUtils.isEmpty(user.getUsername()) ? email : user.getUsername();
... ... @@ -405,7 +405,7 @@ public class VideosServiceImpl {
405 405 */
406 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 409 logger.error("点播回调result:{}", result);
410 410 Integer code = result.getInteger("code");
411 411 String errorCode = result.getString("errorCode");
... ... @@ -525,7 +525,7 @@ public class VideosServiceImpl {
525 525 ShyVideos shyVideos = videosService.selectByPrimaryKey(Integer.parseInt(shyVideoId));
526 526 JSONObject result = null;
527 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 529 } catch (Exception e) {
530 530 logger.error("视频审核失败,id==" + shyVideoId, e);
531 531 showMsg = showMsg + "," + shyVideos.getVideo_title() + " 拒绝请求失败";
... ...