summaryrefslogtreecommitdiff
path: root/src/models.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/models.rs')
-rw-r--r--src/models.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs
new file mode 100644
index 0000000..8bee887
--- /dev/null
+++ b/src/models.rs
@@ -0,0 +1,26 @@
+use crate::schema::config;
+use crate::schema::users;
+
+#[derive(Insertable, Queryable)]
+#[table_name = "config"]
+pub struct Config<'a> {
+ pub strava_client_secret: &'a str,
+ pub strava_client_id: &'a str,
+ pub rocket_secret_key: &'a str,
+}
+
+#[derive(Insertable, Queryable)]
+#[table_name = "users"]
+pub struct User<'a> {
+ pub username: &'a str,
+ password: &'a str,
+}
+
+impl<'a> User<'a> {
+ pub fn new(username: &'a str, password: &'a str) -> User<'a> {
+ User {
+ username: username,
+ password: password,
+ }
+ }
+}