data_api

package
v1.2.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBookCache added in v1.2.11

func DeleteBookCache(c echo.Context) error

DeleteBookCache 删除书籍的元数据和缓存文件 示例 URL: http://127.0.0.1:1234/api/delete_book_cache?id=2b17a13 相关参数: id:书籍的ID,必须参数 &id=2b17a13 delete_metadata: 是否删除元数据JSON文件,可选参数,默认 true &delete_metadata=true delete_cover: 是否删除封面缓存文件,可选参数,默认 true &delete_cover=true delete_image_cache: 是否删除图片缓存目录,可选参数,默认 true &delete_image_cache=true

func DeleteBookmark added in v1.2.12

func DeleteBookmark(c echo.Context) error

DeleteBookmark 删除特定书签的 API 处理函数 DELETE /api/delete-bookmark 参数:book_id, mark_type, page_index

func DownloadEpub added in v1.2.11

func DownloadEpub(c echo.Context) error

DownloadEpub 将书籍转换为 EPUB 格式下载 示例 URL: http://127.0.0.1:1234/api/download-epub?id=2b17a13 相关参数: id:书籍的ID,必须参数 &id=2b17a13

func DownloadZip added in v1.2.11

func DownloadZip(c echo.Context) error

DownloadZip 将 TypeDir 类型的书籍打包为 zip 文件下载 示例 URL: http://127.0.0.1:1234/api/download-zip?id=2b17a13 相关参数: id:书籍的ID,必须参数 &id=2b17a13

func GetAllBookmarks added in v1.1.8

func GetAllBookmarks(c echo.Context) error

GetAllBookmarks 获取所有书签的 API 处理函数

func GetBook

func GetBook(c echo.Context) error

GetBook 相关参数: id: 书籍的ID,必须项目 &id=2b17a130 sort_by:页面排序方法,可选 &sort_by=filename 示例 URL: http://127.0.0.1:1234/api/get-book?id=1215a&sort_by=filename

func GetCover added in v1.2.0

func GetCover(c echo.Context) error

GetCover 获取书籍封面 相关参数: id:书籍的ID,必须参数 &id=2B17a resize_height:可选参数,指定封面高度,默认值为352 &resize_height=500 示例 URL: http://127.0.0.1:1234/api/get-cover?id=2b17a13 示例 URL(自定义高度): http://127.0.0.1:1234/api/get-cover?id=2b17a13&resize_height=500

func GetFile

func GetFile(c echo.Context) error

GetFile 示例 URL: 127.0.0.1:1234/get_file?id=2b17a13&filename=1.jpg 缩放文件,会转化为jpeg:http://127.0.0.1:1234/api/get-file?id=2b17a13&resize_width=300&resize_height=400&id=597e06&filename=01.jpeg 相关参数: id:书籍的ID,必须参数 &id=2B17a filename:获取的文件名,必须参数 &filename=01.jpg 可选参数: resize_width:指定宽度,缩放图片 &resize_width=300 resize_height:指定高度,缩放图片 &resize_height=300 resize_max_width:指定宽度上限,图片宽度大于这个上限时缩小图片 &resize_max_width=740 resize_max_height:指定高度上限,图片高度大于这个上限时缩小图片 &resize_max_height=300 auto_crop:自动切白边,数字是切白边的阈值,范围是0~100 &auto_crop=10 gray:黑白化 &gray=true blurhash:获取对应图片的blurhash,不是原始图片 &blurhash=3 blurhash_image:获取对应图片的blurhash图片,不是原始图片 &blurhash_image=3 base64:返回Base64编码的图片 &base64=true

func GetGeneratedImage

func GetGeneratedImage(c echo.Context) error

func GetParentBook

func GetParentBook(c echo.Context) error

func GetQrcode

func GetQrcode(c echo.Context) error

GetQrcode 下载服务器配置

func GetRawFile

func GetRawFile(c echo.Context) error

func GetReadingHistory added in v1.2.11

func GetReadingHistory(c echo.Context) error

GetReadingHistory 获取阅读历史的 API 处理函数 参数:

  • limit: 限制返回数量 (drawer用,如10),优先级高于分页参数
  • page: 页码 (设置页面分页用,默认1)
  • page_size: 每页数量 (默认20)

func GetRegFile

func GetRegFile(c echo.Context) error

GetRegFile 注册表文件

func GetServerInfoHandler

func GetServerInfoHandler(c echo.Context) error

GetServerInfoHandler 获取服务器信息的API处理函数

func GetStores added in v1.2.4

func GetStores(c echo.Context) error

GetStores 获取书库列表的 API 处理函数

func GetTailscaleStatus

func GetTailscaleStatus(c echo.Context) error

GetTailscaleStatus 处理Tailscale网络的身份信息查询请求

func GetTopOfShelfInfo

func GetTopOfShelfInfo(c echo.Context) error

func ParseHexColor

func ParseHexColor(s string) (c color.RGBA, err error)

ParseHexColor 用于解析如 "#FFFFFF" 或 "FFFFFF" 格式的十六进制颜色字符串

func StoreBookmark

func StoreBookmark(c echo.Context) error

Types

type ReadingHistoryResponse added in v1.2.11

type ReadingHistoryResponse struct {
	Items      []model.BookinfoWithBookMark `json:"items"`       // 阅读历史列表
	TotalCount int                          `json:"total_count"` // 总数量
	Page       int                          `json:"page"`        // 当前页码
	PageSize   int                          `json:"page_size"`   // 每页数量
	TotalPages int                          `json:"total_pages"` // 总页数
}

ReadingHistoryResponse 阅读历史响应结构

type StoreInfo added in v1.2.4

type StoreInfo struct {
	URL    string `json:"url"`    // 书库路径
	Name   string `json:"name"`   // 书库名称
	Exists bool   `json:"exists"` // 路径是否存在
}

StoreInfo 书库信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL