Giter Site home page Giter Site logo

ganeshan102 / spring-boot-booking-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from danielmichalski/spring-boot-booking-service

0.0 0.0 0.0 134 KB

The project aims to present how to build a Java API with Spring Boot, MyBatis, Lombok, and H2.

Java 100.00%

spring-boot-booking-service's Introduction

Property booking service

This is a property booking service with ability to book and block properties.

Table of Contents

Prerequisites

Running the application

On Windows

## Build application using Maven Wrapper
mvnw.cmd clean install

## Run Spring boot application using Maven Wrapper or simply run Application class
mvnw.cmd spring-boot:run

On MacOS/ Linux

## Build application using Maven Wrapper
./mvnw clean install

## Run Spring boot application using Maven Wrapper or simply run Application class
./mvnw spring-boot:run

Testing the API

Bookings

1. Create booking

curl -d '{
  "guestFirstName": "John",
  "guestLastName": "Travolta",
  "startDate": "2027-12-03T00:00:00Z",
  "endDate": "2027-12-06T00:00:00Z"
}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/bookings

2. Update booking

curl -d '{
  "guestFirstName": "Denis_updated",
  "guestLastName": "Carey_updated",
  "startDate": "2025-12-07T00:00:00Z",
  "endDate": "2025-12-08T00:00:00Z"
}' -H "Content-Type: application/json" -X PUT http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/bookings/cdd88bcb-8fc7-4a39-822c-e514150d769e

3. Delete booking

curl -X DELETE http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/bookings/5299e50c-4de4-4d76-95df-412552a9fe38

Property blocks

1. Create property block

curl -d '{
  "startDate": "2023-12-12T00:00:00Z",
  "endDate": "2023-12-15T00:00:00Z"
}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/blocks

2. Update property block

curl -d '{
  "guestFirstName": "Denis_updated",
  "guestLastName": "Carey_updated",
  "startDate": "2025-12-07T00:00:00Z",
  "endDate": "2025-12-08T00:00:00Z"
}' -H "Content-Type: application/json" -X PUT http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/blocks/2e8d11c2-3c7e-4dd8-9714-dd2e5968b4ed

3. Delete property block

curl -X DELETE http://localhost:8080/api/properties/6c5d63b4-d776-4a9a-a5ac-06244ebfbcdf/blocks/49122e5e-7983-447d-a340-03c4a774bae3

spring-boot-booking-service's People

Contributors

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