Commit ba95dadbcba05d406cc26269c7324f3a58095a4d
1 parent
bb243a17
话题审核通知
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 | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | 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 | 8 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 15 | 9 | import com.cnlive.shenhe.serviceImpl.ContentServiceImpl; |
| 16 | 10 | import com.cnlive.shenhe.serviceImpl.SitesServiceImpl; |
| ... | ... | @@ -19,6 +13,7 @@ import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; |
| 19 | 13 | import com.cnlive.shenhe.utils.AuditPass; |
| 20 | 14 | import com.cnlive.shenhe.utils.CommonConst; |
| 21 | 15 | import com.cnlive.shenhe.utils.CommonUtils; |
| 16 | +import com.cnlive.shenhe.utils.InfoUtil; | |
| 22 | 17 | import com.github.pagehelper.PageInfo; |
| 23 | 18 | |
| 24 | 19 | import org.apache.poi.xssf.usermodel.XSSFCell; |
| ... | ... | @@ -28,6 +23,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 28 | 23 | import org.slf4j.Logger; |
| 29 | 24 | import org.slf4j.LoggerFactory; |
| 30 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 26 | +import org.springframework.beans.factory.annotation.Value; | |
| 31 | 27 | import org.springframework.stereotype.Controller; |
| 32 | 28 | import org.springframework.ui.Model; |
| 33 | 29 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -42,7 +38,9 @@ import java.io.ByteArrayInputStream; |
| 42 | 38 | import java.io.ByteArrayOutputStream; |
| 43 | 39 | import java.io.InputStream; |
| 44 | 40 | import java.util.Date; |
| 41 | +import java.util.HashMap; | |
| 45 | 42 | import java.util.List; |
| 43 | +import java.util.Map; | |
| 46 | 44 | |
| 47 | 45 | |
| 48 | 46 | @Controller |
| ... | ... | @@ -61,6 +59,9 @@ public class TopicController extends BaseController { |
| 61 | 59 | @Autowired |
| 62 | 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 | 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 | 219 | * 根据条件导出excel |
| 192 | 220 | */ |
| 193 | 221 | // @GetMapping("excel") | ... | ... |
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| ... | ... | @@ -127,16 +127,21 @@ public class UsersController extends BaseController { |
| 127 | 127 | shyUser.setUser_id(sessionUser.getUserId()); |
| 128 | 128 | shyUser =usersService.select(shyUser); |
| 129 | 129 | boolean isShow_chinnal=false;//是否显示频道消息框 |
| 130 | - boolean isShow_liveApply=false;//是否显示直播申请消息框 | |
| 130 | + boolean isShow_liveApply=false;//是否显示直播申请消息框 | |
| 131 | + boolean isShow_topic=false;//是否显示话题审核消息框 | |
| 131 | 132 | if(CommonUtils.isNotEmpty(shyUser.getNotice_show())&­User.getNotice_show().contains(CommonConst.NOTICE_CHANNAL.toString())){ |
| 132 | 133 | isShow_chinnal=true; |
| 133 | 134 | } |
| 134 | 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 | 141 | Map<String,Object> map=new HashMap<>(); |
| 138 | 142 | map.put("isShow_chinnal", isShow_chinnal); |
| 139 | 143 | map.put("isShow_liveApply", isShow_liveApply); |
| 144 | + map.put("isShow_topic", isShow_topic); | |
| 140 | 145 | return map; |
| 141 | 146 | } |
| 142 | 147 | ... | ... |
src/main/java/com/cnlive/shenhe/utils/CommonConst.java
| ... | ... | @@ -125,6 +125,11 @@ public class CommonConst { |
| 125 | 125 | * 弹窗消息:直播申请 |
| 126 | 126 | */ |
| 127 | 127 | public static Integer NOTICE_LIVEAPPLY = 2; |
| 128 | + | |
| 129 | + /** | |
| 130 | + * 弹窗消息:话题审核 | |
| 131 | + */ | |
| 132 | + public static Integer NOTICE_TOPIC = 3; | |
| 128 | 133 | |
| 129 | 134 | //通知消息设置 |
| 130 | 135 | public static JSONObject NOTICE = JSONObject.parseObject("{\"1\":\"频道通知\",\"2\":\"直播申请通知\",\"3\":\"话题审核通知\"}"); | ... | ... |
src/main/resources/templates/common/head.html
| ... | ... | @@ -97,7 +97,8 @@ |
| 97 | 97 | <script language='JScript'> |
| 98 | 98 | |
| 99 | 99 | var isShow_chinnal=false;//是否显示频道消息框 |
| 100 | - var isShow_liveApply=false;//是否显示直播申请消息框 | |
| 100 | + var isShow_liveApply=false;//是否显示直播申请消息框 | |
| 101 | + var isShow_topic=false;//是否显示话题审核消息框 | |
| 101 | 102 | |
| 102 | 103 | function initialize(){ |
| 103 | 104 | $.ajax({ |
| ... | ... | @@ -114,6 +115,10 @@ |
| 114 | 115 | isShow_liveApply=true; |
| 115 | 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 | 135 | if(isShow_liveApply){ |
| 131 | 136 | notice_liveApply(); |
| 132 | 137 | } |
| 138 | + if(isShow_topic){ | |
| 139 | + notice_topic(); | |
| 140 | + } | |
| 133 | 141 | } |
| 134 | 142 | },1000); |
| 135 | 143 | }); |
| ... | ... | @@ -152,14 +160,28 @@ |
| 152 | 160 | type:'get', |
| 153 | 161 | dataType:'json', |
| 154 | 162 | data:'', |
| 155 | - url: "/liveApply/liveApplyNotice", | |
| 163 | + url: "/topic/topicNotice", | |
| 156 | 164 | success:function(data){ |
| 157 | 165 | if(data!=null && data!="" ){ |
| 158 | 166 | new xWin(data.id,data.title,data.content,data.url); |
| 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: "/liveApply/liveApplyNotice", | |
| 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 | 187 | //window.clearInterval(t1); | ... | ... |