feat: don't use shared models for prns

The shared models will eventually contain every field in the database,
but prns.cc only needs the fields they currently have, so to cut down on
memory usage it shouldn't use the shared models.
This commit is contained in:
sam 2023-07-28 21:01:36 +02:00
parent ca138efc8f
commit ccd546759b
No known key found for this signature in database
GPG Key ID: B4EF20DDE721CAA1
2 changed files with 17 additions and 1 deletions

View File

@ -1,8 +1,10 @@
use pronouns::models::{member::Member, user::User}; pub mod models;
use rocket::{response::Redirect, Config, State}; use rocket::{response::Redirect, Config, State};
use simple_logger; use simple_logger;
use sqlx::{postgres::PgPoolOptions, Pool, Postgres}; use sqlx::{postgres::PgPoolOptions, Pool, Postgres};
use std::{env, path::PathBuf}; use std::{env, path::PathBuf};
use crate::models::{User, Member};
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;

14
prns/src/models.rs Normal file
View File

@ -0,0 +1,14 @@
#[derive(Debug)]
pub struct User {
pub id: String,
pub sid: String,
pub username: String,
}
#[derive(Debug)]
pub struct Member {
pub id: String,
pub user_id: String,
pub sid: String,
pub name: String,
}