git clone -> npm install -> node ./src/main.js
내부 포트번호 : 8880
| regist | login | image | score | food | other |
|---|---|---|---|---|---|
| 사용자 등록 | 로그인 | 목록 | 점수 | 내 리스트 | 이미지 분석 |
| 사용자 삭제 | 로그아웃 | 다른사람 목록 | 전체랭킹 | 내 먹이 추가 | gps 데이터 |
| 사용자 정보 | 로그인 상태 | 랜덤 목록 | 코인 | 내 먹이 사용 |
이메일, 닉네임 중복 금지
url : http://IP:PORT/user/singup
POST 형식
content-type : x-www-form-urlencoded
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 : x-www-form-urlencoded
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/book/list/has
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{ no:1, animalName:동물이름, photo:파일 명 }, ... ] |
| 비로그인 상태 | 401 | "login first" |
로그인 되어있는 상태에서
url : http://IP:PORT/book/list/less
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [ 동물1, 동물2, 동물3, ...] |
| 비로그인 상태 | 401 | "login first" |
로그인 되어있는 상태에서
url : http://IP:PORT/book/list/(닉네임)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{ no:1, animalName:동물이름, photo:파일 명 }, ... ] |
| 닉네임 없음 | 202 | "check the nickname" |
| 비로그인 상태 | 401 | "login first" |
로그인 되어있는 상태에서
url : http://IP:PORT/book/list/rand
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{ no:1, animalName:동물이름, photo:파일 명 }, ... ] |
| 비로그인 상태 | 401 | "login first" |
react-native : <Image source={{uri : "/book/파일 명"}} />
html : <Img src="/book/파일 명">
url : http://IP:PORT/analmal
GET 형식
url : http://IP:PORT/credit
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | 100 (가지고 있는 코인의 수) |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/score
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | 100 (나의 점수) |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/top10
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{no : 1, score : 10, nickname : "nick"}, {no : 2}...] |
| 요청 실패 | 401 | "Wrong Url" |
url : http://IP:PORT/foodlist
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | { ("food_name") : (개수), ...} |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/buyfood
POST 형식 content-type : x-www-form-urlencoded
food_name : (먹이 이름)
cost : (뺄 코인)
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "buy" + food_name |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/use(먹이 이름)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "use" + food_name |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/gpsData
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | [{ "animal_name": " ", "latitude": 0.000, "longitude": 0.0}, ... ] |
url : http://IP:PORT/putachieve
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "achieve one" |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/getachieve
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "(count)" |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/addscore(score)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "add (score) score " |
| 비로그인 상태 | 401 | "login first" |
url : http://IP:PORT/addcoin(coin)
GET 형식
| cause | status | content |
|---|---|---|
| 요청 성공 | 200 | "add (coin) credit" |
| 비로그인 상태 | 401 | "login first" |
