Git Product home page Git Product logo

bookconferencerestapp's Introduction

BookConferenceRestApp

Rest app for booking conference rooms, and user management.

Installing with Maven

mvn clean install

Rest API

All endpoints has prefix /api

Example: localhost:8080/api/user/available

User

Endpoint: /user

  • /available
    • method: GET
    • url params: none
    • data params: none
    • Success response:
      • Code: 200
        Content: json array
        example: [{"name":"John","surname":"Smith","login":"jsmith"},{"name":"Jane","surname":"Doe","login":"jdoe"}]
  • /create
    • method: POST
    • headers: x-api-key: admin password
    • url params: none
    • data params: UserCreateDTO object
      example: { "name": "Mark", "surname": "Bloom", "login": "mbloom", "password": "qazwsx" }
    • Success response:
      • Code: 200
        Content: {"success":true,"message":"User created successfully.","errors":null}
    • Error response:
      • Code: 500
        Content: { "timestamp": "2018-12-24T12:46:53.826+0000", "status": 500, "error": "Internal Server Error", "message": "createUser.userCreateDTO.login: must not be blank", "path": "/api/user/create" }
      • Code: 200
        Content: { "success": false, "message": "Login is already taken.", "errors": null }
  • /edit
    • method: PUT
    • headers: x-api-key: admin password
    • url params: none
    • data params: UserEditDTO object
      example: { "name": "John", "surname": "Bloom", "login": "mbloom", "password": "123456" }
    • Success response:
      • Code: 200
        Content: {"success":true,"message":"User edited successfully.","errors":null}
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "User not found login: msmith" ] }
        OR
      • Code: 500
        Content: { "timestamp": "2018-12-24T12:57:07.103+0000", "status": 500, "error": "Internal Server Error", "message": "editUser.userEditDTO.login: must not be blank", "path": "/api/user/edit" }
  • /delete
    • method: DELETE
    • headers: x-api-key: admin password
    • url params: userLogin
      example: userLogin=jsmith
    • data params: none
    • Success response:
      • Code: 200
        Content: { "success": true, "message": "User deleted successfully.", "errors": null }
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "User not found login: json" ] }

Endpoint: /room

  • /available
    • method: GET
    • url params: none
    • data params: none
    • Success response:
      • Code: 200
        Content: json array
        example: [ { "name": "Large Room", "locationDescription": "1st floor", "numberOfSeats": 10, "hasProjector": true, "phone": "22-22-22-22" }, { "name": "Medium Room", "locationDescription": "1st floor", "numberOfSeats": 6, "hasProjector": true, "phone": "" } ]
  • /create
    • method: POST
    • headers: x-api-key: admin password
    • url params: none
    • data params: RoomCreateDTO object
      example: { "name": "Largest Room", "locationDescription": "3rd floor", "numberOfSeats": 14, "hasProjector": false, "phone": "123-456-789" }
    • Success response:
      • Code: 200
        Content: { "success": true, "message": "Room created successfully.", "errors": null }
    • Error response:
      • Code: 500
        Content: { "timestamp": "2018-12-24T13:03:34.993+0000", "status": 500, "error": "Internal Server Error", "message": "createRoom.roomCreateDTO.numberOfSeats: must not be null", "path": "/api/room/create" }
      • Code 200
        Content: { "success": false, "message": "Name is already taken.", "errors": null }
  • /edit
    • method: PUT
    • headers: x-api-key: admin password
    • url params: none
    • data params: RoomEditDTO object
      example: { "name": "Largest Room", "locationDescription": "3rd floor", "numberOfSeats": 14, "hasProjector": true, "phone": "987-654-321" }
    • Success response:
      • Code: 200
        Content: {"success":true,"message":"Room edited successfully.","errors":null}
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "Room not found name: Largesst Room" ] }
      • Code: 500
        Content: { "timestamp": "2018-12-24T13:07:31.246+0000", "status": 500, "error": "Internal Server Error", "message": "editRoom.roomEditDTO.name: must not be blank", "path": "/api/room/edit" }
  • /delete
    • method: DELETE
    • headers: x-api-key: admin password
    • url params: roomName
      example: roomName=Large Room
    • data params: none
    • Success response:
      • Code: 200
        Content: { "success": true, "message": "Room deleted successfully.", "errors": null }
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "Room not found name: room small" ] }

Endpoint: /book

  • /

    • method: POST
    • url params: none
    • data params: BookingCreateDTO object
      example: { "login": "jdoe", "password": "mySecret", "room": "Large Room", "dateFrom": "2018-12-24 16:30:00", "dateTo": "2018-12-24 18:30:00" }
    • Success response:
      • Code: 200
        Content: { "success": true, "message": "Successfully booked room.", "errors": null }
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Bad login credentials.", "errors": null } *Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "Room not found name: Large Rsoom" ] }
      • Code: 200
        Content: { "success": false, "message": "Date to must be later than date from.", "errors": null }
      • Code: 500
        Content: { "timestamp": "2018-12-24T13:19:33.777+0000", "status": 500, "error": "Internal Server Error", "message": "bookRoom.bookingCreateDTO.dateTo: must not be null", "path": "/api/book" }
  • /all

    • method: GET
    • url params: dateFrom (optional), dateTo (optional)
    • data params: none
    • Success response:
      • Code: 200
        Content: json array
        example: [ { "user": { "name": "Jane", "surname": "Doe" }, "room": { "name": "Large Room" }, "dateFrom": "2018-12-24 16:30:00", "dateTo": "2018-12-24 18:30:00" }, { "user": { "name": "John", "surname": "Smith" }, "room": { "name": "Medium Room" }, "dateFrom": "2018-12-24 16:30:00", "dateTo": "2018-12-24 18:30:00" } ]
  • /user

    • method: GET
    • url params: userName (required), dateFrom (optional), dateTo (optional)
    • data params: none
    • Success response:
      • Code: 200
        Content: json array
        example: [ { "user": { "name": "John", "surname": "Smith" }, "room": { "name": "Medium Room" }, "dateFrom": "2018-12-24 16:30:00", "dateTo": "2018-12-24 18:30:00" } ]
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "User not found name: Jake" ] }
  • /room

    • method: GET
    • url params: roomName (required), dateFrom (optional), dateTo (optional)
    • data params: none
    • Success response:
      • Code: 200
        Content: json array
        example: [ { "user": { "name": "Jane", "surname": "Doe" }, "room": { "name": "Large Room" }, "dateFrom": "2018-12-24 16:30:00", "dateTo": "2018-12-24 18:30:00" } ]
    • Error response:
      • Code: 200
        Content: { "success": false, "message": "Error occurred", "errors": [ "Room not found name: Largse Room" ] }

Models

  • UserCreateDTO

    • name: string
    • surname: string
    • login: string
    • password: string
  • UserEditDTO

    • name: string
    • surname: string
    • login: string
    • password: string
  • RoomCreateDTO

    • name: string
    • lcationDescription: string
    • numberOfSeats: number
    • hasProjector: boolean
    • phone: string
  • RoomEditDTO

    • name: string
    • lcationDescription: string
    • numberOfSeats: number
    • hasProjector: boolean
    • phone: string
  • BookingCreateDTO

    • login: string
    • password: string
    • room: string
    • dateFrom: LocalDateTime
    • dateTo: LocalDateTime

bookconferencerestapp's People

Contributors

bieluk avatar

Watchers

James Cloos 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.