Coder Social home page Coder Social logo

restserviceapispringboot's Introduction

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":"[email protected]",
"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/[email protected]
Return single application on offer for candidate

PUT http://localhost:8080/jobs/{jobTitle}/applications/{candidateEmail}/change/{status}
PUT http://localhost:8080/jobs/job1/applications/[email protected]/change/INVITED
Change the status of particular job

restserviceapispringboot's People

Contributors

rizwan-ishtiaq 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.