git clone -> npm install -> node ./src/mainkp.js
내부 포트번호 : 8880
| regist | login | match | match list | class | class list |
|---|---|---|---|---|---|
| 사용자 등록 | 로그인 | 방만들기 | 방리스트 | 고수 등록 | 모든 방 |
| 사용자 삭제 | 로그아웃 | 방참가 | 내방 | 방 등록 | 내 방 |
| 사용자 정보 | 로그인 상태 | 참가취소 | 게임방 | 방 참가 | 종목별 방 |
| 참가자들 | 참가/방 취소 | ||||
| 참가자리스트 |
이메일, 닉네임 중복 금지
url : http://IP:PORT/user/singup
POST 형식
content-type : application/json
email : (이메일)
pw : (비밀번호)
name : (이름)
nickname : (닉네임)
| cause | status | content |
|---|---|---|
| 정보부족 | 404 | "Please fill it up" |
| email 중복 | 202 | "email ${email} is already exists" |
| nickname 중복 | 202 | "nickname ${nickname} is already exists" |
| 생성 성공 | 200 | "${email} has been created." |
| 오류 | 202 | "something wrong in signup" |
url : http://IP:PORT/user/login
POST 형식
content-type : application/json
email : (이메일)
pw : (비밀번호)
| cause | status | content |
|---|---|---|
| 로그인 성공 | 200 | { "email": "email", "nickname":"nickname", "score": 10, "credit : 10} |
| 로그인 실패 | 401 | "Unauthorized" |
url : http://IP:PORT/user/islogin
Get 형식
| cause | status | content |
|---|---|---|
| 로그인 상태 | 200 | true |
| 비로그인 상태 | 202 | false |
로그인 되어있는 상태에서
url : http://IP:PORT/user/logout
GET 형식
| cause | status | content |
|---|---|---|
| 로그아웃 성공 | 200 | "logout" |
로그인 되어있는 상태에서
url : http://IP:PORT/user/signout
DELETE 형식
| cause | status | content |
|---|---|---|
| 회원탈퇴 성공 | 200 | "sign out" |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/user/detail
nickname 과 email 반환
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | { "nickname":"nickname", "email":"email"} |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/match/start
생성된 방 번호 반환
POST 형식
content-type : application/json
game : (게임 종류) (농구, 축구 등)
lati : (위도)
longi : (경도)
(json) content : {(추가 정보) (목표 시간 등)}
| cause | status | content |
|---|---|---|
| 로그인 성공 | 200 | ${room_id} |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/match/attend(room_id)
GET 형식
| cause | status | content |
|---|---|---|
| 방 참가 성공 | 200 | "${nickname} attend ${game}" |
| room_id 형식 오류 | 402 | "put integer" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/match/attend(room_id)
DELETE 형식
| cause | status | content |
|---|---|---|
| 참가 취소 성공 | 200 | "cancel participation" |
| 본인 방 취소 | 200 | "delete room ${room_id}" |
| 이미 참가 X | 202 | "already deleted" |
| room_id 형식 오류 | 402 | "put integer" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
url : http://IP:PORT/match/part(room_id)
list : 참여자 닉네임, 참여 일시 리스트 반환
number : 참여자 수 반환
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | {"list": ["sample", "2022-12-15 10:00:00", ... ], "number": 2} |
| room_id 형식 오류 | 402 | "put integer" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
url : http://IP:PORT/match/all(offset)
각 offset마다 10개씩 반환 (0: 110, 1: 1120)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "content":${content}, "createdAt":${생성시간} }, ...] |
| room_id 형식 오류 | 402 | "put integer" |
로그인 되어있는 상태에서 url : http://IP:PORT/match/mylist
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "content":${content}, "createdAt":${생성시간} }, ...] |
| 비로그인 상태 | 401 | 'log in first' |
url : http://IP:PORT/match/list(game)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "content":${content}, "createdAt":${생성시간} }, ...] |
로그인 되어있는 상태에서 url : http://IP:PORT/class/register
POST 형식
content-type : application/json
game : (종목) (농구, 축구 등)
(json) content : { ()}
| cause | status | content |
|---|---|---|
| 생성 성공 | 200 | "${nickname} is registered as ${game} gosu." |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서 url : http://IP:PORT/class/start
POST 형식
content-type : application/json
game : (게임 종류) (농구, 축구 등)
lati : (위도)
longi : (경도)
limit : (최대 사람 수) (json) content : {(추가 정보) (목표 시간 등)}
| cause | status | content |
|---|---|---|
| 생성 성공 | 200 | "${room id}" |
| 해당 종목 고수 X | 402 | register gosu first |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/class/attend(room_id)
GET 형식
| cause | status | content |
|---|---|---|
| 방 참가 성공 | 200 | "${nickname} attend ${game}" |
| 본인 방 | 401 | "your class" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
| room_id 형식 오류 | 402 | "put integer" |
로그인 되어있는 상태에서
url : http://IP:PORT/class/attend(room_id)
DELETE 형식
| cause | status | content |
|---|---|---|
| 참가 취소 성공 | 200 | "cancel participation" |
| 본인 방 취소 | 200 | "delete room ${room_id}" |
| 이미 참가 X | 202 | "already deleted" |
| room_id 형식 오류 | 402 | "put integer" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
url : http://IP:PORT/class/part(room_id)
list : 참여자 닉네임, 참여 일시 리스트 반환
number : 참여자 수 반환
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | {"list": ["sample", "2022-12-15 10:00:00", ... ], "number": 2} (list에는 닉네임과 참가시간, number는 참가자 수) |
| room_id 형식 오류 | 402 | "put integer" |
| 해당 room_id 없음 | 202 | "no room" |
| 비로그인 상태 | 401 | "log in first" |
url : http://IP:PORT/class/all(offset)
각 offset마다 10개씩 반환 (0: 110, 1: 1120)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "limit":${수제한}, "content":${content}, "createdAt":${생성시간} }, ...] |
| room_id 형식 오류 | 402 | "put integer" |
로그인 되어있는 상태에서 url : http://IP:PORT/class/mylist
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "limit":${수제한}, "content":${content}, "createdAt":${생성시간} }, ...] |
| 비로그인 상태 | 401 | 'log in first' |
url : http://IP:PORT/class/list(game)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{"id":${room_id}, "game":${game}, "lati":${위도}, "longi":${경도}, "content":${content}, "createdAt":${생성시간} }, ...] |
로그인 되어있는 상태에서 url : http://IP:PORT/report/(nickname)
POST 형식
content : 신고 내용
| cause | status | content |
|---|---|---|
| 신고 완료 | 200 | "reported" |
| 중복된 요청 | 201 | "already reported" |
| 대상 없음 | 400 | "no target" |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/reported
GET 형식
| cause | status | content |
|---|---|---|
| 신고 내역 | 200 | {"list" : [${신고 내용}, ${신고 시간}, ... },], "number":(횟수)} |
| 비로그인 상태 | 401 | "log in first" |
로그인 되어있는 상태에서
url : http://IP:PORT/myreport
GET 형식
| cause | status | content |
|---|---|---|
| 신고 내역 | 200 | {"list" : [${신고 내용}, ${신고 시간}, ... },], "number":(횟수)} |
| 비로그인 상태 | 401 | "log in first" |
