entities

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 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 Admin

type Admin struct {
	UserBase

	Avatar    string         `json:"avatar"`
	IsDeleted bool           `json:"-"`
	DeletedAt types.DateTime `json:"-"`
}

func (*Admin) GetType

func (a *Admin) GetType() string

type Auth

type Auth struct {
	BaseModel

	Identity                     string `gorm:"uniqueIndex"`
	UserTableName                string
	UserId                       uuid.UUID  `gorm:"uniqueIndex"`
	Role                         types.Role `json:"role"`
	PasswordHash                 string
	ResetPasswordToken           string         `json:"resetPasswordToken"`
	ResetPasswordTokenExpiryDate types.DateTime `json:"resetPasswordTokenExpiryDate"`
	OtpSecret                    string         `json:"otpSecret"`
}

func (*Auth) BeforeCreate

func (a *Auth) BeforeCreate(tx *gorm.DB) error

type BaseModel

type BaseModel struct {
	Id      uuid.UUID      `gorm:"default:uuid_generate_v4()" json:"id"`
	Created types.DateTime `json:"created"`
	Updated types.DateTime `json:"updated"`
}

func (*BaseModel) BeforeCreate

func (m *BaseModel) BeforeCreate(tx *gorm.DB) error

func (*BaseModel) BeforeUpdate

func (m *BaseModel) BeforeUpdate(tx *gorm.DB) error

func (*BaseModel) GetId

func (m *BaseModel) GetId() uuid.UUID

func (*BaseModel) HasId

func (m *BaseModel) HasId() bool

func (*BaseModel) SetId

func (m *BaseModel) SetId(id uuid.UUID)

type Model

type Model interface {
	HasId() bool
	SetId(id uuid.UUID)
	GetId() uuid.UUID
	BeforeCreate(tx *gorm.DB) error
	BeforeUpdate(tx *gorm.DB) error
}

type User

type User interface {
	GetId() uuid.UUID
	GetAvatar() string
	GetRole() types.Role
	GetEmail() string
	GetFirstName() string
	GetLastName() string
	GetPhoneNumber() string
	GetIsActive() bool
	GetDeletedAt() types.DateTime
}

type UserBase

type UserBase struct {
	BaseModel

	Avatar      string         `json:"avatar"`
	FirstName   string         `json:"firstName"`
	LastName    string         `json:"lastName"`
	Email       string         `json:"email"`
	PhoneNumber string         `json:"phoneNumber"`
	Role        types.Role     `json:"role"`
	IsActive    bool           `json:"isActive"`
	DeletedAt   types.DateTime `json:"deletedAt"`
}

func (*UserBase) GetAvatar

func (u *UserBase) GetAvatar() string

func (*UserBase) GetDeletedAt

func (u *UserBase) GetDeletedAt() types.DateTime

func (*UserBase) GetEmail

func (u *UserBase) GetEmail() string

func (*UserBase) GetFirstName

func (u *UserBase) GetFirstName() string

func (*UserBase) GetIsActive

func (u *UserBase) GetIsActive() bool

func (*UserBase) GetLastName

func (u *UserBase) GetLastName() string

func (*UserBase) GetPhoneNumber

func (u *UserBase) GetPhoneNumber() string

func (*UserBase) GetRole

func (u *UserBase) GetRole() types.Role

Jump to

Keyboard shortcuts

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