|
4 | 4 | import io.swagger.v3.oas.annotations.tags.Tag; |
5 | 5 | import kuchat.server.common.response.BaseResponse; |
6 | 6 | import kuchat.server.domain.auth.argumentResolver.Auth; |
| 7 | +import kuchat.server.domain.chat.Chat; |
7 | 8 | import kuchat.server.domain.chat.dto.ChatResponses; |
8 | 9 | import kuchat.server.domain.chat.dto.CreateChatRequest; |
9 | 10 | import kuchat.server.domain.chat.dto.RecentMessageResponse; |
|
18 | 19 | import org.springframework.data.domain.PageRequest; |
19 | 20 | import org.springframework.data.domain.Pageable; |
20 | 21 | import org.springframework.data.domain.Sort; |
| 22 | +import org.springframework.data.web.PageableDefault; |
21 | 23 | import org.springframework.http.ResponseEntity; |
22 | 24 | import org.springframework.validation.BindingResult; |
23 | 25 | import org.springframework.validation.annotation.Validated; |
24 | 26 | import org.springframework.web.bind.annotation.*; |
25 | 27 |
|
| 28 | +import java.net.URLDecoder; |
26 | 29 | import java.util.List; |
27 | 30 |
|
28 | 31 | import static kuchat.server.common.response.BaseResponseStatus.SUCCESS; |
@@ -74,10 +77,10 @@ public ResponseEntity<BaseResponse> exit(@Auth Member member, @PathVariable("cha |
74 | 77 | public ResponseEntity<ChatResponses> getChatList(@Auth Member member, |
75 | 78 | @RequestParam(defaultValue = "0") int page, |
76 | 79 | @RequestParam(defaultValue = "30") int size, |
77 | | - @RequestParam(defaultValue = "") String name) { |
| 80 | + @RequestParam(defaultValue = "") String name){ |
78 | 81 | log.info("[getChatList] 채팅방 목록 조회 , 검색 키워드 = {}", name); |
79 | 82 | Pageable pageable = PageRequest.of( |
80 | | - page, ValidatorUtil.sizeValidator(size), Sort.Direction.DESC, "createdDate"); |
| 83 | + page, ValidatorUtil.sizeValidator(size), Sort.Direction.DESC, "modifiedDate"); |
81 | 84 | ChatResponses response = chatService.getChatList(member, name, pageable); |
82 | 85 | return ResponseEntity.ok(response); |
83 | 86 | } |
|
0 commit comments