actions

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: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardDto

type CardDto struct {
	ID          uuid.UUID       `json:"id"`
	Name        string          `json:"name"`
	Code        string          `json:"code"`
	Type        string          `json:"type"`
	Position    int             `json:"position"`
	IsPublished bool            `json:"isPublished"`
	RegularCard *RegularCardDto `json:"regularCard"`
	VideoCard   *VideoCardDto   `json:"videoCard"`
	HtmlCard    *HtmlCardDto    `json:"htmlCard"`
	PhotoCard   *PhotoCardDto   `json:"photoCard"`
	FormCard    *FormCardDto    `json:"formCard"`

	Title       string `json:"title"`
	Description string `json:"description"`
	OgType      string `json:"ogType"`
}

type CardDtoWithoutPosition

type CardDtoWithoutPosition struct {
	ID          uuid.UUID       `json:"id"`
	Name        string          `json:"name"`
	Code        string          `json:"code"`
	Type        string          `json:"type"`
	IsPublished bool            `json:"isPublished"`
	RegularCard *RegularCardDto `json:"regularCard"`
	VideoCard   *VideoCardDto   `json:"videoCard"`
	HtmlCard    *HtmlCardDto    `json:"htmlCard"`
	PhotoCard   *PhotoCardDto   `json:"photoCard"`
	FormCard    *FormCardDto    `json:"formCard"`

	Title       string `json:"title"`
	Description string `json:"description"`
	OgType      string `json:"ogType"`
}

type CardRepository

type CardRepository interface {
	GetById(ctx context.Context, cardId uuid.UUID) (*entity.Card, error)
	GetByIdWithoutAssociate(ctx context.Context, cardId uuid.UUID) (*entity.Card, error)
	GetListByGalleryId(ctx context.Context, galleryId uuid.UUID) ([]entity.Card, error)
	Create(ctx context.Context, card *entity.Card, galleriesCards []entity.GalleriesCards) (*uuid.UUID, error)
	GetListWithSearch(ctx context.Context, searchValue string, name string) ([]entity.Card, error)
	Update(ctx context.Context, card *entity.Card, galleriesCards []entity.GalleriesCards) error
	Delete(ctx context.Context, cardId uuid.UUID) error
	PatchUser(ctx context.Context, card *entity.Card) error
	PatchPreviewText(ctx context.Context, card *entity.Card) error
	PatchDetailText(ctx context.Context, card *entity.Card) error
	PatchLearnMoreUrl(ctx context.Context, card *entity.Card) error
	PatchTags(ctx context.Context, cardId uuid.UUID, tags []entity.Tag) error
	CreateRegularTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) (error, bool)
	DeleteRegularTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) error
	UpdatePublish(ctx context.Context, cardID uuid.UUID, publish *bool) error
	GetLastPositionInGalley(ctx context.Context, galleryID uuid.UUID) (int, error)
	UpdateInverted(ctx context.Context, cardID uuid.UUID, inverted *bool) error
}

type CardUseCase

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

func NewCardUseCase

func NewCardUseCase(
	cardRepository CardRepository, galleryRepository GalleryRepository, tagRepository TagRepository,
	mediaProvider actions.MediaProvider,
	formActions actions2.Forms, copierService CopierInterface, logger *zap.SugaredLogger,
) *CardUseCase

func (CardUseCase) Create

func (CardUseCase) Delete

func (uc CardUseCase) Delete(ctx context.Context, cardId uuid.UUID) error

func (CardUseCase) GetById

func (CardUseCase) GetCardFromDto

func (uc CardUseCase) GetCardFromDto(cardRequest CreateCardRequest) (
	card *entity.Card, err error,
)

func (CardUseCase) GetCardFromDtos

func (uc CardUseCase) GetCardFromDtos(cardsRequest []CreateCardRequest, galleryId uuid.UUID) (
	cards []entity.GalleriesCards, err error,
)

func (CardUseCase) GetCardFromUpdateDto

func (uc CardUseCase) GetCardFromUpdateDto(cardRequest *UpdateCardRequest) (
	card *entity.Card, err error,
)

func (CardUseCase) GetDtoFromCard

func (uc CardUseCase) GetDtoFromCard(card *entity.Card) (cardDto *CardDtoWithoutPosition, err error)

func (CardUseCase) GetDtosFromCard

func (uc CardUseCase) GetDtosFromCard(cards []entity.Card) (cardDtos []CardDtoWithoutPosition, err error)

func (CardUseCase) GetDtosFromGalleriesCard

func (uc CardUseCase) GetDtosFromGalleriesCard(gallery []entity.GalleriesCards) (cardDtos []CardDto, err error)

func (CardUseCase) GetGalleriesCardsFromIds

func (uc CardUseCase) GetGalleriesCardsFromIds(
	ctx context.Context, cardId uuid.UUID, galleryIds []uuid.UUID,
) []entity.GalleriesCards

func (CardUseCase) GetListWithSearch

func (uc CardUseCase) GetListWithSearch(ctx context.Context, searchValue string, name string) (
	[]CardDtoWithoutPosition, error,
)

func (CardUseCase) LinkTags

func (uc CardUseCase) LinkTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) (error, bool)

func (CardUseCase) PatchDetailText

func (uc CardUseCase) PatchDetailText(ctx context.Context, dto *PatchDetailTextRequest) error

func (CardUseCase) PatchLearnMoreUrl

func (uc CardUseCase) PatchLearnMoreUrl(ctx context.Context, dto *PatchLearnMoreUrlRequest) error

func (CardUseCase) PatchPreviewText

func (uc CardUseCase) PatchPreviewText(ctx context.Context, dto *PatchPreviewTextRequest) error

func (CardUseCase) PatchTags

func (uc CardUseCase) PatchTags(ctx context.Context, cardId uuid.UUID, dtos []TagDtoRequest) error

func (CardUseCase) PatchUser

func (uc CardUseCase) PatchUser(ctx context.Context, dto *PatchUserRequest) error

func (CardUseCase) UnlinkTags

func (uc CardUseCase) UnlinkTags(ctx context.Context, cardId uuid.UUID, tagIds []uuid.UUID) error

func (CardUseCase) Update

func (uc CardUseCase) Update(ctx context.Context, dto *UpdateCardRequest) error

type CopierInterface

type CopierInterface interface {
	Copy(toValue interface{}, fromValue interface{}) (err error)
}

type CreateCardRequest

type CreateCardRequest struct {
	GalleryIds  []uuid.UUID               `json:"galleryIds"`
	Type        string                    `json:"type"  validate:"required"`
	Name        string                    `json:"name"`
	Code        string                    `json:"code"`
	Position    int                       `json:"position"`
	IsPublished *bool                     `json:"isPublished"  validate:"required"`
	RegularCard *CreateRegularCardRequest `json:"regularCard"`
	VideoCard   *CreateVideoCardRequest   `json:"videoCard"`
	HtmlCard    *CreateHtmlCardRequest    `json:"htmlCard"`
	PhotoCard   *CreatePhotoCardRequest   `json:"photoCard"`
	FormCard    *CreateFormCardRequest    `json:"formCard"`

	Title       string `json:"title"`
	Description string `json:"description"`
	OgType      string `json:"ogType"`
}

type CreateCardResponse

type CreateCardResponse struct {
	ID uuid.UUID `json:"id"`
}

type CreateFormCardRequest

type CreateFormCardRequest struct {
	FormId       *uuid.UUID  `json:"formId"`
	BackgroundId *uuid.UUID  `json:"backgroundId"`
	UserId       *uuid.UUID  `json:"userId"`
	Tags         []uuid.UUID `json:"tags"`
	LearnMoreUrl *string     `json:"learnMoreUrl"`
}

type CreateGalleryInPageRequest

type CreateGalleryInPageRequest struct {
	Name        string              `json:"name"`
	Code        string              `json:"code"`
	Position    int                 `json:"position"`
	CardsTotal  int                 `json:"cardsTotal"`
	Cards       []CreateCardRequest `json:"cards"`
	Hidden      bool                `json:"hiddenMenu"`
	IsPublished bool                `json:"isPublished"`
}

type CreateGalleryRequest

type CreateGalleryRequest struct {
	Name string `json:"name" validate:"required"`
	Code string `json:"code" validate:"required"`
	//Position    int                 `json:"position"`
	CardsTotal  int                 `json:"cardsTotal"`
	Cards       []CreateCardRequest `json:"cards"`
	Hidden      *bool               `json:"hiddenMenu" validate:"required"`
	IsPublished *bool               `json:"isPublished" validate:"required"`
}

type CreateGalleryResponse

type CreateGalleryResponse struct {
	ID uuid.UUID `json:"id"`
}

type CreateHtmlCardRequest

type CreateHtmlCardRequest struct {
	Html string `json:"html"`
}

type CreatePageRequest

type CreatePageRequest struct {
	Name           string                       `json:"name" validate:"required"`
	Code           string                       `json:"code" validate:"required"`
	Title          string                       `json:"title" validate:"required"`
	Description    string                       `json:"description"`
	TitleSeo       string                       `json:"titleSeo"`
	DescriptionSeo string                       `json:"descriptionSeo"`
	Keywords       string                       `json:"keywords"`
	IsPublished    *bool                        `json:"isPublished" validate:"required"`
	Sort           int                          `json:"sort"`
	Galleries      []CreateGalleryInPageRequest `json:"galleries"`

	OgType string `json:"ogType"`
}

type CreatePageResponse

type CreatePageResponse struct {
	ID uuid.UUID `json:"id"`
}

type CreatePhotoCardRequest

type CreatePhotoCardRequest struct {
	PictureId *uuid.UUID `json:"pictureId"`
}

type CreateRegularCardRequest

type CreateRegularCardRequest struct {
	PreviewText        string      `json:"previewText"`
	DetailText         string      `json:"detailText"`
	Inverted           *bool       `json:"inverted"`
	VideoId            *uuid.UUID  `json:"videoId" validate:"required"`
	VideoLiteId        *uuid.UUID  `json:"videoLiteId" validate:"required"`
	VideoPreviewId     *uuid.UUID  `json:"videoPreviewId" validate:"required"`
	VideoPreviewBlurId *uuid.UUID  `json:"videoPreviewBlurId" validate:"required"`
	Tags               []uuid.UUID `json:"tags"`
	UserId             *uuid.UUID  `json:"userId"`
	LearnMoreUrl       *string     `json:"learnMoreUrl"`
}

type CreateTagResponse

type CreateTagResponse struct {
	ID uuid.UUID `json:"id"`
}

type CreateVideoCardRequest

type CreateVideoCardRequest struct {
	VideoId            *uuid.UUID `json:"videoId"`
	VideoLiteId        *uuid.UUID `json:"videoLiteId"`
	VideoPreviewId     *uuid.UUID `json:"videoPreviewId"`
	VideoPreviewBlurId *uuid.UUID `json:"videoPreviewBlurId"`
}

type CreateVideoRequest

type CreateVideoRequest struct {
	Filename string        `validate:"required,min=3"`
	Size     int64         `validate:""`
	FolderId *uuid.UUID    `validate:"omitempty,notBlank"`
	File     io.ReadSeeker `validate:"required"`
}

type CreateVideoResponse

type CreateVideoResponse struct {
	VideoId          uuid.UUID `json:"videoId"`
	VideoLiteId      uuid.UUID `json:"videoLiteId"`
	PreviewId        uuid.UUID `json:"videoPreviewId"`
	PreviewBlurredId uuid.UUID `json:"videoPreviewBlurId"`
}

type FormCardDto

type FormCardDto struct {
	Form         *FormDto      `json:"form"`
	Background   *entity.Media `json:"background"`
	User         *UserDto      `json:"user"`
	Tags         []TagDto      `json:"tags"`
	LearnMoreUrl *string       `json:"learnMoreUrl"`
}

type FormDto

type FormDto struct {
	Id   uuid.UUID `json:"id"`
	Name string    `json:"name"`
}

type GalleryDto

type GalleryDto struct {
	ID   uuid.UUID `json:"id"`
	Code string    `json:"code"`
	Name string    `json:"name"`
	//Position    int       `json:"position"`
	IsPublished bool      `json:"isPublished"`
	Hidden      bool      `json:"hiddenMenu"`
	Cards       []CardDto `json:"cards"`
}

type GalleryDtoWithCardsTotal

type GalleryDtoWithCardsTotal struct {
	ID          uuid.UUID `json:"id"`
	Code        string    `json:"code"`
	Name        string    `json:"name"`
	Position    int       `json:"position"`
	IsPublished bool      `json:"isPublished"`
	Hidden      bool      `json:"hiddenMenu"`
	CardsTotal  int       `json:"cardsTotal"`
	Cards       []CardDto `json:"cards"`
}

type GalleryInPageDto

type GalleryInPageDto struct {
	ID          uuid.UUID `json:"id"`
	Code        string    `json:"code"`
	Name        string    `json:"name"`
	Position    int       `json:"position"`
	IsPublished bool      `json:"isPublished"`
	Hidden      bool      `json:"hiddenMenu"`
	Cards       []CardDto `json:"cards"`
}

type GalleryRepository

type GalleryRepository interface {
	GetByCode(ctx context.Context, code string) (*entity.Gallery, error)
	GetById(ctx context.Context, id uuid.UUID) (*entity.Gallery, error)
	GetByIdWithoutAssociate(ctx context.Context, id uuid.UUID) (*entity.Gallery, error)
	GetListByPageId(ctx context.Context, pageId uuid.UUID) ([]entity.Gallery, error)
	Create(ctx context.Context, gallery *entity.Gallery) (*uuid.UUID, error)
	GetListWithSearch(ctx context.Context, searchValue string) ([]entity.Gallery, error)
	Update(ctx context.Context, gallery *entity.Gallery) error
	PatchName(ctx context.Context, gallery *entity.Gallery) error
	PatchCardPosition(ctx context.Context, dto *PatchCardPosition) error
	DeleteList(ctx context.Context, galleryIds []uuid.UUID) error
	GetLastPosition(ctx context.Context, galleryID uuid.UUID) (int, error)
	CreateGalleriesCards(ctx context.Context, galleriesCards []entity.GalleriesCards) (error, bool)
	DeleteGalleriesCards(ctx context.Context, galleryID uuid.UUID, cardIDs []uuid.UUID) error
	UpdateHidden(ctx context.Context, galleryID uuid.UUID, hidden *bool) error
	UpdatePublish(ctx context.Context, galleryID uuid.UUID, publish *bool) error
}

type GalleryUseCase

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

func NewGalleryUseCase

func NewGalleryUseCase(
	galleryRepository GalleryRepository, cardRepository CardRepository, cardUseCase CardUseCase,
	copierService CopierInterface, logger *zap.SugaredLogger,
) *GalleryUseCase

func (GalleryUseCase) Create

func (GalleryUseCase) DeleteList

func (uc GalleryUseCase) DeleteList(ctx context.Context, galleryIds []uuid.UUID) error

func (GalleryUseCase) GetByCode

func (uc GalleryUseCase) GetByCode(ctx context.Context, code string) (*GalleryDto, error)

func (GalleryUseCase) GetById

func (GalleryUseCase) GetDtoFromGallery

func (uc GalleryUseCase) GetDtoFromGallery(gallery *entity.Gallery) (
	galleryDto *GalleryDto, err error,
)

func (GalleryUseCase) GetDtosFromGallery

func (uc GalleryUseCase) GetDtosFromGallery(galleries []entity.Gallery) (
	galleryDtos []GalleryDto, err error,
)

func (GalleryUseCase) GetGalleryDtos

func (uc GalleryUseCase) GetGalleryDtos(galleries []entity.PagesGalleries) (
	galleryDtos []GalleryInPageDto, err error,
)

func (GalleryUseCase) GetGalleryFromDto

func (uc GalleryUseCase) GetGalleryFromDto(galleryDto *CreateGalleryRequest) (
	gallery *entity.Gallery, err error,
)

func (GalleryUseCase) GetGalleryFromDtos

func (uc GalleryUseCase) GetGalleryFromDtos(galleryDtos []CreateGalleryInPageRequest, pageId uuid.UUID) (
	galleries []entity.PagesGalleries, err error,
)

func (GalleryUseCase) GetGalleryFromUpdateDto

func (uc GalleryUseCase) GetGalleryFromUpdateDto(galleryDto *UpdateGalleryRequest) (
	gallery *entity.Gallery, err error,
)

func (GalleryUseCase) GetListWithSearch

func (uc GalleryUseCase) GetListWithSearch(ctx context.Context, searchValue string) ([]GalleryDto, error)

func (GalleryUseCase) LinkCards

func (uc GalleryUseCase) LinkCards(ctx context.Context, galleryId uuid.UUID, cardIds []uuid.UUID) (error, bool)

func (GalleryUseCase) PatchCardPosition

func (uc GalleryUseCase) PatchCardPosition(ctx context.Context, dto *PatchCardPosition) error

func (GalleryUseCase) PatchName

func (GalleryUseCase) UnlinkCards

func (uc GalleryUseCase) UnlinkCards(ctx context.Context, galleryId uuid.UUID, cardIds []uuid.UUID) error

func (GalleryUseCase) Update

type GetCardRequest

type GetCardRequest struct {
	ID string `json:"id" validate:"required,sluggable"`
}

type GetGalleryRequest

type GetGalleryRequest struct {
	ID string `json:"id" validate:"required,sluggable"`
}

type GetPageDto

type GetPageDto struct {
	ID string `json:"id" validate:"required,sluggable"`
}

type GetPageListResponse

type GetPageListResponse struct {
	PageList []PageShort `json:"pageList"`
}

type HtmlCardDto

type HtmlCardDto struct {
	Html string `json:"html"`
}

type PageDto

type PageDto struct {
	ID             uuid.UUID          `json:"id"`
	Name           string             `json:"name"`
	Code           string             `json:"code"`
	Title          string             `json:"title"`
	TitleSeo       string             `json:"titleSeo"`
	Keywords       string             `json:"keywords"`
	Description    string             `json:"description"`
	DescriptionSeo string             `json:"descriptionSeo"`
	IsPublished    bool               `json:"isPublished"`
	Sort           int                `json:"sort"`
	Galleries      []GalleryInPageDto `json:"galleries"`

	OgType string `json:"ogType"`
}

type PageRepository

type PageRepository interface {
	GetById(ctx context.Context, id uuid.UUID) (*entity.Page, error)
	GetByIdWithoutAssociate(ctx context.Context, id uuid.UUID) (*entity.Page, error)
	GetList(ctx context.Context, fields []string, allowInactive bool) ([]PageShort, error)
	Create(ctx context.Context, page *entity.Page) (*uuid.UUID, error)
	Delete(ctx context.Context, pageID uuid.UUID) error
	PatchProperties(ctx context.Context, page *entity.Page) error
	PatchGalleryPosition(ctx context.Context, dto *PatchGalleryPosition) error
	GetLastPosition(ctx context.Context, pageID uuid.UUID) (int, error)
	CreatePagesGalleries(ctx context.Context, pagesGalleries []entity.PagesGalleries) (error, bool)
	DeletePagesGalleries(ctx context.Context, pageID uuid.UUID, galleryIDs []uuid.UUID) error
	UpdatePublish(ctx context.Context, pageID uuid.UUID, publish *bool) error
}

type PageShort

type PageShort struct {
	ID   uuid.UUID `json:"id"`
	Name string    `json:"name"`
	Code string    `json:"code"`
	Sort int       `json:"sort"`
}

type PageUseCase

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

func NewPageUseCase

func NewPageUseCase(
	pageRepository PageRepository, galleryRepository GalleryRepository, galleryUseCase GalleryUseCase,
	copierService CopierInterface, logger *zap.SugaredLogger,
) *PageUseCase

func (PageUseCase) Create

func (PageUseCase) Delete

func (uc PageUseCase) Delete(ctx context.Context, pageId uuid.UUID) error

func (PageUseCase) GetById

func (uc PageUseCase) GetById(ctx context.Context, dto GetPageDto) (*PageDto, error)

func (PageUseCase) GetList

func (uc PageUseCase) GetList(ctx context.Context) (*GetPageListResponse, error)

func (PageUseCase) GetPageDto

func (uc PageUseCase) GetPageDto(page entity.Page) (pageDto *PageDto, err error)

func (PageUseCase) GetPageFromDto

func (uc PageUseCase) GetPageFromDto(pageDto CreatePageRequest) (page *entity.Page, err error)

func (PageUseCase) GetPageFromPatchDto

func (uc PageUseCase) GetPageFromPatchDto(pageDto PatchPageRequest) (page *entity.Page, err error)

func (PageUseCase) LinkGalleries

func (uc PageUseCase) LinkGalleries(ctx context.Context, pageId uuid.UUID, galleryIds []uuid.UUID) (error, bool)

func (PageUseCase) PatchGalleryPosition

func (uc PageUseCase) PatchGalleryPosition(ctx context.Context, dto *PatchGalleryPosition) error

func (PageUseCase) PatchProperties

func (uc PageUseCase) PatchProperties(ctx context.Context, dto *PatchPageRequest) error

func (PageUseCase) UnlinkGalleries

func (uc PageUseCase) UnlinkGalleries(ctx context.Context, pageId uuid.UUID, galleryIds []uuid.UUID) error

type PatchCardPosition

type PatchCardPosition struct {
	GalleryID   uuid.UUID `json:"galleryId" validate:"required"`
	CardID      uuid.UUID `json:"cardId" validate:"required"`
	OldPosition *int      `json:"oldPosition" validate:"required"`
	NewPosition *int      `json:"newPosition" validate:"required"`
}

type PatchDetailTextRequest

type PatchDetailTextRequest struct {
	CardId     uuid.UUID `json:"cardId" validate:"required"`
	DetailText string    `json:"detailText" validate:"required"`
}

type PatchGalleryNameRequest

type PatchGalleryNameRequest struct {
	ID   uuid.UUID `json:"id" validate:"required"`
	Name string    `json:"name" validate:"required"`
}

type PatchGalleryPosition

type PatchGalleryPosition struct {
	PageID      uuid.UUID `json:"pageId" validate:"required"`
	GalleryID   uuid.UUID `json:"galleryId" validate:"required"`
	OldPosition *int      `json:"oldPosition" validate:"required"`
	NewPosition *int      `json:"newPosition" validate:"required"`
}

type PatchLearnMoreUrlRequest

type PatchLearnMoreUrlRequest struct {
	CardId       uuid.UUID `json:"cardId" validate:"required"`
	LearnMoreUrl *string   `json:"learnMoreUrl"`
}

type PatchPageRequest

type PatchPageRequest struct {
	ID             uuid.UUID `json:"id"`
	Name           string    `json:"name"`
	Code           string    `json:"code"`
	Title          string    `json:"title"`
	TitleSeo       string    `json:"titleSeo"`
	Keywords       string    `json:"keywords"`
	Description    string    `json:"description"`
	DescriptionSeo string    `json:"descriptionSeo"`
	IsPublished    *bool     `json:"isPublished"`
	Sort           int       `json:"sort"`

	OgImageId *uuid.UUID `json:"ogImageId"`
	OgType    string     `json:"ogType"`
}

type PatchPreviewTextRequest

type PatchPreviewTextRequest struct {
	CardId      uuid.UUID `json:"cardId" validate:"required"`
	PreviewText string    `json:"previewText" validate:"required"`
}

type PatchUserRequest

type PatchUserRequest struct {
	CardId uuid.UUID `json:"cardId" validate:"required"`
	UserId uuid.UUID `json:"userId" validate:"required"`
}

type PhotoCardDto

type PhotoCardDto struct {
	Picture *entity.Media `json:"picture"`
}

type RegularCardDto

type RegularCardDto struct {
	PreviewText      string        `json:"previewText"`
	DetailText       string        `json:"detailText"`
	Inverted         bool          `json:"inverted"`
	Video            *entity.Media `json:"video"`
	VideoLite        *entity.Media `json:"videoLite"`
	VideoPreview     *entity.Media `json:"videoPreview"`
	VideoPreviewBlur *entity.Media `json:"videoPreviewBlur"`
	User             *UserDto      `json:"user"`
	Tags             []TagDto      `json:"tags"`
	LearnMoreUrl     *string       `json:"learnMoreUrl"`
}

type SearchGalleryRequest

type SearchGalleryRequest struct {
	ID         uuid.UUID `json:"id"`
	Name       string    `json:"name"`
	Code       string    `json:"code"`
	Position   int       `json:"position"`
	CardsTotal int       `json:"cardsTotal"`
	Cards      []CardDto `json:"cards"`
}

type TagDto

type TagDto struct {
	ID   uuid.UUID `json:"id"`
	Text string    `json:"text" validate:"required"`
	Link string    `json:"link" validate:"required"`
}

type TagDtoRequest

type TagDtoRequest struct {
	ID   uuid.UUID `json:"id"`
	Text string    `json:"text"`
	Link string    `json:"link"`
}

type TagRepository

type TagRepository interface {
	//GetListByCardId(ctx context.Context, regularCardId uuid.UUID) ([]entity.ExternalTag, []entity.InternalTag, error)
	UpdateIsDetailLink(ctx context.Context, tagID uuid.UUID, value *bool) error
	GetListWithSearch(ctx context.Context, searchValue string) ([]entity.Tag, map[uuid.UUID][]uuid.UUID, error)
	GetById(ctx context.Context, tagId uuid.UUID) (*entity.Tag, error)
	Create(ctx context.Context, tag *entity.Tag) (*uuid.UUID, error)
	Update(ctx context.Context, tag *entity.Tag) error
	Delete(ctx context.Context, tagId uuid.UUID) error
}

type TagSearchDto

type TagSearchDto struct {
	ID      uuid.UUID   `json:"id"`
	CardIds []uuid.UUID `json:"cardIds"`
	Text    string      `json:"text" validate:"required"`
	Link    string      `json:"link" validate:"required"`
}

type TagUseCase

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

func NewTagUseCase

func NewTagUseCase(tagRepository TagRepository, copierService CopierInterface, logger *zap.SugaredLogger) *TagUseCase

func (TagUseCase) Create

func (uc TagUseCase) Create(ctx context.Context, dto *TagDto) (
	*CreateTagResponse, error,
)

func (TagUseCase) Delete

func (uc TagUseCase) Delete(ctx context.Context, tagId uuid.UUID) error

func (TagUseCase) GetDtosFromTags

func (uc TagUseCase) GetDtosFromTags(tags []entity.Tag, tagCardsIds map[uuid.UUID][]uuid.UUID) ([]TagSearchDto, error)

func (TagUseCase) GetListWithSearch

func (uc TagUseCase) GetListWithSearch(ctx context.Context, searchValue string) ([]TagSearchDto, error)

func (TagUseCase) GetTagFromDto

func (uc TagUseCase) GetTagFromDto(tag TagDto) (*entity.Tag, error)

func (TagUseCase) GetTagFromRequestDto

func (uc TagUseCase) GetTagFromRequestDto(tag TagDtoRequest) (*entity.Tag, error)

func (TagUseCase) Update

func (uc TagUseCase) Update(ctx context.Context, dto *TagDtoRequest) error

type UpdateCardRequest

type UpdateCardRequest struct {
	ID         uuid.UUID   `json:"id"`
	Name       string      `json:"name"`
	Code       string      `json:"code"`
	GalleryIds []uuid.UUID `json:"galleryIds"`
	Type       string      `json:"type"`
	//Position    int                       `json:"position"`
	IsPublished *bool                     `json:"isPublished"`
	RegularCard *CreateRegularCardRequest `json:"regularCard"`
	VideoCard   *CreateVideoCardRequest   `json:"videoCard"`
	HtmlCard    *CreateHtmlCardRequest    `json:"htmlCard"`
	PhotoCard   *CreatePhotoCardRequest   `json:"photoCard"`
	FormCard    *CreateFormCardRequest    `json:"formCard"`

	Title       string `json:"title"`
	Description string `json:"description"`
	OgType      string `json:"ogType"`
}

type UpdateGalleryRequest

type UpdateGalleryRequest struct {
	ID          uuid.UUID           `json:"id"`
	Name        string              `json:"name"`
	Code        string              `json:"code"`
	Position    int                 `json:"position"`
	CardsTotal  int                 `json:"cardsTotal"`
	Cards       []CreateCardRequest `json:"cards"`
	Hidden      *bool               `json:"hiddenMenu"`
	IsPublished *bool               `json:"isPublished"`
}

type UserDto

type UserDto struct {
	ID        uuid.UUID     `json:"id"`
	FirstName string        `json:"firstName"`
	LastName  string        `json:"lastName"`
	Position  string        `json:"position"`
	Picture   *entity.Media `json:"picture"`
}

type UserRepository

type UserRepository interface {
	GetById(ctx context.Context, userId uuid.UUID) (*entity.User, error)
}

type VideoCardDto

type VideoCardDto struct {
	Video            *entity.Media `json:"video"`
	VideoLite        *entity.Media `json:"videoLite"`
	VideoPreview     *entity.Media `json:"videoPreview"`
	VideoPreviewBlur *entity.Media `json:"videoPreviewBlur"`
}

type VideoSamples

type VideoSamples struct {
	CompressedVideo *bytes.Reader
	PreviewBlurred  *bytes.Reader
	Preview         *bytes.Reader
}

type VideoUseCase

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

func NewVideoUseCase

func NewVideoUseCase(
	medias *mediaActions.Medias,
	logger *zap.SugaredLogger,
) *VideoUseCase

func (VideoUseCase) Create

Jump to

Keyboard shortcuts

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