@ -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);