From 64e37fcbb8743bba58d8b60f088d8cea0a544644 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Tue, 21 Jun 2022 19:09:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E8=AF=86=E6=89=80=E6=9C=89=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB=E8=B5=84=E6=BA=90=E4=B8=BA=E5=B7=B2=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/notice/controller/SysNoticeController.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/renren-admin/src/main/java/io/renren/modules/notice/controller/SysNoticeController.java b/renren-admin/src/main/java/io/renren/modules/notice/controller/SysNoticeController.java index 93de6ddf..cb7bf161 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/controller/SysNoticeController.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/controller/SysNoticeController.java @@ -18,6 +18,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; @@ -37,6 +38,8 @@ public class SysNoticeController { private SysNoticeService sysNoticeService; @Autowired private SysNoticeUserService sysNoticeUserService; + @Autowired + private JdbcTemplate jdbcTemplate; @GetMapping("page") @ApiOperation("分页") @@ -92,6 +95,13 @@ public class SysNoticeController { return new Result(); } + @PutMapping("mynotice/readall") + @ApiOperation("标记我的所有未读通知为已读") + public Result readAll() { + jdbcTemplate.update(String.format("UPDATE sys_notice_user SET read_status = 1,read_date =NOW() WHERE receiver_id = %s AND read_status = 0;"), SecurityUser.getUserId().toString()); + return new Result(); + } + @GetMapping("mynotice/unread") @ApiOperation("我的通知未读数") public Result unRead() {