contentservice

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 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) BulkDelete added in v0.4.0

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

func (*ContentService) BulkUpdate added in v0.4.0

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

func (*ContentService) Create

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

func (*ContentService) CreateResource added in v0.6.0

func (cs *ContentService) CreateResource(api *fs.Resource)

func (*ContentService) Delete

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

func (*ContentService) Detail

func (cs *ContentService) Detail(c fs.Context, _ any) (*entity.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) (*entity.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       []*entity.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 []*entity.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