> For the complete documentation index, see [llms.txt](https://doongu.gitbook.io/pk_select/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doongu.gitbook.io/pk_select/project-design/api-document.md).

# API Document

API문서 입니다, REST API 에 근거하여 작성합니다.

API 기본 틀을 작성 중이며 REST API에 맞게 작성하고자 한다.

## PKSelcter Login API

<mark style="color:green;">`POST`</mark> `https://pkselecter.url/login`

This is the api used when the users login

#### Request Body

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| pk\_user\_id | string | 사용자의 LMS ID |
| pk\_user\_pw | string | 사용자의 LMS PW |

{% tabs %}
{% tab title="200  입력한 로그인 데이터가 포털에 로그인이 되고, 데이터를 정상적으로 가져오는 경우 프론트에 "200" 반환 해당 예시는 과목이 "데이터베이스", "과제 구현 및 평가", "프로그래밍언어론"인 경우임." %}

```javascript
{
  "status": 200,
  "subject": [
    "[가상]과제구현및평가(캡스톤디자인Ⅱ)(105)",
    "[가상]데이터베이스(101)",
    "[가상]데이터베이스응용(102)",
    "[가상]데이터처리Ⅱ(102)",
    "[가상]리눅스프로그래밍(101)",
    "[가상]소프트웨어공학(102)",
    "[가상]시스템프로그래밍(102)",
    "[가상]프로그래밍언어론(101)",
    "[부경대]2021RUN&LEARN부경팀프로젝트(01)"
  ],
  "lms_data": [
    {
      "subject_name": "[가상]과제구현및평가(캡스톤디자인Ⅱ)(105)",
      "class": "과제",
      "context": "학술발표논문제출(10월17일까지)",
      "date_deadline": "2021.10.17 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스(101)",
      "class": "수업",
      "context": "1차시 DB01-1",
      "date_deadline": "2021.09.07 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스응용(102)",
      "class": "수업",
      "context": "1차시 교재 5 장. ER을 이용한 데이터 모델링 (이론부분)",
      "date_deadline": "2021.10.12 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스응용(102)",
      "class": "수업",
      "context": "2차시 교재 3~4장 복습 (실습부분)",
      "date_deadline": "2021.10.12 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스응용(102)",
      "class": "수업",
      "context": "3차시 교재 3~4장 복습 (실습부분)",
      "date_deadline": "2021.10.12 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스응용(102)",
      "class": "과제",
      "context": "6주차 과제",
      "date_deadline": "2021.10.13 오후 11:59"
    },
    {
      "subject_name": "[가상]데이터베이스응용(102)",
      "class": "시험",
      "context": "5장 정리 퀴즈",
      "date_deadline": "2021.10.13 오후 11:59, 10 분"
    },
    {
      "subject_name": "[가상]리눅스프로그래밍(101)",
      "class": "수업",
      "context": "1차시 3장 파일과 디렉토리 (1)",
      "date_deadline": "2021.10.18 오후 11:59"
    },
    {
      "subject_name": "[가상]리눅스프로그래밍(101)",
      "class": "과제",
      "context": "3장 파일과 디렉토리 (1)",
      "date_deadline": "2021.10.17 오후 11:59"
    },
    {
      "subject_name": "[가상]시스템프로그래밍(102)",
      "class": "수업",
      "context": "1차시 write() System Call",
      "date_deadline": "2021.10.13 오후 11:59"
    },
    {
      "subject_name": "[가상]시스템프로그래밍(102)",
      "class": "수업",
      "context": "2차시 Delayed writing",
      "date_deadline": "2021.10.13 오후 11:59"
    },
    {
      "subject_name": "[가상]시스템프로그래밍(102)",
      "class": "수업",
      "context": "5주 3차시 보강 I/O Synchronization",
      "date_deadline": "2021.10.13 오후 11:59"
    },
    {
      "subject_name": "[가상]프로그래밍언어론(101)",
      "class": "과제",
      "context": "프로그래밍언어론 Assignment#1",
      "date_deadline": "2021.10.13 오후 11:59"
    }
  ]
}
```

{% endtab %}

{% tab title="400  로그인 실패의 경우 프"400" 반환" %}

```javascript
{
   "status" : 400,
   "value" : "Login failed"
}
```

{% endtab %}

{% tab title="500: Internal Server Error 데이터를 가져오는 과정에서 서버 내부 문제가 발생시" %}

```javascript
{
   "status": 500,
   "value": "internal server error"
}
```

{% endtab %}
{% endtabs %}
