E-Tickets - Cinema Owner
E-Tickets-Owner API 文档(影院老板专用)
Admin, User 的 API 见其它文档。
Resource Group ¶
Owner ¶
注册POST/api/owner
Example URI
POST http://172.18.157.240:8000/api/owner
Request
Headers
Content-Type: application/jsonBody
{
"username": "ownerqyb225",
"password": "abcd12345",
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Cinema boss register successfully.",
"data": {
"username": "user8888",
}
}Response
409Headers
Content-Type: application/jsonBody
{
"status": "CONFLICT",
"message": "Cinema boss username conflict.",
"data": {}
}Response
500Headers
Content-Type: application/jsonBody
{
"status": "UNKNOWN_ERROR",
"message": "Something wrong.",
"data": {}
}Session ¶
登录POST/api/session/owner
Example URI
POST http://172.18.157.240:8000/api/session/owner
Request
Headers
Content-Type: applicaton/jsonBody
{
"username": "ownerqyb225",
"password": "123456"
}Response
200Headers
Content-Type: applicaton/jsonBody
{
"status": "OK",
"message": "Cinema boss confirm.",
"data": {
"username": "ownerqyb225"
}
}Response
403Headers
Content-Type: applicaton/jsonBody
{
"status": "FORBIDDEN",
"message": "Password wrong.",
"data": {}
}Response
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cinema owner does not exist.",
"data": {}
}登出DELETE/api/session/owner
Example URI
DELETE http://172.18.157.240:8000/api/session/owner
Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Cinema Owner log out successfully.",
"data": {}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "You have not logged in.",
"data": {}
}Cinema ¶
创建影院POST/api/cinema
Example URI
POST http://172.18.157.240:8000/api/cinema
Request
Headers
Content-Type: application/jsonBody
{
"username": "ownerqyb225",
"cinema_name": "Beijing International Cinema",
"cinema_location": "Beijing"
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Create cinema successfully.",
"data": {
"cinema_id": 4,
"owner": "ownerqyb225",
"cinema_name": "Beijing International Cinema",
"cinema_location": "Beijing"
}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. You are not a cinema owner.",
"data": {}
}Response
500Headers
Content-Type: application/jsonBody
{
"status": "INTERNAL_ERROR",
"message": "Cannot create this cinema."
"data": {}
}MovieHall ¶
创建影厅POST/api/cinema/moviehall
Example URI
POST http://172.18.157.240:8000/api/cinema/moviehall
Request
Headers
Content-Type: application/jsonBody
{
"username": "ownerqyb225",
"cinema_id": 4,
"hall_id": 1,
"size_id": 3,
"size": 480
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Create movie hall successfully.",
"data": {
"cinema_id": 4,
"hall_id": 1,
"size_id": 3,
"size": 480
}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. You are not the owner of this cinema.",
"data": {}
}Response
500Headers
Content-Type: application/jsonBody
{
"status": "INTERNAL_ERROR",
"message": "Cannot create this movie hall."
"data": {}
}Cinema Info ¶
获取电影院信息GET/api/cinema/$cinema_id
Example URI
GET http://172.18.157.240:8000/api/cinema/$cinema_id
Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Cinema information.",
"data": {
"cinema_id": 1,
"cinema_name": "Qubic cinema",
"cinema_location": "Guangzhou",
"owner": "ownerqyb225"
}
}Response
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cannot find any movie halls.",
"data": {}
}Movie hall Info ¶
影院某个影厅信息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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Movie Hall information.",
"data": {
"cinema_id": 1,
"hall_id": 1,
"size_id": 2,
"size": 320
}
}Response
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Cinema search by name.",
"data": [
{
"cinema_id": 1,
"cinema_name": "Qubic cinema",
"cinema_location": "Guangzhou",
"owner": "ownerqyb225"
}
]
}Response
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cannot find any cinemas.",
"data": {}
}Movie Schedule ¶
创建排片POST/api/schedule
Example URI
POST http://172.18.157.240:8000/api/schedule
Request
Headers
Content-Type: application/jsonBody
{
"username": "ownerqyb225",
"cinema_id": 4,
"hall_id": 1,
"movie_id": 8,
"time": "2018-05-03-15-00",
"price": 80
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Create schedule successfully.",
"data": {
"schedule_id": 6,
"movie_id": 8,
"cinema_id": 4,
"hall_id": 1,
"time": "2018-05-03-15-00",
"price": 80
}
}Response
400Headers
Content-Type: application/jsonBody
{
"status": "BAD_REQUEST",
"message": "Invalid params",
"data": {}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. You are not a cinema owner.",
"data": {}
}Movie Schedule ¶
通过 id 获取排片详情GET/api/schedule/$schedule_id
Example URI
GET http://172.18.157.240:8000/api/schedule/$schedule_id
Response
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cannot find any schedules.",
"data": {}
}删除排片DELETE/api/schedule/$schedule_id
Example URI
DELETE http://172.18.157.240:8000/api/schedule/$schedule_id
Request
Headers
Content-Type: applicaton/jsonBody
{
"username": "ownerqyb225",
"cinema_id": 1
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Delete schedule successfully.",
"data": {}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. You are not the owner of this schedule.",
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"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
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cannot find any schedules.",
"data": {}
}