contentservice

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppLike added in v0.0.5

type AppLike interface {
	DB() db.Client
}

type ContentService

type ContentService struct {
	DB func() db.Client
}

func New added in v0.0.5

func New(app AppLike) *ContentService

func (*ContentService) Create

func (cs *ContentService) Create(c fs.Context, _ any) (*schema.Entity, error)

func (*ContentService) Delete

func (cs *ContentService) Delete(c fs.Context, _ any) (any, error)

func (*ContentService) Detail

func (cs *ContentService) Detail(c fs.Context, _ any) (*schema.Entity, error)

func (*ContentService) List

func (cs *ContentService) List(c fs.Context, _ any) (*Pagination, error)

func (*ContentService) Update

func (cs *ContentService) Update(c fs.Context, _ any) (*schema.Entity, error)

type Pagination added in v0.1.0

type Pagination struct {
	Total       uint             `json:"total"`
	PerPage     uint             `json:"per_page"`
	CurrentPage uint             `json:"current_page"`
	LastPage    uint             `json:"last_page"`
	Items       []*schema.Entity `json:"items"`
}

Pagination is a struct that contains pagination info and the data

func NewPagination added in v0.1.0

func NewPagination(total, perPage, currentPage uint, items []*schema.Entity) *Pagination

NewPagination creates a new pagination struct

Jump to

Keyboard shortcuts

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