Code Monkey home page Code Monkey logo

java-webemployees's Introduction

Java Web Employees

A student that completes this project shows that they can:

  • Use IntelliJ in the following areas: application creation, code entry, and code execution
  • Explain the uses of and differences between Maven, Spring, and Tomcat
  • Build a REST service using Spring Boot
  • Use and implement inversion of control and dependency injection with Spring
  • Implement Beans throughout the Beans’ lifecycle controlling the Beans using annotations
  • Produce a complete application following the Maven Phases

Introduction

The purpose of this application is to show how to use Maven, Spring, and Tomcat together to produce a functioning Rest API Backend system. This system does NOT make use of a database, in favor of storing all of its data in an arraylist. The application initializes this arraylist and provides a few endpoints in order to read the data from that list.

Data Layout

The arraylist contains Employee objects.

Fields of the employee objects include

  • Employee id
  • Employee first name
  • Employee last name
  • Employee Salary
  • A flag saying whether or not the employee has a 401K Plan
  • Id number of the employee's company
  • Id number of the employee's health plan

No relationships exist between employee and other objects.

This application works with employee data that is stored inside an arraylist.

Using the provided seed data, the given endpoint will produce the stated output. Expand each endpoint to see its correct output.

http://localhost:2019/data/allemployees
[
    {
        "id": 3,
        "fname": "John",
        "lname": "Jones ",
        "salary": 75000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "John Jones "
    },
    {
        "id": 2,
        "fname": "Sam",
        "lname": "Ford",
        "salary": 80000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Sam Ford"
    },
    {
        "id": 1,
        "fname": "Steve",
        "lname": "Green",
        "salary": 45000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Steve Green"
    }
]
http://localhost:2019/data/employee/2
{
    "id": 2,
    "fname": "Sam",
    "lname": "Ford",
    "salary": 80000.0,
    "has401k": true,
    "companyID": 1,
    "healthPlanID": 1,
    "name": "Sam Ford"
}
http://localhost:2019/data/employees/s
[
    {
        "id": 2,
        "fname": "Sam",
        "lname": "Ford",
        "salary": 80000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Sam Ford"
    },
    {
        "id": 1,
        "fname": "Steve",
        "lname": "Green",
        "salary": 45000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Steve Green"
    }
]
http://localhost:2019/data/sortedemployees/s
[
    {
        "id": 1,
        "fname": "Steve",
        "lname": "Green",
        "salary": 45000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Steve Green"
    },
    {
        "id": 2,
        "fname": "Sam",
        "lname": "Ford",
        "salary": 80000.0,
        "has401k": true,
        "companyID": 1,
        "healthPlanID": 1,
        "name": "Sam Ford"
    }
]
http://localhost:2019/calc/salary/1/0.05
{
    "id": 1,
    "fname": "Steve",
    "lname": "Green",
    "salary": 47250.0,
    "has401k": true,
    "companyID": 1,
    "healthPlanID": 1,
    "name": "Steve Green"
}

java-webemployees's People

Contributors

jrmmba8314 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.