init stats click repo
This commit is contained in:
parent
1c53cb3c1c
commit
8eb1473d64
10
dal/dal.go
10
dal/dal.go
@ -180,7 +180,8 @@ func (d *AmoDal) Close(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ClickHouseDAL struct {
|
type ClickHouseDAL struct {
|
||||||
conn *sql.DB
|
conn *sql.DB
|
||||||
|
StatisticClickRepo *statistics.StatisticClick
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewClickHouseDAL(ctx context.Context, cred string) (*ClickHouseDAL, error) {
|
func NewClickHouseDAL(ctx context.Context, cred string) (*ClickHouseDAL, error) {
|
||||||
@ -196,8 +197,13 @@ func NewClickHouseDAL(ctx context.Context, cred string) (*ClickHouseDAL, error)
|
|||||||
return nil, fmt.Errorf("error ping database: %w", err)
|
return nil, fmt.Errorf("error ping database: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
statsClickRepo := statistics.NewClickStatistic(statistics.DepsClick{
|
||||||
|
Conn: conn,
|
||||||
|
})
|
||||||
|
|
||||||
return &ClickHouseDAL{
|
return &ClickHouseDAL{
|
||||||
conn: conn,
|
conn: conn,
|
||||||
|
StatisticClickRepo: statsClickRepo,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
17
repository/statistics/click_statistics.go
Normal file
17
repository/statistics/click_statistics.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package statistics
|
||||||
|
|
||||||
|
import "database/sql"
|
||||||
|
|
||||||
|
type DepsClick struct {
|
||||||
|
Conn *sql.DB
|
||||||
|
}
|
||||||
|
|
||||||
|
type StatisticClick struct {
|
||||||
|
conn *sql.DB
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewClickStatistic(deps DepsClick) *StatisticClick {
|
||||||
|
return &StatisticClick{
|
||||||
|
conn: deps.Conn,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user