mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2025-12-13 09:48:47 +00:00
Make ListShareGET work
Fix absolute functionality-breaking bugs. There is still a fair amount of funkiness and lack of polish (such as having other and entried in the Lambda return). In addition, the NULL uiPositions that got put in the database may need cleaning up manually.
This commit is contained in:
parent
70195632f8
commit
8ecee59da9
@ -5,14 +5,53 @@ import java.util.ArrayList;
|
||||
public class ListShare {
|
||||
Integer listID;
|
||||
String shareWithEmail;
|
||||
Integer permissionLevel;
|
||||
Integer uiPosition;
|
||||
ArrayList<ListShare> other;
|
||||
|
||||
public ListShare(ResultSet listRow) throws SQLException {
|
||||
this.listID = listRow.getInt("listID");
|
||||
this.shareWithEmail = listRow.getString("userID");
|
||||
this.permissionLevel = listRow.getInt("permissionLevel");
|
||||
this.uiPosition = listRow.getInt("uiPosition");
|
||||
other = new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ListShare{" +
|
||||
"listID=" + listID +
|
||||
", shareWithEmail='" + shareWithEmail + '\'' +
|
||||
", permissionLevel=" + permissionLevel +
|
||||
", uiPosition=" + uiPosition +
|
||||
", other=" + other +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getPermissionLevel() {
|
||||
return permissionLevel;
|
||||
}
|
||||
|
||||
public void setPermissionLevel(Integer permissionLevel) {
|
||||
this.permissionLevel = permissionLevel;
|
||||
}
|
||||
|
||||
public Integer getUiPosition() {
|
||||
return uiPosition;
|
||||
}
|
||||
|
||||
public void setUiPosition(Integer uiPosition) {
|
||||
this.uiPosition = uiPosition;
|
||||
}
|
||||
|
||||
public ArrayList<ListShare> getOther() {
|
||||
return other;
|
||||
}
|
||||
|
||||
public void setOther(ArrayList<ListShare> other) {
|
||||
this.other = other;
|
||||
}
|
||||
|
||||
public Integer getListID() {
|
||||
return listID;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ public class ListShare {
|
||||
String shareWithEmail;
|
||||
final ListShare[] other;
|
||||
Integer permissionLevel;
|
||||
Integer uiPosition;
|
||||
private static final Map<Integer, String> keysToPerms;
|
||||
|
||||
static {
|
||||
@ -24,11 +25,17 @@ public class ListShare {
|
||||
keysToPerms = Collections.unmodifiableMap(keysToPermsTemp);
|
||||
}
|
||||
|
||||
public ListShare(Integer listID, String shareWithEmail, Integer permissionLevel, ListShare[] other) {
|
||||
public ListShare(Integer listID, String shareWithEmail, Integer permissionLevel, Integer uiPosition, ListShare[] other) {
|
||||
this.listID = listID;
|
||||
this.shareWithEmail = shareWithEmail;
|
||||
this.permissionLevel = permissionLevel;
|
||||
this.other = other;
|
||||
this.uiPosition = uiPosition;
|
||||
}
|
||||
|
||||
public ListShare(Integer listID, String shareWithEmail, String permissionsRaw, Integer uiPosition, ListShare[] other) {
|
||||
this(listID, shareWithEmail, permissionsRaw, other);
|
||||
this.uiPosition = uiPosition;
|
||||
}
|
||||
|
||||
public ListShare(Integer listID, String shareWithEmail, String permissionsRaw, ListShare[] other) {
|
||||
@ -42,6 +49,7 @@ public class ListShare {
|
||||
permissionLevel *= keytoPermEntry.getKey();
|
||||
}
|
||||
}
|
||||
this.uiPosition = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user