Users - Gachon-P-project/Back GitHub Wiki

κ°œμš”

μ‚¬μš©μž 등둝, μ™ΈλΆ€ API와 μ—°λ™ν•˜μ—¬ λ“±λ‘λœ μ‚¬μš©μžμΈμ§€ 확인, μ‚¬μš©μž 정보 쑰회, μ‹œκ°„ν‘œ 쑰회λ₯Ό μˆ˜ν–‰ν•˜λŠ” 둜직

μ‚¬μš©μž 등둝

  • URL

    /users

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
user_no μ‚¬μš©μž ν•™λ²ˆ Int O
user_id μ‚¬μš©μž ID VARCHAR(20) O
user_name μ‚¬μš©μž 이름 VARCHAR(20) O
nickname μ‚¬μš©μž λ‹‰λ„€μž„ VARCHAR(10) O
user_major μ‚¬μš©μž ν•™κ³Ό VARCHAR(30) O
  • Sample Call
http://localhost:17394/users
  • Data Input Exaple:
{ 
    "user_no" : "201700000",
    "user_id" : "user_test",
    "user_name": "ν…ŒμŠ€νŠΈ",
    "nickname" : "ν…ŒμŠ€νŠΈκ³„μ •μ΄λ‹€",
    "user_major": "컴퓨터곡학과"
}
  • Success Response
Code: 200
  • Error Response
Code: 400 BAD REQUEST

μ‚¬μš©μž 확인 및 쑰회

  • URL

    /users/check

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
id μ‚¬μš©μž ID String O
pwd μ‚¬μš©μž Password String O
  • Sample Call
http://localhost:17394/users/check
  • Data Input Exaple:
{ 
    "id" : "GACHON_ID",
    "pwd" : "GACHON_PWD"
}
  • Success Response
* λ“±λ‘λœ μ‚¬μš©μžμΌ 경우
{
    "code": 200,
    "data": {
        "user_no": "201739412",
        "user_id": "jy11290",
        "user_name": "κΉ€μ§„μ˜",
        "user_major": "컴퓨터곡학과",
        "nickname": "jy-kkkim"
    }
}

* λ“±λ‘λ˜μ§€ μ•Šμ€ μ‚¬μš©μžμΌ 경우
{
    "code": 204,
    "data": {
        "user_no": "201739412",
        "user_id": "jy11290",
        "user_name": "κΉ€μ§„μ˜",
        "user_major": "컴퓨터곡학과"
    }
}
  • Error Response
* 둜그인 μ‹€νŒ¨
{ "ID/PWλ₯Ό ν™•μΈν•˜μ„Έμš”." }

* μ„œλ²„ μ—°κ²° μ‹€νŒ¨
{ "DB μ—°κ²° 였λ₯˜" }

μ‹œκ°„ν‘œ 쑰회

  • URL

    /users/timetable/:user_no/:year/:sem

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
user_no μ‚¬μš©μž ν•™λ²ˆ String O
year μ‘°νšŒν•  년도 String O
sem μ‘°νšŒν•  ν•™κΈ°(10: 1ν•™κΈ°, 11: 여름학기, 20: 2ν•™κΈ°, 21: κ²¨μšΈν•™κΈ°) String O
  • Sample Call
http://localhost:17394/user/timetable/201739412/2020/20
  • Success Response
[
    {
        "day": "μ›”μš”μΌ MONDAY",
        "data": [
            {
                "subject": "μ°½μ—…κ³Ό κΈ°μ—…κ°€μ •μ‹  / λΉ„μ „νƒ€μ›Œ-B201 /  졜창λͺ…",
                "time": "1100 ~ 1150"
            },
            {
                "subject": "μ°½μ—…κ³Ό κΈ°μ—…κ°€μ •μ‹  / λΉ„μ „νƒ€μ›Œ-B201 /  졜창λͺ…",
                "time": "1200 ~ 1250"
            },
            {
                "subject": "컴퓨터ꡬ쑰 / ITλŒ€ν•™-602 /  μ΄μƒμˆœ",
                "time": "1430 ~ 1545"
            },
            {
                "subject": "μ’…ν•©ν”„λ‘œμ νŠΈ / ITλŒ€ν•™-502 /  μž„μ€€μ‹",
                "time": "1825 ~ 1915"
            },
            {
                "subject": "μ’…ν•©ν”„λ‘œμ νŠΈ / ITλŒ€ν•™-502 /  μž„μ€€μ‹",
                "time": "1920 ~ 2010"
            },
            {
                "subject": "μ’…ν•©ν”„λ‘œμ νŠΈ / ITλŒ€ν•™-502 /  μž„μ€€μ‹",
                "time": "2015 ~ 2105"
            }
        ]
    },
    {
        "day": "ν™”μš”μΌ TUESDAY",
        "data": [
            {
                "subject": "컴퓨터ꡬ쑰 / ITλŒ€ν•™-602 /  μ΄μƒμˆœ",
                "time": "1600 ~ 1715"
            },
            {
                "subject": "μ’…ν•©ν”„λ‘œμ νŠΈ / ITλŒ€ν•™-502 /  μž„μ€€μ‹",
                "time": "1825 ~ 1915"
            },
            {
                "subject": "μ’…ν•©ν”„λ‘œμ νŠΈ / ITλŒ€ν•™-502 /  μž„μ€€μ‹",
                "time": "1920 ~ 2010"
            }
        ]
    },
    {
        "day": "μˆ˜μš”μΌ WEDNESDAY",
        "data": [
            {
                "subject": "λŒ€κΈ°μ—…Β·μ€‘κ²¬κΈ°μ—… μ·¨μ—… μ€€λΉ„μ „λž΅ / κ°€μ²œκ΄€-B101 /  μ‘°μ§„μˆ˜",
                "time": "1300 ~ 1350"
            },
            {
                "subject": "λŒ€κΈ°μ—…Β·μ€‘κ²¬κΈ°μ—… μ·¨μ—… μ€€λΉ„μ „λž΅ / κ°€μ²œκ΄€-B101 /  μ‘°μ§„μˆ˜",
                "time": "1400 ~ 1450"
            }
        ]
    }
]
  • Error Response
Code: 400 BAD REQUEST

λ‹‰λ„€μž„ 쀑볡확인

  • URL

    /user/nickname/check/:nickname

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
nickname μ‚¬μš©ν•  λ‹‰λ„€μž„ String O
  • Sample Call
http://localhost:17394/users/nickname/check/ν…ŒμŠ€νŠΈκ³„μ •μ΄λ‹€
  • Success Response
* μ‚¬μš© κ°€λŠ₯
"μ‚¬μš©κ°€λŠ₯ν•œ λ‹‰λ„€μž„ μž…λ‹ˆλ‹€."

* μ‚¬μš© λΆˆκ°€λŠ₯
"이미 λ“±λ‘λœ λ‹‰λ„€μž„ μž…λ‹ˆλ‹€."
  • Error Response
Code: 400 BAD REQUEST

λ‹‰λ„€μž„ μˆ˜μ •

  • URL

    /users/nickname

  • Method

    PUT

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
nickname μ‚¬μš©μž λ‹‰λ„€μž„ VARCHAR(10) O
user_no μ‚¬μš©μž ν•™λ²ˆ Int O
  • Sample Call
http://localhost:17394/users/nickname
  • Data Input Exaple:
{ 
    "nickname": "λ‹‰λ„€μž„μˆ˜μ •",
    "user_no": "201700000"
}
  • Success Response
Code: 200
  • Error Response
Code: 400 BAD REQUEST

μˆ˜μ—… URL 쑰회

  • URL

    /users/subject-url

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
subject μˆ˜μ—… 이름 VARCHAR(70) O
professor ꡐ수 이름 VARCHAR(30) O
  • Sample Call
http://localhost:17394/users/subject-url
  • Data Input Exaple:
[
    {
        "subject" : "λͺ¨λ°”일웹",
        "professor" : "μ΅œμ§„μš°"
    },
    {
        "subject" : "ERPν”„λ‘œμ νŠΈ",
        "professor" : "이영호"
    }
]

  • Success Response
[
    {
        "subject": "λͺ¨λ°”일웹",
        "professor": "μ΅œμ§„μš°",
        "url": "http://gachon.webex.com/meet/jwchoi"
    },
    {
        "subject": "ERPν”„λ‘œμ νŠΈ",
        "professor": "이영호",
        "url": "http://gachon.webex.com/meet/lyh"
    }
]
  • Error Response
Code: 400 BAD REQUEST
⚠️ **GitHub.com Fallback** ⚠️