models

package
v0.0.0-...-2edd2e0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateBorrows

func MigrateBorrows(db *gorm.DB) error

Types

type Borrow

type Borrow struct {
	ID               int64  `json:"id" gorm:"primary key;autoIncrement"`
	BookID           int64  `json:"BookId"`
	UserID           int64  `json:"UserId"`
	StartDateSeconds int    `json:"start_date_seconds"`
	EndDateSeconds   int    `json:"end_date_seconds"`
	StartDateNanoSec int    `json:"start_date_nano_sec"`
	EndDateNanoSec   int    `json:"end_date_nano_sec"`
	Status           string `json:"status"`
}

func NewBorrow

func NewBorrow(bookID, userID int64, duration time.Duration) *Borrow

type BorrowRequest

type BorrowRequest struct {
	BookID int `json:"BookId"`
	UserID int `json:"UserId"`
}

func NewBorrowRequest

func NewBorrowRequest(bookID, userID int) *BorrowRequest

Jump to

Keyboard shortcuts

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