model

package
v0.0.0-...-74ede58 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddBookRequest

type AddBookRequest struct {
	Title    string `json:"title" validate:"required"`
	Author   string `json:"author" validate:"required"`
	CoverURL string `json:"coverUrl" validate:"required"`
	PostURL  string `json:"postUrl" validate:"required"`
}

type Base

type Base struct {
	CreatedAt time.Time `json:"createdAt" db:"created_at"`
	UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
}

Base creates the default model that every other model is based on.

type Book

type Book struct {
	ID       int            `json:"id" db:"id"`
	Title    string         `json:"title" db:"title"`
	Author   string         `json:"author" db:"author"`
	CoverURL string         `json:"coverUrl" db:"cover_url"`
	PostURL  sql.NullString `json:"postUrl" db:"post_url"`
	Base
}

Book is the db schema for the books table

type GetBookResponse

type GetBookResponse struct {
	ID       int    `json:"id"`
	Title    string `json:"title"`
	Author   string `json:"author"`
	CoverURL string `json:"coverUrl"`
	PostURL  string `json:"postUrl"`
}

type IDResponse

type IDResponse struct {
	ID int `json:"id"`
}

type UpdateBookRequest

type UpdateBookRequest struct {
	ID       int    `json:"id" validate:"required"`
	Title    string `json:"title"`
	Author   string `json:"author"`
	CoverURL string `json:"coverUrl"`
	PostURL  string `json:"postUrl"`
}

Jump to

Keyboard shortcuts

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