Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { Create(context.Context, domain.Viewer) error FindAll(context.Context, *provider.Query) ([]*domain.Viewer, error) }
TODO: For demo only and more interface in the future
type RepositoryInstance ¶
type RepositoryInstance struct { TableName string // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(db *gorm.DB) *RepositoryInstance
type ServiceInstance ¶
type ServiceInstance struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository) ServiceInstance
func (ServiceInstance) Statistic ¶
func (s ServiceInstance) Statistic(ctx context.Context, query *provider.Query) (*cookbook.JSON, error)
Get counter article viewer max 5 days ago depend on business rules Count result by 5 minutes age, 1 hour ago, 1, 2, 3 days ago depend on business rules TODO: Improve the code for better implementation, in code or sql query
Click to show internal directories.
Click to hide internal directories.