1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

Introduce GORM.

This commit is contained in:
Ferdinand Mütsch
2019-05-11 17:49:56 +02:00
parent 7df01fe9c4
commit b4c8e6ecb6
11 changed files with 116 additions and 132 deletions

View File

@ -1,16 +1,16 @@
package services
import (
"database/sql"
"fmt"
"log"
"time"
"github.com/jinzhu/gorm"
"github.com/n1try/wakapi/models"
)
type AggregationService struct {
Db *sql.DB
Db *gorm.DB
HeartbeatService *HeartbeatService
}
@ -19,7 +19,7 @@ func (srv *AggregationService) Aggregate(from time.Time, to time.Time, user *mod
if err != nil {
log.Fatal(err)
}
for _, h := range heartbeats {
for _, h := range *heartbeats {
fmt.Printf("%+v\n", h)
}
}