Giter VIP home page Giter VIP logo

shulibrary's Introduction

shuLibrary

上海大学图书馆手机版后端

docker

docker run -p 5000:5000 -e REDIS_IP=REDIS_IP zhoudian64/shu-library

安装依赖

需要Python3:

pip3 install -r requirements.txt

需要自行安装的依赖

  • redis

运行

运行前请确保redis-server正在工作,可通过app.py中的app.config['REDIS_KWARGS']参数调整host和port(默认为127.0.0.1:6379)

开发环境

export REDIS_IP=localhost
export FLASK_APP=app
flask run

生产环境

gunicorn -b 0.0.0.0:5000 app:app

API Reference

登录

Request

  • method: POST
  • URL: /login
  • Format: json
  • Body:
    {
        "username": "学生证号",
        "password": "学生密码"
    }

Response

{
    "token": "$JWT_TOKEN"
}

借阅信息

Request

  • method: GET
  • URL: /loans
  • Authorization: Bearer $JWT_TOKEN

Response

{
    "loans": [
        {
            "author": "著者",
            "description": "题名",
            "due_date": "应还日期(YYYYMMDD)",
            "fine": "罚金",
            "id": "ID",
            "sub_library": "分馆",
            "year": "出版年(YYYY)"
        },
        "..."
    ]
}

借阅历史

Request

  • method: GET
  • URL: /histories
  • Authorization: Bearer $JWT_TOKEN

Response

{
    "histories": [
        {
            "author": "著者",
            "description": "题名",
            "due_date": "应还日期(YYYYMMDD)",
            "fine": "罚金",
            "returned_date": "归还日期(YYYYMMDD)",
            "returned_hour": "归还时间(HH:MM)",
            "sub_library": "分馆",
            "year": "出版年(YYYY)"
        },
        "..."
    ]
}

shulibrary's People

Contributors

zkllab avatar zhoudian64 avatar

Watchers

Hansen Hu avatar James Cloos avatar Adam Basfop Cavendish avatar grzhan avatar 马逸清 avatar  avatar Shengzhou Li avatar 龙方淞 avatar En Jiang avatar cosformula avatar  avatar

Forkers

zhoudian64

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.