# 悦读 ECUT 接口文档

# 待添加接口

!> 爬到的图书现在只支持 epub 图书,也就是.opf 结尾的文件后缀图书,当然后续我会增加 txt 文本阅读器,可以适当爬取 txt 文本的图书,要多不要少,后续添加一点知网的图书,具体内容可以问一下我,最好买一个服务器,将接口地址转成 https 开头的 ssl 证书地址,具体上线效果可以参考我的小程序或者微信读书,小程序是仿微信读书的。

接口可以参考网易云音乐 API地址 (opens new window)

  • [ ] 首页 banner 部分接口,每个 json 返回对象需要添加和图书详情差不多返回值
  • [ ] 登陆注册接口,这个写接口一般都必会的
  • [ ] 图书详情(具体返回值参考微信读书中的图书详情字段 和本 API 文档字段)
  • [ ] 根据当前用户推荐图书列表
  • [ ] 强化图书查询接口
  • [ ] 每日签到打卡接口 需要返回用户连续签到天数
  • [ ] 增加用户创建书单接口(添加图书到书单,删除图书)
  • [ ] 获取用户创建的书单图书列表
  • [ ] 图书广场接口(仿在东理新鲜事接口,具体可以参考 在东理新鲜事接口 (opens new window))(点赞 评论 取消点赞 取消评论 发布新鲜事 删除 查询用户发布新鲜事 查询新鲜事评论数 具体评论 查询新鲜事点赞数 转发 后续添加关注接口 查询用户关注用户)
  • [ ] 用户相关接口(头像 头像更换上传 书架图书 书单详情 注册时间 等等)
  • [ ] 图书榜单(类似书城都有的那种 top 榜)
  • [ ] 增加更多图书分类列表接口
  • [ ] 封装好的 qq 小程序 openId 获取接口

# 首页

# 获取首页数据

# 接口地址

GET /book/home/v2

# 请求参数

参数名称 是否必须 类型 说明
openId String 用户的 openId

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据
hotSearch Object 热门搜索
shelf Array 书架推荐图书
recommend Array 为你推荐
freeRead Array 免费阅读
hotBook Array 当前最热
category Array 分类
banner Object Banner 图
shelfCount int 书架图书数量

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": {
    "hotSearch": {
      "num": 15,
      "keyword": "Computer"
    },
    "shelf": [
      {
        "id": 20,
        "fileName": "2018_Book_ComputerAidedVerification",
        "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-96142-2_CoverFigure.jpg",
        "title": "Computer Aided Verification",
        "author": "Hana Chockler",
        "publisher": "Springer International Publishing",
        "bookId": "2018_Book_ComputerAidedVerification",
        "category": 1,
        "categoryText": "ComputerScience",
        "language": "en",
        "rootFile": "OEBPS/package.opf"
      }
    ],
    "recommend": [
      {
        "id": 27,
        "fileName": "2018_Book_ApplyingTheKaizenInAfrica",
        "cover": "https://www.youbaobao.xyz/book/res/img/Economics/978-3-319-91400-8_CoverFigure.jpg",
        "title": "Applying the Kaizen in Africa",
        "author": "Keijiro Otsuka",
        "publisher": "Springer International Publishing",
        "bookId": "2018_Book_ApplyingTheKaizenInAfrica",
        "category": 3,
        "categoryText": "Economics",
        "language": "en",
        "rootFile": "OEBPS/package.opf"
      }
    ],
    "freeRead": [
      {
        "id": 17,
        "fileName": "2018_Book_FoundationsOfTrustedAutonomy",
        "cover": "https://www.youbaobao.xyz/book/res/img/Engineering/978-3-319-64816-3_CoverFigure.jpg",
        "title": "Foundations of Trusted Autonomy",
        "author": "Hussein A. Abbass",
        "publisher": "Springer International Publishing",
        "bookId": "2018_Book_FoundationsOfTrustedAutonomy",
        "category": 5,
        "categoryText": "Engineering",
        "language": "en",
        "rootFile": "OEBPS/package.opf"
      }
    ],
    "hotBook": [
      {
        "id": 225,
        "fileName": "2016_Book_MicrofinanceEUStructuralFundsA",
        "cover": "https://www.youbaobao.xyz/book/res/img/Economics/2016_Book_MicrofinanceEUStructuralFundsA.jpeg",
        "title": "Microfinance, EU Structural Funds and Capacity Building for Managing Authorities",
        "author": "Giovanni Nicola Pes",
        "publisher": "Palgrave Macmillan",
        "bookId": "2016_Book_MicrofinanceEUStructuralFundsA",
        "category": 3,
        "categoryText": "Economics",
        "language": "en",
        "rootFile": "OEBPS/9781137536013.opf"
      }
    ],
    "category": [
      {
        "cover": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-25474-6_CoverFigure.jpg",
        "category": 12,
        "categoryText": "Biomedicine",
        "num": 14,
        "cover2": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-72790-5_CoverFigure.jpg"
      }
    ],
    "banner": {
      "img": "https://www.youbaobao.xyz/book/res/bg.jpg",
      "title": "mpvue2.0多端小程序课程重磅上线",
      "subTitle": "马上学习",
      "url": "https://www.youbaobao.xyz/book/#/book-store/shelf"
    },
    "shelfCount": 1
  }
}

# 获取微信用户的 openId

# 接口地址

GET /openId/get

# 请求参数

参数名称 是否必须 类型 说明
appId String 微信小程序的 appId
code String 微信登录 wx.login 后获得的 code
secret String 小程序的 secret key

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据
openid String 用户的 openId
session_key String 用户登录 sessionKey,用于微信 jsapi 请求

# 示例

{
  "error_code": 0,
  "msg": "获取openId成功",
  "data": {
    "session_key": "abcdefg",
    "openid": "hijklmn"
  }
}

# 获取支付宝用户的 openId

# 接口地址

GET /openId/get/alipay

# 请求参数

参数名称 是否必须 类型 说明
appId String 支付宝小程序的 appId
code String 支付宝授权 my.getAuthCode 后获得的 authCode

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据
openid String 用户的 userId+alipayUserId
session_key String 用户登录 sessionKey,用于支付宝 jsapi 请求

# 示例

  • 请求:https://test.youbaobao.xyz:18081/openId/get/alipay?appId=1234&code=5678
  • 响应:
{
  "error_code": 0,
  "msg": "获取openId成功",
  "data": {
    "session_key": "abcdefg",
    "openid": "1234|5678"
  }
}

# 用户注册

# 接口地址

POST /user/register

# 请求参数

参数名称 是否必须 类型 说明
openId String 用户的 openId
platform String 用户所属平台,默认为 wx
avatarUrl String 用户头像图片地址
nickName String 用户昵称
gender int 用户性别,1-男,2-女,0-未公开,默认为 0
country String 用户所在国家
province String 用户所在省份
city String 用户所在城市
language String 用户使用的语言

注:参数为 json 形式

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息

# 示例

{ "error_code": 0, "msg": "用户注册成功" }

# 获取"为你推荐"数据

# 接口地址

GET /book/home/recommend/v2

# 请求参数

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "id": 418,
      "fileName": "2015_Book_SocioeconomicAndEnvironmentalI",
      "cover": "https://www.youbaobao.xyz/book/res/img/SocialSciences/2015_Book_SocioeconomicAndEnvironmentalI.jpeg",
      "title": "Socioeconomic and Environmental Implications of Agricultural Residue Burning",
      "author": "Parmod Kumar, Surender Kumar and Laxmi Joshi",
      "publisher": "Springer India, New Delhi",
      "bookId": "2015_Book_SocioeconomicAndEnvironmentalI",
      "category": 2,
      "categoryText": "SocialSciences",
      "language": "en",
      "rootFile": "OEBPS/content.opf"
    },
    {
      "id": 24,
      "fileName": "2018_Book_SecurityInComputerAndInformati",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-95189-8_CoverFigure.jpg",
      "title": "Security in Computer and Information Sciences",
      "author": "Erol Gelenbe",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_SecurityInComputerAndInformati",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 38,
      "fileName": "2018_Book_DesigningSustainableTechnologi",
      "cover": "https://www.youbaobao.xyz/book/res/img/Environment/978-3-319-66981-6_CoverFigure.jpg",
      "title": "Designing Sustainable Technologies, Products and Policies",
      "author": "Enrico Benetto",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_DesigningSustainableTechnologi",
      "category": 6,
      "categoryText": "Environment",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    }
  ]
}

# 获取"免费阅读"数据

# 接口地址

GET /book/home/freeRead/v2

# 请求参数

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "id": 13,
      "fileName": "2017_Book_SatelliteEarthObservationsAndT",
      "cover": "https://www.youbaobao.xyz/book/res/img/EarthSciences/978-981-10-3713-9_CoverFigure.jpg",
      "title": "Satellite Earth Observations and Their Impact on Society and Policy",
      "author": "Masami Onoda",
      "publisher": "Springer Singapore",
      "bookId": "2017_Book_SatelliteEarthObservationsAndT",
      "category": 14,
      "categoryText": "EarthSciences",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 19,
      "fileName": "2018_Book_AutonomousControlForAReliableI",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-90415-3_CoverFigure.jpg",
      "title": "Autonomous Control for a Reliable Internet of Services",
      "author": "Ivan Ganchev",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_AutonomousControlForAReliableI",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 20,
      "fileName": "2018_Book_ComputerAidedVerification",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-96142-2_CoverFigure.jpg",
      "title": "Computer Aided Verification",
      "author": "Hana Chockler",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_ComputerAidedVerification",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 26,
      "fileName": "2018_Book_AFairShareOfTax",
      "cover": "https://www.youbaobao.xyz/book/res/img/Economics/978-3-319-69772-7_CoverFigure.jpg",
      "title": "A Fair Share of Tax",
      "author": "Lotta Björklund Larsen",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_AFairShareOfTax",
      "category": 3,
      "categoryText": "Economics",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    }
  ]
}

# 获取"当前最热"数据

# 接口地址

GET /book/home/hotBook/v2

# 请求参数

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "id": 139,
      "fileName": "2018_Book_EvolutionMonitoringAndPredicti",
      "cover": "https://www.youbaobao.xyz/book/res/img/EarthSciences/2018_Book_EvolutionMonitoringAndPredicti.jpeg",
      "title": "Evolution, Monitoring and Predicting Models of Rockburst",
      "author": "Chunlai Wang",
      "publisher": "Springer Singapore, Singapore",
      "bookId": "2018_Book_EvolutionMonitoringAndPredicti",
      "category": 14,
      "categoryText": "EarthSciences",
      "language": "en",
      "rootFile": "OEBPS/content.opf"
    },
    {
      "id": 24,
      "fileName": "2018_Book_SecurityInComputerAndInformati",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-95189-8_CoverFigure.jpg",
      "title": "Security in Computer and Information Sciences",
      "author": "Erol Gelenbe",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_SecurityInComputerAndInformati",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 180,
      "fileName": "2014_Book_OptimizingHPCApplicationsWithI",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/2014_Book_OptimizingHPCApplicationsWithI.jpeg",
      "title": "Optimizing HPC Applications with Intel® Cluster Tools",
      "author": "Alexander Supalov, Andrey Semin, Michael Klemm and Christopher Dahnken",
      "publisher": "Apress, Berkeley, CA",
      "bookId": "2014_Book_OptimizingHPCApplicationsWithI",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/content.opf"
    },
    {
      "id": 2,
      "fileName": "2017_Book_HormonesMetabolismAndTheBenefi",
      "cover": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-72790-5_CoverFigure.jpg",
      "title": "Hormones, Metabolism and the Benefits of Exercise",
      "author": "Bruce Spiegelman",
      "publisher": "Springer International Publishing",
      "bookId": "2017_Book_HormonesMetabolismAndTheBenefi",
      "category": 12,
      "categoryText": "Biomedicine",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    }
  ]
}

# 搜索

# 获取热门搜索词

# 接口地址

GET /book/hot-search

# 请求参数

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "title": "Tools and Algorithms for the Construction and Analysis of Systems",
      "fileName": "2018_Book_ToolsAndAlgorithmsForTheConstr"
    },
    {
      "title": "Computer Aided Verification",
      "fileName": "2018_Book_ComputerAidedVerification"
    },
    {
      "title": "Nanoinformatics",
      "fileName": "2018_Book_Nanoinformatics"
    },
    {
      "title": "Designing Sustainable Technologies, Products and Policies",
      "fileName": "2018_Book_DesigningSustainableTechnologi"
    },
    {
      "title": "Optimizing HPC Applications with Intel® Cluster Tools",
      "fileName": "2014_Book_OptimizingHPCApplicationsWithI"
    },
    {
      "title": "Hormones, Metabolism and the Benefits of Exercise",
      "fileName": "2017_Book_HormonesMetabolismAndTheBenefi"
    },
    {
      "title": "Prozessintelligenz",
      "fileName": "2018_Book_Prozessintelligenz"
    },
    {
      "title": "RESTART Sustainable Business Model Innovation",
      "fileName": "2018_Book_RESTARTSustainableBusinessMode"
    },
    {
      "title": "Innovative Medicine",
      "fileName": "2015_Book_InnovativeMedicine"
    },
    {
      "title": "Library and Information Sciences",
      "fileName": "2014_Book_LibraryAndInformationSciences"
    }
  ]
}

# 关键词搜索

# 接口地址

GET /book/search

# 请求参数

参数名称 是否必须 类型 说明
keyword String 搜索关键字
openId String 用户的 openId
page int 搜索页数,默认为 1
pageSize int 搜索结果数,默认为 20

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据
author Array 匹配到的作者
category Array 匹配到的分类
publisher Array 匹配到的出版社
book Array 匹配到的图书

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": {
    "book": [
      {
        "id": 1,
        "fileName": "2016_Book_PhysiologyPsychoacousticsAndCo",
        "cover": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-25474-6_CoverFigure.jpg",
        "title": "Physiology, Psychoacoustics and Cognition in Normal and Impaired Hearing",
        "author": "Pim van Dijk",
        "publisher": "Springer International Publishing",
        "bookId": "2016_Book_PhysiologyPsychoacousticsAndCo",
        "category": 12,
        "categoryText": "Biomedicine",
        "language": "en",
        "rootFile": "OEBPS/package.opf"
      },
      {
        "id": 2,
        "fileName": "2017_Book_HormonesMetabolismAndTheBenefi",
        "cover": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-72790-5_CoverFigure.jpg",
        "title": "Hormones, Metabolism and the Benefits of Exercise",
        "author": "Bruce Spiegelman",
        "publisher": "Springer International Publishing",
        "bookId": "2017_Book_HormonesMetabolismAndTheBenefi",
        "category": 12,
        "categoryText": "Biomedicine",
        "language": "en",
        "rootFile": "OEBPS/package.opf"
      }
    ],
    "author": [
      {
        "author": "Bruce Spiegelman"
      }
    ],
    "category": [
      {
        "category": 1,
        "categoryText": "ComputerScience"
      }
    ],
    "publisher": [
      {
        "publisher": "Apress, Berkeley, CA"
      }
    ]
  }
}

# 图书列表

# 获取图书列表

# 接口地址

GET /book/search-list

# 请求参数

参数名称 是否必须 类型 说明
publisher String 出版社名称
author String 作者名称
category String 分类名称
categoryId String 分类 ID
page int 搜索页数,默认为 1
pageSize int 搜索结果数,默认为 20

publisher、author、category、categoryId 四个参数至少需要传入一个,否则会返回错误

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "id": 19,
      "fileName": "2018_Book_AutonomousControlForAReliableI",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-90415-3_CoverFigure.jpg",
      "title": "Autonomous Control for a Reliable Internet of Services",
      "author": "Ivan Ganchev",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_AutonomousControlForAReliableI",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    },
    {
      "id": 20,
      "fileName": "2018_Book_ComputerAidedVerification",
      "cover": "https://www.youbaobao.xyz/book/res/img/ComputerScience/978-3-319-96142-2_CoverFigure.jpg",
      "title": "Computer Aided Verification",
      "author": "Hana Chockler",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_ComputerAidedVerification",
      "category": 1,
      "categoryText": "ComputerScience",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    }
  ]
}

# 分类列表

# 获取分类列表

# 接口地址

GET /book/category/list/v2

# 请求参数

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "查询成功",
  "data": [
    {
      "cover": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-25474-6_CoverFigure.jpg",
      "category": 12,
      "categoryText": "Biomedicine",
      "num": 14,
      "cover2": "https://www.youbaobao.xyz/book/res/img/Biomedicine/978-3-319-72790-5_CoverFigure.jpg"
    },
    {
      "cover": "https://www.youbaobao.xyz/book/res/img/BusinessandManagement/978-3-319-33515-5_CoverFigure.jpg",
      "category": 13,
      "categoryText": "BusinessandManagement",
      "num": 16,
      "cover2": "https://www.youbaobao.xyz/book/res/img/BusinessandManagement/978-3-319-95261-1_CoverFigure.jpg"
    }
  ]
}

# 图书详情

# 获取图书详情

# 接口地址

GET /book/detail

# 请求参数

参数名称 是否必须 类型 说明
fileName String 图书名称
openId String 用户的 openId

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据
fileName String epub 文件名,电子书唯一标识
opf String opf 文件地址
title String 标题
author String 作者
publisher String 出版社
bookId String 同 fileName,电子书唯一标识
category int 图书对应分类 id
categoryText String 图书分类名称
language String 图书语种
readers Array 阅读人信息,最多 10 条
readerNum int 阅读数量
rank int 当前用户的评分
rankNum int 评分人数
rankAvg String 平均评分

# 示例

{
  "error_code": 0,
  "msg": "获取成功",
  "data": {
    "id": 111,
    "fileName": "2015_Book_ContemporaryBioethics",
    "cover": "https://www.youbaobao.xyz/book/res/img//Biomedicine/2015_Book_ContemporaryBioethics.jpeg",
    "title": "Contemporary Bioethics",
    "author": "Mohammed Ali Al-Bar and Hassan Chamsi-Pasha",
    "publisher": "Springer International Publishing, Cham",
    "bookId": "2015_Book_ContemporaryBioethics",
    "category": 12,
    "categoryText": "Biomedicine",
    "language": "en",
    "rootFile": "OEBPS/content.opf",
    "selected": false,
    "private": false,
    "cache": false,
    "haveRead": 0,
    "opf": "https://www.youbaobao.xyz/epub2/2015_Book_ContemporaryBioethics/OEBPS/content.opf",
    "readers": [
      {
        "avatarUrl": "https://wx.qlogo.cn/xxx",
        "nickName": "xxx",
        "create_dt": 1560081154139
      }
    ],
    "readerNum": 13,
    "rank": 2,
    "rankNum": 2,
    "rankAvg": 3
  }
}

# 获取图书目录

# 接口地址

GET /book/contents

# 请求参数

参数名称 是否必须 类型 说明
fileName String 图书名称

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回数据

# 示例

{
  "error_code": 0,
  "msg": "获取成功",
  "data": {
    "id": 111,
    "fileName": "2015_Book_ContemporaryBioethics",
    "cover": "https://www.youbaobao.xyz/book/res/img//Biomedicine/2015_Book_ContemporaryBioethics.jpeg",
    "title": "Contemporary Bioethics",
    "author": "Mohammed Ali Al-Bar and Hassan Chamsi-Pasha",
    "publisher": "Springer International Publishing, Cham",
    "bookId": "2015_Book_ContemporaryBioethics",
    "category": 12,
    "categoryText": "Biomedicine",
    "language": "en",
    "rootFile": "OEBPS/content.opf",
    "selected": false,
    "private": false,
    "cache": false,
    "haveRead": 0,
    "opf": "https://www.youbaobao.xyz/epub2/2015_Book_ContemporaryBioethics/OEBPS/content.opf",
    "readers": [
      {
        "avatarUrl": "https://wx.qlogo.cn/xxx",
        "nickName": "xxx",
        "create_dt": 1560081154139
      }
    ],
    "readerNum": 13,
    "rank": 2,
    "rankNum": 2,
    "rankAvg": 3
  }
}

# 获取图书存储书架状态

# 接口地址

GET /book/shelf/get

# 请求参数

参数名称 是否必须 类型 说明
fileName String 图书名称
openId String 用户的 openId

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回数据

# 示例

{
  "error_code": 0,
  "msg": "书架获取成功",
  "data": [
    {
      "fileName": "2015_Book_ContemporaryBioethics",
      "openId": "odLQN5FNbQu2I5-S4YuRiyCsKMoQ",
      "date": 1558884420140,
      "id": 111,
      "cover": "https://www.youbaobao.xyz/book/res/img//Biomedicine/2015_Book_ContemporaryBioethics.jpeg",
      "title": "Contemporary Bioethics",
      "author": "Mohammed Ali Al-Bar and Hassan Chamsi-Pasha",
      "publisher": "Springer International Publishing, Cham",
      "bookId": "2015_Book_ContemporaryBioethics",
      "category": 12,
      "categoryText": "Biomedicine",
      "language": "en",
      "rootFile": "OEBPS/content.opf"
    }
  ]
}

# 图书评分

# 接口地址

GET /book/rank/save

# 请求参数

参数名称 是否必须 类型 说明
fileName String 图书名称
openId String 用户的 openId
rank int 评分

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息

# 示例

{ "error_code": 0, "msg": "保存评分成功" }

# 加入书架

# 接口地址

GET /book/shelf/save

# 请求参数

参数名称 是否必须 类型 说明
shelf String 书架信息

TIP

这里向大家演示了如何通过 json 字符串传递参数,参数内包括两个字段:openId 和 fileName,通过 URLEncode 后获得请求参数,这种方案在实际开发中非常常见

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息

# 示例

{ "error_code": 0, "msg": "加入书架成功" }

# 移除书架

# 接口地址

GET /book/shelf/remove

# 请求参数

参数名称 是否必须 类型 说明
shelf String 书架信息

shelf 的用法同加入书架 API

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息

# 示例

{ "error_code": 0, "msg": "移出书架成功" }

# 书架列表

# 获取书架列表

# 接口地址

GET /book/shelf/get

# 请求参数

参数名称 是否必须 类型 说明
openId String 用户的 openId

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Array 返回结果

# 示例

{
  "error_code": 0,
  "msg": "书架获取成功",
  "data": [
    {
      "fileName": "2018_Book_DronesAndTheCreativeIndustry",
      "openId": "odLQN5FNbQu2I5-S4YuRiyCsKMoQ",
      "date": 1558369230202,
      "id": 6,
      "cover": "https://www.youbaobao.xyz/book/res/img//BusinessandManagement/978-3-319-95261-1_CoverFigure.jpg",
      "title": "Drones and the Creative Industry",
      "author": "Virginia Santamarina-Campos",
      "publisher": "Springer International Publishing",
      "bookId": "2018_Book_DronesAndTheCreativeIndustry",
      "category": 13,
      "categoryText": "BusinessandManagement",
      "language": "en",
      "rootFile": "OEBPS/package.opf"
    }
  ]
}

# 获取用户加入天数

# 接口地址

GET /user/day

# 请求参数

参数名称 是否必须 类型 说明
openId String 用户的 openId

# 返回值

参数名称 类型 说明
error_code int 返回值
msg String 返回消息
data Object 返回结果

# 示例

{
  "error_code": 0,
  "msg": "用户注册成功",
  "data": {
    "day": 15
  }
}
Last update: 7/20/2021, 8:53:54 AM