Documentation ¶
Index ¶
- Variables
- type IRepository
- type Profile
- type ProfileCreateInput
- type ProfileCreateRequest
- type ProfileUpdateInput
- type ProfileUpdateProfileInput
- type ProfileUpdateRequest
- type Repository
- type Request
- func (r Request[CreateInput, UpdateInput, UpdateProfileInput]) CreateRequest(c *gin.Context) (*CreateInput, error)
- func (r Request[CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfileRequest(c *gin.Context) (*UpdateProfileInput, error)
- func (r Request[CreateInput, UpdateInput, UpdateProfileInput]) UpdateRequest(c *gin.Context) (*UpdateInput, error)
- type Service
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Create(ctx context.Context, userID int, input CreateInput) (*Model, error)
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Delete(ctx context.Context, userID int) error
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetById(ctx context.Context, userID int) (*Model, error)
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) GetByIds(ctx context.Context, userID ...int) ([]Model, error)
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx(db *gorm.DB) profile.IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Update(ctx context.Context, userID int, input UpdateInput) error
- func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfile(ctx context.Context, userID int, input UpdateProfileInput) error
- type Transform
- type Transformer
- type UpdateProfileRequest
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"} )
View Source
var ( 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.InvalidArgument)) )
View Source
var OrderBy = clause.FieldOrderBy{}
View Source
var Searchable = clause.FieldSearchable{}
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { repository.Repository[IRepository, Profile] }
type Profile ¶
type ProfileCreateInput ¶
type ProfileCreateRequest ¶
type ProfileUpdateInput ¶
type ProfileUpdateRequest ¶
type Repository ¶
type Repository struct { repository.Repo[Profile] }
func NewProfileRepository ¶
func NewProfileRepository(db *gorm.DB) Repository
func (Repository) Joins ¶
func (r Repository) Joins(models ...string) IRepository
func (Repository) Omit ¶
func (r Repository) Omit(columns ...string) IRepository
func (Repository) Trx ¶
func (r Repository) Trx(db *gorm.DB) IRepository
func (Repository) With ¶
func (r Repository) With(models ...string) IRepository
type Request ¶
type Request[CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput] struct { }
func NewRequest ¶
func NewRequest[CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput]() *Request[CreateInput, UpdateInput, UpdateProfileInput]
func (Request[CreateInput, UpdateInput, UpdateProfileInput]) CreateRequest ¶
func (Request[CreateInput, UpdateInput, UpdateProfileInput]) UpdateProfileRequest ¶
type Service ¶
type Service[Model Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput] struct { // contains filtered or unexported fields }
func NewService ¶
func NewService[Model Profile, CreateInput ProfileCreateInput, UpdateInput ProfileUpdateInput, UpdateProfileInput ProfileUpdateProfileInput]( profileRepository IRepository, ) Service[Model, CreateInput, UpdateInput, UpdateProfileInput]
func (Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx ¶
func (s Service[Model, CreateInput, UpdateInput, UpdateProfileInput]) Trx(db *gorm.DB) profile.IProfileService[Model, CreateInput, UpdateInput, UpdateProfileInput]
type Transformer ¶
type Transformer[Model Profile] struct { }
func NewTransformer ¶
func NewTransformer[Model Profile]() *Transformer[Model]
func (Transformer[Model]) Transform ¶
func (r Transformer[Model]) Transform(m *Model) interface{}
func (Transformer[Model]) TransformList ¶
func (r Transformer[Model]) TransformList(m *Model) interface{}
func (Transformer[Model]) TransformProfile ¶
func (r Transformer[Model]) TransformProfile(m *Model) interface{}
type UpdateProfileRequest ¶
Click to show internal directories.
Click to hide internal directories.