diff options
| author | Melonai <einebeere@gmail.com> | 2021-01-11 11:38:26 +0100 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-01-11 11:38:26 +0100 |
| commit | fa1189658a911db852ba974a7382509fb4ffbb7c (patch) | |
| tree | 5637553e1909f863ef6cf78c86116abb218d0fa5 /server/src/types.rs | |
| parent | 5539abe770da491087afcd7dd1ccba1bf8f60631 (diff) | |
| download | shorest-fa1189658a911db852ba974a7382509fb4ffbb7c.tar.zst shorest-fa1189658a911db852ba974a7382509fb4ffbb7c.zip | |
Fully split client and server
Diffstat (limited to 'server/src/types.rs')
| -rw-r--r-- | server/src/types.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/server/src/types.rs b/server/src/types.rs new file mode 100644 index 0000000..0a4926e --- /dev/null +++ b/server/src/types.rs @@ -0,0 +1,27 @@ +use diesel::PgConnection; +use diesel::r2d2::{ConnectionManager, Pool}; +use crate::schema::links; + +#[derive(Debug, Deserialize)] +pub struct UserData { + pub url: String +} + +#[derive(Debug, Serialize)] +pub struct UserResponse { + pub hash: String +} + +#[derive(Debug, Serialize)] +pub struct ErrorResponse { + pub error: String +} + +#[derive(Queryable, Insertable)] +#[table_name="links"] +pub struct Entry { + pub hash: String, + pub url: String +} + +pub type PoolState = Pool<ConnectionManager<PgConnection>>; \ No newline at end of file |
