Game

플레이어 인원 추가

HTTP request

POST /games HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 22
Host: localhost:8080

{
  "player_num" : 3
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 14

{
  "id" : 1
}

랜덤 단어 선택

HTTP request

POST /games/random-words HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 54
Host: localhost:8080

{
  "id" : 1,
  "korean_name" : "스케이트보드"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 35

{
  "english_name" : "skateboard"
}

Draw

사진 전송

HTTP request

POST /draws/games/1/player-no/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 37
Host: localhost:8080

"여기에 파일을 넣어주세요"

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 19

{
  "draw_id" : 1
}

Dictionary

랜덤 단어 조회

HTTP request

GET /dictionaries/random-words HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 33

{
  "korean_name" : "바나나"
}

Result

draw id로 결과 조회(개인)

HTTP request

GET /results/draws/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 874

{
  "image_url" : "http://someDoodleImageUrlToS3",
  "random_word" : {
    "id" : 1,
    "similarity" : 100.0,
    "korean_name" : "사과",
    "english_name" : "Apple",
    "image_url" : "http://someDoodleImageUrlToS3"
  },
  "top_five" : [ {
    "id" : 2,
    "similarity" : 90.0,
    "korean_name" : "오렌지",
    "english_name" : "Orange",
    "image_url" : "http://someDoodleImageUrlToS3"
  }, {
    "id" : 3,
    "similarity" : 80.0,
    "korean_name" : "배",
    "english_name" : "Pear",
    "image_url" : "http://someDoodleImageUrlToS3"
  }, {
    "id" : 4,
    "similarity" : 70.0,
    "korean_name" : "원",
    "english_name" : "Circle",
    "image_url" : "http://someDoodleImageUrlToS3"
  }, {
    "id" : 5,
    "similarity" : 60.0,
    "korean_name" : "햄버거",
    "english_name" : "Hamburger",
    "image_url" : "http://someDoodleImageUrlToS3"
  } ]
}

game id로 결과 조회(다인)

HTTP request

GET /results/games/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 292

{
  "random_word" : "사과",
  "results" : [ {
    "draw_id" : 1,
    "player_no" : 1,
    "image_url" : "http://someResultImageUrlToS3",
    "similarity" : 90.0
  }, {
    "draw_id" : 2,
    "player_no" : 2,
    "image_url" : "http://someResultImageUrlToS3",
    "similarity" : 98.0
  } ]
}