Documentation ¶
Overview ¶
Package user_properties @title user properties actions @host localhost:8090
Index ¶
- type Handler
- func (t Handler) Activate(ctx echo.Context) error
- func (t Handler) AddRoutes(e *echo.Group, m ...echo.MiddlewareFunc)
- func (t Handler) Create(ctx echo.Context) error
- func (t Handler) Deactivate(ctx echo.Context) error
- func (t Handler) Delete(ctx echo.Context) error
- func (t Handler) DeleteImage(ctx echo.Context) error
- func (t Handler) GetUserProp(ctx echo.Context) error
- func (t Handler) ListByUser(ctx echo.Context) error
- func (t Handler) Update(ctx echo.Context) error
- func (t Handler) Upload(ctx echo.Context) error
- type ImagesService
- type ProfileService
- type UserPropertiesService
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 ¶
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) Create ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 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) }