|
@ -5,7 +5,7 @@ import app.annotations.interfaces.CheckWebAccess; |
|
|
import app.annotations.interfaces.CollectStatistic; |
|
|
import app.annotations.interfaces.CollectStatistic; |
|
|
import app.annotations.interfaces.WaitAfterNext; |
|
|
import app.annotations.interfaces.WaitAfterNext; |
|
|
import app.entities.messages.Message; |
|
|
import app.entities.messages.Message; |
|
|
import app.entities.messages.MessageSearch; |
|
|
import app.entities.messages.MessageSearchFilter; |
|
|
import app.entities.other.SteamID; |
|
|
import app.entities.other.SteamID; |
|
|
import app.repositories.GametimeRepository; |
|
|
import app.repositories.GametimeRepository; |
|
|
import app.repositories.MessageRepository; |
|
|
import app.repositories.MessageRepository; |
|
@ -15,16 +15,12 @@ import app.utils.SteamIDConverter; |
|
|
import jakarta.servlet.http.HttpServletRequest; |
|
|
import jakarta.servlet.http.HttpServletRequest; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.data.domain.Page; |
|
|
import org.springframework.data.domain.Page; |
|
|
import org.springframework.data.domain.PageImpl; |
|
|
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
import org.springframework.data.domain.Pageable; |
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.http.HttpStatus; |
|
|
import org.springframework.http.MediaType; |
|
|
import org.springframework.http.MediaType; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* котроллер для пользователя, чтоб смотреть сообщения |
|
|
* котроллер для пользователя, чтоб смотреть сообщения |
|
|
*/ |
|
|
*/ |
|
@ -67,8 +63,8 @@ public class MessagesController { |
|
|
@WaitAfterNext(order = "messages") |
|
|
@WaitAfterNext(order = "messages") |
|
|
@CollectStatistic |
|
|
@CollectStatistic |
|
|
public Page<Message> getMessagesWithFilters(Pageable pageable, |
|
|
public Page<Message> getMessagesWithFilters(Pageable pageable, |
|
|
@RequestBody(required = false) MessageSearch filter) { |
|
|
@RequestBody(required = false) MessageSearchFilter filter) { |
|
|
if (filter == null) filter = new MessageSearch(); |
|
|
if (filter == null) filter = new MessageSearchFilter(); |
|
|
Page<Message> messages = messageRepository.getMessages( |
|
|
Page<Message> messages = messageRepository.getMessages( |
|
|
pageable, |
|
|
pageable, |
|
|
filter.getAccounts(profileService), |
|
|
filter.getAccounts(profileService), |
|
|