Documentation
¶
Index ¶
- Constants
- type IService
- type Offer
- func (e Offer) EntityType() string
- func (e *Offer) GetMapNameSysname() map[string]string
- func (e *Offer) GetValidPropertySysnames() []string
- func (e *Offer) SetCreatedAt(ctx context.Context, value time.Time) error
- func (e *Offer) SetFinishedAt(ctx context.Context, value time.Time) error
- func (e *Offer) SetStartedAt(ctx context.Context, value time.Time) error
- func (e Offer) Validate() error
- type Repository
Constants ¶
View Source
const ( EntityType = "Offer" PropertySysnameCreatedAt = "Offer.CreatedAt" PropertySysnameStartedAt = "Offer.StartedAt" PropertySysnameFinishedAt = "Offer.FinishedAt" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IService ¶
type IService interface { New(ctx context.Context) (*Offer, error) Get(ctx context.Context, id uint, langID uint) (*Offer, error) Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]Offer, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*Offer, error) Count(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (uint, error) Create(ctx context.Context, obj *Offer, langID uint) error Update(ctx context.Context, obj *Offer, 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 Offer ¶
type Offer struct { *entity.Entity ID uint CreatedAt time.Time StartedAt time.Time FinishedAt time.Time }
Offer is the user entity
func (Offer) EntityType ¶
func (*Offer) GetMapNameSysname ¶
func (*Offer) GetValidPropertySysnames ¶
func (*Offer) SetCreatedAt ¶
func (*Offer) SetFinishedAt ¶
func (*Offer) SetStartedAt ¶
type Repository ¶
type Repository interface { New(ctx context.Context) (*Offer, error) // Get returns the entity with the specified ID. Get(ctx context.Context, id uint, langID uint) (*Offer, error) // Query returns the list of albums with the given offset and limit. Query(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) ([]Offer, error) First(ctx context.Context, condition *selection_condition.SelectionCondition, langID uint) (*Offer, 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 *Offer, langID uint) error // Update updates the album with given ID in the storage. Update(ctx context.Context, obj *Offer, 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.