Documentation
¶
Index ¶
- Constants
- type IService
- type Repository
- type TgAccount
- func (e TgAccount) EntityType() string
- func (e *TgAccount) GetMapNameSysname() map[string]string
- func (e *TgAccount) GetValidPropertySysnames() []string
- func (e *TgAccount) SetAccessHash(ctx context.Context, value int) error
- func (e *TgAccount) SetCreatedAt(ctx context.Context, value time.Time) error
- func (e *TgAccount) SetFirstName(ctx context.Context, value string) error
- func (e *TgAccount) SetLangCode(ctx context.Context, value string) error
- func (e *TgAccount) SetLastName(ctx context.Context, value string) error
- func (e *TgAccount) SetPhone(ctx context.Context, value string) error
- func (e *TgAccount) SetPhoto(ctx context.Context, value string) error
- func (e *TgAccount) SetUserID(ctx context.Context, value int) error
- func (e *TgAccount) SetUserName(ctx context.Context, value string) error
- func (e TgAccount) Validate() error
Constants ¶
View Source
const ( EntityType = "TgAccount" PropertySysname_UserID = "TgAccount.UserID" PropertySysname_AccessHash = "TgAccount.AccessHash" PropertySysname_FirstName = "TgAccount.FirstName" PropertySysname_LastName = "TgAccount.LastName" PropertySysname_UserName = "TgAccount.UserName" PropertySysname_Phone = "TgAccount.Phone" PropertySysname_Photo = "TgAccount.Photo" PropertySysname_LangCode = "TgAccount.LangCode" PropertySysname_CreatedAt = "TgAccount.CreatedAt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IService ¶
type IService interface { New(ctx context.Context) (*TgAccount, error) Get(ctx context.Context, id uint, langID uint) (*TgAccount, error) Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]TgAccount, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*TgAccount, error) Count(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (uint, error) Create(ctx context.Context, obj *TgAccount, langID uint) error Update(ctx context.Context, obj *TgAccount, langID uint) error Delete(ctx context.Context, id uint) error }
IService encapsulates usecase logic for TgAccount.
func NewService ¶
func NewService(logger log.Logger, repo Repository) IService
NewService creates a new service.
type Repository ¶
type Repository interface { New(ctx context.Context) (*TgAccount, error) // Get returns the entity with the specified ID. Get(ctx context.Context, id uint, langID uint) (*TgAccount, error) // Query returns the list of albums with the given offset and limit. Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]TgAccount, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*TgAccount, error) // Count returns the number of items. Count(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (uint, error) SetDefaultConditions(conditions *selection_condition.SelectionCondition) // Create saves a new album in the storage. Create(ctx context.Context, obj *TgAccount, langID uint) error // Update updates the album with given ID in the storage. Update(ctx context.Context, obj *TgAccount, langID uint) error // Delete removes the album with given ID from the storage. Delete(ctx context.Context, id uint) error }
Repository encapsulates the logic to access albums from the data source.
type TgAccount ¶
type TgAccount struct { *entity.Entity ID uint UserID int // в gotd/td это поле int64, но ярус поддерживает только int AccessHash int // в gotd/td это поле int64, но ярус поддерживает только int FirstName string LastName string UserName string Phone string Photo string LangCode string CreatedAt time.Time }
TgAccount is the TgAccount entity
func (TgAccount) EntityType ¶
func (*TgAccount) GetMapNameSysname ¶
func (*TgAccount) GetValidPropertySysnames ¶
func (*TgAccount) SetAccessHash ¶
func (*TgAccount) SetCreatedAt ¶
func (*TgAccount) SetFirstName ¶
func (*TgAccount) SetLangCode ¶
func (*TgAccount) SetLastName ¶
func (*TgAccount) SetUserName ¶
Click to show internal directories.
Click to hide internal directories.