{ "swagger": "2.0", "info": { "description": "Omnigram - AI-native self-hosted book library management service", "title": "Omnigram API", "contact": {}, "version": "0.1.0" }, "host": "localhost:9527", "basePath": "/", "paths": { "/admin/accounts": { "get": { "security": [ { "BearerAuth": [] } ], "description": "List all user accounts (admin only)", "produces": [ "application/json" ], "tags": [ "Admin" ], "summary": "List accounts", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "$ref": "#/definitions/schema.User" } }, "total": { "type": "integer" } } } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new user account (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Admin" ], "summary": "Create account", "parameters": [ { "description": "Account details", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "email": { "type": "string" }, "password": { "type": "string" }, "user_name": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.User" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/admin/accounts/{user_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get a specific user account by ID (admin only)", "produces": [ "application/json" ], "tags": [ "Admin" ], "summary": "Get account details", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.User" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a user account (admin only, cannot delete self)", "produces": [ "application/json" ], "tags": [ "Admin" ], "summary": "Delete account", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/accounts/{user_id}/apikeys": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all API keys for a user", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "List API keys", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.APIToken" } } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Generate a new API key for the authenticated user", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Create API key", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.APIToken" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/accounts/{user_id}/apikeys/{key_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete an existing API key", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Delete API key", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true }, { "type": "string", "description": "API Key ID", "name": "key_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/accounts/{user_id}/reset": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Reset user password (self or admin)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Reset password", "parameters": [ { "type": "integer", "description": "User ID", "name": "user_id", "in": "path", "required": true }, { "description": "New password", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "code": { "type": "string" }, "new_password": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/login": { "post": { "description": "Login with account credentials, sets session cookie on success", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "User login", "parameters": [ { "description": "Login credentials", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "account": { "type": "string" }, "client_id": { "type": "string" }, "grant_type": { "type": "string" }, "password": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/logout": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Logout current session and clear cookie", "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "User logout", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/token": { "post": { "description": "Authenticate and get a Bearer access token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Get access token", "parameters": [ { "description": "Login credentials", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "account": { "type": "string" }, "device_id": { "type": "string" }, "grant_type": { "type": "string" }, "password": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "expired_in": { "type": "integer" }, "refresh_token": { "type": "string" }, "token_type": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/auth/token/refresh": { "post": { "description": "Refresh an expired access token using a refresh token", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Auth" ], "summary": "Refresh access token", "parameters": [ { "description": "Refresh token request", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "account": { "type": "string" }, "device_id": { "type": "string" }, "refresh_token": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "access_token": { "type": "string" }, "expired_in": { "type": "integer" }, "refresh_token": { "type": "string" }, "token_type": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "403": { "description": "Forbidden", "schema": { "$ref": "#/definitions/utils.Response" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/img/covers/{book_cover_path}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Retrieve a book cover image by path", "produces": [ "image/jpeg" ], "tags": [ "Reader" ], "summary": "Get book cover image", "parameters": [ { "type": "string", "description": "Cover image path", "name": "book_cover_path", "in": "path", "required": true } ], "responses": { "200": { "description": "Cover image", "schema": { "type": "file" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/m4t/tts/speakers": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get available TTS voice speakers", "produces": [ "application/json" ], "tags": [ "TTS" ], "summary": "List TTS speakers", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array" } } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload and register a new TTS speaker voice", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "TTS" ], "summary": "Add TTS speaker", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object" } } } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/m4t/tts/speakers/{audio_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Remove a TTS speaker voice", "produces": [ "application/json" ], "tags": [ "TTS" ], "summary": "Delete TTS speaker", "parameters": [ { "type": "string", "description": "Speaker audio ID", "name": "audio_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "success": { "type": "boolean" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/m4t/tts/stream": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Synthesize text to speech with streaming audio output", "consumes": [ "application/json" ], "produces": [ "application/octet-stream" ], "tags": [ "TTS" ], "summary": "Stream TTS synthesis", "parameters": [ { "description": "TTS request", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "audio_id": { "type": "string" }, "format": { "type": "integer" }, "lang": { "type": "string" }, "text": { "type": "string" } } } } ], "responses": { "200": { "description": "Audio stream", "schema": { "type": "file" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/opds": { "get": { "description": "Get the OPDS root catalog feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS root catalog", "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/authors": { "get": { "description": "Get all authors as OPDS navigation feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS authors list", "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/authors/{name}": { "get": { "description": "Get books by a specific author as OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS books by author", "parameters": [ { "type": "string", "description": "Author name", "name": "name", "in": "path", "required": true } ], "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/download/{book_id}": { "get": { "description": "Download a book file via OPDS", "produces": [ "application/octet-stream" ], "tags": [ "OPDS" ], "summary": "OPDS download book", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Book file", "schema": { "type": "file" } } } } }, "/opds/new": { "get": { "description": "Get recently added books as OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS new books", "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/popular": { "get": { "description": "Get popular books as OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS popular books", "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/search": { "get": { "description": "Search books via OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS search", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query", "required": true } ], "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/shelves": { "get": { "description": "Get all shelves as OPDS navigation feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS shelves list", "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/shelves/{shelf_id}": { "get": { "description": "Get books in a specific shelf as OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS shelf books", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/opds/tags/{tag}": { "get": { "description": "Get books with a specific tag as OPDS feed", "produces": [ "application/atom+xml" ], "tags": [ "OPDS" ], "summary": "OPDS books by tag", "parameters": [ { "type": "string", "description": "Tag name", "name": "tag", "in": "path", "required": true } ], "responses": { "200": { "description": "OPDS Atom feed", "schema": { "type": "string" } } } } }, "/reader/books": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search books by query parameters", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Search books", "parameters": [ { "type": "string", "description": "Search keyword", "name": "search", "in": "query" }, { "type": "string", "description": "Category filter", "name": "category", "in": "query" }, { "type": "string", "description": "Author filter", "name": "author", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } } } } } }, "/reader/books/batch/delete": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Delete multiple books at once (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Batch delete books", "parameters": [ { "description": "Books to delete", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "book_ids": { "type": "array", "items": { "type": "string" } }, "delete_files": { "type": "boolean" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/batch/shelf": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Add or remove multiple books from a shelf", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Batch shelf operation", "parameters": [ { "description": "Batch shelf operation (action: add/remove)", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "action": { "type": "string" }, "book_ids": { "type": "array", "items": { "type": "string" } }, "shelf_id": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "updated": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/batch/tag": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Add, remove, or set tags on multiple books", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Batch tag books", "parameters": [ { "description": "Batch tag operation (action: add/remove/set)", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "action": { "type": "string" }, "book_ids": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "updated": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/{book_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get detailed information about a specific book", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get book details", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.Book" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update book metadata fields (title, author, description, etc.)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Update book metadata", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "description": "Book metadata", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "author": { "type": "string" }, "description": { "type": "string" }, "language": { "type": "string" }, "publish_date": { "type": "string" }, "publisher": { "type": "string" }, "rating": { "type": "number" }, "series": { "type": "string" }, "series_index": { "type": "integer" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.Book" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a book and optionally its file", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Delete book", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "type": "boolean", "default": false, "description": "Also delete the physical file", "name": "delete_file", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "boolean" }, "id": { "type": "string" } } } } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/{book_id}/annotations": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all annotations for a book", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "List annotations", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.Annotation" } } } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new annotation (highlight, note, or bookmark)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Create annotation", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "description": "Annotation details", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.Annotation" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.Annotation" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/{book_id}/annotations/{annotation_id}": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update an existing annotation", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Update annotation", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "type": "integer", "description": "Annotation ID", "name": "annotation_id", "in": "path", "required": true }, { "description": "Annotation fields to update", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "cfi": { "type": "string" }, "chapter": { "type": "string" }, "color": { "type": "string" }, "content": { "type": "string" }, "page_number": { "type": "integer" }, "position": { "type": "number" }, "selected_text": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.Annotation" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete an annotation", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Delete annotation", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "type": "integer", "description": "Annotation ID", "name": "annotation_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "boolean" }, "id": { "type": "integer" } } } } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/{book_id}/cover": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Upload a custom cover image for a book (max 5MB, jpg/png/webp/gif)", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Upload book cover", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "type": "file", "description": "Cover image file", "name": "cover", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "cover_url": { "type": "string" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/books/{book_id}/progress": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get user's reading progress for a specific book", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get reading progress", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.ReadProgress" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update user's reading progress for a specific book", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Update reading progress", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "description": "Reading progress", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ReadProgress" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.ReadProgress" } } } } }, "/reader/books/{book_id}/rating": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Set a rating for a book (0-5)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Rate book", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true }, { "description": "Book rating (0-5)", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "rating": { "type": "number" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "book_id": { "type": "string" }, "rating": { "type": "number" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/download/books/{book_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Download the original book file", "produces": [ "application/octet-stream" ], "tags": [ "Reader" ], "summary": "Download book", "parameters": [ { "type": "string", "description": "Book ID", "name": "book_id", "in": "path", "required": true } ], "responses": { "200": { "description": "Book file", "schema": { "type": "file" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/reader/fav": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get user's favorite books with reading progress", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get favorite books", "parameters": [ { "type": "integer", "default": 10, "description": "Number of results", "name": "limit", "in": "query" }, { "type": "integer", "default": 0, "description": "Offset for pagination", "name": "offset", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.ProgressBook" } } } } } }, "/reader/index": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get homepage data with random and recent books", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get library index", "parameters": [ { "type": "integer", "default": 6, "description": "Number of random books", "name": "random", "in": "query" }, { "type": "integer", "default": 12, "description": "Number of recent books", "name": "recent", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "random": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } }, "recent": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } } } } } } } }, "/reader/personal": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get user's reading and liked books", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get personal books", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "likes": { "type": "array", "items": { "$ref": "#/definitions/schema.ProgressBook" } }, "readings": { "type": "array", "items": { "$ref": "#/definitions/schema.ProgressBook" } } } } } } } }, "/reader/recent": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get recently added or read books", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get recent books", "parameters": [ { "type": "integer", "default": 12, "description": "Number of books to return", "name": "recent", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } } } } } }, "/reader/search": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Search books with advanced filters and pagination", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Enhanced search", "parameters": [ { "type": "string", "description": "Search query", "name": "q", "in": "query" }, { "type": "string", "description": "File format filter (epub, pdf, mobi)", "name": "format", "in": "query" }, { "type": "string", "description": "Language filter", "name": "language", "in": "query" }, { "type": "string", "description": "Tag filter", "name": "tag", "in": "query" }, { "type": "string", "description": "Author filter", "name": "author", "in": "query" }, { "type": "string", "default": "ctime", "description": "Sort field (ctime, title, author, rating)", "name": "sort", "in": "query" }, { "type": "string", "default": "desc", "description": "Sort order (asc, desc)", "name": "order", "in": "query" }, { "type": "integer", "default": 1, "description": "Page number", "name": "page", "in": "query" }, { "type": "integer", "default": 20, "description": "Page size (1-100)", "name": "page_size", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } }, "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" } } } } } } }, "/reader/sessions": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Record a completed reading session", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Record reading session", "parameters": [ { "description": "Reading session data", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/schema.ReadingSession" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.ReadingSession" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/shelves": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all shelves for the current user", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "List shelves", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/definitions/schema.Shelf" } } } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new book shelf", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Create shelf", "parameters": [ { "description": "Shelf details", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "cover_url": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "sort_order": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.Shelf" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/shelves/{shelf_id}": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get shelf details with its books", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get shelf details", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "books": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } }, "shelf": { "$ref": "#/definitions/schema.Shelf" } } } } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update shelf details", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Update shelf", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true }, { "description": "Shelf details", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "cover_url": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "sort_order": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.Shelf" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a book shelf", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Delete shelf", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "boolean" }, "id": { "type": "integer" } } } } } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/shelves/{shelf_id}/books": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Add one or more books to a shelf", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Add books to shelf", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true }, { "description": "Book IDs to add", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "book_ids": { "type": "array", "items": { "type": "string" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "added": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } }, "delete": { "security": [ { "BearerAuth": [] } ], "description": "Remove one or more books from a shelf", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Remove books from shelf", "parameters": [ { "type": "integer", "description": "Shelf ID", "name": "shelf_id", "in": "path", "required": true }, { "description": "Book IDs to remove", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "book_ids": { "type": "array", "items": { "type": "string" } } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "removed": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/stats": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get aggregated library statistics", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Get book statistics", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.BookStats" } } } } }, "/reader/stats/books": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get most-read books ranked by total reading time", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Top books by reading time", "parameters": [ { "type": "integer", "default": 10, "description": "Number of results (1-50)", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "author": { "type": "string" }, "book_id": { "type": "string" }, "duration": { "type": "integer" }, "sessions": { "type": "integer" }, "title": { "type": "string" } } } } } } } } } }, "/reader/stats/daily": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get daily reading statistics for a date range", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Daily reading stats", "parameters": [ { "type": "string", "description": "Start date (YYYY-MM-DD)", "name": "from", "in": "query" }, { "type": "string", "description": "End date (YYYY-MM-DD)", "name": "to", "in": "query" } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "duration": { "type": "integer" }, "sessions": { "type": "integer" } } } } } } } } } }, "/reader/stats/overview": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get overall reading statistics", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Reading stats overview", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "books_read": { "type": "integer" }, "total_books": { "type": "integer" }, "total_reading_seconds": { "type": "integer" } } } } } } } } }, "/reader/tags": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get all tags with book counts", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "List tags", "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "type": "object", "properties": { "count": { "type": "integer" }, "tag": { "type": "string" } } } } } } }, "post": { "security": [ { "BearerAuth": [] } ], "description": "Create a new tag, optionally associate with a book", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Create tag", "parameters": [ { "description": "Tag details", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "book_id": { "type": "string" }, "tag": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/schema.BookTagShip" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/tags/{tag_id}": { "delete": { "security": [ { "BearerAuth": [] } ], "description": "Delete a tag by name", "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Delete tag", "parameters": [ { "type": "string", "description": "Tag name", "name": "tag_id", "in": "path", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "deleted": { "type": "boolean" }, "tag": { "type": "string" } } } } } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/reader/upload": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Upload a new book file (EPUB, PDF, etc.)", "consumes": [ "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ "Reader" ], "summary": "Upload book", "parameters": [ { "type": "file", "description": "Book file", "name": "file", "in": "formData", "required": true } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/utils.Response" } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/sync/annotations": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Synchronize annotations across devices", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Sync" ], "summary": "Sync annotations", "parameters": [ { "description": "Sync request", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "annotations": { "type": "array", "items": { "$ref": "#/definitions/schema.Annotation" } }, "device_id": { "type": "string" }, "last_sync_time": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "annotations": { "type": "array", "items": { "$ref": "#/definitions/schema.Annotation" } }, "sync_time": { "type": "integer" }, "synced": { "type": "integer" } } } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/sync/delta": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Get books updated since a given timestamp", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "Sync" ], "summary": "Delta data sync", "parameters": [ { "description": "Delta sync parameters", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "file_type": { "type": "string" }, "limit": { "type": "integer" }, "utime": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "books": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } } } } } } } }, "/sync/full": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Synchronize all book data via SSE stream", "consumes": [ "application/json" ], "produces": [ "text/event-stream" ], "tags": [ "Sync" ], "summary": "Full data sync", "parameters": [ { "description": "Sync parameters", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "file_type": { "type": "string" }, "limit": { "type": "integer" }, "until": { "type": "integer" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "books": { "type": "array", "items": { "$ref": "#/definitions/schema.Book" } } } } } } } }, "/sys/ai/config": { "put": { "security": [ { "BearerAuth": [] } ], "description": "Update AI service configuration (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "AI" ], "summary": "Update AI configuration", "parameters": [ { "description": "AI configuration", "name": "request", "in": "body", "required": true, "schema": { "$ref": "#/definitions/conf.AIOptions" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "$ref": "#/definitions/conf.AIOptions" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } }, "500": { "description": "Internal Server Error", "schema": { "$ref": "#/definitions/schema.ErrorResponse" } } } } }, "/sys/ai/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Check if the AI service is enabled and configured", "produces": [ "application/json" ], "tags": [ "AI" ], "summary": "Get AI service status", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "enabled": { "type": "boolean" }, "model": { "type": "string" }, "provider": { "type": "string" }, "status": { "type": "string" } } } } } } } } }, "/sys/info": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get system configuration and status information", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "Get system info", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "architecture": { "type": "string" }, "disk_usage": { "type": "object" }, "docs_data_path": { "type": "string" }, "system": { "type": "string" }, "version": { "type": "string" } } } } } }, "put": { "security": [ { "BearerAuth": [] } ], "description": "Update system configuration (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "Update system config", "parameters": [ { "description": "System config", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "m4t_server_addr": { "type": "string" }, "openai_apikey": { "type": "string" }, "openai_url": { "type": "string" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "system": { "type": "string" }, "version": { "type": "string" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/sys/ping": { "get": { "description": "Check if the server is responsive", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "System heartbeat", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "architecture": { "type": "string" }, "system": { "type": "string" }, "version": { "type": "string" } } } } } } }, "/sys/scan/run": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Start scanning the library directory for books (admin only)", "consumes": [ "application/json" ], "produces": [ "application/json" ], "tags": [ "System" ], "summary": "Start library scan", "parameters": [ { "description": "Scan options", "name": "request", "in": "body", "required": true, "schema": { "type": "object", "properties": { "max_thread": { "type": "integer" }, "refresh": { "type": "boolean" } } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "count": { "type": "integer" }, "running": { "type": "boolean" } } } }, "400": { "description": "Bad Request", "schema": { "$ref": "#/definitions/utils.Response" } } } } }, "/sys/scan/status": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get the current library scan status (admin only)", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "Get scan status", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "count": { "type": "integer" }, "last_scan_time": { "type": "string" }, "running": { "type": "boolean" } } } } } } }, "/sys/scan/stop": { "post": { "security": [ { "BearerAuth": [] } ], "description": "Stop a running library scan (admin only)", "produces": [ "application/json" ], "tags": [ "System" ], "summary": "Stop library scan", "responses": { "200": { "description": "OK", "schema": { "type": "object", "properties": { "count": { "type": "integer" }, "running": { "type": "boolean" } } } } } } }, "/user/userinfo": { "get": { "security": [ { "BearerAuth": [] } ], "description": "Get information about the currently authenticated user", "produces": [ "application/json" ], "tags": [ "User" ], "summary": "Get current user info", "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/schema.User" } }, "404": { "description": "Not Found", "schema": { "$ref": "#/definitions/utils.Response" } } } } } }, "definitions": { "conf.AIOptions": { "type": "object", "properties": { "api_key": { "type": "string" }, "auto_metadata": { "type": "boolean" }, "auto_summary": { "type": "boolean" }, "base_url": { "type": "string" }, "enabled": { "type": "boolean" }, "model": { "type": "string" }, "provider": { "type": "string" } } }, "schema.APIToken": { "type": "object", "properties": { "api_key": { "type": "string" }, "ctime": { "type": "integer" }, "id": { "type": "integer" }, "name": { "type": "string" }, "user_id": { "type": "integer" } } }, "schema.Annotation": { "type": "object", "properties": { "book_id": { "type": "string" }, "cfi": { "type": "string" }, "chapter": { "type": "string" }, "color": { "type": "string" }, "content": { "type": "string" }, "ctime": { "type": "integer" }, "device_id": { "type": "string" }, "id": { "type": "integer" }, "page_number": { "type": "integer" }, "position": { "type": "string" }, "selected_text": { "type": "string" }, "type": { "$ref": "#/definitions/schema.AnnotationType" }, "user_id": { "type": "integer" }, "utime": { "type": "integer" } } }, "schema.AnnotationType": { "type": "string", "enum": [ "note", "highlight", "bookmark" ], "x-enum-varnames": [ "AnnotationNote", "AnnotationHighlight", "AnnotationBookmark" ] }, "schema.Book": { "type": "object", "properties": { "asin": { "type": "string" }, "author": { "type": "string" }, "author_sort": { "type": "string" }, "author_url": { "type": "string" }, "category": { "type": "string" }, "count_download": { "type": "integer" }, "count_visit": { "type": "integer" }, "cover_url": { "type": "string" }, "ctime": { "type": "integer" }, "description": { "type": "string" }, "file_type": { "$ref": "#/definitions/schema.FileType" }, "id": { "type": "string" }, "identifier": { "type": "string" }, "isbn": { "type": "string" }, "language": { "type": "string" }, "pubdate": { "type": "string" }, "publisher": { "description": "Publisher identifies the publication's publisher.", "type": "string" }, "publisher_url": { "type": "string" }, "rating": { "type": "number" }, "series": { "description": "Series is the series to which this book belongs to.", "type": "string" }, "seriesIndex": { "description": "SeriesIndex is the position in the series to which the book belongs to.", "type": "string" }, "size": { "type": "integer" }, "sub_title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" }, "utime": { "type": "integer" }, "uuid": { "type": "string" } } }, "schema.BookStats": { "type": "object", "properties": { "author": { "type": "integer" }, "publisher": { "type": "integer" }, "tag": { "type": "integer" }, "total": { "type": "integer" } } }, "schema.BookTagShip": { "type": "object", "properties": { "book_id": { "type": "string" }, "id": { "type": "integer" }, "tag": { "type": "string" } } }, "schema.ErrorResponse": { "type": "object", "properties": { "code": { "type": "string" }, "details": {}, "message": { "type": "string" } } }, "schema.FileType": { "type": "integer", "enum": [ 0, 1, 2, 3, 4, 5, 6 ], "x-enum-varnames": [ "UnkownFile", "EPUB", "AZW3", "MOBI", "PDF", "TXT", "MD" ] }, "schema.ProgressBook": { "type": "object", "properties": { "asin": { "type": "string" }, "author": { "type": "string" }, "author_sort": { "type": "string" }, "author_url": { "type": "string" }, "category": { "type": "string" }, "count_download": { "type": "integer" }, "count_visit": { "type": "integer" }, "cover_url": { "type": "string" }, "ctime": { "type": "integer" }, "description": { "type": "string" }, "file_type": { "$ref": "#/definitions/schema.FileType" }, "id": { "type": "string" }, "identifier": { "type": "string" }, "isbn": { "type": "string" }, "language": { "type": "string" }, "para_position": { "type": "integer" }, "progress": { "type": "number" }, "progress_index": { "type": "integer" }, "pubdate": { "type": "string" }, "publisher": { "description": "Publisher identifies the publication's publisher.", "type": "string" }, "publisher_url": { "type": "string" }, "rating": { "type": "number" }, "series": { "description": "Series is the series to which this book belongs to.", "type": "string" }, "seriesIndex": { "description": "SeriesIndex is the position in the series to which the book belongs to.", "type": "string" }, "size": { "type": "integer" }, "sub_title": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" }, "utime": { "type": "integer" }, "uuid": { "type": "string" } } }, "schema.ReadProgress": { "type": "object", "properties": { "book_id": { "type": "string" }, "end_date": { "type": "integer" }, "expt_end_date": { "description": "预计完成日期", "type": "integer" }, "id": { "type": "integer" }, "para_position": { "description": "段落定位", "type": "integer" }, "progress": { "type": "number" }, "progress_index": { "type": "integer" }, "start_date": { "type": "integer" }, "updated_at": { "type": "integer" }, "user_id": { "type": "integer" } } }, "schema.ReadingSession": { "type": "object", "properties": { "book_id": { "type": "string" }, "device_id": { "type": "string" }, "duration": { "description": "seconds", "type": "integer" }, "end_time": { "type": "integer" }, "id": { "type": "integer" }, "pages_read": { "type": "integer" }, "start_time": { "type": "integer" }, "user_id": { "type": "integer" } } }, "schema.Shelf": { "type": "object", "properties": { "book_count": { "type": "integer" }, "cover_url": { "type": "string" }, "ctime": { "type": "integer" }, "description": { "type": "string" }, "id": { "type": "integer" }, "name": { "type": "string" }, "sort_order": { "type": "integer" }, "user_id": { "type": "integer" }, "utime": { "type": "integer" } } }, "schema.User": { "type": "object", "properties": { "atime": { "type": "integer" }, "avatar_url": { "type": "string" }, "credential": { "type": "string" }, "ctime": { "type": "integer" }, "email": { "type": "string" }, "id": { "type": "integer" }, "locked": { "type": "boolean" }, "mfa_switch": { "type": "integer" }, "mobile": { "type": "string" }, "name": { "type": "string" }, "nick_name": { "type": "string" }, "role_id": { "type": "integer" }, "utime": { "type": "integer" }, "wx_unionid": { "type": "string" } } }, "utils.Response": { "type": "object", "properties": { "code": { "type": "integer" }, "data": {}, "message": { "type": "string" } } } }, "securityDefinitions": { "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" }, "CookieAuth": { "type": "apiKey", "name": "_omnigram_session", "in": "cookie" } } }