advertiser

package
v0.0.0-...-4f702ff Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityType          = "Advertiser"
	PropertySysnameName = "Advertiser.Name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Advertiser

type Advertiser struct {
	*entity.Entity
	ID   uint
	Name string
}

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) SetName

func (e *Advertiser) SetName(ctx context.Context, value string, langID uint) error

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.

Jump to

Keyboard shortcuts

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