services

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

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImagesByItemId

func GetImagesByItemId(itemId, businessId string, db *sql.DB) (images []models.Image, err error)

To-Do Move this to the image service and use the client instead

Types

type ContentRepository

type ContentRepository struct {
	DB         *sql.DB
	BusinessId string
	Cache      *cache.Cache
	// contains filtered or unexported fields
}

func NewContentRepository

func NewContentRepository(db *sql.DB) (*ContentRepository, error)

func (*ContentRepository) FindAll

func (r *ContentRepository) FindAll(ctx context.Context) (articles []models.Cms, err error)

func (*ContentRepository) FindAllByCategoryId

func (r *ContentRepository) FindAllByCategoryId(categoryId string, ctx context.Context) (articles []models.Cms, err error)

func (*ContentRepository) FindAllByType

func (r *ContentRepository) FindAllByType(cmsType string, ctx context.Context) (articles []models.Cms, err error)

Type as defined as content type, is a string and is stored by values by example (post, page, etc)

func (*ContentRepository) FindAllCategories

func (r *ContentRepository) FindAllCategories(ctx context.Context) (categories []models.CmsCategory, err error)

func (*ContentRepository) FindOneById

func (r *ContentRepository) FindOneById(cmsId string, ctx context.Context) (cms models.Cms, err error)

type ContentRepositoryInterface

type ContentRepositoryInterface interface {
	FindAll(ctx context.Context) ([]models.Cms, error)
	FindAllByType(cmsType string, ctx context.Context) ([]models.Cms, error)
	FindAllByCategoryId(categoryId string, ctx context.Context) ([]models.Cms, error)
	FindAllCategories(ctx context.Context) ([]models.CmsCategory, error)
	FindOneById(cmsId string, ctx context.Context) (models.Cms, error)
}

Jump to

Keyboard shortcuts

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