profile

package
v2.3.214 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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[Model, CreateInput, UpdateInput, UpdateProfileInput any] interface {
	Trx(db *gorm.DB) IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]
	GetById(ctx context.Context, userID int) (*Model, error)
	GetByIds(ctx context.Context, userIDs ...int) ([]Model, error)
	Create(ctx context.Context, userID int, input CreateInput) (*Model, error)
	Update(ctx context.Context, userID int, input UpdateInput) error
	UpdateProfile(ctx context.Context, userID int, input UpdateProfileInput) error
	Delete(ctx context.Context, userID int) error
}

type IRequest

type IRequest[CreateInput, UpdateInput, UpdateProfileInput any] interface {
	CreateRequest(c *gin.Context) (*CreateInput, error)
	UpdateRequest(c *gin.Context) (*UpdateInput, error)
	UpdateProfileRequest(c *gin.Context) (*UpdateProfileInput, error)
}

type ITransformer

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

type Profile

type Profile[Model IModel, CreateInput, UpdateInput, UpdateProfileInput any] struct {
	Service     IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]
	Request     IRequest[CreateInput, UpdateInput, UpdateProfileInput]
	Transformer ITransformer[Model]
}

Jump to

Keyboard shortcuts

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