profile

package
v0.0.0-...-8bdfbef Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TmpDir          = "tmp"
	ValidExtensions = ".jpg,.jpeg,.png,.gif"
	S3Dir           = "profile"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProfileHandler

type ProfileHandler struct {
	conf.Config
	*validator.Validate
	ProfileService
	storage.StorageService
}

func NewProfileHandler

func NewProfileHandler(profileService ProfileService, storageService storage.StorageService, config conf.Config, validate *validator.Validate) ProfileHandler

func (*ProfileHandler) DeleteProfile

func (h *ProfileHandler) DeleteProfile(ctx *gin.Context)

func (*ProfileHandler) GetProfile

func (h *ProfileHandler) GetProfile(ctx *gin.Context)

func (*ProfileHandler) UpdateImage

func (h *ProfileHandler) UpdateImage(ctx *gin.Context)

func (*ProfileHandler) UpdatePassword

func (h *ProfileHandler) UpdatePassword(ctx *gin.Context)

func (*ProfileHandler) UpdateProfile

func (h *ProfileHandler) UpdateProfile(ctx *gin.Context)

type ProfileService

type ProfileService interface {
	UpdateProfileByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdateProfileRequest) (user.UserEntity, error)
	UpdatePasswordByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdatePasswordRequest) (user.UserEntity, error)
	UpdateImageByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdateImageRequest) (user.UserEntity, error)
	DeleteProfileByUserUuid(ctx context.Context, userUUID uuid.UUID) (user.UserEntity, error)
}

func NewProfileService

func NewProfileService(datastore db.DataStore, userService user.UserService) ProfileService

type ProfileServiceImpl

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

func (*ProfileServiceImpl) DeleteProfileByUserUuid

func (service *ProfileServiceImpl) DeleteProfileByUserUuid(ctx context.Context, userUUID uuid.UUID) (user.UserEntity, error)

func (*ProfileServiceImpl) UpdateImageByUserUuid

func (service *ProfileServiceImpl) UpdateImageByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdateImageRequest) (user.UserEntity, error)

func (*ProfileServiceImpl) UpdatePasswordByUserUuid

func (service *ProfileServiceImpl) UpdatePasswordByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdatePasswordRequest) (user.UserEntity, error)

func (*ProfileServiceImpl) UpdateProfileByUserUuid

func (service *ProfileServiceImpl) UpdateProfileByUserUuid(ctx context.Context, userUUID uuid.UUID, req UpdateProfileRequest) (user.UserEntity, error)

type UpdateImageRequest

type UpdateImageRequest struct {
	ImageID  string `json:"imageId" validate:"required"`
	ImageURL string `json:"imageUrl" validate:"required,url"`
}

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	OldPassword string `json:"oldPassword" validate:"required,min=8"`
	NewPassword string `json:"newPassword" validate:"required,min=8"`
}

type UpdateProfileRequest

type UpdateProfileRequest struct {
	Name string `json:"name" validate:"required,max=100"`
}

Jump to

Keyboard shortcuts

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