mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2026-03-11 02:55:04 +00:00
Lamdba Integration
Test Lamdbas with full pipeline of client through database
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -7,14 +8,14 @@ public class List {
|
||||
Integer itemID;
|
||||
String name;
|
||||
String owner;
|
||||
LocalDateTime lastUpdated;
|
||||
long lastUpdated;
|
||||
ArrayList<ItemEntry> entries;
|
||||
|
||||
public List(ResultSet listRow) throws SQLException {
|
||||
itemID = listRow.getInt(1);
|
||||
name = listRow.getString(2);
|
||||
owner = listRow.getString(3);
|
||||
lastUpdated = listRow.getObject(4, LocalDateTime.class);
|
||||
itemID = listRow.getInt("listID");
|
||||
name = listRow.getString("name");
|
||||
owner = listRow.getString("owner");
|
||||
lastUpdated = listRow.getTimestamp("lastUpdated").toInstant().toEpochMilli();
|
||||
entries = new ArrayList<>();
|
||||
}
|
||||
|
||||
@@ -22,6 +23,17 @@ public class List {
|
||||
entries.add(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "List{" +
|
||||
"itemID=" + itemID +
|
||||
", name='" + name + '\'' +
|
||||
", owner='" + owner + '\'' +
|
||||
", lastUpdated=" + lastUpdated +
|
||||
", entries=" + entries +
|
||||
'}';
|
||||
}
|
||||
|
||||
public ItemEntry[] getEntries() {
|
||||
return entries.toArray(new ItemEntry[entries.size()]);
|
||||
}
|
||||
@@ -50,11 +62,11 @@ public class List {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public LocalDateTime getLastUpdated() {
|
||||
public long getLastUpdated() {
|
||||
return lastUpdated;
|
||||
}
|
||||
|
||||
public void setLastUpdated(LocalDateTime lastUpdated) {
|
||||
public void setLastUpdated(long lastUpdated) {
|
||||
this.lastUpdated = lastUpdated;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user