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