fix:修复Bug【69850】
站内信--点击查看后,当前条数据应该变成已读
This commit is contained in:
@@ -46,4 +46,14 @@ public class MessageController {
|
|||||||
return messageEntityService.allRead();
|
return messageEntityService.allRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已读
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("单条已读")
|
||||||
|
@GetMapping("/read/{id}")
|
||||||
|
public ResponseMessage readMessage(@PathVariable String id) {
|
||||||
|
return messageEntityService.readMessage(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,4 +33,11 @@ public interface IMessageService extends IService<MessageEntity> {
|
|||||||
* @param userIds
|
* @param userIds
|
||||||
*/
|
*/
|
||||||
void publishMessage(MessageEntity message, boolean toAllUser, List<String> userIds);
|
void publishMessage(MessageEntity message, boolean toAllUser, List<String> userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看站内信设置为已读
|
||||||
|
* @param messageId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
ResponseMessage readMessage(String messageId);
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-1
@@ -33,6 +33,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.adc.da.report.constant.MessageConstants.READ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ThinkBook
|
* @author ThinkBook
|
||||||
* @description 针对表【ts_message】的数据库操作Service实现
|
* @description 针对表【ts_message】的数据库操作Service实现
|
||||||
@@ -65,7 +67,7 @@ public class IMessageServiceImpl extends ServiceImpl<MessageDao, MessageEntity>
|
|||||||
LambdaUpdateWrapper<UserMessageEntity> wrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<UserMessageEntity> wrapper = new LambdaUpdateWrapper<>();
|
||||||
wrapper.eq(UserMessageEntity::getReadType, MessageConstants.UNREAD);
|
wrapper.eq(UserMessageEntity::getReadType, MessageConstants.UNREAD);
|
||||||
wrapper.eq(UserMessageEntity::getUserId, UserUtils.getUserId());
|
wrapper.eq(UserMessageEntity::getUserId, UserUtils.getUserId());
|
||||||
wrapper.set(UserMessageEntity::getReadType, MessageConstants.READ);
|
wrapper.set(UserMessageEntity::getReadType, READ);
|
||||||
userMessageService.update(wrapper);
|
userMessageService.update(wrapper);
|
||||||
return Result.success("全部已读");
|
return Result.success("全部已读");
|
||||||
}
|
}
|
||||||
@@ -101,6 +103,15 @@ public class IMessageServiceImpl extends ServiceImpl<MessageDao, MessageEntity>
|
|||||||
});
|
});
|
||||||
userMessageService.saveBatch(userMessageEntities);
|
userMessageService.saveBatch(userMessageEntities);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseMessage readMessage(String id) {
|
||||||
|
LambdaUpdateWrapper<UserMessageEntity> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
lambdaUpdateWrapper.eq(UserMessageEntity::getId, id);
|
||||||
|
lambdaUpdateWrapper.set(UserMessageEntity::getReadType, READ);
|
||||||
|
userMessageService.update(lambdaUpdateWrapper);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user