User


<aside>

로그인

HTTP request

POST /auth/login

body : {
  "username": "[email protected]",
  "password": "secret123"
}

HTTP response

{
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzIiwicm9sZSI6IlJPTEVfVVNFUiIsImlhdCI6MTc0NTU2MjY5NCwiZXhwIjoxNzQ1NTY2Mjk0fQ.pl2v3fSei337V5DFJO3a_ZayXLPVwf2NKv0nrkoZ5MM",
    "refreshToken": "941a2e19-89ce-4399-abe1-625c0d2ae3e2",
    "user": {
        "id": 3,
        "nickname": "@gil1_1dod11fng2",
        "img": "<https://ex1ample.com/profilfe.jpg>",
        "followers": 10,
        "followings": 15,
        "content": "",
        "name": "",
        "rate": ,
        "boardCount": ,
        "isStory": true
    },
    "firstLogin": false
}

</aside>

<aside>

소셜 로그인

HTTP request

POST /auth/oauth-login

body : {
  "attributes": {
	  "attributes": "",
	  "nameAttributeKey": "",
	  "username": "",
	  "name": "",
	  "email": "",
	  "img": "",
	  "phone": ""
  },
  "provider": "google"
}

HTTP response

{
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzIiwicm9sZSI6IlJPTEVfVVNFUiIsImlhdCI6MTc0NTU2MjY5NCwiZXhwIjoxNzQ1NTY2Mjk0fQ.pl2v3fSei337V5DFJO3a_ZayXLPVwf2NKv0nrkoZ5MM",
    "refreshToken": "941a2e19-89ce-4399-abe1-625c0d2ae3e2",
    "user": {
        "id": 3,
        "nickname": "@gil1_1dod11fng2",
        "img": "<https://ex1ample.com/profilfe.jpg>",
        "followers": 10,
        "followings": 15,
        "content": "",
        "name": "",
        "rate": ,
        "boardCount": ,
        "isStory": true
    },
    "firstLogin": false
}

</aside>

<aside>

회원가입

HTTP request

POST /auth/sign-up

body : {
  "username": "[email protected]",
  "password": "newpass",
  "name": "",
  "nickname": "newbie",
  "img": "",
  "phone": "01012345678"
}

HTTP response

{
  "회원가입 성공!"
}

</aside>

<aside>

아이디 중복검사

HTTP request

POST /auth/check-username
Content-Type: application/json
{
  "username": "test123"
}

HTTP response

"사용 가능한 아이디입니다!"

</aside>

<aside>

닉네임 중복검사

HTTP request

POST /auth/check-nickname
Content-Type: application/json
{
  "nickname": "knk_0611"
}

HTTP response

"사용 가능한 닉네임입니다!"

</aside>

<aside>

최초 소셜로그인 USER 추가 정보 입력

HTTP request

POST /user/social-info
Content-Type: application/json
Authorization: Bearer {JWT_ACCESS_TOKEN}
{
  "nickname": "닉네임",
  "phone": "01012345678",
}

HTTP response

{
  "추가 정보 입력 완료!"
}

</aside>

<aside>

내 정보 조회

HTTP request

GET /auth/me

HTTP response

{
    "id": 6,
    "nickname": "@gil12_13dbhwsod111f1ng2",
    "img": "<https://s3.ap-northeast-2.amazonaws.com/glim-bucket/https://ex1ample.com/profilfe.jpg_128x128.webp>",
    "followers": 0,
    "followings": 0,
    "content": "",
    "name": "홍길동",
    "rate": 0,
    "boardCount": 1,
    "isStory": false
}

</aside>

<aside>

회원 정보 조회

HTTP request

GET /auth/{id}
Authorization: Bearer {accessToken}

HTTP response

{
    "id": 2,
    "nickname": "knk_062",
    "img": "<https://example.com/profile2.jpg>",
    "followers": 0,
    "followings": 0,
    "content": "한 줄 소개입니다.",
    "name": "테스트2",
    "rate": 1,
    "boardCount": 1,
    "isStory": false,
    "isMine": false,
    "isFollowing": false
}

</aside>

<aside>

마이페이지 조회

HTTP request

GET /auth/update
Authorization: Bearer {accessToken}

HTTP response

{
  "nickname": "knk_0611",
  "img": "<https://s3.ap-northeast-2.amazonaws.com/bucket/userimages/abc.jpg?size=128>",
  "semiImg": "userimages/abc.jpg",
  "name": "홍길동",
  "content": "백엔드 개발자 🐣"
}

</aside>