properties

package
v0.0.0-...-946fd12 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageTypeOrigin    = "origin"
	ImageTypeThumbnail = "thumb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageProcessing

type ImageProcessing interface {
	Process(file *multipart.FileHeader) (*properties.Image, error)
}

type ImageService

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

func NewImageService

func NewImageService(
	imgStorage ImageStorage,
	imagesRepo ImagesRepository,
	imgProcessor ImageProcessing,
	logger *zap.SugaredLogger,
) *ImageService

func (ImageService) DeleteAll

func (s ImageService) DeleteAll(ctx context.Context, prop *properties.Property) error

func (ImageService) DeleteOne

func (s ImageService) DeleteOne(ctx context.Context, propertyId int, imageId string) error

func (ImageService) Get

func (s ImageService) Get(ctx context.Context, id, imgType string) (*properties.Image, *minio.Object, error)

func (ImageService) ImageTypeExists

func (s ImageService) ImageTypeExists(imgType string) bool

func (ImageService) Save

func (s ImageService) Save(ctx context.Context, file *multipart.FileHeader, userId, propId int) error

type ImageStorage

type ImageStorage interface {
	Upload(ctx context.Context, img *properties.Image) error
	Get(ctx context.Context, name string) (*minio.Object, error)
	Del(ctx context.Context, name string) error
}

type ImagesProcessService

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

func NewImagesProcessService

func NewImagesProcessService(dimensions []properties.Dimensions, formats []string) *ImagesProcessService

func (ImagesProcessService) Process

type ImagesRepository

type ImagesRepository interface {
	Create(ctx context.Context, image *properties.Image) error
	Get(ctx context.Context, id string) (*properties.Image, error)
	GetPropertyImage(ctx context.Context, propId int, id string) (*properties.Image, error)
	GetAll(ctx context.Context, id int) ([]properties.Image, error)
	Delete(ctx context.Context, id string) error
	DeletePropertyImages(ctx context.Context, id int) error
}

type PropertyRepository

type PropertyRepository interface {
	Get(ctx context.Context, id int) (*properties.Property, error)
	GetByUser(ctx context.Context, id, userID int) (*properties.Property, error)
	Create(ctx context.Context, property *properties.Property) error
	Update(ctx context.Context, property *properties.Property) error
	Delete(ctx context.Context, property *properties.Property) error
	UpdateActivity(ctx context.Context, userID int, active bool) error

	Searchable
}

type PropertySearchService

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

func NewPropertySearchSrv

func NewPropertySearchSrv(
	propertiesRepo PropertyRepository,
	propertiesSearchRepo PropertySearchRepository,
	similarPropertiesSearchRepo SimilarPropertySearchRepository,
	defaultPropLimit int,
	logger *zap.SugaredLogger,
) PropertySearchService

func (PropertySearchService) Search

func (PropertySearchService) SearchSimilar

func (s PropertySearchService) SearchSimilar(ctx context.Context, id int) (
	[]properties.Property, error,
)

type PropertyService

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

func NewPropertySrv

func NewPropertySrv(
	propertiesRepo PropertyRepository,
	propertiesSearchRepo PropertySearchRepository,
	logger *zap.SugaredLogger,
) PropertyService

func (PropertyService) Get

func (PropertyService) List

func (s PropertyService) List(ctx context.Context, ids []int) ([]properties.Property, error)

type SavedHomesRepository

type SavedHomesRepository interface {
	Exists(ctx context.Context, home properties.UserSavedHome) (bool, error)
	Add(ctx context.Context, home properties.UserSavedHome) error
	Delete(ctx context.Context, home properties.UserSavedHome) error
	List(ctx context.Context, userID int, pagination domain.Pagination) ([]properties.UserSavedHome, error)
}

type SavedHomesService

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

func NewSavedHomesSrv

func NewSavedHomesSrv(
	savedHomesRepo SavedHomesRepository, propertiesRepo PropertyRepository,
	propertiesSearchRepo PropertySearchRepository, logger *zap.SugaredLogger,
) SavedHomesService

func (SavedHomesService) Add

func (SavedHomesService) Delete

func (SavedHomesService) List

func (s SavedHomesService) List(ctx context.Context, userID int, pagination domain.Pagination) (
	[]properties.Property, error,
)

type SearchFilters

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

func NewSearchSrv

func NewSearchSrv(searchFiltersRepo SearchFiltersRepository, logger *zap.SugaredLogger) SearchFilters

func (SearchFilters) Create

func (s SearchFilters) Create(ctx context.Context, searchFilters *domain.UserSearchFilters) (
	*domain.UserSearchFilters, error,
)

func (SearchFilters) Delete

func (s SearchFilters) Delete(ctx context.Context, searchID, userID int) error

func (SearchFilters) Get

func (s SearchFilters) Get(ctx context.Context, userID int, searchID int) (*domain.UserSearchFilters, error)

func (SearchFilters) List

func (s SearchFilters) List(ctx context.Context, userID int) ([]domain.UserSearchFilters, error)

func (SearchFilters) Update

func (s SearchFilters) Update(ctx context.Context, searchFilters *domain.UserSearchFilters) error

type SearchFiltersRepository

type SearchFiltersRepository interface {
	Create(ctx context.Context, search *domain.UserSearchFilters) error
	Update(ctx context.Context, search *domain.UserSearchFilters) error
	Delete(ctx context.Context, searchID, userID int) error
	List(ctx context.Context, userID int) ([]domain.UserSearchFilters, error)
	Get(ctx context.Context, userID, searchID int) (*domain.UserSearchFilters, error)
}

type Searchable

type Searchable interface {
	SearchQueryBuilder() repositories.SearchPropertyQueryBuilder
}

type SimilarSearchable

type SimilarSearchable interface {
	SearchQueryBuilder() repositories.SimilarPropertyQueryBuilder
}

type UserPropertyService

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

func NewUserPropertySrv

func NewUserPropertySrv(
	propertiesRepo PropertyRepository,
	propertiesSearchRepo PropertySearchRepository,
	defaultPropSearchLimit int,
	logger *zap.SugaredLogger,
) UserPropertyService

func (UserPropertyService) CreateUserProperty

func (s UserPropertyService) CreateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)

func (UserPropertyService) DeleteUserProperty

func (s UserPropertyService) DeleteUserProperty(ctx context.Context, prop *properties.Property) error

func (UserPropertyService) GetUserProperty

func (s UserPropertyService) GetUserProperty(ctx context.Context, id, userId int) (*properties.Property, error)

func (UserPropertyService) ListByUser

func (s UserPropertyService) ListByUser(ctx context.Context, userID int, filters search.BaseFilters) ([]properties.Property, error)

func (UserPropertyService) UpdateUserProperty

func (s UserPropertyService) UpdateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)

Jump to

Keyboard shortcuts

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