| | |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.domain.model.LoginUser; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Log(title = "公告已读", businessType = BusinessType.UPDATE) |
| | | @PostMapping("readNotice") |
| | | public AjaxResult read(@RequestBody String json){ |
| | | JSONObject entries = JSONUtil.parseObj(json); |
| | | String noticeId = entries.getStr("noticeId"); |
| | | LambdaUpdateWrapper<SysNoticeUser> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.eq(SysNoticeUser::getNoticeId, noticeId); |
| | | wrapper.eq(SysNoticeUser::getUserId, getUserId()); |
| | | wrapper.set(SysNoticeUser::getIsRead, 1); |
| | | boolean update = sysNoticeUserService.update(wrapper); |
| | | if (update) { |
| | | return success(); |
| | | }else return error(); |
| | | } |
| | | |
| | | /** |
| | | * 修改通知公告 |
| | | */ |