2019-04-25 23:52:17 +02:00
|
|
|
use super::schema::subscriptions;
|
2019-04-02 01:02:13 +02:00
|
|
|
|
|
|
|
#[derive(Queryable)]
|
|
|
|
pub struct Subscription {
|
|
|
|
pub id: i32,
|
|
|
|
pub callback: String,
|
|
|
|
pub topic: String,
|
|
|
|
pub sec: String,
|
|
|
|
pub created_at: i32,
|
2019-04-25 23:52:17 +02:00
|
|
|
pub expires_at: i32,
|
2019-04-02 01:02:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Insertable)]
|
2019-04-25 23:52:17 +02:00
|
|
|
#[table_name = "subscriptions"]
|
2019-04-02 01:02:13 +02:00
|
|
|
pub struct NewSubscription<'a> {
|
|
|
|
pub callback: &'a str,
|
|
|
|
pub topic: &'a str,
|
|
|
|
pub sec: &'a str,
|
|
|
|
pub created_at: &'a i32,
|
2019-04-25 23:52:17 +02:00
|
|
|
pub expires_at: &'a i32,
|
2019-04-02 01:02:13 +02:00
|
|
|
}
|