Commit d23ff0748f17296e9f06b215b165b8919561e0ed
Merge branch 'dev'
Showing
4 changed files
with
72 additions
and
12 deletions
src/main/java/com/cnlive/shenhe/controller/TopicController.java
| @@ -4,13 +4,7 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,13 +4,7 @@ import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.bean.SessionUser; | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | -import com.cnlive.shenhe.entity.ShyComments; | ||
| 8 | -import com.cnlive.shenhe.entity.ShyContent; | ||
| 9 | -import com.cnlive.shenhe.entity.ShyLive; | ||
| 10 | -import com.cnlive.shenhe.entity.ShySites; | ||
| 11 | -import com.cnlive.shenhe.entity.ShyTopic; | ||
| 12 | -import com.cnlive.shenhe.entity.ShyUsers; | ||
| 13 | -import com.cnlive.shenhe.entity.ShyVideos; | 7 | +import com.cnlive.shenhe.entity.*; |
| 14 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | 8 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 15 | import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; | 9 | import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; |
| 16 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| @@ -19,6 +13,7 @@ import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | @@ -19,6 +13,7 @@ import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 19 | import com.cnlive.shenhe.utils.AuditPass; | 13 | import com.cnlive.shenhe.utils.AuditPass; |
| 20 | import com.cnlive.shenhe.utils.CommonConst; | 14 | import com.cnlive.shenhe.utils.CommonConst; |
| 21 | import com.cnlive.shenhe.utils.CommonUtils; | 15 | import com.cnlive.shenhe.utils.CommonUtils; |
| 16 | +import com.cnlive.shenhe.utils.InfoUtil; | ||
| 22 | import com.github.pagehelper.PageInfo; | 17 | import com.github.pagehelper.PageInfo; |
| 23 | 18 | ||
| 24 | import org.apache.poi.xssf.usermodel.XSSFCell; | 19 | import org.apache.poi.xssf.usermodel.XSSFCell; |
| @@ -28,6 +23,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; | @@ -28,6 +23,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; | ||
| 28 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
| 29 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
| 30 | import org.springframework.beans.factory.annotation.Autowired; | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 26 | +import org.springframework.beans.factory.annotation.Value; | ||
| 31 | import org.springframework.stereotype.Controller; | 27 | import org.springframework.stereotype.Controller; |
| 32 | import org.springframework.ui.Model; | 28 | import org.springframework.ui.Model; |
| 33 | import org.springframework.web.bind.annotation.*; | 29 | import org.springframework.web.bind.annotation.*; |
| @@ -42,7 +38,9 @@ import java.io.ByteArrayInputStream; | @@ -42,7 +38,9 @@ import java.io.ByteArrayInputStream; | ||
| 42 | import java.io.ByteArrayOutputStream; | 38 | import java.io.ByteArrayOutputStream; |
| 43 | import java.io.InputStream; | 39 | import java.io.InputStream; |
| 44 | import java.util.Date; | 40 | import java.util.Date; |
| 41 | +import java.util.HashMap; | ||
| 45 | import java.util.List; | 42 | import java.util.List; |
| 43 | +import java.util.Map; | ||
| 46 | 44 | ||
| 47 | 45 | ||
| 48 | @Controller | 46 | @Controller |
| @@ -61,6 +59,9 @@ public class TopicController extends BaseController { | @@ -61,6 +59,9 @@ public class TopicController extends BaseController { | ||
| 61 | @Autowired | 59 | @Autowired |
| 62 | UsersServiceImpl usersService; | 60 | UsersServiceImpl usersService; |
| 63 | 61 | ||
| 62 | + @Value("${spring.localhost.url}") | ||
| 63 | + private String localhost_url; | ||
| 64 | + | ||
| 64 | /** | 65 | /** |
| 65 | * 图文列表 | 66 | * 图文列表 |
| 66 | * | 67 | * |
| @@ -188,6 +189,33 @@ public class TopicController extends BaseController { | @@ -188,6 +189,33 @@ public class TopicController extends BaseController { | ||
| 188 | 189 | ||
| 189 | 190 | ||
| 190 | /** | 191 | /** |
| 192 | + * 话题审核前台通知接口 | ||
| 193 | + * | ||
| 194 | + * @return | ||
| 195 | + */ | ||
| 196 | + @GetMapping("/topicNotice") | ||
| 197 | + @ResponseBody | ||
| 198 | + public Map<String, Object> channelNotice() { | ||
| 199 | + Map<String, Object> map = new HashMap<>(); | ||
| 200 | + | ||
| 201 | + ShyTopic shyTopic = new ShyTopic(); | ||
| 202 | + shyTopic.setShenhe_status(CommonConst.AUDIT_INTT); | ||
| 203 | + shyTopic.setShenhe_type(CommonConst.AUDIT_TYPE_USER); | ||
| 204 | + List<ShyTopic> shyTopicList = topicService.findshyTopic(shyTopic); | ||
| 205 | + if(shyTopicList!=null&­TopicList.size()>0){ | ||
| 206 | + logger.info("您有"+shyTopicList.size()+"条新的话题审核,请注意查看!"); | ||
| 207 | + // 第三个提示框,避免冲突 | ||
| 208 | + map.put("id", "3"); | ||
| 209 | + map.put("title", "新话题审核通知"); | ||
| 210 | + map.put("content", "您有" + shyTopicList.size() + "条新的话题审核,请注意查看!"); | ||
| 211 | + map.put("url", localhost_url+"/topic/page?shenhe_status=0&receive=0"); | ||
| 212 | + return map; | ||
| 213 | + } | ||
| 214 | + return null; | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + | ||
| 218 | + /** | ||
| 191 | * 根据条件导出excel | 219 | * 根据条件导出excel |
| 192 | */ | 220 | */ |
| 193 | // @GetMapping("excel") | 221 | // @GetMapping("excel") |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| @@ -127,16 +127,21 @@ public class UsersController extends BaseController { | @@ -127,16 +127,21 @@ public class UsersController extends BaseController { | ||
| 127 | shyUser.setUser_id(sessionUser.getUserId()); | 127 | shyUser.setUser_id(sessionUser.getUserId()); |
| 128 | shyUser =usersService.select(shyUser); | 128 | shyUser =usersService.select(shyUser); |
| 129 | boolean isShow_chinnal=false;//是否显示频道消息框 | 129 | boolean isShow_chinnal=false;//是否显示频道消息框 |
| 130 | - boolean isShow_liveApply=false;//是否显示直播申请消息框 | 130 | + boolean isShow_liveApply=false;//是否显示直播申请消息框 |
| 131 | + boolean isShow_topic=false;//是否显示话题审核消息框 | ||
| 131 | if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_CHANNAL.toString())){ | 132 | if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_CHANNAL.toString())){ |
| 132 | isShow_chinnal=true; | 133 | isShow_chinnal=true; |
| 133 | } | 134 | } |
| 134 | if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_LIVEAPPLY.toString())){ | 135 | if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_LIVEAPPLY.toString())){ |
| 135 | - isShow_liveApply=true; | 136 | + isShow_liveApply=true; |
| 137 | + } | ||
| 138 | + if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_TOPIC.toString())){ | ||
| 139 | + isShow_topic=true; | ||
| 136 | } | 140 | } |
| 137 | Map<String,Object> map=new HashMap<>(); | 141 | Map<String,Object> map=new HashMap<>(); |
| 138 | map.put("isShow_chinnal", isShow_chinnal); | 142 | map.put("isShow_chinnal", isShow_chinnal); |
| 139 | map.put("isShow_liveApply", isShow_liveApply); | 143 | map.put("isShow_liveApply", isShow_liveApply); |
| 144 | + map.put("isShow_topic", isShow_topic); | ||
| 140 | return map; | 145 | return map; |
| 141 | } | 146 | } |
| 142 | 147 |
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
| @@ -125,9 +125,14 @@ public class CommonConst { | @@ -125,9 +125,14 @@ public class CommonConst { | ||
| 125 | * 弹窗消息:直播申请 | 125 | * 弹窗消息:直播申请 |
| 126 | */ | 126 | */ |
| 127 | public static Integer NOTICE_LIVEAPPLY = 2; | 127 | public static Integer NOTICE_LIVEAPPLY = 2; |
| 128 | + | ||
| 129 | + /** | ||
| 130 | + * 弹窗消息:话题审核 | ||
| 131 | + */ | ||
| 132 | + public static Integer NOTICE_TOPIC = 3; | ||
| 128 | 133 | ||
| 129 | //通知消息设置 | 134 | //通知消息设置 |
| 130 | - public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\"}"); | 135 | + public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\",\"3\":\"话题审核通知\"}"); |
| 131 | 136 | ||
| 132 | /** | 137 | /** |
| 133 | * 邮件消息:直播申请 | 138 | * 邮件消息:直播申请 |
src/main/resources/templates/common/head.html
| @@ -97,7 +97,8 @@ | @@ -97,7 +97,8 @@ | ||
| 97 | <script language='JScript'> | 97 | <script language='JScript'> |
| 98 | 98 | ||
| 99 | var isShow_chinnal=false;//是否显示频道消息框 | 99 | var isShow_chinnal=false;//是否显示频道消息框 |
| 100 | - var isShow_liveApply=false;//是否显示直播申请消息框 | 100 | + var isShow_liveApply=false;//是否显示直播申请消息框 |
| 101 | + var isShow_topic=false;//是否显示话题审核消息框 | ||
| 101 | 102 | ||
| 102 | function initialize(){ | 103 | function initialize(){ |
| 103 | $.ajax({ | 104 | $.ajax({ |
| @@ -114,6 +115,10 @@ | @@ -114,6 +115,10 @@ | ||
| 114 | isShow_liveApply=true; | 115 | isShow_liveApply=true; |
| 115 | notice_liveApply();//第一次进来就弹窗 | 116 | notice_liveApply();//第一次进来就弹窗 |
| 116 | } | 117 | } |
| 118 | + if(data.isShow_topic){ | ||
| 119 | + isShow_topic=true; | ||
| 120 | + notice_topic();//第一次进来就弹窗 | ||
| 121 | + } | ||
| 117 | } | 122 | } |
| 118 | }); | 123 | }); |
| 119 | } | 124 | } |
| @@ -130,6 +135,9 @@ | @@ -130,6 +135,9 @@ | ||
| 130 | if(isShow_liveApply){ | 135 | if(isShow_liveApply){ |
| 131 | notice_liveApply(); | 136 | notice_liveApply(); |
| 132 | } | 137 | } |
| 138 | + if(isShow_topic){ | ||
| 139 | + notice_topic(); | ||
| 140 | + } | ||
| 133 | } | 141 | } |
| 134 | },1000); | 142 | },1000); |
| 135 | }); | 143 | }); |
| @@ -159,7 +167,21 @@ | @@ -159,7 +167,21 @@ | ||
| 159 | } | 167 | } |
| 160 | } | 168 | } |
| 161 | }); | 169 | }); |
| 162 | - } | 170 | + } |
| 171 | + | ||
| 172 | + function notice_topic(){ | ||
| 173 | + $.ajax({ | ||
| 174 | + type:'get', | ||
| 175 | + dataType:'json', | ||
| 176 | + data:'', | ||
| 177 | + url: "/topic/topicNotice", | ||
| 178 | + success:function(data){ | ||
| 179 | + if(data!=null && data!="" ){ | ||
| 180 | + new xWin(data.id,data.title,data.content,data.url); | ||
| 181 | + } | ||
| 182 | + } | ||
| 183 | + }); | ||
| 184 | + } | ||
| 163 | 185 | ||
| 164 | //去掉定时器的方法 | 186 | //去掉定时器的方法 |
| 165 | //window.clearInterval(t1); | 187 | //window.clearInterval(t1); |