通知中心修改
This commit is contained in:
parent
4c15fc12d2
commit
4b9587bae5
|
|
@ -50,7 +50,7 @@ public class SyncNoticeController {
|
|||
|
||||
|
||||
/**
|
||||
* 已读消息
|
||||
* 已读消息, 不传递已读所有
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PutMapping("/read")
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@ public class SyncNoticeReadDTO {
|
|||
/**
|
||||
* 消息id
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<Long> noticeIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ public class SyncNoticeServiceImpl extends ServiceImpl<SyncNoticeMapper, SyncNot
|
|||
|
||||
@Override
|
||||
public Boolean read(Long shopId, SyncNoticeReadDTO syncNoticeReadDTO) {
|
||||
if (syncNoticeReadDTO.getNoticeIdList() == null || syncNoticeReadDTO.getNoticeIdList().isEmpty()) {
|
||||
return updateChain().eq(SyncNotice::getShopId, shopId).set(SyncNotice::getIsRead, 1).set(SyncNotice::getReadTime, DateUtil.date().toLocalDateTime()).update();
|
||||
}
|
||||
List<SyncNotice> listed = list(new QueryWrapper().eq(SyncNotice::getShopId, shopId).in(SyncNotice::getId, syncNoticeReadDTO.getNoticeIdList()));
|
||||
listed.forEach(item -> {
|
||||
if (item.getIsRead() == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue