mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Add migratedFromID
property to GetDocResult
This commit is contained in:
parent
859a4b03b3
commit
19075f18bc
1 changed files with 24 additions and 1 deletions
|
@ -19,6 +19,7 @@ public class GetDocResult extends Result {
|
|||
|
||||
private int error;
|
||||
private int versionID;
|
||||
private String migratedFromID;
|
||||
private String createdAt;
|
||||
private WLUser user;
|
||||
|
||||
|
@ -37,7 +38,8 @@ public class GetDocResult extends Result {
|
|||
int versionID,
|
||||
String createdAt,
|
||||
String email,
|
||||
String name
|
||||
String name,
|
||||
String migratedFromID
|
||||
) {
|
||||
if (error == null) {
|
||||
this.error = -1;
|
||||
|
@ -47,6 +49,17 @@ public class GetDocResult extends Result {
|
|||
this.versionID = versionID;
|
||||
this.createdAt = createdAt;
|
||||
this.user = new WLUser(name, email);
|
||||
this.migratedFromID = migratedFromID;
|
||||
}
|
||||
|
||||
public GetDocResult(
|
||||
JsonElement error,
|
||||
int versionID,
|
||||
String createdAt,
|
||||
String email,
|
||||
String name
|
||||
) {
|
||||
this(error, versionID, createdAt, email, name, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,6 +72,9 @@ public class GetDocResult extends Result {
|
|||
latestVerBy.addProperty("email", getEmail());
|
||||
latestVerBy.addProperty("name", getName());
|
||||
jsonThis.add("latestVerBy", latestVerBy);
|
||||
if (migratedFromID != null) {
|
||||
jsonThis.addProperty("migratedFromId", migratedFromID);
|
||||
}
|
||||
} else {
|
||||
jsonThis.addProperty("status", error);
|
||||
String message;
|
||||
|
@ -93,6 +109,11 @@ public class GetDocResult extends Result {
|
|||
} else {
|
||||
versionID = jsonObject.get("latestVerId").getAsInt();
|
||||
createdAt = jsonObject.get("latestVerAt").getAsString();
|
||||
if (jsonObject.has("migratedFromId")) {
|
||||
migratedFromID = jsonObject.get("migratedFromId").getAsString();
|
||||
} else {
|
||||
migratedFromID = null;
|
||||
}
|
||||
String name = null;
|
||||
String email = null;
|
||||
JsonElement latestVerBy = jsonObject.get("latestVerBy");
|
||||
|
@ -126,4 +147,6 @@ public class GetDocResult extends Result {
|
|||
return user.getEmail();
|
||||
}
|
||||
|
||||
public String getMigratedFromID() { return migratedFromID; }
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue