Browse Source

new db update 2 fix 4

master
gsd 1 year ago
parent
commit
ecd88737e5
  1. 15
      src/main/java/app/controllers/user/MessagesController.java
  2. 12
      src/main/java/app/controllers/user/Payload.java

15
src/main/java/app/controllers/user/MessagesController.java

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

12
src/main/java/app/controllers/user/Payload.java

@ -0,0 +1,12 @@
package app.controllers.user;
import lombok.Data;
@Data
public class Payload {
public String message;
Payload() {}
public String getMessage() {
return message==null||message.isEmpty()?null:message;
}
}
Loading…
Cancel
Save