This project is a Telegram Bot that gives information (some tourist facts) about entered city.
- Change your credential for connection to data base in application.properties file.
- Build project with maven to jar file.
- Start MySQL8 data base (use start script create_db.sql that you can find in this project's properties)
- Start jar file in your server with comand "java -jar city_info_telegram_bot-0.0.1-SNAPSHOT.jar"
You can add new cities and fact about them in DB using REST API:
- Get all cities in bot's DB
GET /cities
- Get city by id
GET /cities/{id}
- Add new city
POST /cities
{
"name": "city_name"
}
- Update city
PUT /cities/{id}
{
"name": "new_city_name"
}
- Delete city by id
DELETE /cities/{id}
Also yor can get, add, update, delete different facts about cities
- Add new fact about city
POST /cities/{id}/facts
{
"fact": "fact_text"
}
- Get facts about city with id = {id}
GET /cities/{id}/facts
- Get fact with id = {fact_id} about city with id = {city_id}
GET /cities/{city_id}/facts/{fact_id}
- Update fact
PUT /cities/{city_id}/facts/{fact_id}
{
"fact": "fact_text"
}
- Delete fact
DELETE /citie/{city_id}/facts/{fact_id}