Git Product home page Git Product logo

java-rest-example's Introduction

Build Status

REST Example

This repository includes a basic REST API built with Jersey and Spring framework and for demonstration purposes.

Run and Test

To run the application type

mvn spring-boot:run

To execute unit and acceptance tests

mvn test

For unit tests and acceptance tests JUnit and REST Assured frameworks are used.

Endpoints

Important: Content-Type: application/json header must be present to use API.

The most common HTTP status codes are returned when there is an error.

Add a transaction

/transactionservice/transactions/{id} [POST]

Content-Type: application/json

{
    "amount": double,
    "type": string
    "parent_id": long|null
}

When succeeed 201 Status code and newly created transaction object are returned.

Get a transaction

/transactionservice/transactions/{id} [GET]

Gets a transaction with given id.

Get sum amount a transaction

/transactionservice/transactions/{id}/sum [GET]

Gets the total amount of transactions whose parent is the transaction with id {id}

Get transactions with a given type

/transactionservice/types/{type} [GET]

Gets ID's of the transactions with given type.

java-rest-example's People

Contributors

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