Giter Site home page Giter Site logo

casto's Introduction

接口

  • /logon/ 注册,POST,username+password
    • 参数不合要求:error: invalid parameter
    • 成功重定向到login.html
  • /login/ 登录,POST,username+password,cookie
    • 参数为空:error: invalid parameter
    • 校验失败:error: fail to login
    • 登录成功200, set-cookie
  • /logout/ 登出,POST,cookie
    • 返回200
  • /operation/upload/ 上传图片,POST,cookie
    • 如果是本地图片,multipart/form-data, name='image'
    • 如果是网络图片,{ 'url': xxx }
    • 未登录:跳转至login.html
    • 请求格式错误:400
    • 下载失败:error: fail to download
    • 错误图片格式:error: wrong jpeg format
    • 操作成功:200, { 'id': 操作id}
  • /operation/{0, 1}/net/ 处理图片,POST, cookie
    • 未登录:跳转至login.html
    • 不属于该用户或不存在:error: not exists
    • 200, { 'data': 处理后data }
  • /operation/delete/ 删除操作,POST,cookie,{ 'ids': [要删除的操作记录id] }
    • 未登录:跳转至login.html
    • 返回200 { 'list': [ { 'id': 操作id, 'state': 是否成功 }, ... ] }
  • /operation/query/ 查看历史操作记录,POST,cookie
    • { 'start': timestamp, 'end': timestamp }, 2个可选参数,按时间段查询
    • 未登录:跳转至login.html
    • 200, { 'list': [ { 'id': 操作id, 'time': 时间戳, 'raw': 原始图片, 'name': 原始图片文件名, 'processed': [data0, data1] }, ...... ] }
  • /operation/{operation_id}/get/ 显示某一具体操作,POST, cookie
    • 未登录:跳转至login.html
    • 不属于该用户或不存在:error: not exists
    • 200, { 'id': 操作id, 'time': 时间戳, 'raw': 原始图片, 'name': 原始图片文件名, 'processed': [data0, data1] }
  • /admin/login/ 管理员登录,同/login/ 我突然意识到没必要做一个管理员登录登出啊,只要在下面这两个接口里判断是不是管理员就行了...
  • /admin/logout/ 管理员退出,同/logout/
  • /admin/query/ 管理员查看操作记录,POST,cookie
    • 未登录:跳转至login.html
    • 不是管理员:error: permission denied
    • { 'username': [ ] },可选,若为空返回所有用户记录,否则返回列表中用户记录
    • { 'start': timestamp, 'end': timestamp }, 2个可选参数,按时间段查询
    • 200, { 'list': [ { 'id': 操作id, 'username': xxx, 'time': xxx, 'raw': 原始图片, 'name': 原始图片文件名, 'processed': [data0, data1] }, ...... ] }
  • /admin/delete/ 管理员删除,同/operation/delete/
    • 不是管理员:error: permission denied

casto's People

Contributors

agil27 avatar zhangxwww avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.