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": "john.doe@example.com"
    }
    

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": "john.doe@example.com"
          },
          {
              "id": 2,
              "firstName": "Jane",
              "lastName": "Smith",
              "mobileNumber": "987-654-3210",
              "email": "jane.smith@example.com"
          }
      ]

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": "john.doe@example.com"
      }

Update Employee

  • URL: /api/update/{id}
  • Method: PUT
  • Path Variable: id (long)
  • Request Body:
    {
        "firstName": "John",
        "lastName": "Doe",
        "mobileNumber": "123-456-7890",
        "email": "john.doe@example.com"
    }
    

Delete Employee

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

Releases

No releases published

Packages

No packages published

Languages