Giter Club home page Giter Club logo

bookmanagement's Introduction

API Document

Get start

run ```npm install```

0 login

请求格式:

method: POST
Content-type: application/json
url: /login
data: {
    id: "1231312313",
    name:"xxx",
    password: "sdufh2398fh"
}

响应格式:

body: {
    status: 状态码,
    token: "Token for identity"
}

1. addBorrow_card

增加借书卡 卡号, 姓名, 单位, 类别 (教师 学生)

请求格式:

method: POST
Content-type: application/json
url: /addcard
data: {
    name:"肥猫",
    department:"大肥猫学院",
    type:"T/S",
    token: "Token for identity"
} 

响应格式:

Content-type: application/json
body: {
    status: 一个状态码,
    card_id: x ,
    message:"sucess/fail"
}

status 状态码及其 message 含义:

status message
1 OK
-1 失败

2. addbook

图书入库 书号, 类别, 书名, 出版社, 年份, 作者, 价格, 数量 请求格式:

method: POST
Content-type: application/json
url: /addBook
data: {
    book:[
        {
            type:"Computer Sicence",
            bookname:"Database System Introduction",
            publisher:"ZheJiangUniversity",
            year:"1999",
            price:"123.22",
            author:"xxx"
        },
        ...
    ]
    token: "Token for identity"
} 

响应格式:

Content-type: application/json
body: {
    status: 一个状态码,
    bookid: xxx,
    message: "状态说明"
}

status 状态码及其 message 含义:

status message
1 OK
-1 失败

3. select/display

显示某个用户的借书情况

请求格式:

method: POST
Content-type: application/json
url: select/display
data: {
    card_id: "借书证唯一id",
    token: "Token for identity",
}

响应格式:

Content-type: application/json
body: {
"status": 1,
"result": [
    {
        "book_id": 10,
        "type": "novel",
        "bookname": "The Old Curiosity Shop",
        "publisher": "Orcale",
        "year": 2018,
        "author": "Charles John Huffam Dickens",
        "price": 22.15
    },
    ...

]
}

4. select/find

更具信息查询数据

请求格式:

method: POST
Content-type: application/json
url: /update/courseData
data: {
    type:"Computer Sicence",
    bookname:"Database System Introduction",
    publisher:"ZheJiangUniversity",
    year_min:"1999",
    yeasr_max:"2010",
    price_min:"123.22",
    price_max:"999.55",
    order:排序状态码,
    token: "Token for identity"
} 

响应格式:

Content-type: application/json
body: {
"status": 1,
"result": [
    {
        "book_id": 10,
        "type": "novel",
        "bookname": "The Old Curiosity Shop",
        "publisher": "Orcale",
        "year": 2018,
        "author": "Charles John Huffam Dickens",
        "price": 22.15
    },
    ...
    
]
}

order

order
bookname 书名首字母排序
type 类别排序
publisher 出版社排序
year 出版年份排序
price 价格

5. borrow

借书

请求格式:

method: POST
Content-type: application/json
url: borrow
data: {
    card_id: "借书证唯一id",
    book_id:"每一本书的唯一id",
    data_borrow:"(now) xxxx-xx-xx",
    data_return:"xxxx-xx-xx",
    admin_name:"sdff",
    token: "Token for identity",
}

响应格式:

Content-type: application/json
body: {
    status: 一个状态码,
    message:""
}
status message
1 OK
-1 失败

6. return

借书

请求格式:

method: POST
Content-type: application/json
url: return
data: {
    card_id: "借书证唯一id",
    book_id:"每一本书的唯一id"
    token: "Token for identity",
}

响应格式:

Content-type: application/json
body: {
    status: 一个状态码,
    message:""
}
status message
1 OK
-1 失败

bookmanagement's People

Contributors

eypidan 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.