E-Tickets - Admin
E-Tickets-Owner API 文档(伟大的系统管理员 —— 我,专用)
Owner, User 的 API 见其它文档。
Resource Group ¶
Session ¶
登录POST/api/session/admin
Example URI
POST http://172.18.157.240:8000/api/session/admin
Request
Headers
Content-Type: applicaton/jsonBody
{
"username": "handsomeadmin",
"password": "123456"
}Response
200Headers
Content-Type: applicaton/jsonBody
{
"status": "OK",
"message": "Admin confirm.",
"data": {
"admin_username": "handsomeadmin"
}
}Response
403Headers
Content-Type: applicaton/jsonBody
{
"status": "FORBIDDEN",
"message": "Password wrong.",
"data": {}
}Response
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Admin does not exist.",
"data": {}
}登出DELETE/api/session/admin
Example URI
DELETE http://172.18.157.240:8000/api/session/admin
Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Admin log out successfully.",
"data": {}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "You have not logged in.",
"data": {}
}Movie ¶
创建电影POST/api/movie
Example URI
POST http://172.18.157.240:8000/api/movie
Request
Headers
Content-Type: application/jsonBody
{
"movie_title": "Interstellar",
"poster": "/images/poster/interstellar.png",
"director": "Christopher Nolan",
"actors": [
"Matthew McConaughey",
"Anne Hathaway",
"Jessica Chastain"
],
"tags": [
"Science Fiction",
"Space",
"Love",
"Adventure"
]
}Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Create movie successfully.",
"data": {
"movie_title": "Interstellar",
"poster": "/images/poster/interstellar.png",
"director": "Christopher Nolan",
"actors": [
"Matthew McConaughey",
"Anne Hathaway",
"Jessica Chastain"
],
"tags": [
"Science Fiction",
"Space",
"Love",
"Adventure"
]
}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. You are not admin",
"data": {}
}Response
500Headers
Content-Type: application/jsonBody
{
"status": "INTERNAL_ERROR",
"message": "Cannot create this movie.",
"data": {}
}Movie Poster ¶
上传电影海报 (不会更新数据,只拿到图片地址)POST/api/movie/poster
Example URI
POST http://172.18.157.240:8000/api/movie/poster
Request
Headers
Content-Type: multipart/form-dataBody
Content-Disposition: form-data; name="poster"; filename="xxx.png"Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Upload successfully.",
"data": {
"poster": "/images/poster/poster.png"
}
}Response
401Headers
Content-Type: application/jsonBody
{
"status": "UNAUTHORIZED",
"message": "Permission denied. Please login as admin.",
"data": {}
}Movie ¶
获取电影详情GET/api/movie/$movie_id
Example URI
GET http://172.18.157.240:8000/api/movie/$movie_id
Response
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies.",
"data": {
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies.",
"data": {
"movies": [
{
"title": "The Dark Knight",
"poster": "/images/poster/the-dark-knight.png",
"director": "Christopher Nolan",
"actors": [
"Christian Bale",
"Heath Ledger",
"Aaron Eckhart"
],
"tags": [
"Crime",
"DC"
]
},
{
"title": "Inception",
"poster": "/images/poster/inception.png",
"director": "Christopher Nolan",
"actors": [
" Leonardo DiCaprio",
"Joseph Gordon-Levitt",
"Ellen Page"
],
"tags": [
"Science Fiction",
"Action",
"Suspense"
]
},
{
"title": "Dunkirk",
"poster": "/images/poster/dunkirk.png",
"director": "Christopher Nolan",
"actors": [
"Fionn Whitehead",
"Barry Keoghan",
"Mark Rylance"
],
"tags": [
"War",
"Suspense"
]
},
{
"title": "Interstellar",
"poster": "/images/poster/interstellar.png",
"director": "Christopher Nolan",
"actors": [
"Matthew McConaughey",
"Anne Hathaway",
"Jessica Chastain"
],
"tags": [
"Science Fiction",
"Space",
"Love",
"Adventure"
]
}
]
}
}Response
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies. Search by title",
"data": {
"movies": [
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies.",
"data": {
"movies": [
{
"title": "The Dark Knight",
"poster": "/images/poster/the-dark-knight.png",
"director": "Christopher Nolan",
"actors": [
"Christian Bale",
"Heath Ledger",
"Aaron Eckhart"
],
"tags": [
"Crime",
"DC"
]
},
{
"title": "Inception",
"poster": "/images/poster/inception.png",
"director": "Christopher Nolan",
"actors": [
" Leonardo DiCaprio",
"Joseph Gordon-Levitt",
"Ellen Page"
],
"tags": [
"Science Fiction",
"Action",
"Suspense"
]
},
{
"title": "Dunkirk",
"poster": "/images/poster/dunkirk.png",
"director": "Christopher Nolan",
"actors": [
"Fionn Whitehead",
"Barry Keoghan",
"Mark Rylance"
],
"tags": [
"War",
"Suspense"
]
},
{
"title": "Interstellar",
"poster": "/images/poster/interstellar.png",
"director": "Christopher Nolan",
"actors": [
"Matthew McConaughey",
"Anne Hathaway",
"Jessica Chastain"
],
"tags": [
"Science Fiction",
"Space",
"Love",
"Adventure"
]
}
]
}
}Response
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies. Search by actor",
"data": {
"movies": [
{
"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
404Headers
Content-Type: application/jsonBody
{
"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
200Headers
Content-Type: application/jsonBody
{
"status": "OK",
"message": "Find movies. Search by tag",
"data": {
"movies": [
{
"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
404Headers
Content-Type: application/jsonBody
{
"status": "NOT_FOUND",
"message": "Cannot find any movie.",
"data": {}
}