complete user class
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package dev.database;
|
package dev.database;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
|
import java.sql.DriverManager;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class DatabaseConnection {
|
public class DatabaseConnection {
|
||||||
@@ -18,10 +19,7 @@ public class DatabaseConnection {
|
|||||||
public static Connection getConnection()
|
public static Connection getConnection()
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
|
|
||||||
// TODO:
|
return DriverManager.getConnection(URL, USER, PASSWORD);
|
||||||
// Return a valid PostgreSQL connection
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,28 @@
|
|||||||
package dev.model;
|
package dev.model;
|
||||||
|
|
||||||
public class User {
|
public class User {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
|
|
||||||
private String username;
|
private String username;
|
||||||
|
private String password; // holds the hash when loaded from DB
|
||||||
private String password;
|
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
public User() {}
|
||||||
|
|
||||||
|
public User(String username, String password, String email) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId(){ return id; }
|
||||||
|
public void setId(int id) { this.id = id; }
|
||||||
|
|
||||||
|
public String getUsername(){ return username; }
|
||||||
|
public void setUsername(String u){ this.username = u; }
|
||||||
|
|
||||||
|
public String getPassword() { return password; }
|
||||||
|
public void setPassword(String p){ this.password = p; }
|
||||||
|
|
||||||
|
public String getEmail(){ return email; }
|
||||||
|
public void setEmail(String e){ this.email = e; }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user