optimize sendUserMessage

main
wangqing 12 months ago
parent eeb9ea361b
commit e0de8f8677

@ -13,7 +13,7 @@ public interface UserMessageDao extends MongoRepository<UserMessage,String> {
List<UserMessage> findAllByUserId(String userId);
Page<UserMessage> findByUserId(String userId, Pageable pageable);
Page<UserMessage> findByUserIdOrderBySendTimeDesc(String userId, Pageable pageable);
}

@ -53,7 +53,7 @@ public class UserMessageService {
PageRequest pageRequest = PageRequest.of(page-1,size);
return userMessageDao.findByUserId(userId,pageRequest);
return userMessageDao.findByUserIdOrderBySendTimeDesc(userId,pageRequest);
}

Loading…
Cancel
Save