Skip to content

AlTriV/city_info_telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

city_info_telegram_bot

This project is a Telegram Bot that gives information (some tourist facts) about entered city.

Usage:

  1. Change your credential for connection to data base in application.properties file.
  2. Build project with maven to jar file.
  3. Start MySQL8 data base (use start script create_db.sql that you can find in this project's properties)
  4. Start jar file in your server with comand "java -jar city_info_telegram_bot-0.0.1-SNAPSHOT.jar"

REST Controle

You can add new cities and fact about them in DB using REST API:

  1. Get all cities in bot's DB
GET /cities
  1. Get city by id
GET /cities/{id}
  1. Add new city
POST /cities
{
  "name": "city_name"
}
  1. Update city
PUT /cities/{id}
{
  "name": "new_city_name"
}
  1. Delete city by id
DELETE /cities/{id}

Also yor can get, add, update, delete different facts about cities

  1. Add new fact about city
POST /cities/{id}/facts
{
  "fact": "fact_text"
}
  1. Get facts about city with id = {id}
GET /cities/{id}/facts
  1. Get fact with id = {fact_id} about city with id = {city_id}
GET /cities/{city_id}/facts/{fact_id}
  1. Update fact
PUT /cities/{city_id}/facts/{fact_id}
{
  "fact": "fact_text"
}
  1. Delete fact
DELETE /citie/{city_id}/facts/{fact_id}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages