Skip to content

API Documentation

KimDaeGeon edited this page Sep 9, 2024 · 3 revisions

전체 사용자 조회

동BTI 검사를 진행한 전체 사용자 수를 조회합니다

➡️ Request

METHOD GET
PATH /stats/total

⬅️ Response

200 성공

{
   "status" : 200,
   "total_count" : 0
}

전체 사용자 대비 해당 MBTI 사용자 수 조회

동BTI 검사를 진행한 전체 사용자 수 대비 해당 MBTI 결과가 나온 인원 수를 조회합니다

➡️ Request

METHOD GET
PATH /stats?type=TYPE

⬅️ Response

200 성공

{
   "status" : 200,
   "count" : 0,
   "total_count" : 0
}

400 BAD REQUEST (유효하지 않은 Type)

{
   "status" : 400,
   "message" : "type 의 값이 유효하지 않습니다"
}

결과 생성

동BTI 검사를 진행한 결과를 저장합니다

➡️ Request

METHOD POST
PATH /stats

BODY

{
   "department" : "enum",
   "mbti" : "string"
}

❗️department 필드에 들어갈 수 있는 값
"humanities", "social-sciences", "natural-sciences", "economics", "engineering", "it", "agriculture", "arts", "teachers", "medicine", "dentisty", "vet", "human-sciences", "nursing", "pharmacy", "advanced-technology", "environment", "science-technology", "administration", "undeclared"

⬅️ Response

201 성공

{
   "status" : 201,
   "data" : {
       "id" : "string",
       "total_count" : 0
   }
}

400 BAD REQUEST (유효하지 않은 Department)

{
   "status" : 400,
   "message" : "department 의 값이 유효하지 않습니다"
}

400 BAD REQUEST (유효하지 않은 mbti)

{
   "status" : 400,
   "message": "mbti 는 string 값이어야 합니다"
}

전체 상위 10개 MBTI 유형 조회

전체 사용자 중 MBTI 유형 상위 10개를 조회합니다

➡️ Request

METHOD GET
PATH /stats/top/mbti

⬅️ Response

200 성공

{
   "status" : 200,
   "top" : [
       ["MBTI TYPE", 10],
       ["MBTI TYPE", 8],
       ["MBTI TYPE", 3],
   ]
}

학과별 상위 10개 MBTI 유형 조회

학과별 MBTI 유형 상위 10개를 조회합니다

➡️ Request

METHOD GET
PATH /stats/top/department
QUERY key=DEPARTMENT_TYPE
ex) /stats/top/department?key=it

⬅️ Response

200 성공

{
   "status" : 200,
   "top" : [
       ["MBTI TYPE", 10],
       ["MBTI TYPE", 8],
       ["MBTI TYPE", 3],
   ]
}

400 BAD REQUEST (유효하지 않은 Department Query Key)

{
   "status" : 400,
   "message" : "department 의 값이 유효하지 않습니다"
}