Documentation ¶
Index ¶
- Constants
- type ImageProcessing
- type ImageService
- func (s ImageService) DeleteAll(ctx context.Context, prop *properties.Property) error
- func (s ImageService) DeleteOne(ctx context.Context, propertyId int, imageId string) error
- func (s ImageService) Get(ctx context.Context, id, imgType string) (*properties.Image, *minio.Object, error)
- func (s ImageService) ImageTypeExists(imgType string) bool
- func (s ImageService) Save(ctx context.Context, file *multipart.FileHeader, userId, propId int) error
- type ImageStorage
- type ImagesProcessService
- type ImagesRepository
- type PropertyRepository
- type PropertySearchRepository
- type PropertySearchService
- type PropertyService
- type SavedHomesRepository
- type SavedHomesService
- func (s SavedHomesService) Add(ctx context.Context, home properties.UserSavedHome) (*properties.Property, error)
- func (s SavedHomesService) Delete(ctx context.Context, home properties.UserSavedHome) error
- func (s SavedHomesService) List(ctx context.Context, userID int, pagination domain.Pagination) ([]properties.Property, error)
- type SearchFilters
- func (s SearchFilters) Create(ctx context.Context, searchFilters *domain.UserSearchFilters) (*domain.UserSearchFilters, error)
- func (s SearchFilters) Delete(ctx context.Context, searchID, userID int) error
- func (s SearchFilters) Get(ctx context.Context, userID int, searchID int) (*domain.UserSearchFilters, error)
- func (s SearchFilters) List(ctx context.Context, userID int) ([]domain.UserSearchFilters, error)
- func (s SearchFilters) Update(ctx context.Context, searchFilters *domain.UserSearchFilters) error
- type SearchFiltersRepository
- type Searchable
- type SimilarPropertySearchRepository
- type SimilarSearchable
- type UserPropertyService
- func (s UserPropertyService) CreateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)
- func (s UserPropertyService) DeleteUserProperty(ctx context.Context, prop *properties.Property) error
- func (s UserPropertyService) GetUserProperty(ctx context.Context, id, userId int) (*properties.Property, error)
- func (s UserPropertyService) ListByUser(ctx context.Context, userID int, filters search.BaseFilters) ([]properties.Property, error)
- func (s UserPropertyService) UpdateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)
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) 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 ImagesProcessService ¶
type ImagesProcessService struct {
// contains filtered or unexported fields
}
func NewImagesProcessService ¶
func NewImagesProcessService(dimensions []properties.Dimensions, formats []string) *ImagesProcessService
func (ImagesProcessService) Process ¶
func (s ImagesProcessService) Process(file *multipart.FileHeader) (*properties.Image, error)
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 PropertySearchRepository ¶
type PropertySearchRepository interface { Search(ctx context.Context, q repositories.SearchPropertyQueryBuilder) (properties.Properties, error) Count(ctx context.Context, q repositories.SearchPropertyQueryBuilder) (int, 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 (s PropertySearchService) Search(ctx context.Context, search *search.PropertySearchRequest) ( []properties.Property, int, error, )
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 (s PropertyService) Get(ctx context.Context, id int) (*properties.Property, error)
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 (s SavedHomesService) Add(ctx context.Context, home properties.UserSavedHome) (*properties.Property, error)
func (SavedHomesService) Delete ¶
func (s SavedHomesService) Delete(ctx context.Context, home properties.UserSavedHome) error
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 SimilarPropertySearchRepository ¶
type SimilarPropertySearchRepository interface { Search(ctx context.Context, q repositories.SimilarPropertyQueryBuilder, location string) (properties.Properties, error) Count(ctx context.Context, q repositories.SimilarPropertyQueryBuilder) (int, error) SimilarSearchable }
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)
Click to show internal directories.
Click to hide internal directories.