Skip to content

πŸ¦„ UNIST λ²„μŠ€ κ°„νŽΈ 쑰회 μ„œλΉ„μŠ€ 🚌

Notifications You must be signed in to change notification settings

HalfBind/UNIST-BusMate-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

96 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🚌 UNIST λ²„μŠ€λ©”μ΄νŠΈ

Alt text UNIST ν•™λ‚΄ κ΅¬μ„±μ›λ“€μ˜ λ²„μŠ€ 이용 어렀움을 ν•΄μ†Œν•˜κΈ° μœ„ν•΄, 기쑴의 λ³΅μž‘ν•œ μšΈμ‚° λ²„μŠ€μ •λ³΄λ₯Ό κ°„νŽΈνžˆ μ΄μš©ν•  수 μžˆλŠ” λ²„μŠ€ μœ ν‹Έλ¦¬ν‹° μ„œλΉ„μŠ€μž…λ‹ˆλ‹€.

Features

Bus

This feature provides several functionalities related to bus information.

  • Route number-based bus information search
  • Bus information search based on route number and departure time
  • Bus information search based on route number and direction
  • Bus information search based on route number, direction, and departure time

Destination Info

This feature provides several functionalities related to bus arrival information.

  • Search bus arrival information based on destination
  • Search bus arrival information based on destination and departure time
  • Search bus arrival information based on destination and desired arrival time
  • Search bus arrival information based on destination, desired arrival time, and departure time

Bookmark

This feature provides several functionalities for bus bookmarking.

  • Create a bookmark
  • Retrieve bookmarks
  • Delete a bookmark

REST APIs

Bus

  • GET /buses/{routeNumber}

    Retrieves bus information based on the route number.

  • GET /buses/{routeNumber}?departureTime={departureTime}

    Retrieves bus information based on the route number and departure time.

  • GET /buses/{routeNumber}/{routeDirection}

    Retrieves bus information based on the route number and direction.

  • GET /buses/{routeNumber}/{routeDirection}?departureTime={departureTime}

    Retrieves bus information based on the route number, direction, and departure time.

Destination Info

  • GET /destinationInfo/{destination}

    Retrieves bus arrival information based on the destination.

  • GET /destinationInfo/{destination}?departureTime={departureTime}

    Retrieves bus arrival information based on the destination and departure time.

  • GET /destinationInfo/{destination}/until/{arrivalTime}

    Retrieves bus arrival information based on the destination and desired arrival time.

  • GET /destinationInfo/{destination}/until/{arrivalTime}?departureTime={departureTime}

    Retrieves bus arrival information based on the destination, desired arrival time, and departure time.

Bookmark

  • GET /bookmarks/{userName}

    Retrieves bookmarks for the specified user.

  • POST /bookmarks

    Creates a new bookmark. (Requires a JSON payload containing busId, userName, and days)

  • DELETE /bookmarks/{bookmarkId}

    Deletes the specified bookmark.

Examples of API usage (with curl)

Bus

  • GET /buses/{routeNumber}
curl -X GET "http://localhost:8080/buses/133"

Expected output:

[
		{
				"routeNumber": "133",
				"routeDirection": "KKOTBAWI",
				"departureTime": "05:00",
				"destinations":["GUYEONG_RI", "ULSAN_TERMINAL"]
		}, ...
]
  • GET /buses/{routeNumber}?departureTime={departureTime}
curl -X GET "http://localhost:8080/buses/133?departureTime=12:00"

Expected output:

[
		{
				"routeNumber": "133",
				"routeDirection": "KKOTBAWI",
				"departureTime": "12:15",
				"destinations":["GUYEONG_RI", "ULSAN_TERMINAL"]
		}, ...
]
  • GET /buses/{routeNumber}/{routeDirection}
curl -X GET "http://localhost:8080/buses/133/KKOTBAWI"

Expected output:

[
  {
    "routeNumber": "133",
    "routeDirection": "KKOTBAWI",
    "departureTime": "05:00",
    "destinations":["GUYEONG_RI", "ULSAN_TERMINAL"]
  }, ...
]
  • GET /buses/{routeNumber}/{routeDirection}?departureTime={departureTime}
curl -X GET "http://localhost:8080/buses/133/KKOTBAWI?departureTime=12:00"

Expected output:

[
  {
    "routeNumber": "133",
    "routeDirection": "KKOTBAWI",
    "departureTime": "12:15",
    "destinations":["GUYEONG_RI", "ULSAN_TERMINAL"]
  }, ...
]

Destination Information

  • GET /destinationInfo/{destination}
curl -X GET "http://localhost:8080/destinationInfos/GUYEONG_RI"

Expected output:

[
  {
    "routeNumber": "133",
    "routeDirection": "KKOTBAWI",
    "departureTime": "05:00",
    "destination": "GUYEONG_RI",
    "arrivalTime": "05:10"
  }, ...
]
  • GET /destinationInfo/{destination}?departureTime={departureTime}
curl -X GET "http://localhost:8080/destinationInfos/GUYEONG_RI?departureTime=12:00"

Expected output:

[
  {
    "routeNumber": "133",
    "routeDirection": "KKOTBAWI",
    "departureTime": "12:15",
    "destination": "GUYEONG_RI",
    "arrivalTime": "12:25"
  }, ...
]
  • GET /destinationInfo/{destination}/until/{arrivalTime}
curl -X GET "http://localhost:8080/destinationInfos/GUYEONG_RI/until/12:16"

Expected output:

[
  {
    "routeNumber": "133",
    "routeDirection": "KKOTBAWI",
    "departureTime": "05:00",
    "destination": "GUYEONG_RI",
    "arrivalTime": "05:10"
  }, ...
]
  • GET /destinationInfo/{destination}/until/{arrivalTime}?departureTime={departureTime}
curl -X GET "http://localhost:8080/destinationInfos/GUYEONG_RI/until/12:16?departureTime=12:00"

Expected output:

[
  {
    "routeNumber": "733",
    "routeDirection": "DEOKHA_GARAGE",
    "departureTime": "12:00",
    "destination": "GUYEONG_RI",
    "arrivalTime": "12:10"
  },
  {
    "routeNumber": "337",
    "routeDirection": "TAEWHA_RIVER",
    "departureTime": "12:00",
    "destination": "GUYEONG_RI",
    "arrivalTime": "12:10"
  }
]

Bookmark

  • GET /bookmarks/{userName}
curl -X GET "http://localhost:8080/bookmarks/Gibeom"

Expected output: (If the target bookmark exists. i. e. After run example of POST method)

[
  {
    "userName": "Gibeom",
    "days":["SUN"],
    "busInfo": {
      "routeNumber": "733",
      "routeDirection": "DEOKHA_GARAGE",
      "departureTime": "19:30",
      "destinations": [
        "GUYEONG_RI",   "ULSAN_UNIVERSITY","SINBOK_ROTARY",
        "SEONGNAM",
        "SAMSAN"
      ]
    }
  }
]

If bookmark not exists, return status 404.

  • POST /bookmarks
curl -X POST "http://localhost:8080/bookmarks" \
		-H "Content-Type: application/json" \
		-d '{"busId": 124, "userName": "Gibeom", "days": ["SUN"]}'

Expected output:

{
  "userName": "Gibeom",
  "days":["SUN"],
  "busInfo": {
    "routeNumber": "733",
    "routeDirection": "DEOKHA_GARAGE",
    "departureTime": "19:30",
    "destinations": [
      "GUYEONG_RI",
      "ULSAN_UNIVERSITY",
      "SINBOK_ROTARY",
      "SEONGNAM",
      "SAMSAN"
    ]
  }
}
  • DELETE /bookmarks/{bookmarkId}
curl -X DELETE "http://localhost:8080/bookmarks/0"

Expected output:

  • No content. If the bookmark is successfully deleted, return status 204.

About

πŸ¦„ UNIST λ²„μŠ€ κ°„νŽΈ 쑰회 μ„œλΉ„μŠ€ 🚌

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages