Giter VIP home page Giter VIP logo

calculation-test's Introduction

Introduction

This is the mathematics calculation. Currently it supports addition, subtraction, multiplication and division.

  • This is the spring boot restful application.
  • Gradle is being used to build this service.
  • lombok is being used to build all the java classes.

How to run this application

  • Navigate the the root folder /calculation-test under the command line

  • run the below gradle command to build the whole project: gradle clean install

  • run the below gradle command to start the spring boot application: gradle bootRun

How to access the spring boot restful application

  • You may use postman or soapUI to access the endpoint The endpoint providing the calculation function is exposed. The details is as follows:
    URL: /calculation
    METHOD: POST
    PAYLOAD: { "operand1":4.7, "operation":"+", "operand2":2 }
    ContentType: application/json
    Accept: application/json

Advantages of this application

Super easy to extend functions

If you want to add one more calculation let's say Modulo function, There is nothing to do at all except add one class which just simply implements the interface FunctionInterface. All the other business logic can be reused.

All the exceptions are handle in one place

When we develop our business logic classes, we just simply need to throw the exception directly. Don't need to worries about how to handle it in our main business logic. All the exceptions are handled in ControllerExceptionHandler class.

Lombok makes our life easier

Lombok is being used to make our java classes are much simpler and easy to change. It automatically generates getter,setter, constructor, hashcode etc.

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.