profile

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFoundTranslate = translator.Translate{translator.RU: "Профиль не найден", translator.EN: "Profile not found"}
	ErrExistsTranslate   = translator.Translate{translator.RU: "Профиль уже зарегистрирован", translator.EN: "A profile is already registered"}
	ErrNotFound          = apperr.New("profile_not_found", apperr.WithTextTranslate(ErrNotFoundTranslate), apperr.WithCode(code.NotFound))
	ErrExists            = apperr.New("profile_exists_error", apperr.WithTextTranslate(ErrExistsTranslate), apperr.WithCode(code.AlreadyExists))
)

Functions

This section is empty.

Types

type IModel added in v2.3.44

type IModel interface {
	GetUserId() int
}

type IProfileService

type IProfileService interface {
	Trx(db *gorm.DB) IProfileService
	GetById(ctx context.Context, userID int) (*IModel, error)
	GetByIds(ctx context.Context, userIDs ...int) ([]IModel, error)
	Create(ctx context.Context, userID int, input any) (*IModel, error)
	Update(ctx context.Context, userID int, input any) error
	UpdateProfile(ctx context.Context, userID int, input any) error
	Delete(ctx context.Context, userID int) error
}

type IRequest

type IRequest interface {
	CreateRequest(c *gin.Context) (any, error)
	UpdateRequest(c *gin.Context) (any, error)
}

type ITransformer

type ITransformer interface {
	Transform(m *IModel) interface{}
	TransformList(models []IModel) []interface{}
	TransformProfile(m *IModel) interface{}
}

type Profile

type Profile struct {
	Service     IProfileService
	Request     IRequest
	Transformer ITransformer
}

Jump to

Keyboard shortcuts

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