Home - Jarvie8176/renison-library GitHub Wiki

Welcome to the renison-library wiki!

API

/webapp/api/v1

GET

  • /webapp/api/v1/book/

    get content of all books as a collection of single search results

Example:

GET /webapp/api/v1/book/

RESPONSE


{
    "books": [
        {
            "content": {
                "ISBN": "9787100021111",
                "Author": "Ge 葛晓音 Xiaoyin",
                "Dewey": "901 G40"
            },
            "cover": "/static/image/cover/s5845929.jpg",
            "id": "31187036461331",
            "title": "Chinese cultural knowledge collection: Historical Scenic Sites in China, Zhongguo de Mingsheng Guji 中国自然地理知识丛书:中国的名胜古迹"
        },

        ...

        {
            "content": {
                "ISBN": "9787105029525",
                "Author": "Wang  王贵 Gui",
                "Dewey": "951.5 W46"
            },
            "cover": "image/cover/default-book-cover.jpg",
            "id": "31187036460754",
            "title": "Comments on the Historical Status of Tibet, 西藏历史地位辨"
        }
    ]
}

  • /webapp/api/v1/book/{book_id}/

    get content of book with given book id

    "cover" will be the relative path to host

    host cover path
    localhost localhost/path/to/cover.jpg/

Example:

GET /webapp/api/v1/book/31187036467049/

RESPONSE


{
    "content": {
        "ISBN": null,
        "Author": "Lu 鲁迅 Xun, Shanghai wenyi chuban she 上海文艺出版社",
        "Dewey": "814 C L80"
    },
    "cover": "image/cover/default-book-cover.jpg",
    "id": "31187036467049",
    "title": "Lu Xun - Dawn blossoms plucked at dusk / 朝花夕拾 zhao hua xi shi"
}

  • /webapp/api/v1/book/search?field={searchable_field}&keyword={keyword}

    searchable_field can be: title, author, isbn

    keyword can be any text

    returns book contents that matches the searching criteria

    Example:

GET /webapp/api/v1/book/search/?field=title&keyword=historical+tibet

RESPONSE


{
    "books": [
        {
            "content": {
                "ISBN": "9787105029525",
                "Author": "Wang  王贵 Gui",
                "Dewey": "951.5 W46"
            },
            "cover": "image/cover/default-book-cover.jpg",
            "id": "31187036460754",
            "title": "Comments on the Historical Status of Tibet, 西藏历史地位辨"
        }
    ]
}

GET /webapp/api/v1/book/search/?field=title&keyword=historical

RESPONSE


{
    "books": [
        {
            "content": {
                "ISBN": "9787100021111",
                "Author": "Ge 葛晓音 Xiaoyin",
                "Dewey": "901 G40"
            },
            "cover": "/static/image/cover/s5845929.jpg",
            "id": "31187036461331",
            "title": "Chinese cultural knowledge collection: Historical Scenic Sites in China, Zhongguo de Mingsheng Guji 中国自然地理知识丛书:中国的名胜古迹"
        },
        {
            "content": {
                "ISBN": "9787105029525",
                "Author": "Wang  王贵 Gui",
                "Dewey": "951.5 W46"
            },
            "cover": "image/cover/default-book-cover.jpg",
            "id": "31187036460754",
            "title": "Comments on the Historical Status of Tibet, 西藏历史地位辨"
        }
    ]
}