UserAPI

APIs. Namespace

UserAPI

Description:
  • UserAPI namespace

See:

Methods

(static) *common(req, res)

Parameters:
Name Type Description
req Object
res Object
Throws:
status message description
404 USER_NOT_FOUND if user is not found

(static) CGoogleAuth API(req, res)

Description:
  • 구글 로그인 활성화 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/:_id/google"
user Object

"admin"

body Object
Properties
Name Type Description
email string
res Object
Properties
Name Type Description
snsId Object
Properties
Name Type Description
google string

updated snsId.google

Throws:
status message description
400 EMAIL_INVALID if email is invalid
409 EMAIL_CONNECTED_ALREADY if email is already connected
409 EMAIL_IN_USE if email is in use

(static) CUser API(req, res)

Description:
  • 사용자 생성 API

Version:
  • 2.0.0
See:
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "POST"
url "/users"
user Object

"admin"

body Object
Properties
Name Type Attributes Description
schools Array.<Object>

ex) [{school:"1234sdf"}]

auth "member" | "manager"
userId string
userName string
password string
tel string <nullable>
email string <nullable>
snsId Object <nullable>
Properties
Name Type Attributes Description
google string <nullable>
res Object
Properties
Name Type Description
user TUser

created user

Throws:
status message description
409 USERID_IN_USE if userId is in use
409 SNSID.GOOGLE_IN_USE if snsId.google is in use

(static) CUserSchool API(req, res)

Description:
  • 소속 학교 추가 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "POST"
url "/users/:_id/schools"
user Object

"admin"

body Object
Properties
Name Type Description
sid string

ObjectId of school

res Object
Properties
Name Type Description
body Object
Properties
Name Type Description
schools Array.<TUserSchool>
Throws:
status message description
409 SCHOOL_CONNECTED_ALREADY if user already registered to school

(static) DGoogleAuth API(req, res)

Description:
  • 구글 로그인 비활성화 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "DELETE"
url "/users/:_id/google"
user Object

"admin"

res Object
Properties
Name Type Description
snsId Object
Properties
Name Type Description
google undefined

updated snsId.google

Throws:
status message description
409 EMAIL_DISCONNECTED_ALREADY if email is already connected

(static) DUser API(req, res)

Description:
  • 사용자 삭제 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "DELETE"
url "/users/:_id"
user Object
Properties
Name Type Description
auth "admin"
res Object

returns nothing

Throws:
status message description
409 SCHOOL_DISCONNECTED_ALREADY if user already deregistered to school

(static) DUserSchool API(req, res)

Description:
  • 소속 학교 삭제 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "DELETE"
url "/users/:_id/schools"
query Object
Properties
Name Type Description
sid string

ObjectId of school

user Object

"admin"

res Object
Properties
Name Type Description
body Object
Properties
Name Type Description
schools Array.<TUserSchool>
Throws:
status message description
409 SCHOOL_DISCONNECTED_ALREADY if user already deregistered to school

(static) LocalGoogle API(req, res)

Description:
  • 구글 로그인 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "POST"
url "/users/login/google"
body Object
Properties
Name Type Attributes Description
academyId string
credential string
persist boolean <nullable>

if true, auto login is set up

res Object
Throws:
status message description
401 ACADEMY_NOT_FOUND if academy is not found
401 ACADEMY_INACTIVATED if academy is inactivated
401 USER_NOT_FOUND if user is not found
401 PASSWORD_INCORRECT if password is incorrect

(static) LocalLogin API(req, res)

Description:
  • 로컬 로그인 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "POST"
url "/users/login/local"
body Object
Properties
Name Type Attributes Description
academyId string
userId string
password string
persist boolean <nullable>

if true, auto login is set up

res Object
Throws:
status message description
401 ACADEMY_NOT_FOUND if academy is not found
401 ACADEMY_INACTIVATED if academy is inactivated
401 USER_NOT_FOUND if user is not found
401 PASSWORD_INCORRECT if password is incorrect

(static) Logout API(req, res)

Description:
  • 로그아웃 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
user Object
method "GET"
url "/users/logout"
res Object

(static) RMySelf API(req, res)

Description:
  • 본인 조회 API; registrations와 함께 반환함

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "GET"
url "/users/current"
user Object
res Object
Properties
Name Type Description
user TUser
registrations Array.<Object>

(static) RUserAPI API(req, res)

Description:
  • 사용자 조회 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "GET"
url "/users/:_id"
query Object
Properties
Name Type Attributes Description
academyId string <nullable>

if user is owner

user Object

"owner"|"admin"|"manager"

res Object
Properties
Name Type Description
user TUser

(static) RUserProfile API(req, res)

Description:
  • 사용자 프로필사진 조회 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "GET"
url "/users/:_id"
user Object
res Object
Properties
Name Type Description
profile string

(static) RUsersAPI API(req, res)

Description:
  • 사용자 목록 조회 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "GET"
url "/users"
query Object
Properties
Name Type Attributes Description
sid string <nullable>

school ObjectId

academyId string <nullable>

if user is owner

user Object

"owner"|"admin"|"manager"

res Object
Properties
Name Type Description
users Array.<TUser>
Throws:

(static) UUserAuth API(req, res)

Description:
  • 등급 변경 API; admin이 사용자 등급을 manager 또는 member로 수정할 수 있다.

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/:_id/auth"
user Object

"admin"

body Object
Properties
Name Type Description
auth "manager" | "member"
res Object
Properties
Name Type Description
auth "manager" | "member"

updated auth

(static) UUserCalendar API(req, res)

Description:
  • 캘린더 변경 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/calendar"
user Object
body Object
Properties
Name Type Attributes Description
calendar string <nullable>
res Object
Properties
Name Type Description
calendar string

updated calendar

(static) UUserEmail API(req, res)

Description:
  • 이메일 변경 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/:_id/email"
user Object

"admin"|"user"

body Object
Properties
Name Type Attributes Description
email string <nullable>
res Object
Properties
Name Type Description
email string

updated email

(static) UUserPassword API(req, res)

Description:
  • 비밀번호 변경 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/:_id/password"
user Object

"admin"|"user"

body Object
Properties
Name Type Description
password string
res Object

(static) UUserProfile API(req, res)

Description:
  • 프로필 사진 변경 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/profile"
user Object
body formData
res Object
Properties
Name Type Description
profile string

(static) UUserTel API(req, res)

Description:
  • 전화번호 변경 API

Version:
  • 2.0.0
Parameters:
Name Type Description
req Object
Properties
Name Type Description
method "PUT"
url "/users/:_id/tel"
user Object

"admin"|"user"

body Object
Properties
Name Type Attributes Description
tel string <nullable>
res Object
Properties
Name Type Description
tel string

updated tel