fix: 微信小程序接口对接修改。

This commit is contained in:
tianyongbao
2026-01-12 00:33:59 +08:00
parent e8fbb37062
commit 750e5351b3
13 changed files with 531 additions and 25 deletions

View File

@@ -65,4 +65,20 @@ public interface IMessageWarnService {
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
/**
* 已读一条消息
*
* @param id 消息ID
* @return 是否成功
*/
Boolean readMessage(Long id);
/**
* 已读全部消息
*
* @param userId 用户ID
* @return 是否成功
*/
Boolean readAllMessages(Long userId);
}

View File

@@ -197,4 +197,38 @@ public class MessageWarnServiceImpl implements IMessageWarnService {
}
return baseMapper.deleteByIds(ids) > 0;
}
/**
* 已读一条消息
*
* @param id 消息ID
* @return 是否成功
*/
@Override
public Boolean readMessage(Long id) {
MessageWarn messageWarn = baseMapper.selectById(id);
if (messageWarn == null) {
return false;
}
messageWarn.setIsRead(1);
return baseMapper.updateById(messageWarn) > 0;
}
/**
* 已读全部消息
*
* @param userId 用户ID
* @return 是否成功
*/
@Override
public Boolean readAllMessages(Long userId) {
MessageWarn update = new MessageWarn();
update.setIsRead(1);
LambdaQueryWrapper<MessageWarn> wrapper = Wrappers.lambdaQuery(MessageWarn.class)
.eq(MessageWarn::getUserId, userId)
.eq(MessageWarn::getIsRead, 0);
return baseMapper.update(update, wrapper) > 0;
}
}