Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

API SharedTimetables

Subeen Park edited this page Mar 19, 2023 · 2 revisions

GET /v1/shared-tables/

μœ μ €κ°€ κ°€μ§„ κ³΅μœ μ‹œκ°„ν‘œ λͺ©λ‘μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€.

OUTPUT (Example)

[
    {
        "id": "6416fa5cf874ed393bed983d",
        "title": "μ–˜λŠ” κ³§ μ‚­μ œν• κ±°μž„",
        "created_at": "2023-03-19T21:04:44.664",
        "updated_at": "2023-03-19T21:04:44.664",
        "is_valid": true
    },
    {
        "id": "6416fa79f874ed393bed983e",
        "title": "gongyou",
        "created_at": "2023-03-19T21:05:13.146",
        "updated_at": "2023-03-19T21:05:13.146",
        "is_valid": true
    }
]

POST /v1/shared-tables/

κ³΅μœ μ‹œκ°„ν‘œλ₯Ό μƒˆλ‘œ μƒμ„±ν•©λ‹ˆλ‹€.


body

name description example
title 곡유 μ‹œκ°„ν‘œμ˜ 제λͺ© λ•‘λ–™ μ‹œκ°„ν‘œ
timetable_id μ‹œκ°„ν‘œ id 641c656(곡유 λ§ν¬λ‘œλΆ€ν„° ν΄λΌμ΄μ–ΈνŠΈκ°€ 얻은 κ°’)

Output

성곡 μ‹œ 200이 λ‚΄λ €μ˜΅λ‹ˆλ‹€. μ‹€νŒ¨μ‹œ μ μ ˆν•œ http status code와 ν•¨κ»˜ { errcode: string, message: string }

SHARED_TIME_TABLE_ALREADY_EXISTS(HttpStatus.BAD_REQUEST, 40004, "이미 κ³΅μœ μ‹œκ°„ν‘œμ— μ‘΄μž¬ν•˜λŠ” timetableIdμž…λ‹ˆλ‹€.", "이미 μΆ”κ°€λœ κ³΅μœ μ‹œκ°„ν‘œμž…λ‹ˆλ‹€.")
TIMETABLE_NOT_FOUND(HttpStatus.NOT_FOUND, 40400, "timetable_idκ°€ μœ νš¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€", "μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” μ‹œκ°„ν‘œμž…λ‹ˆλ‹€.")

GET shared-tables/:id/

ν•΄λ‹Ή 곡유 μ‹œκ°„ν‘œμ˜ 정보λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€.

Output

{
    "id": "641327e66d785a4ab83f7af4",
    "user_id": "63941ce102cbe6001047d1bf",
    "title": "μ§„μ§œ κ³΅μœ λ°›μ€ μ‹œκ°„νŽ΄ μ΄λ¦„λ°”κΏˆ",
    "timetable": {
        "_id": "641325ed0537a3001683c649",
        "userId": "641325e2df48c83154b793b6",
        "year": 2023,
        "semester": 1,
        "lectures": [
            {
                "_id": "64132ab70537a3001683c653",
                "academic_year": "3ν•™λ…„",
                "category": "",
                "class_time": "μ›”(1-2)/수(1-2)",
                "real_class_time": "μ›”(09:00~10:50)/수(09:00~10:50)",
                "class_time_json": [
                    {
                        "_id": "64132ab70537a3001683c655",
                        "day": 0,
                        "place": "302-208",
                        "start_time": "09:00",
                        "end_time": "10:50",
                        "len": 2.0,
                        "start": 1.0
                    },
                    {
                        "_id": "64132ab70537a3001683c654",
                        "day": 2,
                        "place": "302-310-2",
                        "start_time": "09:00",
                        "end_time": "10:50",
                        "len": 2.0,
                        "start": 1.0
                    }
                ],
                "class_time_mask": [
                    251658240,
                    0,
                    251658240,
                    0,
                    0,
                    0,
                    0
                ],
                "classification": "μ „μ„ ",
                "credit": 3,
                "department": "컴퓨터곡학뢀",
                "instructor": "유승주",
                "lecture_number": "001",
                "quota": 50,
                "remark": "β“”",
                "course_number": "4190.309A",
                "course_title": "ν•˜λ“œμ›¨μ–΄μ‹œμŠ€ν…œμ„€κ³„",
                "color": null,
                "color_index": 2
            }
        ],
        "title": "μ§„μ§œ κ³΅μœ ν•  μ‹œκ°„ν‘œ",
        "theme": 0,
        "updatedAt": "2023-03-16T14:41:59.182Z"
    }
}

PUT shared-tables/:id/

곡유 μ‹œκ°„ν‘œ 제λͺ©μ„ μˆ˜μ •ν•©λ‹ˆλ‹€.

body

name description example
title 곡유 μ‹œκ°„ν‘œμ˜ 제λͺ© μƒˆλ‘œμš΄ 제λͺ©

Output

성곡 μ‹œ 200이 λ‚΄λ €μ˜΅λ‹ˆλ‹€. μ‹€νŒ¨μ‹œ μ μ ˆν•œ http status code와 ν•¨κ»˜ { errcode: string, message: string }


DELETE shared-tables/:id/

κ³΅μœ μ‹œκ°„ν‘œλ₯Ό μ‚­μ œν•©λ‹ˆλ‹€.

Output

μ‚­μ œλœ lectureκ°€ 있던 ν˜„μž¬ ν…Œμ΄λΈ” 객체λ₯Ό λ°˜ν™˜ν•©λ‹ˆλ‹€. μœ„ GET tables/:id/ μ°Έκ³ . μ‹€νŒ¨μ‹œ μ μ ˆν•œ http status code와 ν•¨κ»˜ { errcode: string, message: string }

SHARED_TIMETABLE_NOT_FOUND(HttpStatus.NOT_FOUND, 40401, "shared_timetable_idκ°€ μœ νš¨ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€", "μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” κ³΅μœ μ‹œκ°„ν‘œμž…λ‹ˆλ‹€.")
NOT_SHARED_TIMETABLE_OWNER(HttpStatus.BAD_REQUEST, 40003, "λ‚΄ shared timetable이 μ•„λ‹™λ‹ˆλ‹€.", "λ‚΄ κ³΅μœ μ‹œκ°„ν‘œκ°€ μ•„λ‹ˆλ©΄ μ‚­μ œν•  수 μ—†μŠ΅λ‹ˆλ‹€."),

Clone this wiki locally