Model
Text
Vs string
User (done)
{ "username": Text "email" : Email "provider": Text "password" : Password "resetPasswordToken": Text "confirmationToken" : Text "confirmed" : Boolean "blocked": Boolean "role" : Relation with Role (from: users-permissions) "profile" : Profile, // Relation with Profile }
Quiz (done)
{ "category": Text, "answerType": Enum // trueOrFalse | multipleChoice | shortAnswer "question": Text, "image": Text(optional), "answer": Text, "explanation": Text, // 정답 설명 "difficulty": Number, "importance": Number, + "correctCnt" : Number, + "incorrectCnt" : Number "profile" : Profile // Relation with Profile, 1:1 "quiz_pack": QuizPack[] // Relation with QuizPack, 다:1 "likes": Like[] // Relation with Like, "comments": Comment[] // Relation with Comment, }
QuizPack (done)
{ "title": Text, "tags": Tag[] // // Relation with Tag, '다:다' "description": Text // 퀴즈세트 설명 내용 "profile": Profile // Relation with Profile, '다:1', "quizzes": Quiz[], // Relation with Quiz, '1:다' }
Profile (done)
{ "nickname":Text, "points": Number, "users_permissions_user" : User, "achivements": Achievement[] // Relation with Achievement, '다:다' "quizzes": Quiz[], // Relation with Quiz, '1:다' "quiz_packs" :QuizPack[] // Relation with QuizPack, '1:다' => 자기가 만든 것 "likes": Like[], // Relation with Like, '1:다' "comments": String[], // Relation with Comment, '1:다' }
Achievement (done)
{ "title" : String "profiles": Profile[] // Relation with Profile, '다:다', }
Comment (done)
{ "content": Text, "author": Profile[] // Relation with Profile, '다:1', "quiz": Quiz, // Relation with Quiz, '다:1' }
Like (done)
{ "author": Profile[] // Relation with Profile, '다:1', "quiz": Quiz, // Relation with Quiz, '다:1' }
Tag (done)
{ "content" : Text "quiz_packs": QuizPack[] // Relation with QuizPack,'다:다' }
Users
Action
/auth/local
/auth/local
[ Description ]
- 로그인
[ Parameters ]
- Body
- email : string
- password : string
[ Responses ]
- 200 OK
- token : string
- user : User
- 401 Unauthorized
/auth/local/register
/auth/local/register
[ Description ]
- 회원가입
[ Parameters ]
- Body
- email : string
- password : string
- nickname : string
[ Responses ]
- 200 OK
- token : string
- user : User
- 400 Bad Request
/users/me
/users/me
[ Description ]
- 인가
[ Parameters ]
- Header
- Authorization
[ Responses ]
- 200 OK
- token : string
- user : User
- 401 Unauthorized
/logout
/logout
Create
Read
Update
/users
/users
[ Description ]
- 유저 정보(비밀번호)를 변경합니다.
[ Parameters ]
- Header
- Authorization
- Body
- password : string
[ Responses ]
- 200 OK
- user : User
- 401 Unauthorized
Delete
Profiles(deprecated)
Action
Create
Read
Update
/profiles/:id
/profiles/:id
[ Description ]
- 특정 유저의 프로필 정보를 수정합니다.
[ Parameters ]
- Header
- Authorization
- Body
- nickname : string
- points : number
[ Responses ]
- 200 OK
- token : string
- user : User
- 400 Bad Request (로그인은 되어있지만, 잘못된 정보가 들어갈 때)
- 401 Unauthorized
Delete
Quizzes
Action
Create
/quizzes
/quizzes
[ Description ]
- 퀴즈를 만듭니다.
[ Parameters ]
- Header
- Authorization
- Body
- title : string
- explanation : string
- difficulty : number
- importance : number
- answer : string
- answerType : string
- choices : string
optional
- image : string
optional
- category : string // ex) javascript
- setId : string
optional
[ Response ]
- 200 OK
- 400 Bad Request
- 401 Unauthorized
Read
Update (adv)
/quizzes/:id
/quizzes/:id
[ Description ]
- 퀴즈를 수정합니다.
[ Parameters ]
- Header
- Authorization
- Body
- title : string
- explanation : string
- difficulty : string
- importance : string
- answer : string
- answerType : string
- choices : string
optional
- imageUrl: string
optional
- category: string
[ Response ]
- 200 OK
- 401 Unauthorized
Delete (adv)
/quizzes/:id
/quizzes/:id
[ Description ]
- 퀴즈를 삭제합니다.
[ Parameters ]
- Header
- Authorization
[ Response ]
- 200 OK
- 401 Unauthorized
QuizPacks
Action
Create
Read
Update (adv)
/quizpacks/:id
/quizpacks/:id
[ Description ]
- 퀴즈세트를 수정합니다.
[ Parameters ]
- Header
- Authorization
- Body
- title : string
- tag : string[]
- description : string
[ Response ]
- 200 OK
- 401 Unauthorized
Delete (adv)
/quizpacks/:id
/quizpacks/:id
[ Description ]
- 퀴즈세트를 삭제합니다.
- 퀴즈는 남아있음 → SET_NULL
[ Parameters ]
- Header
- Authorization
[ Response ]
- 200 OK
- 401 Unauthorized
Acheivements (adv)
Action
Create
Read
/achievements
/achievements
[ Description ]
모든 업적을 가져옵니다.
[ Parameters ]
- query
- page: number
optional
[ Response ]
- 200 OK
- 400 Bad Request
/achievements/:id
/achievements/:id
Update
Delete
Comments
Action
Create
/comments
/comments
[ Description ]
- 댓글을 작성합니다.
[ Parameters ]
- Header
- Authorization
- Body
- quizId : string
- content : string
[ Response ]
- 200 OK
- 401 Unauthorized
Read
/comments
/comments
[ Description ]
- 모든 댓글을 불러옵니다.
[ Parameters ]
- Header
- Authorization
- Body
- content : string
[ Response ]
- 200 OK
- Comment[]
- 401 Unauthorized
Update (adv)
/comments/:id
/comments/:id
[ Description ]
- 댓글을 수정합니다.
[ Parameters ]
- Header
- Authorization
- Body
- quizId : string
- content : string
[ Response ]
- 200 OK
- 401 Unauthorized
Delete
/comments/:id
/comments/:id
[ Description ]
- 퀴즈를 삭제합니다.
[ Parameters ]
- Header
- Authorization
[ Response ]
- 200 OK
- 401 Unauthorized
Likes
Action
Create
/likes
/likes
[ Description ]
- 좋아요를 생성합니다.
[ Parameters ]
- Header
- Authorization
- Body
- quizId : string
[ Response ]
- 200 OK
- 400 Bad Request
Read (adv)
Update
Delete
/likes/:id
/likes/:id
[ Description ]
- 좋아요를 삭제합니다.
[ Parameters ]
- Header
- Authorization
[ Response ]
- 200 OK
- 400 Bad Request