From 132715764e0521d22ae1b02028759b23db30c97b Mon Sep 17 00:00:00 2001 From: w568w <1278297578@qq.com> Date: Mon, 10 Aug 2020 08:14:09 +0800 Subject: [PATCH 1/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7249d50a..9247676b6 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ ## 阅读3.0 书源规则 https://celeter.github.io + +[![aVElJs.th.jpg](https://s1.ax1x.com/2020/07/28/aVElJs.th.jpg)](https://imgchr.com/i/aVElJs) [![aVEQij.th.jpg](https://s1.ax1x.com/2020/07/28/aVEQij.th.jpg)](https://imgchr.com/i/aVEQij) [![aVEudg.th.jpg](https://s1.ax1x.com/2020/07/28/aVEudg.th.jpg)](https://imgchr.com/i/aVEudg) [![aVEneS.th.jpg](https://s1.ax1x.com/2020/07/28/aVEneS.th.jpg)](https://imgchr.com/i/aVEneS) [![aVEKoQ.th.jpg](https://s1.ax1x.com/2020/07/28/aVEKoQ.th.jpg)](https://imgchr.com/i/aVEKoQ) [![aVE1Wn.th.jpg](https://s1.ax1x.com/2020/07/28/aVE1Wn.th.jpg)](https://imgchr.com/i/aVE1Wn) ### 阅读API 阅读3.0 提供了2种方式的API:`Web方式`和`Content Provider方式`。您可以在[这里](api.md)根据需要自行调用。 ## 免责声明 -[![aVElJs.th.jpg](https://s1.ax1x.com/2020/07/28/aVElJs.th.jpg)](https://imgchr.com/i/aVElJs) [![aVEQij.th.jpg](https://s1.ax1x.com/2020/07/28/aVEQij.th.jpg)](https://imgchr.com/i/aVEQij) [![aVEudg.th.jpg](https://s1.ax1x.com/2020/07/28/aVEudg.th.jpg)](https://imgchr.com/i/aVEudg) [![aVEneS.th.jpg](https://s1.ax1x.com/2020/07/28/aVEneS.th.jpg)](https://imgchr.com/i/aVEneS) [![aVEKoQ.th.jpg](https://s1.ax1x.com/2020/07/28/aVEKoQ.th.jpg)](https://imgchr.com/i/aVEKoQ) [![aVE1Wn.th.jpg](https://s1.ax1x.com/2020/07/28/aVE1Wn.th.jpg)](https://imgchr.com/i/aVE1Wn) - https://gedoor.github.io/MyBookshelf/disclaimer.html From 13077bb67be366ce99f26e4e5a14ab1b6e431c2d Mon Sep 17 00:00:00 2001 From: w568w <1278297578@qq.com> Date: Mon, 10 Aug 2020 08:22:17 +0800 Subject: [PATCH 2/3] Update api.md --- api.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/api.md b/api.md index 2da9c660f..dfdaaec2a 100644 --- a/api.md +++ b/api.md @@ -1,9 +1,87 @@ -#阅读API +# 阅读API ## 对于Web的配置 您需要先在设置中启用"Web 服务"。 ## 使用 ### Web -待补充 +以下说明假设您的操作在本机进行,且开放端口为1234。 +如果您要从远程计算机访问[阅读],请将`127.0.0.1`替换成手机IP。 +#### 插入单个书源 +``` +URL = http://127.0.0.1:1234/saveSource +Method = POST +``` + +请求BODY内容为`JSON`字符串, +格式参考[这个文件](https://github.com/gedoor/legado/blob/master/app/src/main/java/io/legado/app/data/entities/BookSource.kt) + +#### 插入多个书源 +``` +URL = http://127.0.0.1:1234/saveSources +Method = POST +``` + +请求BODY内容为`JSON`字符串, +格式参考[这个文件](https://github.com/gedoor/legado/blob/master/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。 + +#### 获取书源 +``` +URL = http://127.0.0.1:1234/getSource?url=xxx +Method = GET +``` + +获取指定URL对应的书源信息。 + +#### 获取所有书源 +``` +URL = http://127.0.0.1:1234/getSources +Method = GET +``` + +获取APP内的所有书源。 + +#### 删除多个书源 +``` +URL = http://127.0.0.1:1234/deleteSources +Method = POST +``` + +请求BODY内容为`JSON`字符串, +格式参考[这个文件](https://github.com/gedoor/legado/blob/master/app/src/main/java/io/legado/app/data/entities/BookSource.kt),**为数组格式**。 + +#### 插入书籍 +``` +URL = http://127.0.0.1:1234/saveBook +Method = POST +``` + +请求BODY内容为`JSON`字符串, +格式参考[这个文件](https://github.com/gedoor/legado/blob/master/app/src/main/java/io/legado/app/data/entities/Book.kt)。 + +#### 获取所有书籍 +``` +URL = http://127.0.0.1:1234/getBookshelf +Method = GET +``` + +获取APP内的所有书籍。 + +#### 获取书籍章节列表 +``` +URL = http://127.0.0.1:1234/getChapterList?url=xxx +Method = GET +``` + +获取指定图书的章节列表。 + +#### 获取书籍内容 + +``` +URL = http://127.0.0.1:1234/getBookContent?url=xxx&index=1 +Method = GET +``` + +获取指定图书的第`index`章节的文本内容。 + ### Content Provider * 需声明io.legado.READ_WRITE权限 * providerHost为"包名.ReaderProvider", 如io.legado.app.release.ReaderProvider,不同包的地址不同,防止冲突安装失败 @@ -88,4 +166,4 @@ Method = query ``` 获取指定图书的第`index`章节的文本内容。 -用`Cursor.getString(0)`取出返回结果。 \ No newline at end of file +用`Cursor.getString(0)`取出返回结果。 From 406e661b5476a0fb4eeb82209f57c5c7ab9cd988 Mon Sep 17 00:00:00 2001 From: w568w <1278297578@qq.com> Date: Mon, 10 Aug 2020 08:23:21 +0800 Subject: [PATCH 3/3] Update api.md --- api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.md b/api.md index dfdaaec2a..a195b2b52 100644 --- a/api.md +++ b/api.md @@ -83,9 +83,9 @@ Method = GET 获取指定图书的第`index`章节的文本内容。 ### Content Provider -* 需声明io.legado.READ_WRITE权限 -* providerHost为"包名.ReaderProvider", 如io.legado.app.release.ReaderProvider,不同包的地址不同,防止冲突安装失败 -* 以下出现的providerHost请自行替换 +* 需声明`io.legado.READ_WRITE`权限 +* `providerHost`为`包名.ReaderProvider`, 如`io.legado.app.release.ReaderProvider`,不同包的地址不同,防止冲突安装失败 +* 以下出现的`providerHost`请自行替换 #### 插入单个书源 ``` URL = content://providerHost/source/insert