domain

package
v0.0.0-...-b6cb40f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID          uint              `json:"id"`
	Name        string            `json:"name"`
	Password    string            `json:"password"`
	PhoneNumber string            `json:"phone_number"`
	Email       string            `json:"email"`
	BirthDate   time.Time         `json:"birth_date" `
	About       string            `json:"about"`
	Job         string            `json:"job"`
	ProvinceID  string            `json:"province_id"`
	CityID      string            `json:"city_id"`
	Province    *provDom.Province `json:"province"`
	City        *cityDom.City     `json:"city"`
	IsAdmin     bool              `json:"is_admin"`
}

User is a struct that represents the User account.

type UserRepository

type UserRepository interface {
	// GetByID returns the User with the specified ID.
	GetByID(ctx context.Context, id uint) (*User, error)
	// Update updates the User with the specified ID.
	Update(ctx context.Context, user *User) error
	// IsAdmin checks if the User with the specified ID is an admin.
	IsAdmin(ctx context.Context, id uint) (bool, error)
}

UserRepository is an interface that provides access to the User storage.

type UserUsecase

type UserUsecase interface {
	// GetByID returns the User with the specified ID.
	GetByID(ctx context.Context, id uint) (*User, error)
	// Update updates the User with the specified ID.
	Update(ctx context.Context, user *User) error
}

UserUsecase is an interface that provides business logic for User.

Jump to

Keyboard shortcuts

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