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: 9 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 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 Profile struct {
	ID      int    `json:"id"`
	Age     *int   `json:"age"`
	Height  *int   `json:"height"`
	Address string `json:"address"`

	UserID int `json:"user_id"`
}

func (Profile) GetUserId added in v2.3.44

func (m Profile) GetUserId() int

func (Profile) TableName

func (m Profile) TableName() string

type ProfileCreateInput

type ProfileCreateInput struct {
	Age     *int
	Height  *int
	Address string
}

type ProfileCreateRequest

type ProfileCreateRequest struct {
	Age     *int   `json:"age" binding:"omitempty,gte=0"`
	Height  *int   `json:"height" binding:"omitempty,gte=0"`
	Address string `json:"address" binding:"omitempty,min=1,max=255"`
}

type ProfileUpdateInput

type ProfileUpdateInput struct {
	Age     *int
	Height  *int
	Address *string
}

type ProfileUpdateProfileInput

type ProfileUpdateProfileInput struct {
	Age     *int
	Height  *int
	Address *string
}

type ProfileUpdateRequest

type ProfileUpdateRequest struct {
	Age     *int    `json:"age" binding:"omitempty,gte=0"`
	Height  *int    `json:"height" binding:"omitempty,gte=0"`
	Address *string `json:"address" binding:"omitempty,min=1,max=255"`
}

type Repository

type Repository struct {
	repository.Repo[Profile]
}

func NewProfileRepository

func NewProfileRepository(db *gorm.DB) Repository

func (Repository) Trx

func (r Repository) Trx(db *gorm.DB) IRepository

type Request

type Request struct {
}

func NewRequest

func NewRequest() *Request

func (Request) CreateRequest

func (r Request) CreateRequest(c *gin.Context) (any, error)

func (Request) UpdateRequest

func (r Request) UpdateRequest(c *gin.Context) (any, error)

type Service

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

func NewService

func NewService(
	profileRepository IRepository,
) Service

func (Service) Create

func (s Service) Create(ctx context.Context, userID int, input any) (*profile.IModel, error)

func (Service) Delete

func (s Service) Delete(ctx context.Context, userID int) error

func (Service) GetById

func (s Service) GetById(ctx context.Context, userID int) (*profile.IModel, error)

func (Service) GetByIds

func (s Service) GetByIds(ctx context.Context, userID ...int) ([]profile.IModel, error)

func (Service) Trx

func (s Service) Trx(db *gorm.DB) profile.IProfileService

func (Service) Update

func (s Service) Update(ctx context.Context, userID int, input any) error

func (Service) UpdateProfile

func (s Service) UpdateProfile(ctx context.Context, userID int, input any) error

type Transform

type Transform struct {
	Age     *int   `json:"age"`
	Height  *int   `json:"height"`
	Address string `json:"address"`
}

type Transformer

type Transformer struct {
}

func NewTransformer

func NewTransformer() *Transformer

func (Transformer) Transform

func (r Transformer) Transform(m *profile.IModel) interface{}

func (Transformer) TransformList

func (r Transformer) TransformList(models []profile.IModel) []interface{}

func (Transformer) TransformProfile

func (r Transformer) TransformProfile(m *profile.IModel) interface{}

Jump to

Keyboard shortcuts

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