Code Monkey home page Code Monkey logo

2110215-libreserve-api's Introduction

2110215 LibReserve API

This repo is API backend for 2110215 ProgMeth project (Engineer, Chula 101). using Java(Javafx) for UI and javascript mongoDB for backend

endpoint

http://218.199.216.159:3721

API

structure

[[ Data ]] = {
  username:  { type: String, required: true },
  startTime: { type: Number, required: true },
  endTime:   { type: Number, required: true },
  position:  { type: String, required: true }
}

* Time value = Time / 60 Hour + Time % 60 Minute
  eg. 510
    = 510 mn
    = 8 * 60 mn + 30 mn
    = 8 hr + 30 mn
    = 8:30

GET /table

get full table from BigGroup (eg. A, B, C) and SmallGroup (eg. A1, A2, B1)

# A = A1 ∪ A2 ∪ A3 ∪ A4 ...
{
  A:  [Data, Data, ...],
  A1: [Data, Data, ...],
  A2: [Data, Data, ...],
  A3: [Data, Data, ...],
  B:  [Data, Data, ...],
  B1: [Data, Data, ...],
  B2: [Data, Data, ...],
  B3: [Data, Data, ...],
  ...
}

GET /table/:pos

get datas in specific position accept BigGroup and SmallGroup

/table/A1 = [Data, Data, ...]
/table/A  = A1 + A2 + A3 + A4 + ...

GET /add

add data on query string to database.

* require field
/add
  ? username=*
  & startTime=*
  & endTime=*
  & position=*

eg. GET /add?username=MrRock&startTime=510&endTime=600&position=A13

GET /remove

remove all data that match given parameter

/remove
  ? username=
  & startTime=
  & endTime=
  & position=

eg. GET /remove?position=A13
eg. GET /remove?username=MrRock&endTime=600

GET /history/:username

return all data which Data.username = username

/history/:username = [Data, Data, Data, ...]

2110215-libreserve-api's People

Contributors

krist7599555 avatar

Watchers

 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.