User 로그인

하나의 유저 객체를 로그인 시킵니다.


METHOD & URL

POST /user/login/

Permission

등록된 유저만


Request

Body

아래의 항목들을 request body에 담아 POST 요청을 보낸다.

  • email: 유저 이메일. 로그인할 때 username 역할을 함.
  • password: 비밀번호.

Success Response

HTTP Response

200 OK

Content

{
    "token": "토큰값",
    "user": {
        "id": 유저 id값,
        "email": "이메일",
        "nickname": "닉네임",
        "instrument": "악기",
        "user_type": "유저 타입",
        "genre": 선호 장르,
        "total_liked": 받은 좋아요 총합,
        "liked_posts": {
            "post_[id값]": {
                "id": 포스트 id,
                "title": "제목",
                "genre": "장르",
                "instrument": "악기",
                "num_liked": 받은 좋아요 수,
                "num_comments": 커맨트 트랙 수,
                "created_date": "생성 일시"
            },
            .
            .
            .
        },
        "num_followings": 팔로우 중인 유저 수,
        "following": [
            "유저 닉네임",
        ],
        "num_followers": 해당 유저를 팔로우 중인 유저 수,
        "followers": [
            "유저 닉네임",
        ],
        "is_active": true,
        "last_login": 마지막 로그인 일시,
        "post_set": {
            "post_[id값]": {
                "id": 포스트 id,
                "title": "제목",
                "genre": "장르",
                "instrument": "악기",
                "num_liked": 받은 좋아요 수,
                "num_comments": 커맨트 트랙 수,
                "created_date": "생성 일시"
            },
            .
            .
            .
        }
    }
}

Error Response


results matching ""

    No results matching ""