service

package
v2.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProfileNotFound = apperr.New("profile_not_found", apperr.WithTextTranslate(i18n.ErrProfileNotFound), apperr.WithCode(code.NotFound))
	ErrProfileExists   = apperr.New("profile_exists_error", apperr.WithTextTranslate(i18n.ErrProfileExists), apperr.WithCode(code.InvalidArgument))
)

Functions

This section is empty.

Types

type ProfileCreateInput

type ProfileCreateInput struct {
	Login string
	Name  string
}

type ProfileService

type ProfileService[Model model.Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput] struct {
	// contains filtered or unexported fields
}

func NewProfileService

func NewProfileService[Model model.Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput](
	profileRepository repository.IProfileRepository,
) ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Create

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Create(ctx context.Context, userID int, input CreateInput) (*Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Delete

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Delete(ctx context.Context, userID int) error

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetById

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetById(ctx context.Context, userID int) (*Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetByIds

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetByIds(ctx context.Context, userID ...int) ([]Model, error)

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx(db *gorm.DB) profile.IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Update

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) Update(ctx context.Context, userID int, input UpdateInput) error

func (ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfile

func (s ProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfile(ctx context.Context, userID int, input UpdateProfileInput) error

type ProfileUpdateInput

type ProfileUpdateInput struct {
	Login *string
	Name  *string
}

type ProfileUpdateProfileInput

type ProfileUpdateProfileInput struct {
	Login *string
	Name  *string
}

Jump to

Keyboard shortcuts

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