Giter Site home page Giter Site logo

employee-backend's Introduction

Tech Stack

  • Spring Boot
  • PostgreSQL

How to Run the Project

Using GitHub

  1. Clone the repository:

    git clone https://github.com/RickyParte/Employee-Backend.git
  2. Create a database using pgAdmin or DBeaver with the name employee.

  3. Update the database configuration in the application.properties file:

    spring.datasource.url=jdbc:postgresql://localhost:5432/employee?currentSchema=employee
    spring.datasource.username=postgres
    spring.datasource.password=admin
  4. Run the project and check if it is working fine.

Using Deployed Server

  1. Access the deployed server at deployed_link.

  2. Test APIs using Postman or Swagger.

Using Zip

  1. Extract the folder and open it in your favorite IDE.

  2. Create a database using pgAdmin or DBeaver with the name employee.

  3. Update the database configuration in the application.properties file as mentioned above.

  4. Run the project and check if it is working fine.

API Documentation

Add Employee

  • Endpoint: POST /api/employee/add-employee
  • Request URL: localhost:8080/api/employee/add-employee
  • Request Body:
    {
      "employeeName": "Ricky Parte Email",
      "phoneNumber": "892500075",
      "email": "[email protected]",
      "reportsTo": "c971cfd3-fa8a-4c58-93c7-1c93f5916e34",
      "profileImage": "null"
    }
  • Response:
  • CURL
    curl --location 'localhost:8080/api/employee/add-employee' \
       --header 'Content-Type: application/json' \
       --data-raw '{
          "employeeName": "Ricky Parte Email",
          "phoneNumber": "892500075",
          "email": "[email protected]",
          "reportsTo": "c971cfd3-fa8a-4c58-93c7-1c93f5916e34",
          "profileImage": "null"
       }'
    

Get All Employees

  • Endpoint: GET /api/employee/get-employees
  • Request URL: localhost:8080/api/employee/get-employees
  • Response:
    • CURL
       curl --location 'localhost:8080/api/employee/get-employees'
    

Delete Employee By ID

  • Endpoint: POST /api/employee/delete-employee-by-id
  • Request URL: localhost:8080/api/employee/delete-employee-by-id
  • Request Header: employeeId -> value of employeeId
  • Response:
  • CURL
    curl --location --request POST 'localhost:8080/api/employee/delete-employee-by-id' \
     --header 'employeeId: 9bafd606-732e-4076-8c34-c5e5e632b07f'
    

Update Employee

  • Endpoint: POST /api/employee/update-employee/{employeeId}
  • Request URL: localhost:8080/api/employee/update-employee/{employeeId}
  • Request Body:
    {
      "employeeName": "Ricky Parte Work",
      "phoneNumber": "4568536948",
      "email": "[email protected]",
      "reportsTo": "null",
      "profileImage": "null"
    }
  • Response:
  • CURL
      curl --location 'localhost:8080/api/employee/update-employee/f9be16f7-00f3-48f9-b255-b867193cac23' \
     --header 'Content-Type: application/json' \
     --data-raw '{
     "employeeName": "Ricky Parte Work",
     "phoneNumber": "4568536948",
     "email": "[email protected]",
     "reportsTo": "null",
     "profileImage": "null"
     }'
    

Get Nth Manager

  • Endpoint: POST /api/employee/get-nth-manager
  • Request URL: localhost:8080/api/employee/get-nth-manager
  • Request Header:
    • employeeId -> value of employeeId
    • managerLevel -> value of level
  • Response:
  • CURL
    curl --location --request POST 'localhost:8080/api/employee/get-nth-manager' \
     --header 'employeeId: c971cfd3-fa8a-4c58-93c7-1c93f5916e34' \
     --header 'managerLevel: 4' \
     --data ''
    

Get Employee With Pagination

  • Endpoint: GET /api/employee/get-all-employees
  • Request URL: localhost:8080/api/employee/get-all-employees?page=0&size=5&sort=employeeName
  • Request Param: page=0&size=5&sort=employeeName
  • Response:
  • CURL
    curl --location 'localhost:8080/api/employee/get-all-employees?page=0&size=5&sort=employeeName'
    
# ALL TASK ARE DONE PLEASE REVIEW IT 
# IF ANY THING REQURED PLEASE MAIL ON [email protected]

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.