- PostgreSQL
- Python 3.9
- Libraries & Frameworks
python -m pip install wheel
python -m pip install flask
python -m pip install jwt
python -m pip install psycopg2
python -m pip install cryptography
psql -h localhost -p 5432 -d postgres -U postgres
- Connect to the database
psql -h <host> -p <port> -d <db_name> -U <user>
- Insert password
<password>
- Execute data.sql
\i data.sql;
- Modify registAdmins.py
# [ [username, password, email], ... ]
admins = [
["username1", "password1", "e@mail1.com"],
["username2", "password2", "e@mail2.com"],
...
]
- Execute Script
python3 registAdmins.py
POST http://localhost:8080/dbproj/user
{
"username": "maria",
"email": "maria@email.com",
"password": "password"
}
PUT http://localhost:8080/dbproj/user
{
"username": "mara",
"password": "password"
}
POST http://localhost:8080/dbproj/leilao
{
"artigoId": 69,
"precoMinimo": 10000.00,
"titulo": "Lingote de ouro",
"descricao": "Ouro puro (24 quilates)",
"dataFim": "2021-06-10 23:59"
}
GET http://localhost:8080/dbproj/leiloes
GET http://localhost:8080/dbproj/leiloes/{keyword}
GET http://localhost:8080/dbproj/leilao/{leilaoId}
GET http://localhost:8080/dbproj/user/leiloes
POST http://localhost:8080/dbproj/licitar/{leilaoId}/{licitacao}
PUT http://localhost:8080/dbproj/leilao/{leilaoId}
{
"titulo": "Agua do Mondegoo",
"descricao": "Agua fresca do rio Mondegoo"
}
POST http://localhost:8080/dbproj/feed/{leilaoId}
{
"message": "O que justifica o preco do artigo?",
"type": "question"
}
GET http://localhost:8080/dbproj/inbox
PUT http://localhost:8080/dbproj/leilao/checkFinish
PUT http://localhost:8080/dbproj/leilao/cancel/{leilaoId}
PUT http://localhost:8080/dbproj/ban/{username}
GET http://localhost:8080/dbproj/stats