Skip to content
Snippets Groups Projects
Commit cf9b0f1e authored by Sven Kästle's avatar Sven Kästle
Browse files

refactor: Adjust annotation patch and post request

parent be5e4395
No related branches found
No related tags found
No related merge requests found
......@@ -7,28 +7,39 @@ package unipotsdam.gf.modules.annotation.model;
public class AnnotationPatchRequest {
// variables
private String body;
private String title;
private String comment;
// constructors
public AnnotationPatchRequest(String body) {
this.body = body;
public AnnotationPatchRequest(String title, String comment) {
this.title = title;
this.comment = comment;
}
public AnnotationPatchRequest() {}
// methods
public String getBody() {
return body;
public String getTitle() {
return title;
}
public void setBody(String body) {
this.body = body;
public void setTitle(String title) {
this.title = title;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
@Override
public String toString() {
return "AnnotationPatchRequest{" +
"body='" + body + '\'' +
"title='" + title + '\'' +
", comment='" + comment + '\'' +
'}';
}
......
......@@ -7,31 +7,27 @@ package unipotsdam.gf.modules.annotation.model;
public class AnnotationPostRequest {
// variables
private int userId;
private String userToken;
private int targetId;
private String body;
private int startCharacter;
private int endCharacter;
private AnnotationBody body;
// constructors
public AnnotationPostRequest(int userId, int targetId, String body, int startCharacter, int endCharacter) {
this.userId = userId;
public AnnotationPostRequest(String userToken, int targetId, AnnotationBody body) {
this.userToken = userToken;
this.targetId = targetId;
this.body = body;
this.startCharacter = startCharacter;
this.endCharacter = endCharacter;
}
public AnnotationPostRequest() {
}
// methods
public int getUserId() {
return userId;
public String getUserToken() {
return userToken;
}
public void setUserId(int userId) {
this.userId = userId;
public void setUserToken(String userToken) {
this.userToken = userToken;
}
public int getTargetId() {
......@@ -42,38 +38,21 @@ public class AnnotationPostRequest {
this.targetId = targetId;
}
public String getBody() {
public AnnotationBody getBody() {
return body;
}
public void setBody(String body) {
public void setBody(AnnotationBody body) {
this.body = body;
}
public int getStartCharacter() {
return startCharacter;
}
public void setStartCharacter(int startCharacter) {
this.startCharacter = startCharacter;
}
public int getEndCharacter() {
return endCharacter;
}
public void setEndCharacter(int endCharacter) {
this.endCharacter = endCharacter;
}
@Override
public String toString() {
return "AnnotationPostRequest{" +
"userId=" + userId +
"userToken='" + userToken + '\'' +
", targetId=" + targetId +
", body='" + body + '\'' +
", startCharacter=" + startCharacter +
", endCharacter=" + endCharacter +
", body=" + body.toString() +
'}';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment