-
Notifications
You must be signed in to change notification settings - Fork 1
api auth
changicho edited this page Nov 29, 2020
·
1 revision
- 로그인
- 유저 정보 저장 (첫 로그인 시)
- 프로필 변경
- 프로필 사진 변경
interface UserAttribute {
id: string;
nickname: string;
email: string;
profileImage: string;
isPremium: boolean;
createdAt: Date;
updatedAt: Date;
}
/**
* @api {post} api/auth Authenticate user & get token
* @apiName CreateAuth
* @apiGroup Auth
*
* @apiParam {String} id 유일한 유저 번호(key)
* @apiParam {String} nickname 유저의 닉네임
* @apiParam {String} email 유저의 이메일
* @apiParam {String} profileImage 유저의 프로필 사진 URL
*
* @apiSuccess {Boolean} success API 호출 성공 여부
* @apiSuccess {String} message 응답 메시지
* @apiSuccess {Object} 유저의 access token
*/
성공 응답 예시
{
success : true,
message : "GET ACCESS TOKEN SUCCESS",
data : {
token : "token 정보"
}
}
실패 응답 예시 - 데이터베이스 오류
{
success : false,
message : "DB CONNECTION FAILED"
}
/**
* @api {put} api/auth/profile Update User's Nickname
* @apiName UpdateNickname
* @apiGroup Auth
*
* @apiParam {String} nickname 변경할 유저의 닉네임
*
* @apiSuccess {Boolean} success API 호출 성공 여부
* @apiSuccess {String} message 응답 메시지
*/
성공 응답 예시
{
success : true,
message : "UPDATE USER NICKNAME SUCCESS",
data : []
}
실패 응답 예시 - 데이터베이스 오류
{
success : false,
message : "DB CONNECTION FAILED"
}
프로필 사진 변경
/**
* @api {put} api/auth/profileImage Update User's ProfileImage
* @apiName UpdateProfileImage
* @apiGroup Auth
*
* @apiParam {String} profileImage 변경할 유저의 프로필 사진
*
* @apiSuccess {Boolean} success API 호출 성공 여부
* @apiSuccess {String} message 응답 메시지
*/
성공 응답 예시
{
success : true,
message : "UPDATE USER PROFILE IMAGE SUCCESS",
data : []
}
실패 응답 예시 - 데이터베이스 오류
{
success : false,
message : "DB CONNECTION FAILED"
}