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

Documentation

Overview

Package user_properties @title user properties actions @host localhost:8090

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	common.BaseHandler
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(imgService ImagesService, userPropService UserPropertiesService) Handler

func (Handler) Activate

func (t Handler) Activate(ctx echo.Context) error

Activate

@Summary Activate Property @Description Activate Property by ID @Tags properties @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{id}/activate [PUT]

func (Handler) AddRoutes

func (t Handler) AddRoutes(e *echo.Group, m ...echo.MiddlewareFunc)

func (Handler) Create

func (t Handler) Create(ctx echo.Context) error

Create

@Summary Create propertyCreateRequest @Description Create propertyCreateRequest @Tags properties @Accept json @Produce json @Param propertyCreate body propertyCreateRequest true "property data" @Success 200 {object} common.DefaultResponse{data=propertyResponse} @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties [POST]

func (Handler) Deactivate

func (t Handler) Deactivate(ctx echo.Context) error

Deactivate

@Summary Deactivate Property @Description Deactivate Property by ID @Tags properties @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{id}/deactivate [PUT]

func (Handler) Delete

func (t Handler) Delete(ctx echo.Context) error

Delete

@Summary Delete Property @Description Delete Property and images @Tags properties @Accept json @Produce json @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{id} [DELETE]

func (Handler) DeleteImage

func (t Handler) DeleteImage(ctx echo.Context) error

DeleteImage

@Summary Download property image @Description Download property image @Tags properties @Accept json @Success 204 {object} common.EmptyResponse @Param property_id path int true "property id" @Param image_id path string true "image uuid from property images list" @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{property_id}/image/{image_id} [DELETE]

func (Handler) GetUserProp

func (t Handler) GetUserProp(ctx echo.Context) error

GetUserProp user prop

@Summary GetUserProp user propertyGetRequest by ID @Description GetUserProp user propertyGetRequest by ID @Tags properties @Accept json @Produce json @Param id path int true "propertyGetRequest ID" @Success 200 {object} common.DefaultResponse{data=propertyResponse} @Success 404 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/user/properties/{id} [GET]

func (Handler) ListByUser

func (t Handler) ListByUser(ctx echo.Context) error

ListByUser

@Summary List properties by auth user id. @Description List properties auth user id. @Tags properties @Accept json @Produce json @Param Search body propertyListRequest true "property list body" @Success 200 {object} common.DefaultResponse{data=[]propertyResponse} @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Router /v1/user/properties [GET]

func (Handler) Update

func (t Handler) Update(ctx echo.Context) error

Update

@Summary Update PropertyUpdateRequest @Description Update PropertyUpdateRequest by ID @Tags properties @Accept json @Produce json @Param updateProperty body propertyCreateRequest true "property data" @Success 200 {object} common.DefaultResponse{data=propertyResponse} @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{id} [PUT]

func (Handler) Upload

func (t Handler) Upload(ctx echo.Context) error

Upload

@Summary Create property image @Description Create property image @Tags properties @Accept json @Produce json @Param imageContent body image true "image" @Success 204 {object} common.EmptyResponse @Failure 400 {object} common.ErrorResponse @Failure 401 {object} common.ErrorResponse @Failure 403 {object} common.ErrorResponse @Failure 404 {object} common.ErrorResponse @Failure 500 {object} common.ErrorResponse @Security ApiKeyAuth @Router /v1/user/properties/{id}/image [POST]

type ImagesService

type ImagesService interface {
	DeleteAll(ctx context.Context, prop *properties.Property) error
	DeleteOne(ctx context.Context, propertyId int, imageId string) error
	Save(ctx context.Context, file *multipart.FileHeader, userId, propId int) error
	Get(ctx context.Context, id, imgType string) (*properties.Image, *minio.Object, error)
	ImageTypeExists(imgType string) bool
}

type ProfileService

type ProfileService interface {
	GetProfile(ctx context.Context, userID int) (*domain.User, error)
}

type UserPropertiesService

type UserPropertiesService interface {
	CreateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)
	UpdateUserProperty(ctx context.Context, prop *properties.Property) (*properties.Property, error)
	DeleteUserProperty(ctx context.Context, prop *properties.Property) error
	ListByUser(ctx context.Context, userID int, filters search.BaseFilters) ([]properties.Property, error)
	GetUserProperty(ctx context.Context, id, userId int) (*properties.Property, error)
}

Jump to

Keyboard shortcuts

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