Back to top

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
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "username": "handsomeadmin",
  "password": "123456"
}
Response  200
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "status": "OK",
  "message": "Admin confirm.",
  "data": {
    "admin_username": "handsomeadmin"
  }
}
Response  403
HideShow
Headers
Content-Type: applicaton/json
Body
{
  "status": "FORBIDDEN",
  "message": "Password wrong.",
  "data": {}
}
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "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  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Admin log out successfully.",
  "data": {}
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "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
HideShow
Headers
Content-Type: application/json
Body
{
  "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  200
HideShow
Headers
Content-Type: application/json
Body
{
  "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  401
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "UNAUTHORIZED",
  "message": "Permission denied. You are not admin",
  "data": {}
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "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
HideShow
Headers
Content-Type: multipart/form-data
Body
Content-Disposition: form-data; name="poster"; filename="xxx.png"
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "status": "OK",
  "message": "Upload successfully.",
  "data": {
    "poster": "/images/poster/poster.png"
  }
}
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "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  200
HideShow
Headers
Content-Type: application/json
Body
{
    "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  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": [
      {
        "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  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": [
      {
        "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.",
  "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  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": [
      {
        "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": [
      {
        "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": {}
}

Generated by aglio on 09 Jun 2018