handlers

package
v0.0.0-...-18f2871 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package classification of Book API

Documentation for Book API

Schemes: http
BasePath: /
Version: 1.0.0

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	DB *gorm.DB
}

func (*Repository) AddBook

func (r *Repository) AddBook(ctx *gin.Context)

AddBook adds a book to the database

func (*Repository) BorrowBook

func (r *Repository) BorrowBook(ctx *gin.Context)

BorrowBook increments the borrow count of a book

func (*Repository) DeleteBook

func (r *Repository) DeleteBook(ctx *gin.Context)

DeleteBook deletes a book form the database

func (*Repository) GetAboutAuthor

func (r *Repository) GetAboutAuthor(c *gin.Context)

func (*Repository) GetAboutBook

func (r *Repository) GetAboutBook(c *gin.Context)

func (*Repository) GetBook

func (r *Repository) GetBook(ctx *gin.Context)

swagger:route GET /books/{id} books getBook Returns a book responses:

200: bookResponse

func (*Repository) GetBooks

func (r *Repository) GetBooks(ctx *gin.Context)

swagger:route GET /books books getBooks Returns a list of books responses:

200: booksResponse

func (*Repository) GetSimilarSuggestions

func (r *Repository) GetSimilarSuggestions(c *gin.Context)

func (*Repository) LikeBook

func (r *Repository) LikeBook(ctx *gin.Context)

LikeBook increments the likes count of a book

func (*Repository) RemoveLike

func (r *Repository) RemoveLike(ctx *gin.Context)

RemoveLike decrement the likes count of a book

func (*Repository) SetupRoutes

func (r *Repository) SetupRoutes(app *gin.Engine)

func (*Repository) Test

func (r *Repository) Test(ctx *gin.Context)

func (*Repository) UpdateBook

func (r *Repository) UpdateBook(ctx *gin.Context)

UpdateBook updates a book on the database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳