This commit is contained in:
@ -1,29 +0,0 @@
|
||||
package cc.fascinated.model.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@Getter @AllArgsConstructor
|
||||
public class Response {
|
||||
|
||||
/**
|
||||
* The status code of this error.
|
||||
*/
|
||||
private HttpStatus status;
|
||||
|
||||
/**
|
||||
* The message of this error.
|
||||
*/
|
||||
private String message;
|
||||
|
||||
/**
|
||||
* Gets this response as a {@link ResponseEntity}.
|
||||
*
|
||||
* @return the response entity
|
||||
*/
|
||||
public ResponseEntity<?> toResponseEntity() {
|
||||
return new ResponseEntity<>(this, status);
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cc.fascinated.model.response.impl;
|
||||
|
||||
import cc.fascinated.model.response.Response;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
public class InvalidPartResponse extends Response {
|
||||
|
||||
public InvalidPartResponse() {
|
||||
super(HttpStatus.NOT_FOUND, "Invalid part name.");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package cc.fascinated.model.response.impl;
|
||||
|
||||
import cc.fascinated.model.response.Response;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
public class PlayerNotFoundResponse extends Response {
|
||||
|
||||
public PlayerNotFoundResponse() {
|
||||
super(HttpStatus.NOT_FOUND, "Player not found.");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user