Code Monkey home page Code Monkey logo

utnphones's Introduction

Trabajo Practico Integrador : Programacion Avanzada I & Base de Datos II

Build API Restful for a phonelines company using Spring MVC, JPA y Mysql.

Steps to Setup

1. Clone the application

git clone https://github.com/abelacu95/UTNPhones.git

2. Create Mysql database

create database utn_phones
  • run src/main/resources/schema/mysql/utn-phones.sql

3. Change mysql username and password as per your installation

  • open src/main/resources/application.properties
  • change spring.datasource.username and spring.datasource.password as per your mysql installation

The app will start running at http://localhost:8080

Explore Rest APIs

The app defines following CRUD APIs.

Auth

Method Url Decription Sample Valid Request Body
POST /api/login Login JSON
POST /api/logout Logout

Backoffice - Clients

Method Url Description Sample Valid Request Body
GET /api/backoffice/clients Get all clients
GET /api/backoffice/clients/{dni} Get client by dni
POST /api/backoffice/clients Add client JSON
PUT /api/backoffice/clients/{dni} Update client by dni JSON
DELETE /api/backoffice/clients/{dni} Delete client by dni

Backoffice - PhoneLines

Method Url Description Sample Valid Request Body
GET /api/backoffice/phone-lines Get all phone lines
GET /api/backoffice/phone-lines/{dni} Get phone lines by dni
POST /api/backoffice/clients/{dni}/phone-lines Add phone line by client dni JSON
PUT /api/backoffice/phone-lines/{id} Enabled phone lines by id
DELETE /api/backoffice/phone-lines/{id} Diabled phone lines by id

Backoffice - Tariffs

Method Url Description Sample Valid Request Body
POST /api/backoffice/tariffs Add tariff JSON
GET /api/backoffice/tariffs Get all tariffs

Backoffice - Calls - Bills

Method Url Description Sample Valid Request Body
GET /api/backoffice/clients/{dni}/calls Get calls by client dni
GET /api/backoffice/clients/{dni}/bills Get bills by client dni

Calls

Method Url Description Sample Valid Request Body
POST /api/calls Add call JSON

Web

Method Url Description Sample Valid Request Body
GET /api/web/calls?from=05/12/2019&to=26/06/2020 Get calls by dates range
GET /api/web/bills?from=01/05/2020&to=30/06/2020 Get bills by dates range
GET /api/web/cities/top-10/calls Get TOP 10 destination most called

Test them using postman or any other rest client.

Sample Valid JSON Request Bodys

{
	"dni": "123456789",
	"password": "1234pwd"
}
{
    "cityId" : 32,
    "firstname" : "Name",
    "lastname" : "LastName",
    "dni" : "123456789",
    "password": "1234pwd",
    "typeLine" : "mobile"
}
{
    "cityId" : 4,
    "firstname" : "Name",
    "lastname" : "LastName"
}
{
    "dni":"12345678",
    "typeLine":"mobile"
}
{
    "costPrice": 3.5,
    "price": 7.3,
    "cityOriginId":4,
    "cityDestinationId":32
}
{
	"numberOrigin":"02234919872",
	"numberDestination":"22678263806",
	"duration":19,
	"date":"03/05/2020"	
}

utnphones's People

Contributors

abakudev avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.