Documentation ¶
Index ¶
Constants ¶
View Source
const ( EntityType = "Advertiser" PropertySysnameName = "Advertiser.Name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advertiser ¶
Advertiser is the user entity
func (Advertiser) EntityType ¶
func (e Advertiser) EntityType() string
func (*Advertiser) GetMapNameSysname ¶
func (e *Advertiser) GetMapNameSysname() map[string]string
func (*Advertiser) GetValidPropertySysnames ¶
func (e *Advertiser) GetValidPropertySysnames() []string
func (Advertiser) Validate ¶
func (e Advertiser) Validate() error
type IService ¶
type IService interface { New(ctx context.Context) (*Advertiser, error) Get(ctx context.Context, id uint, langID uint) (*Advertiser, error) Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]Advertiser, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*Advertiser, error) Count(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (uint, error) Create(ctx context.Context, obj *Advertiser, langID uint) error Update(ctx context.Context, obj *Advertiser, langID uint) error Delete(ctx context.Context, id uint) error }
IService encapsulates usecase logic for user.
func NewService ¶
func NewService(logger log.Logger, repo Repository) IService
NewService creates a new service.
type Repository ¶
type Repository interface { New(ctx context.Context) (*Advertiser, error) // Get returns the entity with the specified ID. Get(ctx context.Context, id uint, langID uint) (*Advertiser, error) // Query returns the list of albums with the given offset and limit. Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]Advertiser, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*Advertiser, 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 item in the storage. Create(ctx context.Context, obj *Advertiser, langID uint) error // Update updates the album with given ID in the storage. Update(ctx context.Context, obj *Advertiser, 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.
Click to show internal directories.
Click to hide internal directories.