Add the REST model to return an error or an message as a JSON.
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
package space.kklochko.spring_rest_example.models.rest;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class RestError {
|
||||||
|
public String error;
|
||||||
|
|
||||||
|
public RestError() {
|
||||||
|
error = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package space.kklochko.spring_rest_example.models.rest;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class RestMessage {
|
||||||
|
public String message;
|
||||||
|
|
||||||
|
public RestMessage() {
|
||||||
|
message = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user