Skip to content

devparthgarg/Employee-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee-Management-System

REST API using Spring Boot

alt text

This document provides an overview of the Employee Management API, including endpoints, request/response formats, and example curl commands for each operation.

Table of Contents

  1. Introduction
  2. Endpoints

Introduction

The Employee Management API allows for creating, retrieving, updating, and deleting employee records. This API is implemented using Spring Boot and provides a set of RESTful endpoints to manage employee data.

Endpoints

Create Employee

  • URL: /api/create
  • Method: POST
  • Status Code: 201 Created
  • Request Body:
    {
        "firstName": "John",
        "lastName": "Doe",
        "mobileNumber": "123-456-7890",
        "email": "[email protected]"
    }
    

Get All Employees

  • URL: /api/get/all
  • Method: GET
  • Response:
    • Status: 200 OK
    • Body:
      [
          {
              "id": 1,
              "firstName": "John",
              "lastName": "Doe",
              "mobileNumber": "123-456-7890",
              "email": "[email protected]"
          },
          {
              "id": 2,
              "firstName": "Jane",
              "lastName": "Smith",
              "mobileNumber": "987-654-3210",
              "email": "[email protected]"
          }
      ]

Get Employee by ID

  • URL: /api/get/{id}
  • Method: GET
  • Path Variable: id (long)
  • Response:
    • Status: 200 OK
    • Body:
      {
          "id": 1,
          "firstName": "John",
          "lastName": "Doe",
          "mobileNumber": "123-456-7890",
          "email": "[email protected]"
      }

Update Employee

  • URL: /api/update/{id}
  • Method: PUT
  • Path Variable: id (long)
  • Request Body:
    {
        "firstName": "John",
        "lastName": "Doe",
        "mobileNumber": "123-456-7890",
        "email": "[email protected]"
    }
    

Delete Employee

  • URL: /api/delete/{id}
  • Method: DELETE
  • Path Variable: id (long)
  • Response:
    • Status: 200 OK
    • Body:
      "Employee Record Deleted for ID: 1"

About

REST APIs using Java, Spring Boot & MySQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages