Commit 286d7f2d60dd7fdde7222f9240dea5eb3d0870fb
1 parent
d51b917d
代码格式优化
Showing
47 changed files
with
284 additions
and
115 deletions
src/main/java/com/cnlive/shenhe/api/ChannelControllerApi.java
| @@ -17,6 +17,13 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -17,6 +17,13 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 17 | 17 | ||
| 18 | import java.util.List; | 18 | import java.util.List; |
| 19 | 19 | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * @author Administrator | ||
| 26 | + */ | ||
| 20 | @Controller | 27 | @Controller |
| 21 | @RequestMapping("/api/channel") | 28 | @RequestMapping("/api/channel") |
| 22 | public class ChannelControllerApi { | 29 | public class ChannelControllerApi { |
src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
| @@ -20,6 +20,9 @@ import org.springframework.web.bind.annotation.ResponseBody; | @@ -20,6 +20,9 @@ import org.springframework.web.bind.annotation.ResponseBody; | ||
| 20 | import java.util.Date; | 20 | import java.util.Date; |
| 21 | import java.util.List; | 21 | import java.util.List; |
| 22 | 22 | ||
| 23 | +/** | ||
| 24 | + * @author Administrator | ||
| 25 | + */ | ||
| 23 | @Controller | 26 | @Controller |
| 24 | @RequestMapping("/api/comments") | 27 | @RequestMapping("/api/comments") |
| 25 | public class CommentsControllerApi { | 28 | public class CommentsControllerApi { |
| @@ -30,9 +33,6 @@ public class CommentsControllerApi { | @@ -30,9 +33,6 @@ public class CommentsControllerApi { | ||
| 30 | CommentsServiceImpl commentsService; | 33 | CommentsServiceImpl commentsService; |
| 31 | @Autowired | 34 | @Autowired |
| 32 | TopicServiceImpl topicService; | 35 | TopicServiceImpl topicService; |
| 33 | - | ||
| 34 | -// @Value("${topic_comment_shareH5}") | ||
| 35 | -// String topic_comment_shareH5; | ||
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * @Auther: chenhao | 38 | * @Auther: chenhao |
| @@ -44,8 +44,10 @@ public class CommentsControllerApi { | @@ -44,8 +44,10 @@ public class CommentsControllerApi { | ||
| 44 | public ResponseBean impotComment(String param) { | 44 | public ResponseBean impotComment(String param) { |
| 45 | logger.info("评论入库,param=====" + param); | 45 | logger.info("评论入库,param=====" + param); |
| 46 | JSONObject json = JSONObject.parseObject(param); | 46 | JSONObject json = JSONObject.parseObject(param); |
| 47 | - String type=json.getString("type")==null?"else":json.getString("type");//评论类型,topic:话题 | ||
| 48 | - Integer level=json.getInteger("level")==null?1:json.getInteger("level");//评论的级别 | 47 | + //评论类型,topic:话题 |
| 48 | + String type=json.getString("type")==null?"else":json.getString("type"); | ||
| 49 | + //评论的级别 | ||
| 50 | + Integer level=json.getInteger("level")==null?1:json.getInteger("level"); | ||
| 49 | String programId=json.getString("programId"); | 51 | String programId=json.getString("programId"); |
| 50 | String originalUrl=json.getString("originalUrl"); | 52 | String originalUrl=json.getString("originalUrl"); |
| 51 | String commentTitle=json.getString("commentTitle"); | 53 | String commentTitle=json.getString("commentTitle"); |
src/main/java/com/cnlive/shenhe/api/ContentControllerApi.java
| @@ -173,22 +173,27 @@ public class ContentControllerApi { | @@ -173,22 +173,27 @@ public class ContentControllerApi { | ||
| 173 | JSONObject json = JSONObject.parseObject(param); | 173 | JSONObject json = JSONObject.parseObject(param); |
| 174 | //判断是否存在 | 174 | //判断是否存在 |
| 175 | ShyContent shyContent = new ShyContent(); | 175 | ShyContent shyContent = new ShyContent(); |
| 176 | - shyContent.setContent_id(json.getString("momentId"));//朋友圈id | ||
| 177 | - shyContent.setContent_tag("moment");//朋友圈标签 | 176 | + //朋友圈id |
| 177 | + shyContent.setContent_id(json.getString("momentId")); | ||
| 178 | + //朋友圈标签 | ||
| 179 | + shyContent.setContent_tag("moment"); | ||
| 178 | List<ShyContent> contentList = contentService.findshyContent(shyContent); | 180 | List<ShyContent> contentList = contentService.findshyContent(shyContent); |
| 179 | //获取审核类型 | 181 | //获取审核类型 |
| 180 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment"); | 182 | Integer shenheType = contentService.getShenheType(json.getInteger("spId"), "moment"); |
| 181 | 183 | ||
| 182 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 | 184 | //获取生活圈内容的类型 1:图片 2:视频 3:分享 |
| 183 | Integer contentType = json.getInteger("contentType"); | 185 | Integer contentType = json.getInteger("contentType"); |
| 184 | - String contentImageUrl = "";//内容图片地址 | 186 | + //内容图片地址 |
| 187 | + String contentImageUrl = ""; | ||
| 185 | if (contentType != null && contentType == 1) { | 188 | if (contentType != null && contentType == 1) { |
| 186 | - JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl"));//朋友圈分享的内容的url | 189 | + //朋友圈分享的内容的url |
| 190 | + JSONArray contentImageUrlList = JSONObject.parseArray(json.getString("contentImageUrl")); | ||
| 187 | for (int i = 0; i < contentImageUrlList.size(); i++) { | 191 | for (int i = 0; i < contentImageUrlList.size(); i++) { |
| 188 | JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i); | 192 | JSONObject contentImageUrlMap = contentImageUrlList.getJSONObject(i); |
| 189 | contentImageUrl += contentImageUrlMap.getString("imageUrl") + ","; | 193 | contentImageUrl += contentImageUrlMap.getString("imageUrl") + ","; |
| 190 | } | 194 | } |
| 191 | - contentImageUrl = contentImageUrl.substring(0, contentImageUrl.length() - 1);//去掉最后一个逗号 | 195 | + //去掉最后一个逗号 |
| 196 | + contentImageUrl = contentImageUrl.substring(0, contentImageUrl.length() - 1); | ||
| 192 | } else { | 197 | } else { |
| 193 | contentImageUrl = json.getString("contentImageUrl"); | 198 | contentImageUrl = json.getString("contentImageUrl"); |
| 194 | } | 199 | } |
| @@ -196,12 +201,14 @@ public class ContentControllerApi { | @@ -196,12 +201,14 @@ public class ContentControllerApi { | ||
| 196 | //存在则更新 | 201 | //存在则更新 |
| 197 | if (contentList.size() > 0) { | 202 | if (contentList.size() > 0) { |
| 198 | ShyContent shyContent1 = contentList.get(0); | 203 | ShyContent shyContent1 = contentList.get(0); |
| 199 | - shyContent1.setTitle(json.getString("title"));//标题 | ||
| 200 | - shyContent1.setTitle_image(json.getString("image"));//用户头像 | 204 | + //标题 |
| 205 | + shyContent1.setTitle(json.getString("title")); | ||
| 206 | + //用户头像 | ||
| 207 | + shyContent1.setTitle_image(json.getString("image")); | ||
| 201 | shyContent1.setShenhe_type(shenheType);//审核类型 | 208 | shyContent1.setShenhe_type(shenheType);//审核类型 |
| 202 | String contentTime = json.getString("createTime");//朋友圈内容创建时间 | 209 | String contentTime = json.getString("createTime");//朋友圈内容创建时间 |
| 203 | if (CommonUtils.isNotEmpty(contentTime)) { | 210 | if (CommonUtils.isNotEmpty(contentTime)) { |
| 204 | -// Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); | 211 | + //Date timestamp = CommonUtils.getTimestamp(contentTime, "yyyy-MM-dd HH:mm:ss"); |
| 205 | shyContent1.setContent_time(new Date(Long.valueOf(contentTime))); | 212 | shyContent1.setContent_time(new Date(Long.valueOf(contentTime))); |
| 206 | 213 | ||
| 207 | } | 214 | } |
src/main/java/com/cnlive/shenhe/api/LiveApplyControllerApi.java
| @@ -18,7 +18,10 @@ import java.util.Date; | @@ -18,7 +18,10 @@ import java.util.Date; | ||
| 18 | import java.util.List; | 18 | import java.util.List; |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | -@SuppressWarnings("unused") | 21 | + |
| 22 | +/** | ||
| 23 | + * @author Administrator | ||
| 24 | + */ | ||
| 22 | @Controller | 25 | @Controller |
| 23 | @RequestMapping("/api/liveApply") | 26 | @RequestMapping("/api/liveApply") |
| 24 | public class LiveApplyControllerApi { | 27 | public class LiveApplyControllerApi { |
| @@ -32,20 +35,24 @@ public class LiveApplyControllerApi { | @@ -32,20 +35,24 @@ public class LiveApplyControllerApi { | ||
| 32 | public JSONObject impotVideo(String param) { | 35 | public JSONObject impotVideo(String param) { |
| 33 | JSONObject map = new JSONObject(); | 36 | JSONObject map = new JSONObject(); |
| 34 | JSONObject result = new JSONObject(); | 37 | JSONObject result = new JSONObject(); |
| 35 | - boolean YorN =true;//初始化一个请求数据库返回结果 | ||
| 36 | - | 38 | + //初始化一个请求数据库返回结果 |
| 39 | + boolean YorN =true; | ||
| 40 | + | ||
| 37 | logger.info("直播申请入库,param=====" + param); | 41 | logger.info("直播申请入库,param=====" + param); |
| 38 | JSONObject json = JSONObject.parseObject(param); | 42 | JSONObject json = JSONObject.parseObject(param); |
| 39 | //获取所有参数 | 43 | //获取所有参数 |
| 40 | - String activityId = json.getString("activityId");//直播活动id | ||
| 41 | - String channelId = json.getString("channelId");//直播频道id | ||
| 42 | - Integer spId=null; | 44 | + //直播活动id |
| 45 | + String activityId = json.getString("activityId"); | ||
| 46 | + //直播频道id | ||
| 47 | + String channelId = json.getString("channelId"); | ||
| 48 | + Integer spId=null; | ||
| 43 | try { | 49 | try { |
| 44 | spId=json.getInteger("spId"); | 50 | spId=json.getInteger("spId"); |
| 45 | } catch (Exception e) { | 51 | } catch (Exception e) { |
| 46 | spId=null; | 52 | spId=null; |
| 47 | } | 53 | } |
| 48 | - String sender = json.getString("sender");//直播发起人 | 54 | + //直播发起人 |
| 55 | + String sender = json.getString("sender"); | ||
| 49 | String mobile = json.getString("mobile");//联系方式 | 56 | String mobile = json.getString("mobile");//联系方式 |
| 50 | String callback = json.getString("callback");//回调地址 | 57 | String callback = json.getString("callback");//回调地址 |
| 51 | String organization = json.getString("organization");//直播发起单位 | 58 | String organization = json.getString("organization");//直播发起单位 |
src/main/java/com/cnlive/shenhe/api/LiveControllerApi.java
| @@ -19,6 +19,9 @@ import java.util.List; | @@ -19,6 +19,9 @@ import java.util.List; | ||
| 19 | import java.util.UUID; | 19 | import java.util.UUID; |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | +/** | ||
| 23 | + * @author Administrator | ||
| 24 | + */ | ||
| 22 | @SuppressWarnings("unused") | 25 | @SuppressWarnings("unused") |
| 23 | @Controller | 26 | @Controller |
| 24 | @RequestMapping("/api/live") | 27 | @RequestMapping("/api/live") |
| @@ -33,12 +36,14 @@ public class LiveControllerApi { | @@ -33,12 +36,14 @@ public class LiveControllerApi { | ||
| 33 | public JSONObject impotVideo(String param) { | 36 | public JSONObject impotVideo(String param) { |
| 34 | JSONObject map = new JSONObject(); | 37 | JSONObject map = new JSONObject(); |
| 35 | JSONObject result = new JSONObject(); | 38 | JSONObject result = new JSONObject(); |
| 36 | - boolean YorN =true;//初始化一个请求数据库返回结果 | ||
| 37 | - | 39 | + //初始化一个请求数据库返回结果 |
| 40 | + boolean YorN =true; | ||
| 41 | + | ||
| 38 | logger.info("直播入库,param=====" + param); | 42 | logger.info("直播入库,param=====" + param); |
| 39 | JSONObject json = JSONObject.parseObject(param); | 43 | JSONObject json = JSONObject.parseObject(param); |
| 40 | //获取所有参数 | 44 | //获取所有参数 |
| 41 | - String activityId = json.getString("activityId");//直播活动id | 45 | + //直播活动id |
| 46 | + String activityId = json.getString("activityId"); | ||
| 42 | String activityName = json.getString("activityName");//直播活动名称 | 47 | String activityName = json.getString("activityName");//直播活动名称 |
| 43 | Integer activityStatus = Integer.parseInt(json.getString("activityStatus"));//直播活动状态 | 48 | Integer activityStatus = Integer.parseInt(json.getString("activityStatus"));//直播活动状态 |
| 44 | String channelId = json.getString("channelId");//直播频道id | 49 | String channelId = json.getString("channelId");//直播频道id |
| @@ -238,7 +243,7 @@ public class LiveControllerApi { | @@ -238,7 +243,7 @@ public class LiveControllerApi { | ||
| 238 | 243 | ||
| 239 | /** | 244 | /** |
| 240 | * 测试视频流 | 245 | * 测试视频流 |
| 241 | - * @param videoStream | 246 | + * @param |
| 242 | */ | 247 | */ |
| 243 | @RequestMapping(value="ceshiFinishVideo") | 248 | @RequestMapping(value="ceshiFinishVideo") |
| 244 | @ResponseBody | 249 | @ResponseBody |
| @@ -252,7 +257,7 @@ public class LiveControllerApi { | @@ -252,7 +257,7 @@ public class LiveControllerApi { | ||
| 252 | 257 | ||
| 253 | /** | 258 | /** |
| 254 | * 测试视频流 | 259 | * 测试视频流 |
| 255 | - * @param videoStream | 260 | + * @param |
| 256 | */ | 261 | */ |
| 257 | @RequestMapping(value="queryVideo") | 262 | @RequestMapping(value="queryVideo") |
| 258 | @ResponseBody | 263 | @ResponseBody |
src/main/java/com/cnlive/shenhe/api/TopicControllerApi.java
| @@ -25,6 +25,9 @@ import java.util.HashMap; | @@ -25,6 +25,9 @@ import java.util.HashMap; | ||
| 25 | import java.util.List; | 25 | import java.util.List; |
| 26 | import java.util.Map; | 26 | import java.util.Map; |
| 27 | 27 | ||
| 28 | +/** | ||
| 29 | + * @author Administrator | ||
| 30 | + */ | ||
| 28 | @Controller | 31 | @Controller |
| 29 | @RequestMapping("/api/topic") | 32 | @RequestMapping("/api/topic") |
| 30 | public class TopicControllerApi { | 33 | public class TopicControllerApi { |
src/main/java/com/cnlive/shenhe/bean/ErrorEnum.java
src/main/java/com/cnlive/shenhe/bean/ResponseBean.java
| @@ -5,6 +5,9 @@ import com.cnlive.shenhe.utils.CommonUtils; | @@ -5,6 +5,9 @@ import com.cnlive.shenhe.utils.CommonUtils; | ||
| 5 | import java.io.Serializable; | 5 | import java.io.Serializable; |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | +/** | ||
| 9 | + * @author Administrator | ||
| 10 | + */ | ||
| 8 | public class ResponseBean implements Serializable { | 11 | public class ResponseBean implements Serializable { |
| 9 | 12 | ||
| 10 | 13 |
src/main/java/com/cnlive/shenhe/config/MyInterceptor.java
| @@ -11,6 +11,9 @@ import javax.servlet.http.HttpServletRequest; | @@ -11,6 +11,9 @@ import javax.servlet.http.HttpServletRequest; | ||
| 11 | import javax.servlet.http.HttpServletResponse; | 11 | import javax.servlet.http.HttpServletResponse; |
| 12 | import javax.servlet.http.HttpSession; | 12 | import javax.servlet.http.HttpSession; |
| 13 | 13 | ||
| 14 | +/** | ||
| 15 | + * @author Administrator | ||
| 16 | + */ | ||
| 14 | @Component | 17 | @Component |
| 15 | public class MyInterceptor implements HandlerInterceptor { | 18 | public class MyInterceptor implements HandlerInterceptor { |
| 16 | @Override | 19 | @Override |
src/main/java/com/cnlive/shenhe/config/SessionFilter.java
| 1 | package com.cnlive.shenhe.config; | 1 | package com.cnlive.shenhe.config; |
| 2 | + | ||
| 2 | import org.slf4j.LoggerFactory; | 3 | import org.slf4j.LoggerFactory; |
| 3 | import org.springframework.web.context.request.RequestContextHolder; | 4 | import org.springframework.web.context.request.RequestContextHolder; |
| 4 | import org.springframework.web.context.request.ServletRequestAttributes; | 5 | import org.springframework.web.context.request.ServletRequestAttributes; |
| @@ -16,14 +17,15 @@ import java.util.regex.Matcher; | @@ -16,14 +17,15 @@ import java.util.regex.Matcher; | ||
| 16 | import java.util.regex.Pattern; | 17 | import java.util.regex.Pattern; |
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| 19 | - * Created by liwei on 2018/08/28. | ||
| 20 | - * | 20 | + * @author liwei |
| 21 | + * @date 2018/08/28 | ||
| 22 | + * <p> | ||
| 21 | * 过滤器 | 23 | * 过滤器 |
| 22 | */ | 24 | */ |
| 23 | public class SessionFilter implements Filter { | 25 | public class SessionFilter implements Filter { |
| 24 | private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SessionFilter.class); | 26 | private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SessionFilter.class); |
| 25 | - HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest(); | ||
| 26 | - HttpServletResponse response = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getResponse(); | 27 | + HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
| 28 | + HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse(); | ||
| 27 | /** | 29 | /** |
| 28 | * 封装,不需要过滤的list列表 | 30 | * 封装,不需要过滤的list列表 |
| 29 | */ | 31 | */ |
| @@ -44,19 +46,19 @@ public class SessionFilter implements Filter { | @@ -44,19 +46,19 @@ public class SessionFilter implements Filter { | ||
| 44 | url = url.substring(1); | 46 | url = url.substring(1); |
| 45 | } | 47 | } |
| 46 | 48 | ||
| 47 | - if (isInclude(url)){ | 49 | + if (isInclude(url)) { |
| 48 | chain.doFilter(httpRequest, httpResponse); | 50 | chain.doFilter(httpRequest, httpResponse); |
| 49 | return; | 51 | return; |
| 50 | } else { | 52 | } else { |
| 51 | HttpSession session = httpRequest.getSession(); | 53 | HttpSession session = httpRequest.getSession(); |
| 52 | - if (session.getAttribute(SessionUser.getSessionKey()) != null){ | 54 | + if (session.getAttribute(SessionUser.getSessionKey()) != null) { |
| 53 | // session存在 | 55 | // session存在 |
| 54 | chain.doFilter(httpRequest, httpResponse); | 56 | chain.doFilter(httpRequest, httpResponse); |
| 55 | return; | 57 | return; |
| 56 | } else { | 58 | } else { |
| 57 | // session不存在 准备跳转失败 | 59 | // session不存在 准备跳转失败 |
| 58 | - RequestDispatcher dispatcher = request.getRequestDispatcher("/users/login"); | ||
| 59 | - dispatcher.forward(request, response); | 60 | + RequestDispatcher dispatcher = request.getRequestDispatcher("/users/login"); |
| 61 | + dispatcher.forward(request, response); | ||
| 60 | // chain.doFilter(httpRequest, httpResponse); | 62 | // chain.doFilter(httpRequest, httpResponse); |
| 61 | return; | 63 | return; |
| 62 | } | 64 | } |
| @@ -73,6 +75,7 @@ public class SessionFilter implements Filter { | @@ -73,6 +75,7 @@ public class SessionFilter implements Filter { | ||
| 73 | 75 | ||
| 74 | /** | 76 | /** |
| 75 | * 是否需要过滤 | 77 | * 是否需要过滤 |
| 78 | + * | ||
| 76 | * @param url | 79 | * @param url |
| 77 | * @return | 80 | * @return |
| 78 | */ | 81 | */ |
src/main/java/com/cnlive/shenhe/config/WebConfiguration.java
| @@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry | @@ -8,6 +8,7 @@ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry | ||
| 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | 8 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | + * @author Administrator | ||
| 11 | * @Auther: 周伟鹏 | 12 | * @Auther: 周伟鹏 |
| 12 | * @Date: 2018/12/4 10:51 | 13 | * @Date: 2018/12/4 10:51 |
| 13 | */ | 14 | */ |
src/main/java/com/cnlive/shenhe/controller/ChannelController.java
| @@ -30,6 +30,9 @@ import java.util.List; | @@ -30,6 +30,9 @@ import java.util.List; | ||
| 30 | import java.util.Map; | 30 | import java.util.Map; |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | +/** | ||
| 34 | + * @author Administrator | ||
| 35 | + */ | ||
| 33 | @Controller | 36 | @Controller |
| 34 | @RequestMapping("/channel") | 37 | @RequestMapping("/channel") |
| 35 | public class ChannelController extends BaseController { | 38 | public class ChannelController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -324,7 +324,8 @@ public class CommentsController extends BaseController { | @@ -324,7 +324,8 @@ public class CommentsController extends BaseController { | ||
| 324 | BufferedOutputStream bos = null; | 324 | BufferedOutputStream bos = null; |
| 325 | try { | 325 | try { |
| 326 | XSSFSheet sheetlist = wb.createSheet(fileName); | 326 | XSSFSheet sheetlist = wb.createSheet(fileName); |
| 327 | - XSSFRow row = sheetlist.createRow(0);//行 | 327 | + //行 |
| 328 | + XSSFRow row = sheetlist.createRow(0); | ||
| 328 | XSSFCell cell = row.createCell(0);//列 | 329 | XSSFCell cell = row.createCell(0);//列 |
| 329 | cell.setCellValue("id"); | 330 | cell.setCellValue("id"); |
| 330 | cell = row.createCell(1);//列 | 331 | cell = row.createCell(1);//列 |
src/main/java/com/cnlive/shenhe/controller/ContentController.java
| @@ -32,6 +32,9 @@ import java.io.*; | @@ -32,6 +32,9 @@ import java.io.*; | ||
| 32 | import java.util.List; | 32 | import java.util.List; |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | +/** | ||
| 36 | + * @author Administrator | ||
| 37 | + */ | ||
| 35 | @Controller | 38 | @Controller |
| 36 | @RequestMapping("/content") | 39 | @RequestMapping("/content") |
| 37 | public class ContentController extends BaseController { | 40 | public class ContentController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/EmailController.java
| @@ -28,6 +28,7 @@ import javax.servlet.http.HttpSession; | @@ -28,6 +28,7 @@ import javax.servlet.http.HttpSession; | ||
| 28 | import java.util.List; | 28 | import java.util.List; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | + * | ||
| 31 | * @Auther: liwei | 32 | * @Auther: liwei |
| 32 | * @Date: 2019/08/20 14:22 | 33 | * @Date: 2019/08/20 14:22 |
| 33 | * @Description: | 34 | * @Description: |
src/main/java/com/cnlive/shenhe/controller/LiveApplyController.java
| @@ -37,6 +37,9 @@ import java.util.HashMap; | @@ -37,6 +37,9 @@ import java.util.HashMap; | ||
| 37 | import java.util.List; | 37 | import java.util.List; |
| 38 | import java.util.Map; | 38 | import java.util.Map; |
| 39 | 39 | ||
| 40 | +/** | ||
| 41 | + * @author Administrator | ||
| 42 | + */ | ||
| 40 | @Controller | 43 | @Controller |
| 41 | @RequestMapping("/liveApply") | 44 | @RequestMapping("/liveApply") |
| 42 | public class LiveApplyController extends BaseController { | 45 | public class LiveApplyController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/LiveController.java
| @@ -41,6 +41,9 @@ import java.util.HashMap; | @@ -41,6 +41,9 @@ import java.util.HashMap; | ||
| 41 | import java.util.List; | 41 | import java.util.List; |
| 42 | import java.util.Map; | 42 | import java.util.Map; |
| 43 | 43 | ||
| 44 | +/** | ||
| 45 | + * @author Administrator | ||
| 46 | + */ | ||
| 44 | @Controller | 47 | @Controller |
| 45 | @RequestMapping("/live") | 48 | @RequestMapping("/live") |
| 46 | public class LiveController extends BaseController { | 49 | public class LiveController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/NotSpeakController.java
| @@ -26,6 +26,9 @@ import javax.servlet.http.HttpSession; | @@ -26,6 +26,9 @@ import javax.servlet.http.HttpSession; | ||
| 26 | import java.util.List; | 26 | import java.util.List; |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | +/** | ||
| 30 | + * @author Administrator | ||
| 31 | + */ | ||
| 29 | @Controller | 32 | @Controller |
| 30 | @RequestMapping("/notSpeak") | 33 | @RequestMapping("/notSpeak") |
| 31 | public class NotSpeakController extends BaseController { | 34 | public class NotSpeakController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/SitesController.java
| @@ -22,6 +22,7 @@ import javax.servlet.http.HttpSession; | @@ -22,6 +22,7 @@ import javax.servlet.http.HttpSession; | ||
| 22 | import java.util.List; | 22 | import java.util.List; |
| 23 | 23 | ||
| 24 | /** | 24 | /** |
| 25 | + * @author Administrator | ||
| 25 | * @Auther: 周伟鹏 | 26 | * @Auther: 周伟鹏 |
| 26 | * @Date: 2018/11/30 17:28 | 27 | * @Date: 2018/11/30 17:28 |
| 27 | * @Description: | 28 | * @Description: |
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| @@ -32,6 +32,9 @@ import java.util.List; | @@ -32,6 +32,9 @@ import java.util.List; | ||
| 32 | import java.util.Map; | 32 | import java.util.Map; |
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | +/** | ||
| 36 | + * @author Administrator | ||
| 37 | + */ | ||
| 35 | @Controller | 38 | @Controller |
| 36 | @RequestMapping("/topic") | 39 | @RequestMapping("/topic") |
| 37 | public class TopicController extends BaseController { | 40 | public class TopicController extends BaseController { |
src/main/java/com/cnlive/shenhe/controller/UsersFreeController.java
| @@ -27,6 +27,7 @@ import javax.servlet.http.HttpSession; | @@ -27,6 +27,7 @@ import javax.servlet.http.HttpSession; | ||
| 27 | import java.util.List; | 27 | import java.util.List; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | + * @author Administrator | ||
| 30 | * @Auther: liwei | 31 | * @Auther: liwei |
| 31 | * @Date: 2019/08/20 14:22 | 32 | * @Date: 2019/08/20 14:22 |
| 32 | * @Description: | 33 | * @Description: |
src/main/java/com/cnlive/shenhe/job/ChannelJob.java
| @@ -2,8 +2,6 @@ package com.cnlive.shenhe.job; | @@ -2,8 +2,6 @@ package com.cnlive.shenhe.job; | ||
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyChannel; | 3 | import com.cnlive.shenhe.entity.ShyChannel; |
| 4 | import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.ChannelServiceImpl; |
| 5 | -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | ||
| 6 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 7 | import com.cnlive.shenhe.utils.AuditPass; | 5 | import com.cnlive.shenhe.utils.AuditPass; |
| 8 | import com.cnlive.shenhe.utils.CommonConst; | 6 | import com.cnlive.shenhe.utils.CommonConst; |
| 9 | import com.cnlive.shenhe.utils.InfoUtil; | 7 | import com.cnlive.shenhe.utils.InfoUtil; |
| @@ -16,6 +14,9 @@ import org.springframework.stereotype.Component; | @@ -16,6 +14,9 @@ import org.springframework.stereotype.Component; | ||
| 16 | 14 | ||
| 17 | import java.util.List; | 15 | import java.util.List; |
| 18 | 16 | ||
| 17 | +/** | ||
| 18 | + * @author Administrator | ||
| 19 | + */ | ||
| 19 | @Component | 20 | @Component |
| 20 | public class ChannelJob { | 21 | public class ChannelJob { |
| 21 | private static Logger logger = LoggerFactory.getLogger(ChannelJob.class); | 22 | private static Logger logger = LoggerFactory.getLogger(ChannelJob.class); |
src/main/java/com/cnlive/shenhe/job/CommentsJob.java
| @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | @@ -2,7 +2,6 @@ package com.cnlive.shenhe.job; | ||
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyComments; | 3 | import com.cnlive.shenhe.entity.ShyComments; |
| 4 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 5 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 6 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 7 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 8 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| @@ -12,6 +11,9 @@ import org.springframework.stereotype.Component; | @@ -12,6 +11,9 @@ import org.springframework.stereotype.Component; | ||
| 12 | 11 | ||
| 13 | import java.util.List; | 12 | import java.util.List; |
| 14 | 13 | ||
| 14 | +/** | ||
| 15 | + * @author Administrator | ||
| 16 | + */ | ||
| 15 | @Component | 17 | @Component |
| 16 | public class CommentsJob { | 18 | public class CommentsJob { |
| 17 | private static Logger logger = LoggerFactory.getLogger(CommentsJob.class); | 19 | private static Logger logger = LoggerFactory.getLogger(CommentsJob.class); |
src/main/java/com/cnlive/shenhe/job/LiveApplyJob.java
| @@ -8,8 +8,10 @@ import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; | @@ -8,8 +8,10 @@ import com.cnlive.shenhe.mapper.ShyLiveapplyMapper; | ||
| 8 | import com.cnlive.shenhe.serviceImpl.EmailServiceImpl; | 8 | import com.cnlive.shenhe.serviceImpl.EmailServiceImpl; |
| 9 | import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl; | 9 | import com.cnlive.shenhe.serviceImpl.LiveApplyServiceImpl; |
| 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| 11 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 12 | -import com.cnlive.shenhe.utils.*; | 11 | +import com.cnlive.shenhe.utils.CommonConst; |
| 12 | +import com.cnlive.shenhe.utils.CommonUtils; | ||
| 13 | +import com.cnlive.shenhe.utils.HttpUtil; | ||
| 14 | +import com.cnlive.shenhe.utils.OpenUtil; | ||
| 13 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 14 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| 15 | import org.springframework.beans.factory.annotation.Autowired; | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -23,6 +25,9 @@ import java.util.HashMap; | @@ -23,6 +25,9 @@ import java.util.HashMap; | ||
| 23 | import java.util.List; | 25 | import java.util.List; |
| 24 | import java.util.Map; | 26 | import java.util.Map; |
| 25 | 27 | ||
| 28 | +/** | ||
| 29 | + * @author Administrator | ||
| 30 | + */ | ||
| 26 | @Component | 31 | @Component |
| 27 | public class LiveApplyJob { | 32 | public class LiveApplyJob { |
| 28 | private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class); | 33 | private static Logger logger = LoggerFactory.getLogger(LiveApplyJob.class); |
src/main/java/com/cnlive/shenhe/job/NotSpeakJob.java
| 1 | package com.cnlive.shenhe.job; | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyNotspeak; | 3 | import com.cnlive.shenhe.entity.ShyNotspeak; |
| 4 | -import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | ||
| 5 | import com.cnlive.shenhe.serviceImpl.NotspeakServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.NotspeakServiceImpl; |
| 6 | -import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | ||
| 7 | -import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 8 | -import com.cnlive.shenhe.utils.AuditPass; | ||
| 9 | import com.cnlive.shenhe.utils.CommonConst; | 5 | import com.cnlive.shenhe.utils.CommonConst; |
| 10 | import org.slf4j.Logger; | 6 | import org.slf4j.Logger; |
| 11 | import org.slf4j.LoggerFactory; | 7 | import org.slf4j.LoggerFactory; |
| @@ -15,6 +11,9 @@ import org.springframework.stereotype.Component; | @@ -15,6 +11,9 @@ import org.springframework.stereotype.Component; | ||
| 15 | 11 | ||
| 16 | import java.util.List; | 12 | import java.util.List; |
| 17 | 13 | ||
| 14 | +/** | ||
| 15 | + * @author Administrator | ||
| 16 | + */ | ||
| 18 | @Component | 17 | @Component |
| 19 | public class NotSpeakJob { | 18 | public class NotSpeakJob { |
| 20 | private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class); | 19 | private static Logger logger = LoggerFactory.getLogger(NotSpeakJob.class); |
src/main/java/com/cnlive/shenhe/job/UsersSiteJob.java
| @@ -19,12 +19,12 @@ import org.springframework.scheduling.annotation.Scheduled; | @@ -19,12 +19,12 @@ import org.springframework.scheduling.annotation.Scheduled; | ||
| 19 | import org.springframework.stereotype.Component; | 19 | import org.springframework.stereotype.Component; |
| 20 | import tk.mybatis.mapper.entity.Example; | 20 | import tk.mybatis.mapper.entity.Example; |
| 21 | 21 | ||
| 22 | -import java.util.Date; | ||
| 23 | import java.util.HashMap; | 22 | import java.util.HashMap; |
| 24 | import java.util.List; | 23 | import java.util.List; |
| 25 | import java.util.Map; | 24 | import java.util.Map; |
| 26 | 25 | ||
| 27 | /** | 26 | /** |
| 27 | + * @author Administrator | ||
| 28 | * @Auther: 周伟鹏 | 28 | * @Auther: 周伟鹏 |
| 29 | * @Date: 2018/11/30 11:31 | 29 | * @Date: 2018/11/30 11:31 |
| 30 | * @Description:同步用户和站点信息 | 30 | * @Description:同步用户和站点信息 |
| @@ -55,11 +55,13 @@ public class UsersSiteJob { | @@ -55,11 +55,13 @@ public class UsersSiteJob { | ||
| 55 | List<ShyUsers> usersList = shyUsersMapper.selectByExample(usersExample); | 55 | List<ShyUsers> usersList = shyUsersMapper.selectByExample(usersExample); |
| 56 | if (!usersList.isEmpty()) { | 56 | if (!usersList.isEmpty()) { |
| 57 | Long tmStr = usersList.get(0).getTm(); | 57 | Long tmStr = usersList.get(0).getTm(); |
| 58 | - if (CommonUtils.isNotNull(tmStr)) tm = tmStr + ""; | 58 | + if (CommonUtils.isNotNull(tmStr)) { |
| 59 | + tm = tmStr + ""; | ||
| 60 | + } | ||
| 59 | } | 61 | } |
| 60 | HashMap<String, String> dataMap = new HashMap<>(); | 62 | HashMap<String, String> dataMap = new HashMap<>(); |
| 61 | dataMap.put("tm", tm); | 63 | dataMap.put("tm", tm); |
| 62 | - dataMap.put("timestamp", new Date().getTime() / 1000 + ""); | 64 | + dataMap.put("timestamp", System.currentTimeMillis() / 1000 + ""); |
| 63 | String httpUrl = OpenUtil.buildURL(syncUserApi, dataMap, app_key); | 65 | String httpUrl = OpenUtil.buildURL(syncUserApi, dataMap, app_key); |
| 64 | logger.info("httpUrl===" + httpUrl); | 66 | logger.info("httpUrl===" + httpUrl); |
| 65 | Map<String, String> resultMap = HttpUtil.init().post(httpUrl); | 67 | Map<String, String> resultMap = HttpUtil.init().post(httpUrl); |
src/main/java/com/cnlive/shenhe/job/VideosJob.java
| 1 | package com.cnlive.shenhe.job; | 1 | package com.cnlive.shenhe.job; |
| 2 | 2 | ||
| 3 | import com.cnlive.shenhe.entity.ShyVideos; | 3 | import com.cnlive.shenhe.entity.ShyVideos; |
| 4 | -import com.cnlive.shenhe.entity.ShyYidun; | ||
| 5 | import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; | 4 | import com.cnlive.shenhe.serviceImpl.VideosServiceImpl; |
| 6 | import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl; | 5 | import com.cnlive.shenhe.serviceImpl.YiDunServiceImpl; |
| 7 | import com.cnlive.shenhe.utils.CommonConst; | 6 | import com.cnlive.shenhe.utils.CommonConst; |
| @@ -13,6 +12,9 @@ import org.springframework.stereotype.Component; | @@ -13,6 +12,9 @@ import org.springframework.stereotype.Component; | ||
| 13 | 12 | ||
| 14 | import java.util.List; | 13 | import java.util.List; |
| 15 | 14 | ||
| 15 | +/** | ||
| 16 | + * @author Administrator | ||
| 17 | + */ | ||
| 16 | @Component | 18 | @Component |
| 17 | public class VideosJob { | 19 | public class VideosJob { |
| 18 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); | 20 | private static Logger logger = LoggerFactory.getLogger(VideosJob.class); |
src/main/java/com/cnlive/shenhe/jsoup/GetData.java
| @@ -10,6 +10,7 @@ import java.util.ArrayList; | @@ -10,6 +10,7 @@ import java.util.ArrayList; | ||
| 10 | import java.util.List; | 10 | import java.util.List; |
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | + * @author Administrator | ||
| 13 | * @Auther: 陈浩 | 14 | * @Auther: 陈浩 |
| 14 | * @Date: 2019/6/21 14:31 | 15 | * @Date: 2019/6/21 14:31 |
| 15 | * @Description: | 16 | * @Description: |
src/main/java/com/cnlive/shenhe/jsoup/newCrawl.java
| @@ -7,6 +7,9 @@ import org.jsoup.select.Elements; | @@ -7,6 +7,9 @@ import org.jsoup.select.Elements; | ||
| 7 | import java.io.IOException; | 7 | import java.io.IOException; |
| 8 | import java.net.URL; | 8 | import java.net.URL; |
| 9 | 9 | ||
| 10 | +/** | ||
| 11 | + * @author Administrator | ||
| 12 | + */ | ||
| 10 | public class newCrawl { | 13 | public class newCrawl { |
| 11 | public void abc(String url) throws Exception { | 14 | public void abc(String url) throws Exception { |
| 12 | newCrawl newCl = new newCrawl(); | 15 | newCrawl newCl = new newCrawl(); |
src/main/java/com/cnlive/shenhe/serviceImpl/ChannelServiceImpl.java
| @@ -40,7 +40,6 @@ public class ChannelServiceImpl { | @@ -40,7 +40,6 @@ public class ChannelServiceImpl { | ||
| 40 | SitesServiceImpl sitesService; | 40 | SitesServiceImpl sitesService; |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | - //************************************** | ||
| 44 | public List<ShyChannel> findshyChannel(ShyChannel shyChannel) { | 43 | public List<ShyChannel> findshyChannel(ShyChannel shyChannel) { |
| 45 | return shyChannelMapper.selectByRowBounds(shyChannel, new RowBounds(0, 100)); | 44 | return shyChannelMapper.selectByRowBounds(shyChannel, new RowBounds(0, 100)); |
| 46 | } | 45 | } |
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| @@ -78,6 +78,7 @@ public class CommentsServiceImpl { | @@ -78,6 +78,7 @@ public class CommentsServiceImpl { | ||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | public PageInfo<ShyComments> getPage(CommentsDTO commentsDTO) { | 80 | public PageInfo<ShyComments> getPage(CommentsDTO commentsDTO) { |
| 81 | + logger.info("接受参数对象为,CommentsDTO:{}",JSONObject.toJSON(commentsDTO)); | ||
| 81 | Example example = new Example(ShyComments.class); | 82 | Example example = new Example(ShyComments.class); |
| 82 | Example.Criteria criteria = example.createCriteria(); | 83 | Example.Criteria criteria = example.createCriteria(); |
| 83 | if (CommonUtils.isNotEmpty(commentsDTO.getOrderByClause())) { | 84 | if (CommonUtils.isNotEmpty(commentsDTO.getOrderByClause())) { |
| @@ -85,7 +86,7 @@ public class CommentsServiceImpl { | @@ -85,7 +86,7 @@ public class CommentsServiceImpl { | ||
| 85 | } else { | 86 | } else { |
| 86 | example.setOrderByClause("comment_time desc"); | 87 | example.setOrderByClause("comment_time desc"); |
| 87 | } | 88 | } |
| 88 | - if (CommonUtils.isNotNull(commentsDTO.getStart_date()) && CommonUtils.isNotNull(commentsDTO.getEnd_date())) { | 89 | + if (CommonUtils.isNotEmpty(commentsDTO.getStart_date()) && CommonUtils.isNotEmpty(commentsDTO.getEnd_date())) { |
| 89 | criteria.andGreaterThanOrEqualTo("comment_time", commentsDTO.getStart_date()); | 90 | criteria.andGreaterThanOrEqualTo("comment_time", commentsDTO.getStart_date()); |
| 90 | criteria.andLessThanOrEqualTo("comment_time", commentsDTO.getEnd_date()); | 91 | criteria.andLessThanOrEqualTo("comment_time", commentsDTO.getEnd_date()); |
| 91 | } | 92 | } |
| @@ -104,9 +105,9 @@ public class CommentsServiceImpl { | @@ -104,9 +105,9 @@ public class CommentsServiceImpl { | ||
| 104 | if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) { | 105 | if (CommonUtils.isNotNull(commentsDTO.getComment_user_id())) { |
| 105 | criteria.andEqualTo("comment_user_id", commentsDTO.getComment_user_id()); | 106 | criteria.andEqualTo("comment_user_id", commentsDTO.getComment_user_id()); |
| 106 | } | 107 | } |
| 107 | - if (CommonUtils.isNotNull(commentsDTO.getType()) && commentsDTO.getType() == "0") { | 108 | + if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "0") { |
| 108 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); | 109 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); |
| 109 | - } else if (CommonUtils.isNotNull(commentsDTO.getType()) && commentsDTO.getType() == "1") { | 110 | + } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "1") { |
| 110 | criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE); | 111 | criteria.andEqualTo("type", CommonConst.CATEGORY_ELSE); |
| 111 | } | 112 | } |
| 112 | if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { | 113 | if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { |
| @@ -119,14 +120,14 @@ public class CommentsServiceImpl { | @@ -119,14 +120,14 @@ public class CommentsServiceImpl { | ||
| 119 | } | 120 | } |
| 120 | } | 121 | } |
| 121 | 122 | ||
| 122 | -// if (CommonUtils.isNotEmpty(states)) { | ||
| 123 | -// Example.Criteria criteria1 = example.createCriteria(); | ||
| 124 | -// String[] stas = states.split(","); | ||
| 125 | -// for (String s : stas) { | ||
| 126 | -// criteria1.orEqualTo("state", Integer.parseInt(s)); | ||
| 127 | -// } | ||
| 128 | -// example.and(criteria1); | ||
| 129 | -// } | 123 | + //if (CommonUtils.isNotNull(commentsDTO.getState())) { |
| 124 | + // Example.Criteria criteria1 = example.createCriteria(); | ||
| 125 | + // String[] stas = String.valueOf(commentsDTO.getState()).split(","); | ||
| 126 | + // for (String s : stas) { | ||
| 127 | + // criteria1.orEqualTo("state", s); | ||
| 128 | + // } | ||
| 129 | + // example.and(criteria1); | ||
| 130 | + //} | ||
| 130 | 131 | ||
| 131 | if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { | 132 | if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { |
| 132 | criteria.andEqualTo("state", commentsDTO.getState()); | 133 | criteria.andEqualTo("state", commentsDTO.getState()); |
| @@ -167,9 +168,9 @@ public class CommentsServiceImpl { | @@ -167,9 +168,9 @@ public class CommentsServiceImpl { | ||
| 167 | if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) { | 168 | if (CommonUtils.isNotNull(commentsDTO.getIs_hot())) { |
| 168 | criteria.andEqualTo("is_hot", commentsDTO.getIs_hot()); | 169 | criteria.andEqualTo("is_hot", commentsDTO.getIs_hot()); |
| 169 | } | 170 | } |
| 170 | - if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType()=="0") { | 171 | + if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "0") { |
| 171 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); | 172 | criteria.andEqualTo("type", CommonConst.CATEGORY_TOPIC); |
| 172 | - } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType()=="1") { | 173 | + } else if (CommonUtils.isNotEmpty(commentsDTO.getType()) && commentsDTO.getType() == "1") { |
| 173 | criteria.andIsNull("type"); | 174 | criteria.andIsNull("type"); |
| 174 | } | 175 | } |
| 175 | if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { | 176 | if (CommonUtils.isNotEmpty(commentsDTO.getActivity_id())) { |
| @@ -182,14 +183,14 @@ public class CommentsServiceImpl { | @@ -182,14 +183,14 @@ public class CommentsServiceImpl { | ||
| 182 | } | 183 | } |
| 183 | } | 184 | } |
| 184 | 185 | ||
| 185 | - //if (CommonUtils.isNotEmpty(String.valueOf(commentsDTO.getState()))) { | ||
| 186 | - // Example.Criteria criteria1 = example.createCriteria(); | ||
| 187 | - // String[] stas = String.valueOf(commentsDTO.getState()).split(","); | ||
| 188 | - // for (String s : stas) { | ||
| 189 | - // criteria1.orEqualTo("state", Integer.parseInt(s)); | ||
| 190 | - // } | ||
| 191 | - // example.and(criteria1); | ||
| 192 | - //} | 186 | + if (CommonUtils.isNotEmpty(String.valueOf(commentsDTO.getState()))) { |
| 187 | + Example.Criteria criteria1 = example.createCriteria(); | ||
| 188 | + String[] stas = String.valueOf(commentsDTO.getState()).split(","); | ||
| 189 | + for (String s : stas) { | ||
| 190 | + criteria1.orEqualTo("state", Integer.parseInt(s)); | ||
| 191 | + } | ||
| 192 | + example.and(criteria1); | ||
| 193 | + } | ||
| 193 | 194 | ||
| 194 | if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { | 195 | if (CommonUtils.isNotNull(commentsDTO.getState()) && commentsDTO.getState() != 3) { |
| 195 | criteria.andEqualTo("state", commentsDTO.getState()); | 196 | criteria.andEqualTo("state", commentsDTO.getState()); |
src/main/java/com/cnlive/shenhe/serviceImpl/ContentServiceImpl.java
| @@ -264,7 +264,8 @@ public class ContentServiceImpl { | @@ -264,7 +264,8 @@ public class ContentServiceImpl { | ||
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | - content.setContent_status(state);// 设置图文状态为审核后的状态 | 267 | + // 设置图文状态为审核后的状态 |
| 268 | + content.setContent_status(state); | ||
| 268 | content.setReceive_status(CommonConst.RECEIVE_AUDIT);// 领取状态为已审核 | 269 | content.setReceive_status(CommonConst.RECEIVE_AUDIT);// 领取状态为已审核 |
| 269 | content.setShenhe_msg(msg);// 设置审核消息 | 270 | content.setShenhe_msg(msg);// 设置审核消息 |
| 270 | if (CommonUtils.isNotEmpty(userId)) { | 271 | if (CommonUtils.isNotEmpty(userId)) { |
| @@ -283,7 +284,6 @@ public class ContentServiceImpl { | @@ -283,7 +284,6 @@ public class ContentServiceImpl { | ||
| 283 | return success; | 284 | return success; |
| 284 | } | 285 | } |
| 285 | 286 | ||
| 286 | - //********************************** | ||
| 287 | public Integer receive(String ids, Integer num, String userId, Integer spid) { | 287 | public Integer receive(String ids, Integer num, String userId, Integer spid) { |
| 288 | Integer n = 0; | 288 | Integer n = 0; |
| 289 | if (CommonUtils.isNotEmpty(ids)) { | 289 | if (CommonUtils.isNotEmpty(ids)) { |
| @@ -320,7 +320,6 @@ public class ContentServiceImpl { | @@ -320,7 +320,6 @@ public class ContentServiceImpl { | ||
| 320 | return n; | 320 | return n; |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | - //*************************************** | ||
| 324 | public Integer retReceive(String ids, String userId) { | 323 | public Integer retReceive(String ids, String userId) { |
| 325 | Integer n = 0; | 324 | Integer n = 0; |
| 326 | String[] cids = ids.split(","); | 325 | String[] cids = ids.split(","); |
| @@ -339,7 +338,7 @@ public class ContentServiceImpl { | @@ -339,7 +338,7 @@ public class ContentServiceImpl { | ||
| 339 | return n; | 338 | return n; |
| 340 | } | 339 | } |
| 341 | 340 | ||
| 342 | - //************************************** | 341 | + |
| 343 | public ShyContent selectByPrimaryKey(Integer id) { | 342 | public ShyContent selectByPrimaryKey(Integer id) { |
| 344 | ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id); | 343 | ShyContent shyContent = shyContentMapper.selectByPrimaryKey(id); |
| 345 | return shyContent; | 344 | return shyContent; |
src/main/java/com/cnlive/shenhe/serviceImpl/EmailServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.alibaba.fastjson.JSON; | ||
| 4 | import com.cnlive.shenhe.dto.EmailDTO; | 5 | import com.cnlive.shenhe.dto.EmailDTO; |
| 5 | import com.cnlive.shenhe.entity.ShyEmail; | 6 | import com.cnlive.shenhe.entity.ShyEmail; |
| 6 | import com.cnlive.shenhe.mapper.ShyEmailMapper; | 7 | import com.cnlive.shenhe.mapper.ShyEmailMapper; |
| @@ -29,6 +30,7 @@ public class EmailServiceImpl { | @@ -29,6 +30,7 @@ public class EmailServiceImpl { | ||
| 29 | ShyEmailMapper shyEmailMapper; | 30 | ShyEmailMapper shyEmailMapper; |
| 30 | 31 | ||
| 31 | public PageInfo<ShyEmail> getPage(EmailDTO emailDTO) { | 32 | public PageInfo<ShyEmail> getPage(EmailDTO emailDTO) { |
| 33 | + logger.info("接受参数列表为:{}", JSON.toJSONString(emailDTO)); | ||
| 32 | Example example = new Example(ShyEmail.class); | 34 | Example example = new Example(ShyEmail.class); |
| 33 | Example.Criteria criteria = example.createCriteria(); | 35 | Example.Criteria criteria = example.createCriteria(); |
| 34 | if (CommonUtils.isNotEmpty(emailDTO.getOrderByClause())) { | 36 | if (CommonUtils.isNotEmpty(emailDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveApplyServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.alibaba.fastjson.JSON; | ||
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 5 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.dto.LiveApplyDTO; | 7 | import com.cnlive.shenhe.dto.LiveApplyDTO; |
| @@ -93,6 +94,7 @@ public class LiveApplyServiceImpl { | @@ -93,6 +94,7 @@ public class LiveApplyServiceImpl { | ||
| 93 | 94 | ||
| 94 | //=============== | 95 | //=============== |
| 95 | public PageInfo<ShyLiveapply> getListLiveApply(LiveApplyDTO liveApplyDTO) { | 96 | public PageInfo<ShyLiveapply> getListLiveApply(LiveApplyDTO liveApplyDTO) { |
| 97 | + logger.info("接参数列表为,LiveApplyDTO:{}", JSON.toJSONString(liveApplyDTO)); | ||
| 96 | Example example = new Example(ShyLiveapply.class); | 98 | Example example = new Example(ShyLiveapply.class); |
| 97 | Example.Criteria criteria = example.createCriteria(); | 99 | Example.Criteria criteria = example.createCriteria(); |
| 98 | if (CommonUtils.isNotEmpty(liveApplyDTO.getOrderByClause())) { | 100 | if (CommonUtils.isNotEmpty(liveApplyDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/LiveServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 3 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 4 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 5 | import com.cnlive.shenhe.dto.LiveDTO; | 6 | import com.cnlive.shenhe.dto.LiveDTO; |
| @@ -80,6 +81,7 @@ public class LiveServiceImpl { | @@ -80,6 +81,7 @@ public class LiveServiceImpl { | ||
| 80 | 81 | ||
| 81 | //=============== | 82 | //=============== |
| 82 | public PageInfo<ShyLive> getListContent(LiveDTO liveDTO) { | 83 | public PageInfo<ShyLive> getListContent(LiveDTO liveDTO) { |
| 84 | + logger.info("接受参数对象,LiveDTO:{}", JSON.toJSONString(liveDTO)); | ||
| 83 | Example example = new Example(ShyLive.class); | 85 | Example example = new Example(ShyLive.class); |
| 84 | Example.Criteria criteria = example.createCriteria(); | 86 | Example.Criteria criteria = example.createCriteria(); |
| 85 | if (CommonUtils.isNotEmpty(liveDTO.getOrderByClause())) { | 87 | if (CommonUtils.isNotEmpty(liveDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/NotspeakServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.alibaba.fastjson.JSON; | ||
| 4 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 6 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.dto.NotSpeakDTO; | 7 | import com.cnlive.shenhe.dto.NotSpeakDTO; |
| @@ -251,6 +252,7 @@ public class NotspeakServiceImpl { | @@ -251,6 +252,7 @@ public class NotspeakServiceImpl { | ||
| 251 | } | 252 | } |
| 252 | 253 | ||
| 253 | public PageInfo<ShyNotspeak> getPage(NotSpeakDTO notSpeakDTO) { | 254 | public PageInfo<ShyNotspeak> getPage(NotSpeakDTO notSpeakDTO) { |
| 255 | + logger.info("接受参数对象为,NotSpeakDTO:{}", JSON.toJSONString(notSpeakDTO)); | ||
| 254 | Example example = new Example(ShyNotspeak.class); | 256 | Example example = new Example(ShyNotspeak.class); |
| 255 | Example.Criteria criteria = example.createCriteria(); | 257 | Example.Criteria criteria = example.createCriteria(); |
| 256 | if (CommonUtils.isNotEmpty(notSpeakDTO.getOrderByClause())) { | 258 | if (CommonUtils.isNotEmpty(notSpeakDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | +import com.alibaba.fastjson.JSON; | ||
| 4 | import com.cnlive.shenhe.dto.ShyActivityDTO; | 5 | import com.cnlive.shenhe.dto.ShyActivityDTO; |
| 5 | import com.cnlive.shenhe.entity.ShyActivity; | 6 | import com.cnlive.shenhe.entity.ShyActivity; |
| 6 | import com.cnlive.shenhe.mapper.ShyActivityMapper; | 7 | import com.cnlive.shenhe.mapper.ShyActivityMapper; |
| 7 | import com.cnlive.shenhe.utils.CommonUtils; | 8 | import com.cnlive.shenhe.utils.CommonUtils; |
| 8 | import com.github.pagehelper.PageHelper; | 9 | import com.github.pagehelper.PageHelper; |
| 9 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 11 | +import org.slf4j.Logger; | ||
| 12 | +import org.slf4j.LoggerFactory; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 12 | import tk.mybatis.mapper.entity.Example; | 15 | import tk.mybatis.mapper.entity.Example; |
| @@ -22,6 +25,8 @@ import java.util.List; | @@ -22,6 +25,8 @@ import java.util.List; | ||
| 22 | @Service | 25 | @Service |
| 23 | public class ShyActivityImpl { | 26 | public class ShyActivityImpl { |
| 24 | 27 | ||
| 28 | + private static Logger logger = LoggerFactory.getLogger(ShyActivityImpl.class); | ||
| 29 | + | ||
| 25 | @Autowired | 30 | @Autowired |
| 26 | private ShyActivityMapper ShyActivityMapper; | 31 | private ShyActivityMapper ShyActivityMapper; |
| 27 | 32 | ||
| @@ -73,6 +78,7 @@ public class ShyActivityImpl { | @@ -73,6 +78,7 @@ public class ShyActivityImpl { | ||
| 73 | * @return | 78 | * @return |
| 74 | */ | 79 | */ |
| 75 | public PageInfo<ShyActivity> selectByExample(ShyActivityDTO shyActivityDTO) { | 80 | public PageInfo<ShyActivity> selectByExample(ShyActivityDTO shyActivityDTO) { |
| 81 | + logger.info("参数接受对象为,ShyActivityDTO:{}", JSON.toJSONString(shyActivityDTO)); | ||
| 76 | Example example = new Example(ShyActivity.class); | 82 | Example example = new Example(ShyActivity.class); |
| 77 | //如果为空 按照倒序排序 分页查询所有 | 83 | //如果为空 按照倒序排序 分页查询所有 |
| 78 | //以创建时间为条件进行倒序 | 84 | //以创建时间为条件进行倒序 |
src/main/java/com/cnlive/shenhe/serviceImpl/SitesServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 3 | import com.cnlive.shenhe.dto.SitesDTO; | 4 | import com.cnlive.shenhe.dto.SitesDTO; |
| 4 | import com.cnlive.shenhe.entity.ShySites; | 5 | import com.cnlive.shenhe.entity.ShySites; |
| 5 | import com.cnlive.shenhe.entity.ShyUsers; | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| @@ -7,6 +8,8 @@ import com.cnlive.shenhe.mapper.ShySitesMapper; | @@ -7,6 +8,8 @@ import com.cnlive.shenhe.mapper.ShySitesMapper; | ||
| 7 | import com.cnlive.shenhe.utils.CommonUtils; | 8 | import com.cnlive.shenhe.utils.CommonUtils; |
| 8 | import com.github.pagehelper.PageHelper; | 9 | import com.github.pagehelper.PageHelper; |
| 9 | import com.github.pagehelper.PageInfo; | 10 | import com.github.pagehelper.PageInfo; |
| 11 | +import org.slf4j.Logger; | ||
| 12 | +import org.slf4j.LoggerFactory; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 14 | import org.springframework.stereotype.Service; |
| 12 | import tk.mybatis.mapper.entity.Example; | 15 | import tk.mybatis.mapper.entity.Example; |
| @@ -15,6 +18,7 @@ import java.util.ArrayList; | @@ -15,6 +18,7 @@ import java.util.ArrayList; | ||
| 15 | import java.util.Arrays; | 18 | import java.util.Arrays; |
| 16 | import java.util.List; | 19 | import java.util.List; |
| 17 | 20 | ||
| 21 | + | ||
| 18 | /** | 22 | /** |
| 19 | * @Auther: 周伟鹏 | 23 | * @Auther: 周伟鹏 |
| 20 | * @Date: 2018/11/29 14:23 | 24 | * @Date: 2018/11/29 14:23 |
| @@ -22,12 +26,14 @@ import java.util.List; | @@ -22,12 +26,14 @@ import java.util.List; | ||
| 22 | */ | 26 | */ |
| 23 | @Service | 27 | @Service |
| 24 | public class SitesServiceImpl { | 28 | public class SitesServiceImpl { |
| 29 | + private static Logger logger = LoggerFactory.getLogger(SitesServiceImpl.class); | ||
| 25 | @Autowired | 30 | @Autowired |
| 26 | ShySitesMapper shySitesMapper; | 31 | ShySitesMapper shySitesMapper; |
| 27 | @Autowired | 32 | @Autowired |
| 28 | UsersServiceImpl usersService; | 33 | UsersServiceImpl usersService; |
| 29 | 34 | ||
| 30 | public PageInfo<ShySites> getPage(SitesDTO sitesDTO) { | 35 | public PageInfo<ShySites> getPage(SitesDTO sitesDTO) { |
| 36 | + logger.info("接受参数列表为,SitesDTO:{}", JSON.toJSONString(sitesDTO)); | ||
| 31 | Example example = new Example(ShySites.class); | 37 | Example example = new Example(ShySites.class); |
| 32 | Example.Criteria criteria = example.createCriteria(); | 38 | Example.Criteria criteria = example.createCriteria(); |
| 33 | Example.Criteria criteria2 = example.createCriteria(); | 39 | Example.Criteria criteria2 = example.createCriteria(); |
src/main/java/com/cnlive/shenhe/serviceImpl/TopicServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.cnlive.shenhe.dto.TopicDTO; | 5 | import com.cnlive.shenhe.dto.TopicDTO; |
| 5 | import com.cnlive.shenhe.entity.ShyComments; | 6 | import com.cnlive.shenhe.entity.ShyComments; |
| @@ -94,6 +95,7 @@ public class TopicServiceImpl { | @@ -94,6 +95,7 @@ public class TopicServiceImpl { | ||
| 94 | } | 95 | } |
| 95 | 96 | ||
| 96 | public PageInfo<ShyTopic> getPage(TopicDTO topicDTO) { | 97 | public PageInfo<ShyTopic> getPage(TopicDTO topicDTO) { |
| 98 | + logger.info("接受参数列表为,TopicDTO:{}", JSON.toJSONString(topicDTO)); | ||
| 97 | Example example = new Example(ShyTopic.class); | 99 | Example example = new Example(ShyTopic.class); |
| 98 | Example.Criteria criteria = example.createCriteria(); | 100 | Example.Criteria criteria = example.createCriteria(); |
| 99 | if (CommonUtils.isNotEmpty(topicDTO.getOrderByClause())) { | 101 | if (CommonUtils.isNotEmpty(topicDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 3 | import com.cnlive.shenhe.dto.UsersDTO; | 4 | import com.cnlive.shenhe.dto.UsersDTO; |
| 4 | import com.cnlive.shenhe.entity.ShyUsers; | 5 | import com.cnlive.shenhe.entity.ShyUsers; |
| 5 | import com.cnlive.shenhe.mapper.ShyUsersMapper; | 6 | import com.cnlive.shenhe.mapper.ShyUsersMapper; |
| 6 | import com.cnlive.shenhe.utils.CommonUtils; | 7 | import com.cnlive.shenhe.utils.CommonUtils; |
| 7 | import com.github.pagehelper.PageHelper; | 8 | import com.github.pagehelper.PageHelper; |
| 8 | import com.github.pagehelper.PageInfo; | 9 | import com.github.pagehelper.PageInfo; |
| 10 | +import org.slf4j.Logger; | ||
| 11 | +import org.slf4j.LoggerFactory; | ||
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 11 | import tk.mybatis.mapper.entity.Example; | 14 | import tk.mybatis.mapper.entity.Example; |
| @@ -19,10 +22,12 @@ import java.util.List; | @@ -19,10 +22,12 @@ import java.util.List; | ||
| 19 | */ | 22 | */ |
| 20 | @Service | 23 | @Service |
| 21 | public class UsersServiceImpl { | 24 | public class UsersServiceImpl { |
| 25 | + private static Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class); | ||
| 22 | @Autowired | 26 | @Autowired |
| 23 | ShyUsersMapper shyUsersMapper; | 27 | ShyUsersMapper shyUsersMapper; |
| 24 | 28 | ||
| 25 | public PageInfo<ShyUsers> getPage(UsersDTO usersDTO) { | 29 | public PageInfo<ShyUsers> getPage(UsersDTO usersDTO) { |
| 30 | + logger.info("接受参数列表为,UsersDTO:{}", JSON.toJSONString(usersDTO)); | ||
| 26 | Example example = new Example(ShyUsers.class); | 31 | Example example = new Example(ShyUsers.class); |
| 27 | Example.Criteria criteria = example.createCriteria(); | 32 | Example.Criteria criteria = example.createCriteria(); |
| 28 | if (CommonUtils.isNotEmpty(usersDTO.getOrderByClause())) { | 33 | if (CommonUtils.isNotEmpty(usersDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/UsersfreeServiceImpl.java
| 1 | package com.cnlive.shenhe.serviceImpl; | 1 | package com.cnlive.shenhe.serviceImpl; |
| 2 | 2 | ||
| 3 | +import com.alibaba.fastjson.JSON; | ||
| 3 | import com.alibaba.fastjson.JSONObject; | 4 | import com.alibaba.fastjson.JSONObject; |
| 4 | import com.cnlive.shenhe.dto.UsersFreeDTO; | 5 | import com.cnlive.shenhe.dto.UsersFreeDTO; |
| 5 | import com.cnlive.shenhe.entity.ShyUsers; | 6 | import com.cnlive.shenhe.entity.ShyUsers; |
| @@ -45,6 +46,7 @@ public class UsersfreeServiceImpl { | @@ -45,6 +46,7 @@ public class UsersfreeServiceImpl { | ||
| 45 | } | 46 | } |
| 46 | 47 | ||
| 47 | public PageInfo<ShyUsersfree> getpage(UsersFreeDTO usersFreeDTO) { | 48 | public PageInfo<ShyUsersfree> getpage(UsersFreeDTO usersFreeDTO) { |
| 49 | + logger.info("接受参数列表为,UsersFreeDTO:{}", JSON.toJSONString(usersFreeDTO)); | ||
| 48 | Example example = new Example(ShyUsers.class); | 50 | Example example = new Example(ShyUsers.class); |
| 49 | Example.Criteria criteria = example.createCriteria(); | 51 | Example.Criteria criteria = example.createCriteria(); |
| 50 | if (CommonUtils.isNotEmpty(usersFreeDTO.getOrderByClause())) { | 52 | if (CommonUtils.isNotEmpty(usersFreeDTO.getOrderByClause())) { |
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
| @@ -38,7 +38,8 @@ import java.util.UUID; | @@ -38,7 +38,8 @@ import java.util.UUID; | ||
| 38 | */ | 38 | */ |
| 39 | @Service | 39 | @Service |
| 40 | public class VideosServiceImpl { | 40 | public class VideosServiceImpl { |
| 41 | - private static Logger logger = LoggerFactory.getLogger(VideosServiceImpl.class); | 41 | + |
| 42 | + private static Logger logger = LoggerFactory.getLogger(VideofilterServiceImpl.class); | ||
| 42 | @Autowired | 43 | @Autowired |
| 43 | ShyVideosMapper shyVideosMapper; | 44 | ShyVideosMapper shyVideosMapper; |
| 44 | @Autowired | 45 | @Autowired |
| @@ -112,6 +113,7 @@ public class VideosServiceImpl { | @@ -112,6 +113,7 @@ public class VideosServiceImpl { | ||
| 112 | } | 113 | } |
| 113 | 114 | ||
| 114 | public PageInfo<ShyVideos> getListContent(VideosDTO videosDTO) { | 115 | public PageInfo<ShyVideos> getListContent(VideosDTO videosDTO) { |
| 116 | + logger.info("接受桉树列表为,VideosDTO:{}",JSON.toJSONString(videosDTO)); | ||
| 115 | Example example = new Example(ShyVideos.class); | 117 | Example example = new Example(ShyVideos.class); |
| 116 | Example.Criteria criteria = example.createCriteria(); | 118 | Example.Criteria criteria = example.createCriteria(); |
| 117 | Example.Criteria criteria2 = example.createCriteria(); | 119 | Example.Criteria criteria2 = example.createCriteria(); |
src/main/java/com/cnlive/shenhe/utils/CommonUtils.java
| @@ -21,8 +21,11 @@ import java.text.ParseException; | @@ -21,8 +21,11 @@ import java.text.ParseException; | ||
| 21 | import java.text.SimpleDateFormat; | 21 | import java.text.SimpleDateFormat; |
| 22 | import java.util.*; | 22 | import java.util.*; |
| 23 | 23 | ||
| 24 | +/** | ||
| 25 | + * @author Administrator | ||
| 26 | + */ | ||
| 24 | public class CommonUtils { | 27 | public class CommonUtils { |
| 25 | - private static char md5Chars[] = { | 28 | + private static char[] md5Chars = { |
| 26 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', | 29 | '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', |
| 27 | 'a', 'b', 'c', 'd', 'e', 'f' | 30 | 'a', 'b', 'c', 'd', 'e', 'f' |
| 28 | }; | 31 | }; |
src/main/java/com/cnlive/shenhe/utils/HttpClientUtils.java
| @@ -24,6 +24,9 @@ import java.util.ArrayList; | @@ -24,6 +24,9 @@ import java.util.ArrayList; | ||
| 24 | import java.util.List; | 24 | import java.util.List; |
| 25 | import java.util.Map; | 25 | import java.util.Map; |
| 26 | 26 | ||
| 27 | +/** | ||
| 28 | + * @author Administrator | ||
| 29 | + */ | ||
| 27 | public class HttpClientUtils { | 30 | public class HttpClientUtils { |
| 28 | public static String post(String url, Map<String, Object> map) { | 31 | public static String post(String url, Map<String, Object> map) { |
| 29 | // 创建post请求 | 32 | // 创建post请求 |
| @@ -42,9 +45,12 @@ public class HttpClientUtils { | @@ -42,9 +45,12 @@ public class HttpClientUtils { | ||
| 42 | HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8"); | 45 | HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8"); |
| 43 | // 把请求实体放到post请求中 | 46 | // 把请求实体放到post请求中 |
| 44 | post.setEntity(postEntity); | 47 | post.setEntity(postEntity); |
| 45 | - HttpResponse response = client.execute(post); // 执行post请求 | ||
| 46 | - HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | ||
| 47 | - text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | 48 | + // 执行post请求 |
| 49 | + HttpResponse response = client.execute(post); | ||
| 50 | + // 从响应中取得一个响应实体 | ||
| 51 | + HttpEntity entity = response.getEntity(); | ||
| 52 | + // 把响应实体转成文本信息 | ||
| 53 | + text = EntityUtils.toString(entity); | ||
| 48 | } catch (Exception e) { | 54 | } catch (Exception e) { |
| 49 | e.printStackTrace(); | 55 | e.printStackTrace(); |
| 50 | } finally { | 56 | } finally { |
| @@ -57,11 +63,15 @@ public class HttpClientUtils { | @@ -57,11 +63,15 @@ public class HttpClientUtils { | ||
| 57 | String text = "请求失败"; | 63 | String text = "请求失败"; |
| 58 | HttpGet httpGet = null; | 64 | HttpGet httpGet = null; |
| 59 | try { | 65 | try { |
| 60 | - HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | 66 | + // 创建http访问的客户端 |
| 67 | + HttpClient client = HttpClients.createDefault(); | ||
| 61 | httpGet = new HttpGet(url); | 68 | httpGet = new HttpGet(url); |
| 62 | - HttpResponse response = client.execute(httpGet); // 执行get请求 | ||
| 63 | - HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | ||
| 64 | - text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | 69 | + // 执行get请求 |
| 70 | + HttpResponse response = client.execute(httpGet); | ||
| 71 | + // 从响应中取得一个响应实体 | ||
| 72 | + HttpEntity entity = response.getEntity(); | ||
| 73 | + // 把响应实体转成文本信息 | ||
| 74 | + text = EntityUtils.toString(entity); | ||
| 65 | } catch (Exception e) { | 75 | } catch (Exception e) { |
| 66 | e.printStackTrace(); | 76 | e.printStackTrace(); |
| 67 | } finally { | 77 | } finally { |
| @@ -74,7 +84,8 @@ public class HttpClientUtils { | @@ -74,7 +84,8 @@ public class HttpClientUtils { | ||
| 74 | String text = "请求失败"; | 84 | String text = "请求失败"; |
| 75 | HttpGet httpGet = null; | 85 | HttpGet httpGet = null; |
| 76 | try { | 86 | try { |
| 77 | - HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | 87 | + // 创建http访问的客户端 |
| 88 | + HttpClient client = HttpClients.createDefault(); | ||
| 78 | List<NameValuePair> params = new ArrayList<NameValuePair>(); | 89 | List<NameValuePair> params = new ArrayList<NameValuePair>(); |
| 79 | if (map != null && map.size() > 0) { | 90 | if (map != null && map.size() > 0) { |
| 80 | for (Map.Entry<String, String> entry : map.entrySet()) { | 91 | for (Map.Entry<String, String> entry : map.entrySet()) { |
| @@ -83,9 +94,12 @@ public class HttpClientUtils { | @@ -83,9 +94,12 @@ public class HttpClientUtils { | ||
| 83 | } | 94 | } |
| 84 | String paramsStr = EntityUtils.toString(new UrlEncodedFormEntity(params, "UTF-8")); | 95 | String paramsStr = EntityUtils.toString(new UrlEncodedFormEntity(params, "UTF-8")); |
| 85 | httpGet = new HttpGet(url + "?" + paramsStr); | 96 | httpGet = new HttpGet(url + "?" + paramsStr); |
| 86 | - HttpResponse response = client.execute(httpGet); // 执行get请求 | ||
| 87 | - HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | ||
| 88 | - text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | 97 | + // 执行get请求 |
| 98 | + HttpResponse response = client.execute(httpGet); | ||
| 99 | + // 从响应中取得一个响应实体 | ||
| 100 | + HttpEntity entity = response.getEntity(); | ||
| 101 | + // 把响应实体转成文本信息 | ||
| 102 | + text = EntityUtils.toString(entity); | ||
| 89 | } catch (Exception e) { | 103 | } catch (Exception e) { |
| 90 | e.printStackTrace(); | 104 | e.printStackTrace(); |
| 91 | } finally { | 105 | } finally { |
| @@ -98,23 +112,31 @@ public class HttpClientUtils { | @@ -98,23 +112,31 @@ public class HttpClientUtils { | ||
| 98 | HttpPost post = null; | 112 | HttpPost post = null; |
| 99 | String text = "请求失败"; | 113 | String text = "请求失败"; |
| 100 | try { | 114 | try { |
| 101 | - HttpClient client = HttpClients.createDefault();// 创建http访问的客户端 | 115 | + // 创建http访问的客户端 |
| 116 | + HttpClient client = HttpClients.createDefault(); | ||
| 102 | List<NameValuePair> param = new ArrayList<>(); | 117 | List<NameValuePair> param = new ArrayList<>(); |
| 103 | if (map != null && map.size() > 0) { | 118 | if (map != null && map.size() > 0) { |
| 104 | for (Map.Entry<String, String> entry : map.entrySet()) { | 119 | for (Map.Entry<String, String> entry : map.entrySet()) { |
| 105 | param.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); | 120 | param.add(new BasicNameValuePair(entry.getKey(), entry.getValue())); |
| 106 | } | 121 | } |
| 107 | } | 122 | } |
| 108 | - HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8");// 用参数构造请求实体 | ||
| 109 | - post = new HttpPost(url);// 创建post请求 | ||
| 110 | - post.setEntity(postEntity);// 把请求实体放到post请求中 | ||
| 111 | - HttpResponse response = client.execute(post); // 执行post请求 | ||
| 112 | - HttpEntity entity = response.getEntity();// 从响应中取得一个响应实体 | ||
| 113 | - text = EntityUtils.toString(entity);// 把响应实体转成文本信息 | 123 | + // 用参数构造请求实体 |
| 124 | + HttpEntity postEntity = new UrlEncodedFormEntity(param, "utf-8"); | ||
| 125 | + // 创建post请求 | ||
| 126 | + post = new HttpPost(url); | ||
| 127 | + // 把请求实体放到post请求中 | ||
| 128 | + post.setEntity(postEntity); | ||
| 129 | + // 执行post请求 | ||
| 130 | + HttpResponse response = client.execute(post); | ||
| 131 | + // 从响应中取得一个响应实体 | ||
| 132 | + HttpEntity entity = response.getEntity(); | ||
| 133 | + // 把响应实体转成文本信息 | ||
| 134 | + text = EntityUtils.toString(entity); | ||
| 114 | } catch (Exception e) { | 135 | } catch (Exception e) { |
| 115 | e.printStackTrace(); | 136 | e.printStackTrace(); |
| 116 | } finally { | 137 | } finally { |
| 117 | - post.releaseConnection();// 释放连接 | 138 | + // 释放连接 |
| 139 | + post.releaseConnection(); | ||
| 118 | } | 140 | } |
| 119 | return text; | 141 | return text; |
| 120 | } | 142 | } |
src/main/java/com/cnlive/shenhe/utils/HttpUtil.java
| @@ -53,14 +53,35 @@ public class HttpUtil { | @@ -53,14 +53,35 @@ public class HttpUtil { | ||
| 53 | 53 | ||
| 54 | private Logger logger = LoggerFactory.getLogger(HttpUtil.class); | 54 | private Logger logger = LoggerFactory.getLogger(HttpUtil.class); |
| 55 | 55 | ||
| 56 | - private static PoolingHttpClientConnectionManager pcm;//httpclient连接池 | ||
| 57 | - private CloseableHttpClient httpClient = null; //http连接 | ||
| 58 | - private int connectTimeout = 120000;//连接超时时间 | ||
| 59 | - private int connectionRequestTimeout = 10000;//从连接池获取连接超时时间 | ||
| 60 | - private int socketTimeout = 300000;//获取数据超时时间 | 56 | + /** |
| 57 | + * httpclient连接池 | ||
| 58 | + */ | ||
| 59 | + private static PoolingHttpClientConnectionManager pcm; | ||
| 60 | + /** | ||
| 61 | + * http连接 | ||
| 62 | + */ | ||
| 63 | + private CloseableHttpClient httpClient = null; | ||
| 64 | + /** | ||
| 65 | + * 连接超时时间 | ||
| 66 | + */ | ||
| 67 | + private int connectTimeout = 120000; | ||
| 68 | + /** | ||
| 69 | + * 从连接池获取连接超时时间 | ||
| 70 | + */ | ||
| 71 | + private int connectionRequestTimeout = 10000; | ||
| 72 | + /** | ||
| 73 | + * 获取数据超时时间 | ||
| 74 | + */ | ||
| 75 | + private int socketTimeout = 300000; | ||
| 61 | private String charset = "utf-8"; | 76 | private String charset = "utf-8"; |
| 62 | - private RequestConfig requestConfig = null;//请求配置 | ||
| 63 | - private Builder requestConfigBuilder = null;//build requestConfig | 77 | + /** |
| 78 | + * 请求配置 | ||
| 79 | + */ | ||
| 80 | + private RequestConfig requestConfig = null; | ||
| 81 | + /** | ||
| 82 | + * build requestConfig | ||
| 83 | + */ | ||
| 84 | + private Builder requestConfigBuilder = null; | ||
| 64 | 85 | ||
| 65 | private List<NameValuePair> nvps = new ArrayList<>(); | 86 | private List<NameValuePair> nvps = new ArrayList<>(); |
| 66 | private List<Header> headers = new ArrayList<>(); | 87 | private List<Header> headers = new ArrayList<>(); |
| @@ -298,7 +319,8 @@ public class HttpUtil { | @@ -298,7 +319,8 @@ public class HttpUtil { | ||
| 298 | if (entity != null) { | 319 | if (entity != null) { |
| 299 | try { | 320 | try { |
| 300 | result = EntityUtils.toString(entity, charset); | 321 | result = EntityUtils.toString(entity, charset); |
| 301 | - EntityUtils.consume(entity);//释放连接 | 322 | + //释放连接 |
| 323 | + EntityUtils.consume(entity); | ||
| 302 | } catch (Exception e) { | 324 | } catch (Exception e) { |
| 303 | logger.error("获取http请求返回值解析失败", e); | 325 | logger.error("获取http请求返回值解析失败", e); |
| 304 | request.abort(); | 326 | request.abort(); |
| @@ -403,6 +425,7 @@ public class HttpUtil { | @@ -403,6 +425,7 @@ public class HttpUtil { | ||
| 403 | 425 | ||
| 404 | /** | 426 | /** |
| 405 | * from请求 | 427 | * from请求 |
| 428 | + * | ||
| 406 | * @param url | 429 | * @param url |
| 407 | * @param params | 430 | * @param params |
| 408 | * @return | 431 | * @return |
| @@ -475,13 +498,13 @@ public class HttpUtil { | @@ -475,13 +498,13 @@ public class HttpUtil { | ||
| 475 | 498 | ||
| 476 | 499 | ||
| 477 | JSONObject params = new JSONObject(); | 500 | JSONObject params = new JSONObject(); |
| 478 | - params.put("video_id","60_8be004799c424688949704814ea0d16d"); | ||
| 479 | - params.put("state",3+""); | ||
| 480 | - params.put("attr_tags",""); | ||
| 481 | - params.put("msg",""); | 501 | + params.put("video_id", "60_8be004799c424688949704814ea0d16d"); |
| 502 | + params.put("state", 3 + ""); | ||
| 503 | + params.put("attr_tags", ""); | ||
| 504 | + params.put("msg", ""); | ||
| 482 | HttpUtil httpUtil = HttpUtil.init(); | 505 | HttpUtil httpUtil = HttpUtil.init(); |
| 483 | - httpUtil.setParam("param",params.toJSONString()); | ||
| 484 | - String URL ="http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify?platform=AUDIT&token=2718c88930175686e40398994cead75c"; | 506 | + httpUtil.setParam("param", params.toJSONString()); |
| 507 | + String URL = "http://mam.innerapi.cnlive.com/v1/inner/ShenHeInfo/shenheNotify?platform=AUDIT&token=2718c88930175686e40398994cead75c"; | ||
| 485 | Map<String, String> post = httpUtil.post(URL); | 508 | Map<String, String> post = httpUtil.post(URL); |
| 486 | System.out.println(post.get("result")); | 509 | System.out.println(post.get("result")); |
| 487 | } | 510 | } |
src/main/java/com/cnlive/shenhe/utils/OpenUtil.java
| 1 | package com.cnlive.shenhe.utils; | 1 | package com.cnlive.shenhe.utils; |
| 2 | 2 | ||
| 3 | import javax.servlet.ServletRequest; | 3 | import javax.servlet.ServletRequest; |
| 4 | - | ||
| 5 | -import com.alibaba.fastjson.JSONObject; | ||
| 6 | - | ||
| 7 | import java.io.UnsupportedEncodingException; | 4 | import java.io.UnsupportedEncodingException; |
| 8 | import java.net.URLDecoder; | 5 | import java.net.URLDecoder; |
| 9 | import java.net.URLEncoder; | 6 | import java.net.URLEncoder; |
| 10 | import java.util.*; | 7 | import java.util.*; |
| 11 | 8 | ||
| 9 | +/** | ||
| 10 | + * @author Administrator | ||
| 11 | + */ | ||
| 12 | public class OpenUtil { | 12 | public class OpenUtil { |
| 13 | 13 | ||
| 14 | 14 |
src/main/java/com/cnlive/shenhe/utils/TransitServiceUtils.java
| @@ -6,13 +6,22 @@ import org.springframework.amqp.core.AmqpTemplate; | @@ -6,13 +6,22 @@ import org.springframework.amqp.core.AmqpTemplate; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Component; | 7 | import org.springframework.stereotype.Component; |
| 8 | 8 | ||
| 9 | +/** | ||
| 10 | + * @author Administrator | ||
| 11 | + */ | ||
| 9 | @Component | 12 | @Component |
| 10 | public class TransitServiceUtils { | 13 | public class TransitServiceUtils { |
| 11 | 14 | ||
| 12 | @Autowired | 15 | @Autowired |
| 13 | - private AmqpTemplate rabbitTemplate; | ||
| 14 | - private String exchange = "transitService";//交换机 | ||
| 15 | - private String routingKey = "audit";//路由 | 16 | + private AmqpTemplate rabbitTemplate; |
| 17 | + /**交换机 | ||
| 18 | + * | ||
| 19 | + */ | ||
| 20 | + private String exchange = "transitService"; | ||
| 21 | + /**路由 | ||
| 22 | + * | ||
| 23 | + */ | ||
| 24 | + private String routingKey = "audit"; | ||
| 16 | 25 | ||
| 17 | /** | 26 | /** |
| 18 | * MQ 生产者工具类 | 27 | * MQ 生产者工具类 |
| @@ -27,7 +36,7 @@ public class TransitServiceUtils { | @@ -27,7 +36,7 @@ public class TransitServiceUtils { | ||
| 27 | try{ | 36 | try{ |
| 28 | JSONObject json = new JSONObject(); | 37 | JSONObject json = new JSONObject(); |
| 29 | json.put("callerId", "audit"); | 38 | json.put("callerId", "audit"); |
| 30 | - json.put("calleeId", calleeId);// | 39 | + json.put("calleeId", calleeId); |
| 31 | json.put("cmdId", cmdId); | 40 | json.put("cmdId", cmdId); |
| 32 | if (isCallback) { | 41 | if (isCallback) { |
| 33 | json.put("isCallback", "0"); | 42 | json.put("isCallback", "0"); |