右上角铃铛消息
This commit is contained in:
@ -3,6 +3,8 @@ package com.ruoyi.web.controller.system;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.mysql.cj.protocol.x.Notice;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@ -41,7 +43,12 @@ public class SysNoticeController extends BaseController
|
||||
{
|
||||
return prefix + "/notice";
|
||||
}
|
||||
|
||||
@RequiresPermissions("system:notice:view")
|
||||
@GetMapping("/notice2")
|
||||
public String notice2()
|
||||
{
|
||||
return prefix + "/notice2";
|
||||
}
|
||||
/**
|
||||
* 查询公告列表
|
||||
*/
|
||||
@ -65,6 +72,9 @@ public class SysNoticeController extends BaseController
|
||||
public String detail(@PathVariable Long noticeId, ModelMap mmap)
|
||||
{
|
||||
SysNotice notice = noticeService.selectNoticeById(noticeId);
|
||||
// 阅读状态
|
||||
notice.setReadStatus("1");
|
||||
noticeService.updateNotice(notice);
|
||||
mmap.put("notice", notice);
|
||||
return prefix + "/detail";
|
||||
}
|
||||
@ -127,4 +137,15 @@ public class SysNoticeController extends BaseController
|
||||
{
|
||||
return toAjax(noticeService.deleteNoticeByIds(ids));
|
||||
}
|
||||
|
||||
@GetMapping("/unreadCount")
|
||||
@ResponseBody
|
||||
public int getUnreadNoticeCount() {
|
||||
SysNotice notice = new SysNotice();
|
||||
notice.setUserId(getSysUser().getUserId());
|
||||
notice.setReadStatus("0");
|
||||
notice.setNoticeType("1");
|
||||
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||
return list.size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user