|
|
@ -7,9 +7,9 @@ import app.entities.other.SteamID; |
|
|
|
import app.services.db.MessageService; |
|
|
|
import app.utils.SteamIDConverter; |
|
|
|
import jakarta.servlet.http.HttpServletRequest; |
|
|
|
import lombok.Data; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.http.HttpStatus; |
|
|
|
import org.springframework.http.MediaType; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -23,7 +23,7 @@ public class MessagesController { |
|
|
|
this.messageService = messageService; |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping |
|
|
|
@PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE}) |
|
|
|
@CheckWebAccess(auth_method = AuthMethod.STEAM64) |
|
|
|
@WaitAfterNext(order = "messages") |
|
|
|
public ResponseEntity getMessages(HttpServletRequest request, |
|
|
@ -35,7 +35,7 @@ public class MessagesController { |
|
|
|
return new ResponseEntity(messageService.getAllMessages(srv, filter==null?null:filter.getMessage(), offset, limit), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/account") |
|
|
|
@PostMapping(value = "/account", consumes = {MediaType.APPLICATION_JSON_VALUE}) |
|
|
|
@CheckWebAccess(auth_method = AuthMethod.STEAM64) |
|
|
|
@WaitAfterNext(order = "messages") |
|
|
|
public ResponseEntity getAccountMessages(HttpServletRequest request, |
|
|
@ -50,13 +50,4 @@ public class MessagesController { |
|
|
|
if (limit > 20) return new ResponseEntity(HttpStatus.NOT_ACCEPTABLE); |
|
|
|
return new ResponseEntity(messageService.getAccountMessages(steamID, srv, filter==null?null: filter.getMessage(), offset, limit), HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@Data |
|
|
|
public class Payload { |
|
|
|
public String message; |
|
|
|
Payload() {} |
|
|
|
public String getMessage() { |
|
|
|
return message==null||message.isEmpty()?null:message; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|