controller

package
v0.0.0-...-5e664b8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCreateRequest

func ValidateCreateRequest(dirtyData *AttachmentCreateRequestIDO) error

func ValidateUpdateRequest

func ValidateUpdateRequest(dirtyData *AttachmentUpdateRequestIDO) error

Types

type AttachmentController

type AttachmentController interface {
	Create(ctx context.Context, req *AttachmentCreateRequestIDO) (*domain.Attachment, error)
	GetByID(ctx context.Context, id primitive.ObjectID) (*domain.Attachment, error)
	UpdateByID(ctx context.Context, ns *AttachmentUpdateRequestIDO) (*domain.Attachment, error)
	ListByFilter(ctx context.Context, f *domain.AttachmentListFilter) (*domain.AttachmentListResult, error)
	ListAsSelectOptionByFilter(ctx context.Context, f *domain.AttachmentListFilter) ([]*domain.AttachmentAsSelectOption, error)
	DeleteByID(ctx context.Context, id primitive.ObjectID) error
	PermanentlyDeleteByID(ctx context.Context, id primitive.ObjectID) error
}

AttachmentController Interface for attachment business logic controller.

func NewController

func NewController(
	appCfg *config.Conf,
	loggerp *slog.Logger,
	uuidp uuid.Provider,
	s3 s3_storage.S3Storager,
	client *mongo.Client,
	emailer mg.Emailer,
	org_storer attachment_s.AttachmentStorer,
	usr_storer user_s.UserStorer,
) AttachmentController

type AttachmentControllerImpl

type AttachmentControllerImpl struct {
	Config           *config.Conf
	Logger           *slog.Logger
	UUID             uuid.Provider
	S3               s3_storage.S3Storager
	Emailer          mg.Emailer
	DbClient         *mongo.Client
	AttachmentStorer attachment_s.AttachmentStorer
	UserStorer       user_s.UserStorer
}

func (*AttachmentControllerImpl) Create

func (*AttachmentControllerImpl) DeleteByID

func (impl *AttachmentControllerImpl) DeleteByID(ctx context.Context, id primitive.ObjectID) error

func (*AttachmentControllerImpl) GetByID

func (*AttachmentControllerImpl) ListAsSelectOptionByFilter

func (*AttachmentControllerImpl) ListByFilter

func (*AttachmentControllerImpl) PermanentlyDeleteByID

func (impl *AttachmentControllerImpl) PermanentlyDeleteByID(ctx context.Context, id primitive.ObjectID) error

func (*AttachmentControllerImpl) UpdateByID

type AttachmentCreateRequestIDO

type AttachmentCreateRequestIDO struct {
	Name          string
	Description   string
	OwnershipID   primitive.ObjectID
	OwnershipType int8
	FileName      string
	FileType      string
	File          multipart.File
}

type AttachmentUpdateRequestIDO

type AttachmentUpdateRequestIDO struct {
	ID            primitive.ObjectID
	Name          string
	Description   string
	OwnershipID   primitive.ObjectID
	OwnershipType int8
	FileName      string
	FileType      string
	File          multipart.File
}

Jump to

Keyboard shortcuts

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