repositories

package
v0.0.0-...-d1c3bf3 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UniqueViolationErr = "23505"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CardRepository

type CardRepository struct {
	// contains filtered or unexported fields
}

func NewCardRepository

func NewCardRepository(db *gorm.DB) *CardRepository
func (r *CardRepository) CheckLink(ctx context.Context, card *entity.Card, tagID uuid.UUID) bool

func (*CardRepository) Create

func (r *CardRepository) Create(
	ctx context.Context, card *entity.Card, galleriesCards []entity.GalleriesCards,
) (*uuid.UUID, error)

func (*CardRepository) CreateRegularTags

func (r *CardRepository) CreateRegularTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) (error, bool)

func (*CardRepository) Delete

func (r *CardRepository) Delete(ctx context.Context, cardId uuid.UUID) error

func (*CardRepository) DeleteRegularTags

func (r *CardRepository) DeleteRegularTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) error

func (*CardRepository) GetById

func (r *CardRepository) GetById(ctx context.Context, cardId uuid.UUID) (*entity.Card, error)

func (*CardRepository) GetByIdWithoutAssociate

func (r *CardRepository) GetByIdWithoutAssociate(ctx context.Context, cardId uuid.UUID) (*entity.Card, error)

func (*CardRepository) GetInternalCardId

func (r *CardRepository) GetInternalCardId(ctx context.Context, cardId uuid.UUID) (*entity.Card, error)

func (*CardRepository) GetLastPositionInGalley

func (r *CardRepository) GetLastPositionInGalley(ctx context.Context, galleryID uuid.UUID) (int, error)

func (*CardRepository) GetListByGalleryId

func (r *CardRepository) GetListByGalleryId(ctx context.Context, galleryId uuid.UUID) ([]entity.Card, error)

func (*CardRepository) GetListWithSearch

func (r *CardRepository) GetListWithSearch(ctx context.Context, searchValue string, name string) (
	[]entity.Card, error,
)

func (*CardRepository) GetRegularCardId

func (r *CardRepository) GetRegularCardId(ctx context.Context, cardId uuid.UUID) (string, error)

func (*CardRepository) PatchDetailText

func (r *CardRepository) PatchDetailText(ctx context.Context, card *entity.Card) error

func (*CardRepository) PatchLearnMoreUrl

func (r *CardRepository) PatchLearnMoreUrl(ctx context.Context, card *entity.Card) error

func (*CardRepository) PatchPreviewText

func (r *CardRepository) PatchPreviewText(ctx context.Context, card *entity.Card) error

func (*CardRepository) PatchTags

func (r *CardRepository) PatchTags(ctx context.Context, cardId uuid.UUID, tags []entity.Tag) error

func (*CardRepository) PatchUser

func (r *CardRepository) PatchUser(ctx context.Context, card *entity.Card) error

func (*CardRepository) Update

func (r *CardRepository) Update(
	ctx context.Context, card *entity.Card, galleriesCards []entity.GalleriesCards,
) error

func (*CardRepository) UpdateInverted

func (r *CardRepository) UpdateInverted(ctx context.Context, cardID uuid.UUID, inverted *bool) error

func (*CardRepository) UpdatePositionBeforeDelete

func (r *CardRepository) UpdatePositionBeforeDelete(ctx context.Context, cardId uuid.UUID) error

func (*CardRepository) UpdatePublish

func (r *CardRepository) UpdatePublish(ctx context.Context, cardID uuid.UUID, publish *bool) error

type GalleryRepository

type GalleryRepository struct {
	// contains filtered or unexported fields
}

func NewGalleryRepository

func NewGalleryRepository(db *gorm.DB) *GalleryRepository
func (r *GalleryRepository) CheckLink(ctx context.Context, galleryID uuid.UUID, cardID uuid.UUID) bool

func (*GalleryRepository) Create

func (r *GalleryRepository) Create(ctx context.Context, gallery *entity.Gallery) (*uuid.UUID, error)

func (*GalleryRepository) CreateGalleriesCards

func (r *GalleryRepository) CreateGalleriesCards(ctx context.Context, galleriesCards []entity.GalleriesCards) (
	error, bool,
)

func (*GalleryRepository) DeleteGalleriesCards

func (r *GalleryRepository) DeleteGalleriesCards(ctx context.Context, galleryID uuid.UUID, cardIDs []uuid.UUID) error

func (*GalleryRepository) DeleteList

func (r *GalleryRepository) DeleteList(ctx context.Context, galleryIds []uuid.UUID) error

func (*GalleryRepository) GetByCode

func (r *GalleryRepository) GetByCode(ctx context.Context, code string) (*entity.Gallery, error)

func (*GalleryRepository) GetById

func (r *GalleryRepository) GetById(ctx context.Context, id uuid.UUID) (*entity.Gallery, error)

func (*GalleryRepository) GetByIdWithoutAssociate

func (r *GalleryRepository) GetByIdWithoutAssociate(ctx context.Context, id uuid.UUID) (*entity.Gallery, error)

func (*GalleryRepository) GetLastPosition

func (r *GalleryRepository) GetLastPosition(ctx context.Context, galleryID uuid.UUID) (int, error)

func (*GalleryRepository) GetListByPageId

func (r *GalleryRepository) GetListByPageId(ctx context.Context, pageId uuid.UUID) ([]entity.Gallery, error)

func (*GalleryRepository) GetListWithSearch

func (r *GalleryRepository) GetListWithSearch(ctx context.Context, searchValue string) (
	[]entity.Gallery, error,
)

func (*GalleryRepository) PatchCardPosition

func (r *GalleryRepository) PatchCardPosition(ctx context.Context, dto *actions.PatchCardPosition) error

func (*GalleryRepository) PatchName

func (r *GalleryRepository) PatchName(ctx context.Context, gallery *entity.Gallery) error

func (*GalleryRepository) Update

func (r *GalleryRepository) Update(ctx context.Context, gallery *entity.Gallery) error

func (*GalleryRepository) UpdateCardsPositionAfterDelete

func (r *GalleryRepository) UpdateCardsPositionAfterDelete(
	ctx context.Context, galleryID uuid.UUID, galleriesCards []entity.GalleriesCards, err error,
) error

func (*GalleryRepository) UpdateCardsPositionAfterPatch

func (r *GalleryRepository) UpdateCardsPositionAfterPatch(
	ctx context.Context, dto *actions.PatchCardPosition, tx *gorm.DB,
) error

func (*GalleryRepository) UpdateHidden

func (r *GalleryRepository) UpdateHidden(ctx context.Context, galleryID uuid.UUID, hidden *bool) error

func (*GalleryRepository) UpdatePositionBeforeDelete

func (r *GalleryRepository) UpdatePositionBeforeDelete(ctx context.Context, galleryIds []uuid.UUID) error

func (*GalleryRepository) UpdatePublish

func (r *GalleryRepository) UpdatePublish(ctx context.Context, galleryID uuid.UUID, publish *bool) error

type PageRepository

type PageRepository struct {
	// contains filtered or unexported fields
}

func NewPageRepository

func NewPageRepository(db *gorm.DB) *PageRepository
func (r *PageRepository) CheckLink(ctx context.Context, pageID uuid.UUID, galleryID uuid.UUID) bool

func (*PageRepository) Create

func (r *PageRepository) Create(ctx context.Context, page *entity.Page) (*uuid.UUID, error)

func (*PageRepository) CreatePagesGalleries

func (r *PageRepository) CreatePagesGalleries(ctx context.Context, pagesGalleries []entity.PagesGalleries) (
	error, bool,
)

func (*PageRepository) Delete

func (r *PageRepository) Delete(ctx context.Context, pageId uuid.UUID) error

func (*PageRepository) DeletePagesGalleries

func (r *PageRepository) DeletePagesGalleries(ctx context.Context, pageID uuid.UUID, galleryIDs []uuid.UUID) error

func (*PageRepository) GetById

func (r *PageRepository) GetById(ctx context.Context, id uuid.UUID) (
	*entity.Page, error,
)

func (*PageRepository) GetByIdWithoutAssociate

func (r *PageRepository) GetByIdWithoutAssociate(ctx context.Context, id uuid.UUID) (*entity.Page, error)

func (*PageRepository) GetLastPosition

func (r *PageRepository) GetLastPosition(ctx context.Context, pageID uuid.UUID) (int, error)

func (*PageRepository) GetList

func (r *PageRepository) GetList(
	ctx context.Context, fields []string, allowInactive bool,
) (list []actions.PageShort, err error)

func (*PageRepository) PatchGalleryPosition

func (r *PageRepository) PatchGalleryPosition(ctx context.Context, dto *actions.PatchGalleryPosition) error

func (*PageRepository) PatchProperties

func (r *PageRepository) PatchProperties(ctx context.Context, page *entity.Page) error

func (*PageRepository) UpdateGalleriesPositionAfterDelete

func (r *PageRepository) UpdateGalleriesPositionAfterDelete(
	ctx context.Context, pageID uuid.UUID, pagesGalleries []entity.PagesGalleries, err error,
) error

func (*PageRepository) UpdateGalleriesPositionAfterPatch

func (r *PageRepository) UpdateGalleriesPositionAfterPatch(
	ctx context.Context, dto *actions.PatchGalleryPosition, tx *gorm.DB,
) error

func (*PageRepository) UpdatePublish

func (r *PageRepository) UpdatePublish(ctx context.Context, pageId uuid.UUID, publish *bool) error

type TagRepository

type TagRepository struct {
	// contains filtered or unexported fields
}

func NewTagRepository

func NewTagRepository(db *gorm.DB) *TagRepository

func (*TagRepository) Create

func (r *TagRepository) Create(ctx context.Context, tag *entity.Tag) (*uuid.UUID, error)

func (*TagRepository) Delete

func (r *TagRepository) Delete(ctx context.Context, tagId uuid.UUID) error

func (*TagRepository) GetById

func (r *TagRepository) GetById(ctx context.Context, tagId uuid.UUID) (*entity.Tag, error)

func (*TagRepository) GetCardIdsByTagId

func (r *TagRepository) GetCardIdsByTagId(ctx context.Context, tagId uuid.UUID) ([]uuid.UUID, error)

func (*TagRepository) GetListWithSearch

func (r *TagRepository) GetListWithSearch(ctx context.Context, searchValue string) (
	[]entity.Tag, map[uuid.UUID][]uuid.UUID, error,
)

func (*TagRepository) Update

func (r *TagRepository) Update(ctx context.Context, tag *entity.Tag) error
func (r *TagRepository) UpdateIsDetailLink(ctx context.Context, tagID uuid.UUID, value *bool) error

type UserRepository

type UserRepository struct {
	// contains filtered or unexported fields
}

func NewUserRepository

func NewUserRepository(db *gorm.DB) *UserRepository

func (*UserRepository) GetById

func (r *UserRepository) GetById(ctx context.Context, userId uuid.UUID) (*user_entity.User, error)

Jump to

Keyboard shortcuts

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