Renaming project to json-api for clarity sake

This commit is contained in:
shockrah 2021-01-24 13:34:17 -08:00
parent 84c865e194
commit b67bb6105f
52 changed files with 83 additions and 2 deletions

25
json-api/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Client Tests",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/client-tests/client.py",
"console": "integratedTerminal"
},
{
"type": "lldb",
"request": "launch",
"name": "(Linux) Debug",
"program": "${workspaceFolder}/target/debug/freechat-server",
"args": [
"-s"
],
"cwd": "${workspaceFolder}"
}
]
}

View File

@ -1,6 +1,6 @@
[package]
name = "freechat-server"
version = "0.1.0"
name = "json-api"
version = "0.2.0"
authors = ["shockrah <alejandros714@protonmail.com>"]
edition = "2018"

2
json-api/hmac.secret Normal file
View File

@ -0,0 +1,2 @@
bïò<EFBFBD>Cˆ'BIŸ¬%©b»jˆ]<>Ž¥µH>ŒŒ$ ° æúϦwÙY攘#ÂýÐ
4O¶>'ŸÉ“

54
json-api/src/schema.rs Normal file
View File

@ -0,0 +1,54 @@
table! {
channels (id) {
id -> Unsigned<Bigint>,
name -> Varchar,
description -> Nullable<Varchar>,
kind -> Integer,
}
}
table! {
invites (id) {
id -> Bigint,
uses -> Nullable<Bigint>,
expires -> Bool,
}
}
table! {
jwt (id) {
id -> Unsigned<Bigint>,
token -> Varchar,
}
}
table! {
members (id, secret) {
id -> Unsigned<Bigint>,
secret -> Varchar,
name -> Varchar,
joindate -> Bigint,
status -> Integer,
permissions -> Unsigned<Bigint>,
}
}
table! {
messages (id) {
id -> Unsigned<Bigint>,
time -> Bigint,
content -> Varchar,
author_id -> Unsigned<Bigint>,
channel_id -> Unsigned<Bigint>,
}
}
joinable!(messages -> channels (channel_id));
allow_tables_to_appear_in_same_query!(
channels,
invites,
jwt,
members,
messages,
);