2016-07-30 07:10:33 -04:00
|
|
|
// TODO
|
2014-06-29 19:41:29 -05:00
|
|
|
package database
|
2013-06-01 02:34:11 +02:00
|
|
|
|
|
|
|
import (
|
2014-08-30 13:17:50 -05:00
|
|
|
"time"
|
2014-06-29 19:41:29 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type VisitType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
Hourly_visits = iota
|
|
|
|
Daily_visits
|
|
|
|
Monthly_visits
|
|
|
|
Hourly_downloads
|
|
|
|
Daily_downloads
|
|
|
|
Monthly_downloads
|
|
|
|
)
|
|
|
|
|
|
|
|
type Visits struct {
|
|
|
|
Date time.Time "date"
|
|
|
|
Count int "count"
|
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
// TODO: split code in files
|
|
|
|
func (db *pgDB) AddStats(stats interface{}) error {
|
|
|
|
return nil
|
2013-06-01 05:48:15 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
/* Get the most visited books
|
|
|
|
*/
|
|
|
|
func (db *pgDB) GetVisitedBooks() (books []Book, err error) {
|
|
|
|
return []Book{}, nil
|
2014-02-09 23:22:45 +01:00
|
|
|
}
|
2013-06-01 05:48:15 +02:00
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateMostVisited() error {
|
2014-02-18 21:35:26 +01:00
|
|
|
return nil
|
2013-06-01 03:40:06 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
/* Get the most downloaded books
|
|
|
|
*/
|
|
|
|
func (db *pgDB) GetDownloadedBooks() (books []Book, err error) {
|
|
|
|
return []Book{}, nil
|
2013-06-01 02:34:11 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateDownloadedBooks() error {
|
|
|
|
return nil
|
2014-02-09 23:22:45 +01:00
|
|
|
}
|
2013-06-01 03:40:06 +02:00
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) GetTags() ([]string, error) {
|
|
|
|
return []string{}, nil
|
2013-06-01 03:40:06 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateTags() error {
|
|
|
|
return nil
|
2014-02-09 23:22:45 +01:00
|
|
|
}
|
2013-09-24 14:22:53 +02:00
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) GetVisits(visitType VisitType) ([]Visits, error) {
|
|
|
|
return []Visits{}, nil
|
2013-09-24 14:22:53 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateHourVisits() error {
|
|
|
|
return nil
|
2013-09-24 14:22:53 +02:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateDayVisits() error {
|
|
|
|
return nil
|
2014-02-18 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateMonthVisits() error {
|
|
|
|
return nil
|
2014-02-18 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateHourDownloads() error {
|
|
|
|
return nil
|
2014-02-18 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateDayDownloads() error {
|
|
|
|
return nil
|
2014-02-18 19:05:27 +01:00
|
|
|
}
|
|
|
|
|
2016-07-30 07:10:33 -04:00
|
|
|
func (db *pgDB) UpdateMonthDownloads() error {
|
|
|
|
return nil
|
2013-06-01 02:34:11 +02:00
|
|
|
}
|