Skip to content

rizwan-ishtiaq/RestServiceApiSpringBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

RestServiceApiSpringBoot

Rest Service Api with Spring Boot (demo)

In memory Service that handles a (very simple) recruiting process. The process requires two types of objects: job offers and applications from candidates.

Offer

  • jobTitle (unique)
  • startDate
  • numberOfApplications

Application

  • related offer
  • candidate email (unique per Offer)
  • resume text
  • applicationStatus (APPLIED, INVITED, REJECTED, HIRED)

OPERATIONS

  • Create a job offer and read a single and list all offers
  • Apply for an job offer
  • Read one and list all applications per offer
  • Change progress / status of an application
  • Track the number of applications
  • Status change triggers a notification

Run Project

  1. This is simple maven project
  2. Download or Clone project
  3. Goto project root directory
  4. mvn spring-boot:run
  5. http://localhost:8080/

End points

Method Endpoint URL Description
GET / show All the Endpoints
GET /jobs List all offers
POST /jobs Add new offer
GET /jobs/{jobTitle} Get Single job
GET /jobs/{jobTitle}/applications List all application on offer
POST /jobs/{jobTitle}/applications Apply candidate application
GET /jobs/{jobTitle}/applications/{candidateEmail} Return single application on offer for candidate
PUT /jobs/{jobTitle}/applications/{candidateEmail}/change/{status} Change the status of particular job

Technology Stack

  • REST API
  • java 1.8
  • Spring Boot 1.5.9
  • Spring 4.3.13
  • maven
  • Junit
  • mockito
  • Spring Test
  • JSON (jackson)
  • JAVAX Validation

Usage

For consuming service one can use firefox or chorme extension search for REST service testing

set request header
Content-Type=application/json;charset=UTF-8

GET http://localhost:8080/
Will Return all the endpoints in JSON

POST http://localhost:8080/jobs
Add new offer (use following body)
{"jobTitle":"job1"}

GET http://localhost:8080/jobs
List all offers

GET http://localhost:8080/jobs/{jobTitle}
GET http://localhost:8080/jobs/job1
Get Single job

POST http://localhost:8080/jobs/{jobTitle}/applications
POST http://localhost:8080/jobs/job1/applications
Apply candidate application (use following body)
{
"candidateEmail":"rizwan@mail.com",
"resumeText":"This is my resume"
}

GET http://localhost:8080/jobs/{jobTitle}/applications
GET http://localhost:8080/jobs/job1/applications
List all application on offer

GET http://localhost:8080/jobs/{jobTitle}/applications/{candidateEmail}
GET http://localhost:8080/jobs/job1/applications/rizwan@mail.com
Return single application on offer for candidate

PUT http://localhost:8080/jobs/{jobTitle}/applications/{candidateEmail}/change/{status}
PUT http://localhost:8080/jobs/job1/applications/rizwan@mail.com/change/INVITED
Change the status of particular job

About

Rest Service Api with Spring Boot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages