Back to top

E-Tickets - User

E-Tickets-User API 文档(普通用户专用)

Admin, Cinema Owner 的 API 见其它文档。

Resource Group

User

注册
POST/api/user

Example URI

POST http://172.18.157.240:8000/api/user
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "user8888",
  "password": "abcd12345",
  "nickname": "Superbaby"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Register successfully.",
  "data": {
    "username": "user8888",
    "nickname": "Superbaby",
    "avatar": "/images/avatar/default.png"
  }
}
Response  409
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "CONFLICT",
  "message": "Username conflict.",
  "data": {}
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNKNOWN_ERROR",
  "message": "Something wrong.",
  "data": {}
}

User-Info

获取用户信息
GET/api/user/$username

Example URI

GET http://172.18.157.240:8000/api/user/$username
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "User Infomation.",
  "data": {
    "username": "user8888",
    "nickname": "Superbaby",
    "avatar": "/images/avatar/default.png"
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "User does not exist.",
  "data": {}
}

更新用户信息
PATCH/api/user/$username

Example URI

PATCH http://172.18.157.240:8000/api/user/$username
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "nickname": "Angelababy",
  "avatar": "/images/avatar/user888820180501122330.png"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Update User Info successfully.",
  "data": {
    "username": "user8888",
    "nickname": "Angelababy",
    "avatar": "/images/avatar/user888820180501122330.png"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}

User Session

用户登录
POST/api/session/user

Example URI

POST http://172.18.157.240:8000/api/session/user
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "user8888",
  "password": "abcd12345"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "User confirm.",
  "data": {
    "username": "user8888"
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "User does not exit.",
  "data": {}
}
Response  403
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "FORBIDDEN",
  "message": "Password wrong.",
  "data": {}
}

用户登出
DELETE/api/session/user

Example URI

DELETE http://172.18.157.240:8000/api/session/user
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Log out successfully.",
  "data": {}
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "You have not logged in.",
  "data": {}
}

User Avatar

上传头像 (不会更新User数据,只拿到图片地址)
POST/api/user/avatar/$username

Example URI

POST http://172.18.157.240:8000/api/user/avatar/$username
Request
HideShow
Headers
Content-Type: multipart/form-data
Body
Content-Disposition: form-data; name="avatar"; filename="xxx.png"
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Upload successfully.",
  "data": {
    "avatar": "/images/avatar/avatarxxxx.png"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}

Movie

获取电影详情
GET/api/movie/$movie_id

Example URI

GET http://172.18.157.240:8000/api/movie/$movie_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "status": "OK",
    "message": "Find movies.",
    "data": {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
            "Christian Bale",
            "Heath Ledger",
            "Aaron Eckhart"
        ],
        "tags": [
            "Crime",
            "DC"
    }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by status

通过电影未上映、热映中、下映检索电影
GET/api/movies/status/$status_id

Example URI

GET http://172.18.157.240:8000/api/movies/status/$status_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "status": "OK",
    "message": "Find movies.",
    "data": {
        "movies": [
            {
                "movie_id": 7,
                "title": "The Dark Knight",
                "poster": "/images/poster/the-dark-knight.png",
                "director": "Christopher Nolan",
                "actors": [
                    "Christian Bale",
                    "Heath Ledger",
                    "Aaron Eckhart"
                ],
                "tags": [
                    "Crime",
                    "DC"
                ]
            },
            {
                //...
            }
        ]
    }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by keyword

根据key检索电影
GET/api/movies/$key_word

Example URI

GET http://172.18.157.240:8000/api/movies/$key_word
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find movies.",
  "data": {
    "movies": [
      {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
          "Christian Bale",
          "Heath Ledger",
          "Aaron Eckhart"
        ],
        "tags": [
          "Crime",
          "DC"
        ]
      }
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by Title

标题检索电影
GET/api/movies/title/$key_word

Example URI

GET http://172.18.157.240:8000/api/movies/title/$key_word
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find movies. Search by title",
  "data": {
    "movies": [
      {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
          "Christian Bale",
          "Heath Ledger",
          "Aaron Eckhart"
        ],
        "tags": [
          "Crime",
          "DC"
        ]
      }
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by Director

导演检索电影
GET/api/movies/director/$key_word

Example URI

GET http://172.18.157.240:8000/api/movies/director/$key_word
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find movies. Search by director",
  "data": {
    "movies": [
      {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
          "Christian Bale",
          "Heath Ledger",
          "Aaron Eckhart"
        ],
        "tags": [
          "Crime",
          "DC"
        ]
      }
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by Actor

演员检索电影
GET/api/movies/actor/$key_word

Example URI

GET http://172.18.157.240:8000/api/movies/actor/$key_word
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find movies. Search by actor",
  "data": {
    "movies": [
      {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
          "Christian Bale",
          "Heath Ledger",
          "Aaron Eckhart"
        ],
        "tags": [
          "Crime",
          "DC"
        ]
      }
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Movies - by Tag

标签检索电影
GET/api/movies/tag/$key_word

Example URI

GET http://172.18.157.240:8000/api/movies/tag/$key_word
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find movies. Search by tag",
  "data": {
    "movies": [
      {
        "movie_id": 7,
        "title": "The Dark Knight",
        "poster": "/images/poster/the-dark-knight.png",
        "director": "Christopher Nolan",
        "actors": [
          "Christian Bale",
          "Heath Ledger",
          "Aaron Eckhart"
        ],
        "tags": [
          "Crime",
          "DC"
        ]
      }
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie.",
  "data": {}
}

Cinema

获取电影院信息
GET/api/cinema/$cinema_id

Example URI

GET http://172.18.157.240:8000/api/cinema/$cinema_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Cinema information.",
  "data": {
    "cinema_id": 1,
    "cinema_name": "Qubic cinema",
    "cinema_location": "Guangzhou",
    "owner": "ownerqyb225"
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cinema does not exist.",
  "data": {}
}

Movie halls

影院所有影厅信息
GET/api/cinema/$cinema_id/moviehalls

Example URI

GET http://172.18.157.240:8000/api/cinema/$cinema_id/moviehalls
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Moviehall search by cinema_id.",
  "data": [
    {
      "cinema_id": 1,
      "hall_id": 1,
      "size_id": 2,
      "size": 320
    },
    {
      "cinema_id": 1,
      "hall_id": 2,
      "size_id": 3,
      "size": 480
    },
    {
      "cinema_id": 1,
      "hall_id": 3,
      "size_id": 3,
      "size": 480
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie halls.",
  "data": {}
}

Movie hall

影院某个影厅信息
GET/api/cinema/$cinema_id/moviehall/$hall_id

Example URI

GET http://172.18.157.240:8000/api/cinema/$cinema_id/moviehall/$hall_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Movie Hall information.",
  "data": {
    "cinema_id": 1,
    "hall_id": 1,
    "size_id": 2,
    "size": 320
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any movie halls.",
  "data": {}
}

Cinemas - Owner

某影院老板的所有影院信息
GET/api/cinemas/owner/$owner_username

Example URI

GET http://172.18.157.240:8000/api/cinemas/owner/$owner_username
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Cinema search by owner.",
  "data": [
    {
      "cinema_id": 1,
      "cinema_name": "Qubic cinema",
      "cinema_location": "Guangzhou",
      "owner": "ownerqyb225"
    },
    {
      "cinema_id": 2,
      "cinema_name": "Wonderful Cinema",
      "cinema_location": "Guangzhou",
      "owner": "ownerqyb225"
    },
    {
      "cinema_id": 3,
      "cinema_name": "Pk Cinema",
      "cinema_location": "Beijing",
      "owner": "ownerqyb225"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any cinemas.",
  "data": {}
}

Cinemas - Location

某地的所有影院
GET/api/cinemas/location/$location

Example URI

GET http://172.18.157.240:8000/api/cinemas/location/$location
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Cinema search by location.",
  "data": [
    {
      "cinema_id": 1,
      "cinema_name": "Qubic cinema",
      "cinema_location": "Guangzhou",
      "owner": "ownerqyb225"
    },
    {
      "cinema_id": 2,
      "cinema_name": "Wonderful Cinema",
      "cinema_location": "Guangzhou",
      "owner": "ownerqyb225"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any cinemas.",
  "data": {}
}

Cinemas - CinemaName

某名字的所有影院
GET/api/cinemas/cinema-name/$cinema_name

Example URI

GET http://172.18.157.240:8000/api/cinemas/cinema-name/$cinema_name
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Cinema search by name.",
  "data": [
    {
      "cinema_id": 1,
      "cinema_name": "Qubic cinema",
      "cinema_location": "Guangzhou",
      "owner": "ownerqyb225"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any cinemas.",
  "data": {}
}

Movie Schedule

通过 schedule_id 获取排片信息
GET/api/schedule/$schedule_id

Example URI

GET http://172.18.157.240:8000/api/schedule/$schedule_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get schedule infomation successfully.",
  "data": {
    "schedule_id": 5,
    "cinema_id": 1,
    "hall_id": 1,
    "time": "2018/05/03-15:00",
    "movie_id": 8,
    "price": 80,
    "seat": [
      120,
      121,
      130,
      131
    ]
  }
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any schedules.",
  "data": {}
}

Movie Schedules - cinema_id

某影院的所有排片
GET/api/schedules/cinemaid/$cinema_id

Example URI

GET http://172.18.157.240:8000/api/schedules/cinemaid/$cinema_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get schedules successfully.",
  "data": [
    {
      "schedule_id": 1,
      "cinema_id": 1,
      "hall_id": 1,
      "time": "2018/05/03-12:00",
      "movie_id": 7,
      "price": 80
    },
    {
      "schedule_id": 5,
      "cinema_id": 1,
      "hall_id": 1,
      "time": "2018/05/03-15:00",
      "movie_id": 8,
      "price": 80
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any schedules.",
  "data": {}
}

Movie Schedules - movie_id

某电影的排片情况
GET/api/schedules/movieid/$movie_id

Example URI

GET http://172.18.157.240:8000/api/schedules/movieid/$movie_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get schedules successfully.",
  "data": [
    {
      "schedule_id": 1,
      "cinema_id": 1,
      "hall_id": 1,
      "time": "2018/05/03-12:00",
      "movie_id": 7,
      "price": 80
    },
    {
      "schedule_id": 2,
      "cinema_id": 2,
      "hall_id": 1,
      "time": "2018/05/03-13:00",
      "movie_id": 7,
      "price": 80
    },
    {
      "schedule_id": 3,
      "cinema_id": 3,
      "hall_id": 1,
      "time": "2018/05/03-13:00",
      "movie_id": 7,
      "price": 80
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any schedules.",
  "data": {}
}

Movie Schedules - movie_id and location

某地区某电影排片情况
GET/api/schedules/movieid/$movie_id/location/$location

Example URI

GET http://172.18.157.240:8000/api/schedules/movieid/$movie_id/location/$location
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get schedules successfully.",
  "data": [
    {
      "schedule_id": 1,
      "cinema_id": 1,
      "hall_id": 1,
      "time": "2018/05/03-12:00",
      "movie_id": 7,
      "price": 80
    },
    {
      "schedule_id": 2,
      "cinema_id": 2,
      "hall_id": 1,
      "time": "2018/05/03-13:00",
      "movie_id": 7,
      "price": 80
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any schedules.",
  "data": {}
}

Order

创建订单
POST/api/order

Example URI

POST http://172.18.157.240:8000/api/order
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "qyb225",
  "schedule_id": 5,
  "seat_id": 131
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Create order successfully.",
  "data": {
    "username": "qyb225",
    "order_id": 7
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "BAD_REQUEST",
  "message": "Cannot create this order, check you params.",
  "data": {}
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "INTERNAL_ERROR",
  "message": "Cannot create this order",
  "data": {}
}

Order

订单信息查询
GET/api/order/$username/$order_id

Example URI

GET http://172.18.157.240:8000/api/order/$username/$order_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get order information.",
  "data": {
    "order_id": 2,
    "username": "qyb225",
    "schedule_id": 5,
    "seat": 121,
    "is_paid": 1
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any order.",
  "data": {}
}

Order Payment

支付订单
PATCH/api/order/payment/$order_id

Example URI

PATCH http://172.18.157.240:8000/api/order/payment/$order_id
Request
HideShow
Body
{
  "username": "qyb225",
  "is_paid": true
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Successful payment.",
  "data": {
    "order_id": "1"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Order does not exist or has been paid.",
  "data": {}
}

Unpaid Orders

用户所有未支付订单
GET/api/orders/$username/unpaid-orders

Example URI

GET http://172.18.157.240:8000/api/orders/$username/unpaid-orders
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Find unpaid orders!",
  "data": [
    {
      "order_id": 3,
      "username": "qyb225",
      "schedule_id": 5,
      "seat": 130,
      "is_paid": 0
    },
    {
      "order_id": 4,
      "username": "qyb225",
      "schedule_id": 5,
      "seat": 131,
      "is_paid": 0
    }
  ]
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. Please login.",
  "data": {}
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any unpaid order.",
  "data": {}
}

Comment

发布评论
POST/api/comment

Example URI

POST http://172.18.157.240:8000/api/comment
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "qyb225",
  "movie_id": 8,
  "is_recommended": true,
  "comment_content": "这部电影真好看,墙裂推荐",
  "is_spoiled": false
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Comment created!",
  "data": {
    "comment_id": 4,
    "username": "qyb225",
    "movie_id": 8,
    "is_recommended": true,
    "comment_content": "这部电影真好看,墙裂推荐",
    "is_spoiled": false
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "BAD_REQUEST",
  "message": "Movie is not exists.",
  "data": {}
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied.",
  "data": {}
}
Response  409
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "CONFLICT",
  "message": "You have made a comment.",
  "data": {}
}
Response  500
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "status": "UNKNOWN_ERROR",
  "message": "Something wrong.",
  "data": {}
}

删除评论
DELETE/api/comment

Example URI

DELETE http://172.18.157.240:8000/api/comment
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "username": "qyb225",
    "movie_id": 8,
}
Response  200
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "status": "OK",
  "message": "Delete this comment successfully.",
  "data": {}
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied.",
  "data": {}
}

Movie's All Comments

一部电影的全部评论
GET/api/comments/all-comments/movieid/$movie_id

Example URI

GET http://172.18.157.240:8000/api/comments/all-comments/movieid/$movie_id
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "All comments.",
  "data": [
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    },
    {
      "comment_id": 10,
      "username": "user2",
      "movie_id": 9,
      "is_recommended": 0,
      "comment_content": "我觉得这个电影一般吧",
      "is_spoiled": 0,
      "time": "2018-05-26 20:33:38"
    },
    {
      "comment_id": 9,
      "username": "user1",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "主角死了,死得好惨",
      "is_spoiled": 1,
      "time": "2018-05-26 20:32:49"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

Amount of movie's comments

一部电影的全部评论数量
GET/api/comments/all-comments/movieid/$movie_id/amount

Example URI

GET http://172.18.157.240:8000/api/comments/all-comments/movieid/$movie_id/amount
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Amount of comments.",
  "data": {
    "amount": 3
  }
}

One Page of Movie's All Comments

获取电影全部评论中的一页
GET/api/comments/all-comments/movieid/$movie_id/page/$page_id/page-amount/$max_page_item_amount

Example URI

GET http://172.18.157.240:8000/api/comments/all-comments/movieid/$movie_id/page/$page_id/page-amount/$max_page_item_amount
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "All comments.",
  "data": [
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    },
    {
      "comment_id": 10,
      "username": "user2",
      "movie_id": 9,
      "is_recommended": 0,
      "comment_content": "我觉得这个电影一般吧",
      "is_spoiled": 0,
      "time": "2018-05-26 20:33:38"
    },
    {
      "comment_id": 9,
      "username": "user1",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "主角死了,死得好惨",
      "is_spoiled": 1,
      "time": "2018-05-26 20:32:49"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

Movie's Unspoiled Comments

一部电影的非剧透评论
GET/api/comments/unspoiled-comments/movieid/$movie_id

Example URI

GET http://172.18.157.240:8000/api/comments/unspoiled-comments/movieid/$movie_id
Response  200
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "status": "OK",
  "message": "Unspoiled comments.",
  "data": [
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    },
    {
      "comment_id": 10,
      "username": "user2",
      "movie_id": 9,
      "is_recommended": 0,
      "comment_content": "我觉得这个电影一般吧",
      "is_spoiled": 0,
      "time": "2018-05-26 20:33:38"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

Amount of movie's unspoiled comments

一部电影的非剧透评论数量
GET/api/comments/unspoiled-comments/movieid/$movie_id/amount

Example URI

GET http://172.18.157.240:8000/api/comments/unspoiled-comments/movieid/$movie_id/amount
Response  200
HideShow
Headers
Content-Type: applicaiton/json
Body
{
  "status": "OK",
  "message": "Amount of unspoiled comments.",
  "data": {
    "amount": 2
  }
}

One Page of Movie's Unspoiled Comments

获取电影非剧透评论中的一页
GET/api/comments/unspoiled-comments/movieid/$movie_id/page/$page_id/page-amount/$max_page_item_amount

Example URI

GET http://172.18.157.240:8000/api/comments/unspoiled-comments/movieid/$movie_id/page/$page_id/page-amount/$max_page_item_amount
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Unspoiled comments.",
  "data": [
    {
      "comment_id": 10,
      "username": "user2",
      "movie_id": 9,
      "is_recommended": 0,
      "comment_content": "我觉得这个电影一般吧",
      "is_spoiled": 0,
      "time": "2018-05-26 20:33:38"
    },
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

User's comments

某用户发布的所有评论
GET/api/comments/user/$username

Example URI

GET http://172.18.157.240:8000/api/comments/user/$username
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get user comments.",
  "data": [
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    },
    {
      "comment_id": 1,
      "username": "qyb225",
      "movie_id": 8,
      "is_recommended": 1,
      "comment_content": "这部电影真好看,墙裂推荐",
      "is_spoiled": 0,
      "time": "2018-05-26 19:17:54"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

Amount of user's comments

某用户发布的评论数量
GET/api/comments/user/$username/amount

Example URI

GET http://172.18.157.240:8000/api/comments/user/$username/amount
Response  200
HideShow
Headers
Content-Type: applicaiton/json
Body
{
  "status": "OK",
  "message": "Amount of comments.",
  "data": {
    "amount": 2
  }
}

One Page of User's Comments

获取某用户评论中的一页
GET/api/comments/user/$username/page/$page_id/page-amount/$max_page_item_amount

Example URI

GET http://172.18.157.240:8000/api/comments/user/$username/page/$page_id/page-amount/$max_page_item_amount
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Get user comments.",
  "data": [
    {
      "comment_id": 11,
      "username": "qyb225",
      "movie_id": 9,
      "is_recommended": 1,
      "comment_content": "超级好看,墙裂推荐!",
      "is_spoiled": 0,
      "time": "2018-05-26 20:39:19"
    },
    {
      "comment_id": 1,
      "username": "qyb225",
      "movie_id": 8,
      "is_recommended": 1,
      "comment_content": "这部电影真好看,墙裂推荐",
      "is_spoiled": 0,
      "time": "2018-05-26 19:17:54"
    }
  ]
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "NOT_FOUND",
  "message": "Cannot find any comment.",
  "data": {}
}

Generated by aglio on 23 Jun 2018